:root {
    color-scheme: light dark;
    font-family: Inter, "Segoe UI", sans-serif;
}

html[data-color-scheme="dark"] { color-scheme: dark; }
html[data-color-scheme="light"] { color-scheme: light; }

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
main { min-height: 100vh; }

.page-shell { min-height: 100vh; display: flex; flex-direction: column; padding: 1.5rem 1.25rem 1rem; }
.top-bar { display: flex; align-items: center; justify-content: space-between; }
.top-actions { display: flex; align-items: center; gap: .25rem; }
.working-name { font-size: 1rem; font-weight: 650; letter-spacing: .03em; }
.culture-switch { text-transform: none; }
.culture-switch select { border: 1px solid var(--mud-palette-divider); border-radius: .4rem; padding: .35rem .5rem; background: transparent; color: inherit; font: inherit; }
.culture-switch option { background: var(--mud-palette-surface); color: var(--mud-palette-text-primary); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.hero { width: min(100%, 980px); margin: clamp(4rem, 13vh, 9rem) auto 4rem; text-align: center; }
.hero-title { font-size: clamp(2.5rem, 7vw, 5rem) !important; font-weight: 650 !important; margin-bottom: 2rem; }
.url-input { width: 100%; }
.url-input .mud-input-control { font-size: 1.35rem; }
.audit-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; width: 100%; }
.audit-card { min-height: 15rem; display: flex; flex-direction: column; justify-content: space-between; padding: .5rem; }
.card-description { margin-top: .75rem; opacity: .78; }
.content-run-modes { display: flex; flex-direction: column; align-items: flex-start; gap: .4rem; margin-top: 1rem; }
.run-mode-description { margin: 0 0 .4rem .5rem; font-size: .9rem; opacity: .75; }
.locked-note { padding-left: .5rem; opacity: .7; }
.reopen-audit { display: flex; justify-content: center; margin-top: 1.25rem; }
.site-footer { margin-top: auto; padding-top: 4rem; text-align: center; opacity: .65; }
.audit-overlay { position: fixed; inset: 0; z-index: 1500; display: grid; place-items: center; padding: 1rem; background: rgb(0 0 0 / 55%); }
.audit-dialog { width: min(100%, 780px); max-height: min(88vh, 900px); display: flex; flex-direction: column; overflow: hidden; border-radius: 12px; background: var(--mud-palette-surface); color: var(--mud-palette-text-primary); box-shadow: 0 1.5rem 5rem rgb(0 0 0 / 35%); }
.dialog-header, .dialog-footer { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; }
.dialog-header { border-bottom: 1px solid var(--mud-palette-divider); }
.dialog-title { margin: 0; font-size: 1.5rem; font-weight: 500; }
.close-button { display: grid; width: 2.5rem; height: 2.5rem; place-items: center; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.close-button:hover { background: var(--mud-palette-action-default-hover); }
.validation-message { margin-top: .5rem; }
.dialog-content { padding: .5rem 1.25rem; overflow: auto; }
.dialog-footer { justify-content: flex-end; border-top: 1px solid var(--mud-palette-divider); }
.check-row { display: grid; grid-template-columns: 2rem minmax(0, 1fr); align-items: start; gap: .75rem; padding: .85rem 0; border-bottom: 1px solid var(--mud-palette-divider); }
.check-icon { display: flex; min-height: 1.5rem; align-items: center; justify-content: center; }
.check-copy { display: flex; flex-direction: column; gap: .25rem; overflow-wrap: anywhere; }
.check-copy span { opacity: .75; font-size: .92rem; }
.content-audit-state { display: flex; flex-direction: column; gap: 1rem; padding: 1rem 0; }
.content-audit-purpose { margin: 0; font-size: 1.05rem; line-height: 1.5; }
.content-status, .content-step-error { margin: 0; }
.content-step-error { color: var(--mud-palette-error); }
.content-stepper { display: flex; flex-direction: column; gap: .75rem; }
.content-step { display: grid; grid-template-columns: 2rem minmax(0, 1fr); align-items: start; gap: .75rem; }
.content-step-icon { display: grid; min-height: 1.5rem; place-items: center; font-weight: 650; }
.content-step-content { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.content-step-content strong { font-weight: 600; }
.content-step-detail { font-size: .9rem; opacity: .76; overflow-wrap: anywhere; }
.content-step-failed .content-step-content { color: var(--mud-palette-error); }
.content-error-details { font-size: .9rem; }
.content-error-details pre { max-height: 18rem; margin: .5rem 0 0; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.backend-note { display: flex; flex-wrap: wrap; gap: .25rem; font-size: .85rem; opacity: .7; }
.content-stream { max-height: 18rem; padding: .8rem 1rem; overflow: auto; border-radius: .5rem; background: var(--mud-palette-background); color: var(--mud-palette-text-secondary); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.content-result-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.content-result-card { min-width: 0; padding: .9rem; border: 1px solid var(--mud-palette-divider); border-radius: .6rem; background: var(--mud-palette-background); }
.content-result-card h3 { margin: 0 0 .5rem; font-size: 1rem; font-weight: 600; }
.content-result-card p { margin: 0; line-height: 1.5; overflow-wrap: anywhere; }
.content-input-summary { margin: 0; font-size: .85rem; line-height: 1.45; opacity: .65; }
.content-evaluation { line-height: 1.6; overflow-wrap: anywhere; }
.not-found { display: grid; min-height: 80vh; place-items: center; }

@media (max-width: 760px) {
    .page-shell { padding-inline: 1rem; }
    .hero { margin: 4rem auto 2.5rem; }
    .audit-cards { grid-template-columns: 1fr; }
    .audit-card { min-height: 11rem; }
    .content-result-cards { grid-template-columns: 1fr; }
}
