:root {
    --hfc-ink: #1f302f;
    --hfc-forest: #12645f;
    --hfc-coral: #b9474d;
    --hfc-honey: #c98213;
    --hfc-mint: #e7f4ed;
    --hfc-paper: #fffaf0;
    --hfc-cloud: #f5f7f2;
    --hfc-line: #d7ded3;
    --hfc-focus: #0b5fff;
    --hfc-shadow: 0 10px 24px rgba(31, 48, 47, .12);
    color-scheme: light;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--hfc-cloud);
    color: var(--hfc-ink);
    font-family: "Nunito Sans", "Segoe UI", system-ui, sans-serif;
}

a,
button,
input,
select,
textarea {
    font: inherit;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
    outline: 3px solid var(--hfc-focus);
    outline-offset: 3px;
}

.hfc-skip-link {
    position: absolute;
    left: 1rem;
    top: .75rem;
    transform: translateY(-160%);
    background: var(--hfc-ink);
    color: white;
    padding: .75rem 1rem;
    z-index: 20;
}

.hfc-skip-link:focus {
    transform: translateY(0);
}

.hfc-app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(18rem, 24rem) minmax(0, 1fr) minmax(17rem, 22rem);
    gap: 1rem;
    padding: 1rem;
}

.hfc-topbar,
.hfc-screen,
.hfc-evidence-panel,
.hfc-empty-state {
    background: var(--hfc-paper);
    border: 1px solid var(--hfc-line);
    border-radius: 8px;
    box-shadow: var(--hfc-shadow);
}

.hfc-topbar {
    align-self: start;
    position: sticky;
    top: 1rem;
    padding: 1rem;
}

.hfc-kicker {
    margin: 0 0 .35rem;
    color: var(--hfc-forest);
    font-size: .82rem;
    font-weight: 800;
    text-transform: uppercase;
}

h1,
h2,
h3 {
    margin: 0;
    line-height: 1.1;
    letter-spacing: 0;
    font-family: "Baloo 2", "Segoe UI", system-ui, sans-serif;
}

h1 {
    font-size: clamp(1.7rem, 1.45rem + 1vw, 2.5rem);
}

h2 {
    font-size: clamp(1.55rem, 1.35rem + .8vw, 2.2rem);
}

h3 {
    font-size: 1.25rem;
}

.hfc-surface-nav {
    display: grid;
    gap: .75rem;
    margin-top: 1rem;
}

.hfc-surface-nav summary {
    min-height: 44px;
    cursor: pointer;
    font-weight: 800;
    color: var(--hfc-coral);
}

.hfc-surface-nav div {
    display: grid;
    gap: .35rem;
}

.hfc-surface-nav a {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: .55rem .7rem;
    color: var(--hfc-ink);
    text-decoration: none;
    border-radius: 6px;
}

.hfc-surface-nav a[aria-current="page"] {
    background: var(--hfc-mint);
    color: var(--hfc-forest);
    font-weight: 800;
}

.hfc-screen-main {
    min-width: 0;
}

.hfc-screen {
    overflow: clip;
}

.hfc-screen-hero {
    display: grid;
    gap: .8rem;
    padding: clamp(1rem, 2vw, 2rem);
    background: linear-gradient(135deg, var(--hfc-paper), var(--hfc-mint));
    border-bottom: 1px solid var(--hfc-line);
}

.hfc-screen-hero p {
    max-width: 72ch;
}

.hfc-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.hfc-metrics span {
    border: 1px solid var(--hfc-line);
    border-radius: 999px;
    background: white;
    color: var(--hfc-ink);
    padding: .35rem .7rem;
    font-weight: 800;
}

.hfc-control-section {
    padding: clamp(1rem, 2vw, 1.5rem);
}

.hfc-control-section + .hfc-control-section {
    border-top: 1px solid var(--hfc-line);
}

.hfc-control-grid,
.hfc-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
    gap: .8rem;
    margin-top: 1rem;
}

.hfc-control {
    min-width: 0;
    display: grid;
    gap: .45rem;
    padding: .85rem;
    border: 1px solid var(--hfc-line);
    border-radius: 8px;
    background: white;
}

.hfc-control label {
    font-weight: 800;
}

.hfc-control input,
.hfc-control select,
.hfc-control textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid #aab7ae;
    border-radius: 6px;
    padding: .65rem .75rem;
    background: white;
    color: var(--hfc-ink);
}

.hfc-control textarea {
    min-height: 7rem;
    resize: vertical;
}

.hfc-control p {
    margin: 0;
    color: #4f615f;
    overflow-wrap: anywhere;
}

.hfc-control button,
.hfc-action-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid var(--hfc-forest);
    background: var(--hfc-forest);
    color: white;
    padding: .65rem .85rem;
    text-decoration: none;
    font-weight: 900;
    cursor: pointer;
}

.hfc-action-status {
    align-items: center;
    background: color-mix(in srgb, var(--hfc-mint) 20%, white);
    border: 1px solid color-mix(in srgb, var(--hfc-mint) 70%, var(--hfc-ink));
    border-radius: 999px;
    color: var(--hfc-ink);
    display: inline-flex;
    font-size: .88rem;
    font-weight: 900;
    min-height: 44px;
    padding: .4rem .8rem;
}

.hfc-action:nth-child(3n) button,
.hfc-action:nth-child(3n) .hfc-action-link {
    background: var(--hfc-coral);
    border-color: var(--hfc-coral);
}

.hfc-action:nth-child(3n + 1) button,
.hfc-action:nth-child(3n + 1) .hfc-action-link {
    background: var(--hfc-honey);
    border-color: var(--hfc-honey);
    color: #241800;
}

.hfc-control button:disabled,
.hfc-action:nth-child(3n) button:disabled,
.hfc-action:nth-child(3n + 1) button:disabled {
    background: #667370;
    border-color: #667370;
    color: white;
    cursor: not-allowed;
    opacity: .86;
}

.hfc-evidence-panel {
    align-self: start;
    position: sticky;
    top: 1rem;
    padding: 1rem;
}

.hfc-evidence-panel dl {
    display: grid;
    gap: .75rem;
}

.hfc-evidence-panel dt {
    font-weight: 900;
}

.hfc-evidence-panel dd {
    margin: .15rem 0 0;
    overflow-wrap: anywhere;
}

.hfc-empty-state {
    padding: 2rem;
}

@media (max-width: 1050px) {
    .hfc-app-shell {
        grid-template-columns: 1fr;
    }

    .hfc-topbar,
    .hfc-evidence-panel {
        position: static;
    }

    .hfc-surface-nav {
        max-height: min(38vh, 18rem);
        overflow: auto;
        padding-right: .25rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
}

@media (forced-colors: active) {
    .hfc-control,
    .hfc-topbar,
    .hfc-screen,
    .hfc-evidence-panel {
        border: 1px solid CanvasText;
        box-shadow: none;
    }
}
