.hav-workspace {
    --hav-accent: var(--accent-primary);
    --hav-border: var(--border-color);
    --hav-panel: var(--bg-surface);
    --hav-subtle: var(--bg-panel);
    --hav-warning: var(--warning);
    --hav-danger: var(--danger);
    display: grid;
    gap: 1.25rem;
    max-width: 92rem;
    margin-inline: auto;
    container-type: inline-size;
}

.hav-breadcrumb, .hav-block-head, .hav-pager, .hav-exposure-legend, .hav-step-controls, .hav-hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
}

.hav-breadcrumb { font-size: .875rem; }
.hav-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.25rem 2rem;
    padding: clamp(1.25rem, 3.5cqi, 2.6rem);
    border: 1px solid var(--hav-border);
    border-inline-start: .3rem solid var(--hav-accent);
    border-radius: .9rem;
    background: linear-gradient(125deg, color-mix(in srgb, var(--hav-accent) 10%, var(--hav-panel)), var(--hav-panel) 74%);
}
.hav-hero > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.hav-hero h1 { font-size: clamp(1.8rem, 4cqi, 3rem); line-height: 1.12; margin: 0; }
.hav-hero p { max-width: 58ch; margin: .55rem 0 0; }

.hav-split, .hav-form-grid, .hav-facts, .hav-tool-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.hav-block {
    padding: clamp(1rem, 2.2cqi, 1.6rem);
    border: 1px solid var(--hav-border);
    border-radius: .8rem;
    min-width: 0;
    background: var(--hav-panel);
    box-shadow: var(--shadow-sm);
}
.hav-block h2, .hav-calculator-tools > h2 { font-size: clamp(1.15rem, 2.1cqi, 1.45rem); line-height: 1.25; margin: 0 0 .75rem; }
.hav-block h3 { font-size: 1.12rem; margin: 0; }
.hav-block-head { justify-content: space-between; margin-bottom: .9rem; }
.hav-block-head h2, .hav-block-head p { margin: 0; }
.hav-block-head h2 + p { margin-top: .35rem; }

.hav-value strong {
    display: block;
    margin: 0;
    font-size: clamp(1.4rem, 3.2cqi, 2.15rem);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.hav-value { min-width: 11rem; }
.hav-record-list, .hav-contributions { margin: 0; padding: 0; list-style: none; }
.hav-record-list li {
    display: flex;
    align-items: baseline;
    gap: .45rem .8rem;
    justify-content: space-between;
    padding: .8rem 0;
    border-top: 1px solid var(--hav-border);
    overflow-wrap: anywhere;
}
.hav-record-list a { font-weight: 650; }
.hav-record-list a span, .hav-record-list li div span { display: block; font-size: .875em; font-weight: 400; color: var(--text-muted); }
.hav-record-list strong { text-align: end; }
.hav-record-status, .hav-exposure-legend strong {
    display: inline-block;
    flex-shrink: 0;
    padding: .23rem .55rem;
    border: 1px solid var(--hav-border);
    border-radius: .4rem;
    background: var(--hav-subtle);
    color: var(--text-primary);
    font-size: .8rem;
    font-weight: 650;
}
.hav-status-warning, .hav-exposure-legend .hav-exposure-action {
    border-color: color-mix(in srgb, var(--hav-warning) 45%, var(--hav-border));
    background: color-mix(in srgb, var(--hav-warning) 12%, var(--hav-panel));
}
.hav-exposure-legend .hav-exposure-limit {
    border-color: color-mix(in srgb, var(--hav-danger) 50%, var(--hav-border));
    background: color-mix(in srgb, var(--hav-danger) 13%, var(--hav-panel));
}

.hav-record, .hav-estimator, .hav-exposure {
    border: 1px solid var(--hav-border);
    border-radius: .65rem;
    padding: .85rem;
    margin-block: .75rem;
    overflow-wrap: anywhere;
}
.hav-record summary, .hav-estimator summary { font-weight: 650; cursor: pointer; }
.hav-estimator p { margin-block: .5rem; }
.hav-facts dt { font-weight: 650; }
.hav-facts dd { margin-inline-start: 0; white-space: pre-line; }
.hav-form-grid label, .hav-inline-fields label, .hav-operation label, .hav-tool label, .hav-calculator-settings label {
    display: grid;
    min-width: 0;
    gap: .28rem;
    align-content: start;
    font-weight: 550;
}
.hav-form-grid textarea, .hav-inline-fields textarea { min-height: 5.5rem; resize: vertical; }
.hav-form-grid legend, .hav-inline-fields legend, .hav-axis-fields legend { font-weight: 650; padding-inline: .2rem; }
.hav-inline-fields { display: grid; min-width: 0; gap: .75rem; margin-block: .65rem; border: 1px solid var(--hav-border); border-radius: .6rem; padding: .85rem; }
.hav-check { display: flex !important; align-items: center; gap: .5rem; }
.hav-check input { flex: none; accent-color: var(--hav-accent); }

.hav-calculator-settings {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: .65rem 1.1rem;
    margin-block: .85rem;
}
.hav-calculator-settings input { max-width: 11rem; }
.hav-calculator-settings a { padding-block: .45rem; font-size: .875rem; }
.hav-scenario-grid { display: grid; gap: .9rem; }
.hav-two-scenarios { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hav-calculator-scenario { min-width: 0; border: 1px solid var(--hav-border); border-radius: .7rem; padding: clamp(.8rem, 2cqi, 1.2rem); }
.hav-operation-list { display: grid; gap: .65rem; margin-bottom: .75rem; }
.hav-operation {
    display: grid;
    grid-template-columns: minmax(7rem, 2fr) repeat(2, minmax(6rem, 1fr)) auto;
    align-items: end;
    gap: .55rem;
    min-width: 0;
    margin: 0;
    padding: .65rem 0;
    border: 0;
    border-top: 1px solid var(--hav-border);
}
.hav-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
.hav-empty { margin: .85rem 0 0; padding: .8rem; border-radius: .55rem; background: var(--hav-subtle); color: var(--text-muted); }
.hav-calculator-result { margin-bottom: .9rem; }
.hav-exposure { margin: .85rem 0 0; background: var(--hav-subtle); }
.hav-calculator-result .hav-exposure { margin-top: 0; }
.hav-exposure-head { display: grid; gap: .22rem; line-height: 1.2; }
.hav-exposure-head > span:first-child { font-weight: 650; }
.hav-exposure-head strong { font-size: clamp(1.6rem, 4cqi, 2.5rem); font-variant-numeric: tabular-nums; }
.hav-exposure-head strong small { font-size: .9rem; }
.hav-exposure-head > span:last-child { font-size: .875rem; }
.hav-scale { position: relative; display: flex; justify-content: space-between; gap: .25rem; margin: .85rem 0 .65rem; padding-top: 1.05rem; font-size: .74rem; font-variant-numeric: tabular-nums; }
.hav-exposure-track {
    position: absolute;
    inset: 0 0 auto;
    height: .78rem;
    border-radius: .25rem;
    background: linear-gradient(to right,
        color-mix(in srgb, var(--hav-accent) 19%, var(--hav-panel)) 0 var(--action),
        color-mix(in srgb, var(--hav-warning) 20%, var(--hav-panel)) var(--action) var(--limit),
        color-mix(in srgb, var(--hav-danger) 19%, var(--hav-panel)) var(--limit) 100%);
}
.hav-exposure-fill { position: absolute; inset: 0 auto 0 0; border-radius: .25rem; background: var(--hav-accent); }
.hav-exposure-fill.hav-exposure-action { background: var(--hav-warning); }
.hav-exposure-fill.hav-exposure-limit { background: var(--hav-danger); }
.hav-exposure-marker { position: absolute; inset-block: -.13rem; border-inline-start: 2px solid var(--text-primary); }
.hav-action-marker, .hav-action-tick { left: 20%; }
.hav-limit-marker, .hav-limit-tick { left: 80%; }
.hav-action-tick, .hav-limit-tick { position: absolute; transform: translateX(-50%); }
.hav-exposure-legend { gap: .4rem .7rem; font-size: .79rem; }

.hav-contribution-panel { margin-top: .85rem; }
.hav-contribution-panel h4 { font-size: .9rem; margin: 0 0 .35rem; }
.hav-contributions li { padding: .35rem 0; overflow-wrap: anywhere; }
.hav-contributions li > div:first-child {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .15rem .65rem;
    font-size: .875rem;
}
.hav-contributions small { color: var(--text-muted); }
.hav-contribution-track, .hav-source-track { height: .32rem; margin-top: .25rem; border-radius: 1rem; background: var(--hav-subtle); }
.hav-contribution-track span, .hav-source-track span { display: block; max-width: 100%; height: 100%; border-radius: inherit; background: var(--hav-accent); }

.hav-comparison-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .4rem .85rem;
    margin-top: .9rem;
    padding: .7rem .85rem;
    border-inline-start: 3px solid var(--hav-accent);
    border-radius: .35rem;
    background: var(--hav-subtle);
    font-variant-numeric: tabular-nums;
}
.hav-calculator-note { margin: .85rem 0 0; font-size: .875rem; }
.hav-tool-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
.hav-tool { display: grid; gap: .65rem; }
.hav-tool p { margin: 0; }
.hav-tool .hav-form-grid { gap: .6rem; }
.hav-tool-result {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(7.2rem, 1fr));
    gap: .55rem;
    margin: .55rem 0 0;
}
.hav-tool-result > div { min-width: 0; padding: .55rem .65rem; border: 1px solid var(--hav-border); border-radius: .45rem; background: var(--hav-subtle); }
.hav-tool-result dt { font-size: .8rem; }
.hav-tool-result dd { margin: .15rem 0 0; font-weight: 680; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.hav-axis-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem; min-width: 0; margin: 0; padding: 0; border: 0; }
.hav-axis-fields legend { margin-bottom: .25rem; font-size: .85rem; }
.hav-source-chart { display: grid; gap: .75rem; max-width: 49rem; margin: .85rem 0; }
.hav-source-chart dt, .hav-source-chart dd { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .55rem; margin: 0; }
.hav-source-chart dd span { font-size: .82rem; color: var(--text-muted); }
.hav-source-track { height: .48rem; }
.hav-source-track span { opacity: .54; }
.hav-source-track .hav-source-selected { opacity: 1; }
.hav-step-controls button[aria-pressed="true"] { outline: 2px solid var(--hav-accent); outline-offset: -2px; }
.hav-workspace [hidden] { display: none !important; }
.hav-advice { white-space: pre-line; }

@container (max-width: 60rem) and (min-width: 44.01rem) {
    .hav-two-scenarios .hav-operation { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hav-two-scenarios .hav-operation label:first-of-type { grid-column: 1 / -1; }
    .hav-two-scenarios .hav-operation button { justify-self: start; }
}
@container (max-width: 61rem) { .hav-tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (max-width: 44rem) {
    .hav-split, .hav-form-grid, .hav-facts, .hav-tool-grid, .hav-two-scenarios { grid-template-columns: minmax(0, 1fr); }
    .hav-record-list li { flex-wrap: wrap; }
    .hav-operation { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hav-operation label:first-of-type { grid-column: 1 / -1; }
    .hav-operation button { justify-self: start; }
    .hav-exposure-legend { align-items: start; }
}

.hav-comparison-context { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .5rem 1rem; }
.hav-comparison-context p { margin: 0; }
.hav-compare-link { display: inline-block; margin-top: .65rem; }