.af-refresh[data-af-refresh] {
    --af-refresh-accent: #225b47;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 0 0 auto;
    box-sizing: border-box;
    min-inline-size: 44px;
    min-block-size: 44px;
    max-inline-size: 100%;
    padding: 6px 12px;
    border: 1px solid #bfd3c8;
    border-radius: 10px;
    background: #fff;
    color: var(--af-refresh-accent);
    font: inherit;
    font-size: .95em;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .16s, border-color .16s, color .16s, box-shadow .16s, transform .16s;
}
.af-refresh[data-af-refresh][hidden] { display: none !important; }
.af-refresh.af-refresh--icon[data-af-refresh] {
    inline-size: 44px;
    block-size: 44px;
    padding: 0;
}
.af-refresh[data-af-refresh]:hover {
    background: #eaf4ee;
    border-color: #81aa94;
    color: #174633;
    text-decoration: none;
}
.af-refresh[data-af-refresh]:focus-visible {
    outline: 2px solid #237854;
    outline-offset: 2px;
}
.af-refresh[data-af-refresh]:active:not([aria-busy="true"]) { transform: scale(.95); }
.af-refresh[data-af-refresh]:disabled:not([aria-busy="true"]) { opacity: .5; cursor: default; }

.af-refresh[data-af-refresh] .af-refresh-symbol {
    display: grid;
    place-items: center;
    inline-size: 22px;
    block-size: 22px;
    flex: 0 0 22px;
}
.af-refresh[data-af-refresh] .af-refresh-symbol > svg {
    inline-size: 22px;
    block-size: 22px;
    display: block;
    grid-area: 1 / 1;
}
.af-refresh[data-af-refresh] .af-refresh-symbol > :is(.af-refresh-check, .af-refresh-warning) { visibility: hidden; }
.af-refresh[data-af-refresh][data-af-refresh-state="busy"] {
    background: var(--af-refresh-accent);
    border-color: var(--af-refresh-accent);
    color: #fff;
    opacity: 1;
    box-shadow: 0 0 0 3px #cbe8d8;
    cursor: progress;
}
.af-refresh[data-af-refresh-state="busy"] .af-refresh-arrow {
    animation: af-refresh-turn .7s linear infinite;
}
@keyframes af-refresh-turn { to { transform: rotate(360deg); } }

.af-refresh[data-af-refresh][data-af-refresh-state="done"] {
    background: #e2f3e8;
    border-color: #78a98c;
    color: #145839;
}
.af-refresh[data-af-refresh][data-af-refresh-state="error"] {
    background: #fdece8;
    border-color: #db9386;
    color: #8b251b;
}
.af-refresh[data-af-refresh][data-af-refresh-state="done"] .af-refresh-check,
.af-refresh[data-af-refresh][data-af-refresh-state="error"] .af-refresh-warning { visibility: visible; }
.af-refresh[data-af-refresh][data-af-refresh-state="done"] .af-refresh-arrow,
.af-refresh[data-af-refresh][data-af-refresh-state="error"] .af-refresh-arrow { visibility: hidden; }

.af-refresh-announcement {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) {
    .af-refresh[data-af-refresh] { transition: none; }
    .af-refresh[data-af-refresh]:active { transform: none; }
    .af-refresh[data-af-refresh-state="busy"] .af-refresh-arrow { animation: none; }
}
