.handoff-page {
    --handoff-ink: #1d2533;
    --handoff-muted: #667085;
    --handoff-line: rgba(103, 117, 143, 0.18);
    --handoff-violet: #6844c6;
    --handoff-teal: #147d73;
    --handoff-amber: #b16b12;
    --handoff-rose: #c44963;
}

.handoff-page .ui-button--primary {
    border-color: rgba(20, 125, 115, 0.18);
    background: #147d73;
    box-shadow: 0 10px 22px rgba(20, 125, 115, 0.16);
}

.handoff-page .ui-button--primary:hover,
.handoff-page .ui-button--primary:focus-visible {
    background: #10665f;
}

.handoff-shell {
    width: min(100%, 74rem);
    margin-inline: auto;
}

.handoff-heading {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-default);
}

.handoff-heading__actions,
.handoff-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
}

.handoff-actions > form {
    display: inline-flex;
}

.handoff-heading__actions > form {
    display: inline-flex;
}

.handoff-actions .ui-button,
.handoff-heading__actions .ui-button {
    min-width: 7.25rem;
}

.handoff-hero {
    position: relative;
    overflow: hidden;
}

.handoff-hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
}

.handoff-visual {
    display: grid;
    gap: 0.75rem;
    min-height: 12rem;
    padding: 1rem;
    border: 1px solid rgba(104, 68, 198, 0.12);
    border-radius: var(--radius-card);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 252, 0.92)),
        linear-gradient(135deg, rgba(20, 125, 115, 0.12), rgba(177, 107, 18, 0.1));
}

.handoff-visual__bar {
    height: 0.55rem;
    border-radius: 999px;
    background: rgba(103, 117, 143, 0.15);
    overflow: hidden;
}

.handoff-visual__bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--handoff-teal), var(--handoff-violet));
}

.handoff-visual__row {
    display: grid;
    grid-template-columns: 1.6rem minmax(0, 1fr) 4.5rem;
    align-items: center;
    gap: 0.7rem;
    min-height: 2.7rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--handoff-line);
    border-radius: var(--radius-control);
    background: rgba(255, 255, 255, 0.78);
}

.handoff-visual__dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 999px;
    background: rgba(20, 125, 115, 0.13);
    color: var(--handoff-teal);
    font-size: 0.8rem;
}

.handoff-visual__dot--pending {
    background: rgba(196, 73, 99, 0.12);
    color: var(--handoff-rose);
}

.handoff-visual__name {
    color: var(--handoff-ink);
    font-size: 0.9rem;
    font-weight: 900;
}

.handoff-visual__state {
    justify-self: end;
    color: var(--handoff-muted);
    font-size: 0.75rem;
    font-weight: 900;
    white-space: nowrap;
}

.handoff-section-header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.handoff-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
    gap: 0.9rem;
}

.handoff-session-card,
.handoff-roster-card,
.handoff-member-card,
.handoff-receipt-row {
    min-width: 0;
}

.handoff-progress {
    height: 0.55rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(103, 117, 143, 0.15);
}

.handoff-progress__bar {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--handoff-teal), #34a399);
}

.handoff-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 22rem) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

.handoff-form-panel {
    width: min(100%, 56rem);
}

.handoff-start-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(18rem, 22rem);
    gap: 1.25rem;
    align-items: start;
}

.handoff-start-card {
    border-width: 2px;
    border-color: rgba(20, 125, 115, 0.22);
}

.handoff-start-grid__primary {
    order: 1;
}

.handoff-start-grid__settings {
    order: 2;
}

.handoff-muted-panel {
    background: rgba(255, 255, 255, 0.68);
}

.handoff-member-form-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 0.75rem;
}

.handoff-member-form-grid > * {
    min-width: 0;
}

.handoff-field-name {
    grid-column: span 3;
}

.handoff-field-affiliation {
    grid-column: span 3;
}

.handoff-field-short {
    grid-column: span 2;
}

.handoff-field-note {
    grid-column: span 3;
}

.handoff-field-actions {
    grid-column: span 2;
    display: grid;
    grid-template-columns: repeat(2, minmax(4.5rem, 1fr));
    gap: 0.5rem;
    align-self: end;
}

.handoff-toolbar {
    display: grid;
    grid-template-columns: auto minmax(12rem, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
}

.handoff-filter-group,
.handoff-export-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.handoff-filter-group .ui-button,
.handoff-export-group .ui-button {
    min-width: 5.5rem;
}

.handoff-receipt-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.9rem;
    align-items: center;
}

.handoff-receipt-row .receipt-state-form {
    width: auto;
}

.handoff-receipt-row .state-button {
    min-width: 7.5rem;
}

.handoff-toast {
    width: min(calc(100vw - 2rem), 28rem);
}

@media (min-width: 768px) {
    .handoff-heading,
    .handoff-section-header {
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
    }

    .handoff-hero__grid {
        grid-template-columns: minmax(0, 1fr) minmax(17rem, 22rem);
        align-items: stretch;
    }
}

@media (max-width: 1023px) {
    .handoff-dashboard-grid,
    .handoff-start-grid,
    .handoff-toolbar {
        grid-template-columns: minmax(0, 1fr);
    }

    .handoff-member-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .handoff-field-name,
    .handoff-field-affiliation,
    .handoff-field-short,
    .handoff-field-note,
    .handoff-field-actions {
        grid-column: auto;
    }
}

@media (max-width: 639px) {
    .handoff-heading__actions,
    .handoff-actions,
    .handoff-filter-group,
    .handoff-export-group,
    .handoff-actions > form,
    .handoff-heading__actions > form,
    .handoff-receipt-row .receipt-state-form {
        width: 100%;
    }

    .handoff-heading__actions .ui-button,
    .handoff-actions .ui-button,
    .handoff-filter-group .ui-button,
    .handoff-export-group .ui-button,
    .handoff-receipt-row .state-button {
        width: 100%;
    }

    .handoff-receipt-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .handoff-member-form-grid,
    .handoff-field-actions {
        grid-template-columns: minmax(0, 1fr);
    }

    .handoff-visual {
        min-height: auto;
    }

    .handoff-visual__row {
        grid-template-columns: 1.6rem minmax(0, 1fr);
    }

    .handoff-visual__state {
        grid-column: 2;
        justify-self: start;
    }
}
