:root {
    --ha-ink: #1b1f24;
    --ha-muted: #5b6470;
    --ha-accent: #285828;
    --ha-warm: #b86040;
    --ha-banner: #fff4d6;
    --ha-banner-ink: #5a3d00;
}

html, body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--ha-ink);
    line-height: 1.5;
}

.rb-banner {
    background: var(--ha-banner);
    color: var(--ha-banner-ink);
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.rb-banner .rb-versions {
    display: block;
    font-size: 0.8rem;
}

.site-header {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e3e6ea;
}

.site-header .brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--ha-ink);
    text-decoration: none;
}

.site-header .brand-mark {
    height: 2.75rem;
    width: auto;
}

.site-header .brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.site-header .brand-name {
    font-weight: 700;
    font-size: 1.3rem;
    letter-spacing: 0.14em;
}

.site-header .brand-tagline {
    font-size: 0.72rem;
    color: var(--ha-warm);
    letter-spacing: 0.03em;
}

.hero {
    text-align: center;
    padding: 0.5rem 0 0;
}

.hero-logo {
    max-width: min(100%, 34rem);
    height: auto;
}

.hero-tagline {
    margin: 0 0 1rem;
    font-size: 1.15rem;
    letter-spacing: 0.08em;
    color: var(--ha-warm);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.site-header nav a {
    margin-right: 1rem;
    color: var(--ha-accent);
}

.site-main {
    max-width: 56rem;
    margin: 0 auto;
    padding: 1rem;
}

.site-footer {
    color: var(--ha-muted);
    font-size: 0.85rem;
    padding: 1rem;
    border-top: 1px solid #e3e6ea;
}

.form-row {
    margin: 0.75rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-width: 28rem;
}

.form-row input[type="text"], .form-row input[type="email"], .form-row input[type="password"] {
    padding: 0.4rem 0.5rem;
    font: inherit;
}

.form-check {
    flex-direction: row;
    align-items: flex-start;
    gap: 0.5rem;
}

.form-errors {
    color: #a12622;
}

button[type="submit"] {
    padding: 0.5rem 1rem;
    font: inherit;
    background: var(--ha-accent);
    color: #fff;
    border: 0;
    border-radius: 4px;
    cursor: pointer;
}

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.75rem 1rem;
    background: #ffe9e9;
    border-top: 1px solid #d9534f;
}

/* Assessment runner (M4) */
.card {
    border: 1px solid #e3e6ea;
    border-radius: 6px;
    padding: 1rem 1.25rem;
    margin: 1rem 0;
}

.button {
    display: inline-block;
    background: var(--ha-accent);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
}

.progress {
    color: var(--ha-muted);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.prompt {
    font-size: 1.35rem;
    line-height: 1.4;
}

.muted {
    color: var(--ha-muted);
}

.notice {
    background: #eef4fa;
    border-left: 4px solid var(--ha-accent);
    padding: 0.5rem 0.75rem;
    margin: 0.75rem 0;
}

.option {
    padding: 0.4rem 0;
    border-bottom: 1px solid #f0f2f4;
}

.option label {
    margin-left: 0.5rem;
}

.na {
    margin-top: 1rem;
    color: var(--ha-muted);
}

.poles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 0.5rem 0;
}

.pole {
    border: 1px solid #e3e6ea;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
}

.actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 1rem;
}

fieldset {
    border: 0;
    padding: 0;
    margin: 0;
}

textarea, select {
    width: 100%;
    max-width: 40rem;
    font: inherit;
    padding: 0.4rem;
}

button.link {
    background: none;
    border: 0;
    color: var(--ha-accent);
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    font: inherit;
}

/* Item components (M5) */
.two-up {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.two-up input[type="text"], .two-up input[type="date"], .two-up select {
    width: 100%;
}

.label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.evidence-request {
    margin-top: 1.5rem;
}

.evidence-request h2 {
    margin-top: 0;
    font-size: 1.1rem;
}

/* Event records and evidence (M6) */
fieldset.rubric {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    border: 1px solid #e3e6ea;
    border-radius: 4px;
}

fieldset.rubric legend {
    font-weight: 600;
}

fieldset.rubric p.muted {
    margin-top: 0;
}

.event-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0.75rem;
}

.event-table th, .event-table td {
    text-align: left;
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid #e3e6ea;
    vertical-align: top;
}

.arena-links {
    columns: 2;
    padding-left: 1.25rem;
}

.evidence-list {
    list-style: none;
    padding: 0;
}

.evidence-record {
    margin-bottom: 0.75rem;
}

.artifacts {
    padding-left: 1.25rem;
}

form.inline {
    display: inline;
    margin-left: 0.5rem;
}

form.upload {
    margin: 0.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-width: 28rem;
}

.common-source select {
    max-width: 28rem;
}

details {
    margin: 0.5rem 0 1rem;
}

details summary {
    cursor: pointer;
    color: var(--ha-accent);
}

/* Results profile (M9) */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 1rem;
}

.dimension {
    border: 1px solid #e3e6ea;
    border-radius: 6px;
    padding: 1rem;
}

.dimension h2, .dimension h3 {
    margin-top: 0;
}

.score {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1;
}

.score-small {
    font-size: 1.25rem;
    font-weight: 600;
}

.band {
    color: var(--ha-muted);
    font-size: 0.9rem;
}

.state {
    color: var(--ha-muted);
    font-style: italic;
}

.parts {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0;
}

.parts li {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.2rem 0;
    border-bottom: 1px solid #f0f2f4;
}

.composite {
    border: 1px dashed #c9cfd6;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    color: var(--ha-muted);
    margin-top: 1.5rem;
}

.composite .score {
    font-size: 1.5rem;
    color: var(--ha-ink);
}

.why {
    border-top: 1px solid #e3e6ea;
    padding: 0.75rem 0;
}

.why table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.why th, .why td {
    text-align: left;
    padding: 0.2rem 0.4rem;
    border-bottom: 1px solid #f0f2f4;
    vertical-align: top;
}

.facts {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.1rem 1rem;
    font-size: 0.9rem;
}

.facts dt {
    color: var(--ha-muted);
}

.facts dd {
    margin: 0;
}

.profile-nav a {
    margin-right: 1rem;
}

/* History (M10) */
.history, .deltas {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.history th, .history td, .deltas th, .deltas td {
    text-align: left;
    padding: 0.3rem 0.5rem;
    border-bottom: 1px solid #f0f2f4;
    vertical-align: top;
}

/* Privacy notice, consent and account controls (M15) */
.consent-notice h2 {
    font-size: 1.15rem;
    margin-top: 1.5rem;
}

.consent-summary {
    font-size: 1.05rem;
}

.acknowledgment {
    border: 1px solid #e3e6ea;
    border-radius: 6px;
    padding: 0.75rem 1.25rem;
    margin: 1rem 0;
    max-width: 44rem;
}

.acknowledgment legend {
    font-weight: 600;
}

button.secondary {
    background: #fff;
    color: var(--ha-accent);
    border: 1px solid var(--ha-accent);
}

.card.danger {
    border-color: #d9534f;
}

.button.danger, button.danger {
    background: #a12622;
    color: #fff;
}
