.health-workbench {
    overflow: hidden;
}

.health-workbench-content {
    display: block;
}

.health-workbench.is-loading .health-workbench-content {
    display: none;
}

.health-intro {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 28px;
    margin: 24px 28px 0;
    padding: 22px;
    border: 2px solid var(--ink);
    background: #fffefa;
}

.health-intro strong {
    display: block;
    margin-bottom: 8px;
    font: 900 .82rem/1.2 "Arial Black", Arial, sans-serif;
    letter-spacing: .025em;
}

.health-intro p {
    max-width: 860px;
    margin: 0;
    color: #4c4840;
    font: 400 .96rem/1.5 Georgia, "Times New Roman", serif;
}

.health-badge {
    flex: 0 0 auto;
    border: 2px solid var(--ink);
    background: var(--yellow);
    padding: 9px 11px;
    box-shadow: 3px 3px 0 var(--ink);
    font: 900 .62rem/1 "Courier New", monospace;
    letter-spacing: .05em;
    white-space: nowrap;
}

.health-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 18px;
    padding: 24px 28px 0;
}

.health-form .tool-field {
    margin: 0;
}

.health-form input {
    min-height: 56px;
    font-size: 1rem;
}

.health-actions {
    min-height: 56px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.health-status {
    margin: 22px 28px 0;
}

.health-results {
    margin: 28px;
    padding-top: 24px;
    border-top: 4px solid var(--ink);
    scroll-margin-top: 24px;
}

.health-summary {
    display: grid;
    grid-template-columns: minmax(210px, .45fr) minmax(0, 1.55fr);
    gap: 18px;
}

.health-score-card {
    min-height: 220px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 7px;
    padding: 22px;
    border: 3px solid var(--ink);
    background: var(--white);
    box-shadow: 6px 6px 0 var(--ink);
    text-align: center;
}

.health-score-card > span,
.health-score-card > small {
    font: 900 .6rem/1 "Courier New", monospace;
    letter-spacing: .07em;
}

.health-score-card > strong {
    font: 900 clamp(4rem, 8vw, 6.5rem)/.85 "Arial Black", Arial, sans-serif;
    letter-spacing: -.07em;
}

.health-score-card > b {
    padding: 6px 9px;
    border: 2px solid var(--ink);
    background: var(--paper);
    font: 900 .67rem/1 "Courier New", monospace;
}

.health-score-card[data-grade="excellent"] > b,
.health-score-card[data-grade="good"] > b {
    background: var(--green);
}

.health-score-card[data-grade="needs-work"] > b {
    background: var(--yellow);
}

.health-score-card[data-grade="poor"] > b {
    background: #e94b35;
    color: var(--white);
}

.health-summary-details {
    min-width: 0;
    display: grid;
    grid-template-rows: repeat(3, minmax(0, 1fr));
    border: 2px solid var(--ink);
    background: #fffefa;
}

.health-summary-details > div {
    min-width: 0;
    display: grid;
    gap: 7px;
    align-content: center;
    padding: 16px 18px;
}

.health-summary-details > div + div {
    border-top: 2px solid var(--ink);
}

.health-summary-details span,
.health-technical-card span {
    color: var(--muted);
    font: 900 .57rem/1 "Courier New", monospace;
    letter-spacing: .06em;
}

.health-summary-details strong,
.health-technical-card strong {
    overflow-wrap: anywhere;
    font: 900 .72rem/1.35 "Courier New", monospace;
}

.health-report-section {
    margin-top: 30px;
}

.health-section-note {
    margin: 10px 0 14px;
    color: #514d44;
    font: 400 .9rem/1.45 Georgia, "Times New Roman", serif;
}

.health-category-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.health-category-card {
    min-width: 0;
    min-height: 130px;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 6px;
    padding: 14px 10px;
    border: 2px solid var(--ink);
    background: #fffefa;
    text-align: center;
}

.health-category-card[data-rating="good"] { box-shadow: inset 0 7px 0 var(--green); }
.health-category-card[data-rating="warning"] { box-shadow: inset 0 7px 0 var(--yellow); }
.health-category-card[data-rating="bad"] { box-shadow: inset 0 7px 0 #e94b35; }

.health-category-card span {
    color: #6b270f;
    font: 900 .57rem/1 "Courier New", monospace;
    letter-spacing: .06em;
}

.health-category-card strong {
    font: 900 clamp(2rem, 3.6vw, 3rem)/1 "Arial Black", Arial, sans-serif;
}

.health-category-card small {
    color: var(--muted);
    font: 700 .57rem/1.2 "Courier New", monospace;
}

.health-fix-list {
    display: grid;
    gap: 10px;
}

.health-fix {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    border: 2px solid var(--ink);
    background: #fffefa;
}

.health-fix-number {
    display: grid;
    place-items: start center;
    padding-top: 15px;
    border-right: 2px solid var(--ink);
    background: var(--orange);
    font: 900 .72rem/1 "Courier New", monospace;
}

.health-fix-copy {
    min-width: 0;
    padding: 14px 16px;
}

.health-fix-copy > span {
    display: block;
    margin-bottom: 5px;
    color: #6b270f;
    font: 900 .56rem/1 "Courier New", monospace;
    letter-spacing: .06em;
}

.health-fix-copy > strong {
    display: block;
    font: 900 .84rem/1.25 "Arial Black", Arial, sans-serif;
}

.health-fix-copy > p {
    margin: 7px 0 0;
    color: #514d44;
    font: 400 .84rem/1.45 Georgia, "Times New Roman", serif;
}

.health-finding-groups {
    display: grid;
    gap: 18px;
}

.health-finding-group {
    border: 2px solid var(--ink);
    background: #fffefa;
}

.health-finding-group > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 13px;
    border-bottom: 2px solid var(--ink);
    background: var(--paper);
}

.health-finding-group > header strong,
.health-finding-group > header span {
    font: 900 .62rem/1 "Courier New", monospace;
    letter-spacing: .06em;
}

.health-finding-list {
    display: grid;
}

.health-finding-row {
    min-width: 0;
    display: grid;
    grid-template-columns: 92px minmax(150px, .7fr) minmax(0, 1.3fr);
    gap: 14px;
    align-items: start;
    padding: 13px 14px;
}

.health-finding-row + .health-finding-row {
    border-top: 1px solid #b9b4a8;
}

.health-finding-status {
    display: inline-flex;
    justify-content: center;
    width: fit-content;
    min-width: 68px;
    padding: 5px 7px;
    border: 1px solid var(--ink);
    font: 900 .54rem/1 "Courier New", monospace;
}

.health-finding-status[data-status="good"] { background: var(--green); }
.health-finding-status[data-status="warning"] { background: var(--yellow); }
.health-finding-status[data-status="bad"] { background: #e94b35; color: var(--white); }
.health-finding-status[data-status="info"] { background: var(--paper-deep); }

.health-finding-name {
    min-width: 0;
    display: grid;
    gap: 5px;
}

.health-finding-name strong {
    font: 900 .68rem/1.25 "Arial Black", Arial, sans-serif;
}

.health-finding-name code {
    overflow-wrap: anywhere;
    white-space: normal;
    font: 700 .6rem/1.35 "Courier New", monospace;
}

.health-finding-detail {
    min-width: 0;
    color: #514d44;
    font: 400 .82rem/1.45 Georgia, "Times New Roman", serif;
}

.health-technical-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border: 2px solid var(--ink);
    background: var(--paper);
}

.health-technical-card {
    min-width: 0;
    min-height: 92px;
    display: grid;
    align-content: start;
    gap: 7px;
    padding: 13px 14px;
    border-right: 1px solid var(--ink);
    border-bottom: 1px solid var(--ink);
}

.health-technical-card:nth-child(3n) {
    border-right: 0;
}

.health-technical-card p {
    margin: 0;
    overflow-wrap: anywhere;
    color: #514d44;
    font: 400 .78rem/1.4 Georgia, "Times New Roman", serif;
}

.health-empty-state {
    display: grid;
    gap: 5px;
    padding: 18px;
    border: 2px dashed var(--ink);
    background: var(--paper);
    color: var(--muted);
    font: 700 .7rem/1.4 "Courier New", monospace;
}

.health-empty-state strong {
    color: var(--ink);
    font: 900 .74rem/1.2 "Arial Black", Arial, sans-serif;
}

.health-workbench-content > .privacy-note {
    margin-inline: 28px;
}

.health-loading {
    min-height: 430px;
    padding: 48px 28px 52px;
    background: var(--paper);
}

.health-workbench.is-loading .health-loading {
    display: grid;
    place-items: center;
}

.health-loading-panel {
    position: relative;
    width: min(760px, 100%);
    padding: 32px;
    border: 3px solid var(--ink);
    background: #fffefa;
    box-shadow: 8px 8px 0 var(--ink);
    text-align: center;
}

.health-loading-panel::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 9px;
    background: var(--orange);
    border-bottom: 2px solid var(--ink);
}

.health-loading-kicker {
    display: inline-block;
    margin-top: 6px;
    padding: 6px 9px;
    border: 2px solid var(--ink);
    background: var(--yellow);
    font: 900 .62rem/1 "Courier New", monospace;
    letter-spacing: .07em;
}

.health-loading-spinner {
    width: 72px;
    height: 72px;
    margin: 24px auto 16px;
    display: grid;
    place-items: center;
    border: 4px solid var(--ink);
    border-radius: 50%;
    background: var(--white);
}

.health-loading-spinner span {
    width: 32px;
    height: 32px;
    border: 6px solid var(--paper-deep);
    border-top-color: var(--orange);
    border-right-color: var(--orange);
    border-radius: 50%;
    animation: health-spin .9s linear infinite;
}

.health-loading h2 {
    margin: 0;
    font: 900 clamp(1.8rem, 4vw, 3rem)/.95 "Arial Black", Arial, sans-serif;
    letter-spacing: -.035em;
}

.health-loading p {
    max-width: 620px;
    margin: 14px auto 0;
    color: #514d44;
    font: 400 .96rem/1.5 Georgia, "Times New Roman", serif;
}

.health-loading-target {
    display: grid;
    gap: 6px;
    margin-top: 24px;
    padding: 12px 14px;
    border: 2px solid var(--ink);
    background: var(--paper);
    text-align: left;
}

.health-loading-target span {
    color: var(--muted);
    font: 900 .55rem/1 "Courier New", monospace;
    letter-spacing: .07em;
}

.health-loading-target strong {
    overflow-wrap: anywhere;
    font: 900 .7rem/1.35 "Courier New", monospace;
}

.health-progress-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 24px;
    font: 900 .64rem/1 "Courier New", monospace;
    letter-spacing: .055em;
}

.health-progress {
    position: relative;
    height: 24px;
    margin-top: 9px;
    overflow: hidden;
    border: 3px solid var(--ink);
    background: var(--paper-deep);
}

.health-progress::after {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(135deg, transparent 0 10px, rgb(255 255 255 / .35) 10px 20px);
    animation: health-stripes .8s linear infinite;
    pointer-events: none;
}

.health-progress > span {
    display: block;
    width: 8%;
    height: 100%;
    background: var(--orange);
    transition: width .45s ease;
}

.health-loading small {
    display: block;
    margin-top: 12px;
    color: var(--muted);
    font: 700 .62rem/1.45 "Courier New", monospace;
}

@keyframes health-spin {
    to { transform: rotate(360deg); }
}

@keyframes health-stripes {
    from { transform: translateX(-14px); }
    to { transform: translateX(14px); }
}

@media (prefers-reduced-motion: reduce) {
    .health-loading-spinner span,
    .health-progress::after {
        animation: none;
    }

    .health-progress > span {
        transition: none;
    }
}

@media (max-width: 960px) {
    .health-category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .health-technical-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .health-technical-card:nth-child(3n) { border-right: 1px solid var(--ink); }
    .health-technical-card:nth-child(2n) { border-right: 0; }
}

@media (max-width: 680px) {
    .health-intro {
        margin: 18px 16px 0;
        padding: 17px;
        flex-direction: column;
        gap: 14px;
    }

    .health-badge { align-self: flex-start; }

    .health-form {
        grid-template-columns: 1fr;
        padding: 18px 16px 0;
        gap: 12px;
    }

    .health-actions {
        min-height: 0;
        align-items: flex-start;
        flex-direction: column;
        gap: 9px;
    }

    .health-actions .button { width: 100%; }
    .health-status { margin: 18px 16px 0; }

    .health-status.tool-status {
        grid-template-columns: 1fr;
    }

    .health-status.tool-status strong {
        min-width: 0;
        border-right: 0;
        border-bottom: 2px solid var(--ink);
    }

    .health-results {
        margin: 24px 16px 18px;
        padding-top: 20px;
    }

    .health-summary {
        grid-template-columns: 1fr;
    }

    .health-score-card { min-height: 190px; }
    .health-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .health-finding-row {
        grid-template-columns: 82px minmax(0, 1fr);
    }

    .health-finding-detail {
        grid-column: 1 / -1;
    }

    .health-technical-grid { grid-template-columns: 1fr; }
    .health-technical-card,
    .health-technical-card:nth-child(2n),
    .health-technical-card:nth-child(3n) {
        border-right: 0;
    }

    .health-workbench-content > .privacy-note { margin-inline: 16px; }

    .health-loading {
        min-height: 390px;
        padding: 30px 16px 36px;
    }

    .health-loading-panel {
        padding: 27px 18px 24px;
        box-shadow: 5px 5px 0 var(--ink);
    }
}

@media (max-width: 430px) {
    .health-category-grid { grid-template-columns: 1fr; }
    .health-fix { grid-template-columns: 42px minmax(0, 1fr); }
}
