.handoff-page {
    --handoff-ink: var(--text-primary);
    --handoff-muted: var(--text-muted);
    --handoff-line: var(--border-default);
    --handoff-accent: var(--color-accent-primary);
    --handoff-accent-strong: var(--color-accent-strong);
    --handoff-accent-soft: var(--color-accent-soft);
    --handoff-success: var(--color-success);
    --handoff-success-soft: var(--color-success-soft);
    --handoff-warning: var(--color-warning);
    --handoff-warning-soft: var(--color-warning-soft);
    --handoff-danger: var(--color-danger);
    --handoff-danger-soft: var(--color-danger-soft);
}

.handoff-page .ui-button--primary {
    border-color: rgba(104, 68, 198, 0.22);
    background: var(--action-primary-background);
    box-shadow: 0 10px 22px var(--color-accent-shadow-soft);
}

.handoff-page .ui-button--primary:hover,
.handoff-page .ui-button--primary:focus-visible {
    background: var(--action-primary-background-hover);
}

.handoff-shell {
    margin-inline: auto;
}

.handoff-kicker,
.handoff-panel-eyebrow {
    color: var(--color-accent-strong);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0;
}

.handoff-hero-copy {
    max-width: 36rem;
    color: var(--handoff-muted);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.55;
}

.handoff-hub-hero,
.handoff-detail-hero {
    display: grid;
    gap: 1.15rem;
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(242, 235, 255, 0.92), transparent 42%),
        var(--surface-panel);
}

.handoff-hub-hero__main {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.handoff-detail-hero {
    align-items: start;
}

.handoff-hub-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
    gap: 0.75rem;
}

.handoff-stat {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
    min-height: 4.8rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--handoff-line);
    border-radius: var(--radius-card);
    background: rgba(255, 255, 255, 0.82);
}

.handoff-stat span {
    color: var(--handoff-muted);
    font-size: 0.72rem;
    font-weight: 900;
}

.handoff-stat strong {
    overflow-wrap: anywhere;
    color: var(--handoff-ink);
    font-size: clamp(1.05rem, 2vw, 1.45rem);
    font-weight: 900;
    line-height: 1.18;
}

.handoff-stat--ready {
    background: var(--handoff-accent-soft);
}

.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-panel-icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-control);
    background: var(--surface-panel-muted);
    color: var(--handoff-accent-strong);
}

.handoff-panel-icon--primary {
    background: var(--handoff-accent-soft);
}

.handoff-admin-panel {
    background: rgba(255, 255, 255, 0.74);
}

.handoff-create-panel,
.handoff-list-panel,
.handoff-start-card {
    position: relative;
}

.handoff-primary-action {
    min-height: 3rem;
}

.handoff-roster-card {
    transition:
        border-color var(--motion-duration-fast) var(--motion-ease-standard),
        transform var(--motion-duration-fast) var(--motion-ease-standard),
        box-shadow var(--motion-duration-fast) var(--motion-ease-standard);
}

.handoff-roster-card:hover,
.handoff-roster-card:focus-within {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-floating);
    transform: translateY(var(--motion-lift-subtle));
}

.handoff-inline-warning {
    color: var(--handoff-warning);
    font-size: 0.78rem;
    font-weight: 900;
}

.handoff-warning-box {
    border: 1px solid rgba(198, 138, 26, 0.24);
    border-radius: var(--radius-card);
    background: var(--handoff-warning-soft);
    color: var(--handoff-warning);
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
    font-weight: 900;
}

.handoff-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--handoff-line);
    border-radius: var(--radius-card);
    background: rgba(255, 255, 255, 0.82);
}

.handoff-info-row span:last-child {
    color: var(--handoff-accent-strong);
    font-variant-numeric: tabular-nums;
}

.handoff-linked-services {
    border: 1px solid var(--handoff-line);
    border-radius: var(--radius-card);
    background: var(--surface-panel-muted);
    color: var(--handoff-muted);
    padding: 1rem;
    font-size: 0.9rem;
    font-weight: 800;
}

.handoff-disclosure > summary,
.handoff-member-summary,
.handoff-action-menu > summary,
.handoff-export-menu > summary {
    cursor: pointer;
    list-style: none;
}

.handoff-disclosure > summary::-webkit-details-marker,
.handoff-member-summary::-webkit-details-marker,
.handoff-action-menu > summary::-webkit-details-marker,
.handoff-export-menu > summary::-webkit-details-marker {
    display: none;
}

.handoff-disclosure__summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.85rem;
    min-height: 5rem;
    padding: 1.15rem 1.25rem;
}

.handoff-disclosure__summary::after {
    content: "+";
    color: var(--handoff-muted);
    font-size: 1.2rem;
    font-weight: 900;
}

.handoff-disclosure[open] > .handoff-disclosure__summary::after {
    content: "−";
}

.handoff-members-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.85rem;
    min-height: 5rem;
    padding: 1.15rem 1.25rem;
}

.handoff-member-disclosure {
    overflow: clip;
}

.handoff-member-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 4rem;
    padding: 0.8rem 1rem;
}

.handoff-member-summary strong,
.handoff-member-summary small {
    display: block;
}

.handoff-member-summary small {
    margin-top: 0.2rem;
    color: var(--handoff-muted);
    font-size: 0.75rem;
    font-weight: 700;
}

.handoff-member-disclosure[open] .handoff-member-summary {
    border-bottom: 1px solid var(--handoff-line);
}

.handoff-session-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: hidden;
}

.handoff-session-summary p {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.9rem 1rem;
}

.handoff-session-summary p + p {
    border-left: 1px solid var(--handoff-line);
}

.handoff-session-summary span {
    color: var(--handoff-muted);
    font-size: 0.75rem;
    font-weight: 800;
}

.handoff-session-summary strong {
    font-size: 1.35rem;
    font-weight: 900;
}

.handoff-action-menu,
.handoff-export-menu {
    position: relative;
}

.handoff-action-menu__panel {
    position: absolute;
    z-index: 20;
    right: 0;
    top: calc(100% + 0.5rem);
    display: grid;
    width: 10rem;
    gap: 0.5rem;
    border: 1px solid var(--handoff-line);
    border-radius: var(--radius-card);
    background: var(--surface-panel);
    padding: 0.65rem;
    box-shadow: var(--shadow-floating);
}

.handoff-action-menu__panel form,
.handoff-action-menu__panel .ui-button {
    width: 100%;
}

.handoff-empty-state {
    border: 1px dashed var(--handoff-line);
    border-radius: var(--radius-card);
    background: var(--surface-panel-muted);
}

.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(250, 247, 253, 0.92)),
        linear-gradient(135deg, rgba(104, 68, 198, 0.12), rgba(198, 165, 107, 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-accent), var(--handoff-success));
}

.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: var(--handoff-success-soft);
    color: var(--handoff-success);
    font-size: 0.8rem;
}

.handoff-visual__dot--pending {
    background: var(--handoff-danger-soft);
    color: var(--handoff-danger);
}

.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-accent), var(--handoff-success));
}

.handoff-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(18rem, 23rem) 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(104, 68, 198, 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-hub-hero,
    .handoff-detail-hero {
        grid-template-columns: minmax(0, 1fr) minmax(18rem, 26rem);
        align-items: end;
    }

    .handoff-detail-hero {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .handoff-hub-hero__main {
        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-action-menu,
    .handoff-export-menu,
    .handoff-action-menu > summary,
    .handoff-export-menu > summary {
        width: 100%;
    }

    .handoff-action-menu__panel {
        position: static;
        width: 100%;
        margin-top: 0.5rem;
        box-shadow: none;
    }

    .handoff-session-summary p {
        flex-direction: column;
        align-items: flex-start;
    }

    .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;
    }
}
