.skip-link {
    position: fixed;
    z-index: 100000;
    top: 0.5rem;
    left: 0.5rem;
    padding: 0.75rem 1rem;
    border: 2px solid currentColor;
    border-radius: 0.4rem;
    background: #ffffff;
    color: #12344d;
    font-weight: 700;
    transform: translateY(-160%);
}

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

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 3px solid #0b5d2a !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 2px #ffffff !important;
}

:where(input, select, textarea)[aria-invalid="true"] {
    border-color: #b42318 !important;
    border-width: 2px !important;
}

[hidden] {
    display: none !important;
}

/* Accessible equivalents of the calculator palette (minimum 4.5:1 on white). */
.step-dot.active,
.tab-btn.active,
.lang-btn.active,
.btn:not(.btn-success):not(.btn-next):not(.btn-secondary):not(.btn-prev) {
    background-color: #216b31 !important;
    color: #ffffff !important;
}

.step-dot.done,
.btn-success,
.btn-next {
    background-color: #18733a !important;
    color: #ffffff !important;
}

.btn-secondary,
.btn-prev {
    background-color: #586a6b !important;
    color: #ffffff !important;
}

.lang-btn:not(.active) {
    border-color: #216b31 !important;
    color: #174f25 !important;
}

.step-label,
.hint,
.info-note,
.sub-val,
.eff-label,
.npk-badge,
.item-unit {
    color: #59636e !important;
}

.val-pos {
    color: #b42318 !important;
}

.val-neg {
    color: #9a4a00 !important;
}

.val-ok {
    color: #18733a !important;
}

.val-deficit {
    color: #174f25 !important;
}

.npk-calculator h3,
.npk-calculator .auto-info,
.npk-calculator .auto-row .val,
.npk-calculator [style*="color:#3498db"],
.npk-calculator [style*="color:#2980b9"] {
    color: #174f25 !important;
}

.npk-calculator .auto-info,
.npk-calculator .card-auto {
    border-color: #216b31 !important;
    background: #eef8f0 !important;
}

.npk-calculator .calculations-table th {
    background: #216b31 !important;
    color: #ffffff !important;
}

.npk-calculator .byproduct-section .bp-title {
    color: #18733a !important;
}

.npk-calculator [style*="color:#7f8c8d"] {
    color: #59636e !important;
}

.npk-calculator [style*="color:#e74c3c"] {
    color: #b42318 !important;
}

.modal[aria-hidden="true"] {
    display: none !important;
}

.a11y-live-region {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.a11y-toolbar {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem;
    border: 1px solid #9bbda3;
    border-radius: 0.55rem;
    background: #ffffff;
    color: #174f25;
}

.a11y-toolbar button.a11y-toolbar-button {
    min-width: 2.75rem;
    min-height: 2.5rem;
    margin: 0;
    padding: 0.45rem 0.65rem;
    border: 2px solid #216b31;
    border-radius: 0.4rem;
    background: #ffffff !important;
    color: #174f25 !important;
    font: inherit;
    font-weight: 750;
    line-height: 1;
    cursor: pointer;
    transform: none;
}

.a11y-toolbar button.a11y-toolbar-button:hover {
    background: #eef8f0 !important;
}

.a11y-toolbar button.a11y-toolbar-button[aria-pressed="true"] {
    background: #216b31 !important;
    color: #ffffff !important;
}

.a11y-font-status {
    min-width: 3.4rem;
    text-align: center;
    color: #174f25;
    font-size: 0.85rem;
    font-weight: 700;
}

html.a11y-high-contrast body,
html.a11y-high-contrast :where(main, header, section, article, .card, .modal-content, .selected-item, .field-card, .balance-block, .summary, .recommendation, .result-conclusion, .field-result, .history-item, .a11y-toolbar) {
    border-color: #ffffff !important;
    background: #000000 !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

html.a11y-high-contrast :where(h1, h2, h3, h4, p, span, strong, small, label, dt, dd, .hint, .info-note, .sub-val, .step-label, .eff-label, .npk-badge, .item-unit) {
    color: #ffffff !important;
}

html.a11y-high-contrast :where(a, .back-link) {
    color: #ffff00 !important;
    text-decoration: underline !important;
}

html.a11y-high-contrast :where(button, input[type="submit"], .btn),
html.a11y-high-contrast .a11y-toolbar button.a11y-toolbar-button {
    border: 2px solid #ffff00 !important;
    background: #ffff00 !important;
    color: #000000 !important;
}

html.a11y-high-contrast .a11y-toolbar button.a11y-toolbar-button,
html.a11y-high-contrast .a11y-toolbar button.a11y-toolbar-button[aria-pressed="true"] {
    border-color: #ffff00 !important;
    background: #ffff00 !important;
    color: #000000 !important;
}

html.a11y-high-contrast .a11y-font-status {
    color: #ffffff !important;
}

html.a11y-high-contrast :where(input, select, textarea) {
    border: 2px solid #ffffff !important;
    background: #000000 !important;
    color: #ffffff !important;
}

html.a11y-high-contrast :where(input, select, textarea)::placeholder {
    color: #e6e6e6 !important;
    opacity: 1;
}

html.a11y-high-contrast :where(.message, [role="alert"], .error-message, .picker-error) {
    border: 2px solid #ff6b6b !important;
    background: #000000 !important;
    color: #ffb3b3 !important;
}

html.a11y-high-contrast :where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline-color: #00ffff !important;
    box-shadow: 0 0 0 2px #000000 !important;
}

@media (max-width: 400px) {
    body,
    main,
    .container,
    .card,
    .modal-content {
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    input,
    select,
    textarea,
    button {
        max-width: 100%;
    }
}

@media (max-width: 600px) {
    .npk-calculator .step-indicator {
        width: 100%;
        justify-content: space-between;
        gap: 4px;
        overflow-x: visible;
    }

    .npk-calculator .step {
        min-width: 0;
        flex: 1 1 0;
        flex-direction: column;
        gap: 4px;
        text-align: center;
    }

    .npk-calculator .step-line {
        display: none;
    }

    .npk-calculator .step-label {
        margin: 0;
        font-size: 11px;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }
}

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

@media (forced-colors: active) {
    :where(a, button, input, select, textarea, [tabindex]):focus-visible {
        outline: 3px solid Highlight !important;
        box-shadow: none !important;
    }

    .active,
    [aria-current="step"],
    [aria-pressed="true"] {
        forced-color-adjust: none;
        border: 2px solid Highlight !important;
    }
}
