.volunteers-page .volunteer-list {
    gap: 8px;
}

.volunteers-page .filter-bar {
    margin-bottom: 0;
}

.volunteers-page [data-search-status] {
    margin: 0;
}

/* Keep the live region available without reserving an empty grid row. */
.volunteers-page [data-search-status]:empty {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}

.volunteers-page [data-volunteer-results] > .list-count {
    margin-bottom: -8px;
}

.volunteer-card {
    position: relative;
    overflow-wrap: anywhere;
}

.volunteer-card > label {
    position: relative;
    z-index: 1;
    width: fit-content;
}

[id^="volunteer-name-"] { scroll-margin-top: 100px; }

.volunteer-card-main {
    display: block;
    color: inherit;
}

.volunteer-card-main::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
}

.volunteer-card-main:hover {
    text-decoration: none;
}

.volunteer-card-main:focus-visible {
    outline: none;
}

.volunteer-card-main:focus-visible::after {
    outline: 1px solid color-mix(in srgb, var(--green) 55%, var(--border));
    outline-offset: 2px;
}

.volunteer-card .person-heading {
    padding-right: 40px;
}

.volunteer-congregation {
    font-size: .85rem;
}

.volunteers-page .current-user-name, .volunteer-you {
    background: var(--green-light);
    color: var(--green);
}

.volunteer-you {
    font-size: .7rem;
    margin-left: 6px;
}

.volunteer-card .person-heading h2 {
    display: inline;
}

.volunteer-admin {
    display: inline-block;
    margin-left: 6px;
    font-size: .7rem;
    font-weight: 700;
    vertical-align: baseline;
}

.volunteer-menu {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
}

.volunteer-menu-toggle {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: var(--paper);
    color: var(--ink);
    border-color: transparent;
    font-size: 1.5rem;
}

.volunteer-menu-toggle:hover {
    background: var(--green-light);
    color: var(--green);
    border-color: transparent;
}

.volunteer-menu-items {
    position: absolute;
    right: 0;
    top: 100%;
    min-width: 170px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--paper);
    box-shadow: 0 8px 24px rgb(0 0 0 / 15%);
}

.volunteer-menu-items a, .volunteer-menu-items button {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--ink);
    text-align: left;
    font: inherit;
    white-space: nowrap;
}

.volunteer-menu-items svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.volunteer-menu-items a:hover, .volunteer-menu-items button:hover,
.volunteer-menu-items a:focus-visible, .volunteer-menu-items button:focus-visible {
    background: var(--green-light);
    color: var(--green);
    text-decoration: none;
}

.volunteer-card:has(.volunteer-menu-toggle[aria-expanded="true"]) {
    z-index: 3;
}

.volunteer-icon-line {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.volunteers-page .volunteer-icon-line svg, .volunteer-dialog .volunteer-icon-line svg {
    width: 19px;
    height: 19px;
    margin-top: 2px;
    flex: 0 0 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    color: var(--green);
}

.volunteer-details {
    display: grid;
    gap: 16px;
}

.volunteer-details dt {
    font-size: .85rem;
    color: var(--muted);
}

.volunteer-details dd {
    margin: 4px 0 0 27px;
}

.volunteer-details dd p {
    margin: 4px 0;
}

.volunteer-assignment {
    padding: 16px 0;
    border-top: 1px solid var(--border);
}

.volunteer-assignment h4, .volunteer-assignment p {
    margin: 0 0 8px;
}

.volunteers-page .volunteer-page-actions { display: flex; flex-direction: row; flex-wrap: nowrap; gap: 12px; }
.volunteers-page .volunteer-page-actions > .button { flex: 0 1 auto; }

.transfer-title { display: flex; align-items: center; gap: 10px; }
.transfer-title h1 { margin: 0; }
.transfer-help { position: relative; }
.transfer-help > button { padding: 4px 8px; background: transparent; color: var(--green); border: 0; }
.transfer-help [role="tooltip"] {
    display: none; position: absolute; top: 100%; right: 0; z-index: 5;
    width: min(300px, 75vw); padding: 12px; border: 1px solid var(--border);
    border-radius: var(--radius); background: var(--surface, white); color: var(--text, #222);
    font-size: .85rem; box-shadow: 0 4px 16px #0002;
}
.transfer-help:hover [role="tooltip"], .transfer-help:focus-within [role="tooltip"] { display: block; }
#transfer-volunteer-dialog .transfer-selection-filters { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
#transfer-volunteer-dialog .transfer-selection-filters input, #transfer-volunteer-dialog .transfer-selection-filters select { width: 100%; min-width: 0; font-size: 1rem; }
#transfer-volunteer-dialog [data-transfer-results] > p { overflow-wrap: anywhere; }
#transfer-volunteer-dialog .card-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: .8rem; }
.transfer-destination-warning { position: relative; display: flex; align-items: center; gap: 8px; color: #b42318; }
.transfer-help-danger { position: relative; display: inline-block; }
.transfer-help-danger > button { color: #b42318; min-width: 44px; min-height: 44px; }
.transfer-help-danger [role="tooltip"] { left: 0; right: auto; color: #b42318; border-color: #b42318; background: #fff1f0; }
@media (max-width: 600px) {
    .transfer-source { position: relative; }
    .transfer-source .transfer-help-danger { position: static; }
    .transfer-source .transfer-help-danger [role="tooltip"] { left: 0; right: auto; width: min(300px, 100%); box-sizing: border-box; }
    [data-transfer-review] > form { display: flex; }
    [data-transfer-review] > form > button { flex: 1; }
    #transfer-volunteer-dialog .transfer-selection-filters { grid-template-columns: minmax(0, 1fr); }
    .transfer-title { flex-wrap: wrap; }
}
