/* Event pages
 * Split from application.css to keep page-specific styles maintainable.
 */

.participant-chip input {
    display: none;
}

.participant-chip span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    padding: 0.5rem 0.875rem;
    background: #f1f5f9;
    color: #334155;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 120ms ease;
}

.participant-chip input:checked + span {
    background: var(--blue-500);
    color: white;
}

.participant-chip span:hover {
    background: #e2e8f0;
}

.participant-chip input:checked + span:hover {
    background: var(--blue-600);
}

.expense-split-mode {
    display: inline-flex;
    gap: 4px;
    border-radius: 14px;
    background: #f1f5f9;
    padding: 4px;
}

.expense-split-mode-option input {
    display: none;
}

.expense-split-mode-option span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    border-radius: 11px;
    padding: 8px 12px;
    color: #64748b;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

.expense-split-mode-option input:checked + span {
    background: white;
    color: var(--blue-700);
    box-shadow: 0 1px 2px rgba(15,23,42,0.08);
}

.expense-share-weights {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background:
            linear-gradient(180deg, rgba(248,250,252,0.98), rgba(241,245,249,0.92));
    padding: 14px;
}

.expense-share-weight-list {
    display: grid;
    gap: 10px;
}

.expense-share-weight-row {
    display: grid;
    grid-template-columns: minmax(72px, 1fr) minmax(88px, 1.4fr) auto;
    align-items: center;
    gap: 8px;
    color: #334155;
    font-size: 14px;
    font-weight: 700;
}

.expense-share-weight-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.expense-share-weight-bar {
    display: block;
    height: 10px;
    overflow: hidden;
    border-radius: 9999px;
    background: #e2e8f0;
}

.expense-share-weight-fill {
    display: block;
    width: 0;
    height: 100%;
    min-width: 0;
    border-radius: inherit;
    background: var(--blue-400);
}

.expense-share-weight-value {
    min-width: 28px;
    color: #64748b;
    font-size: 13px;
    font-weight: 800;
    text-align: center;
}

.expense-share-weight-control {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    min-width: 0;
}

.expense-share-weight-stepper {
    display: inline-flex;
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border: 1px solid #cbd5e1;
    border-radius: 9999px;
    background: white;
    color: var(--blue-600);
    font-size: 16px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
}

.expense-share-weight-stepper:hover {
    background: var(--blue-50);
    border-color: var(--blue-300);
}

.expense-share-weight-stepper:focus-visible {
    outline: 3px solid rgba(9, 110, 250,0.18);
    outline-offset: 2px;
}

.expense-share-weight-input {
    width: 58px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: white;
    padding: 7px 8px;
    color: #0f172a;
    font-size: 14px;
    font-weight: 700;
    text-align: right;
}

.expense-share-weight-input::-webkit-outer-spin-button,
.expense-share-weight-input::-webkit-inner-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.expense-share-weight-input[type="number"] {
    -moz-appearance: textfield;
}

.expense-share-weight-total {
    margin-top: 12px;
    color: #475569;
    font-size: 13px;
    font-weight: 800;
}

@media (max-width: 420px) {
    .expense-share-weight-row {
        grid-template-columns: minmax(58px, 0.8fr) minmax(58px, 1fr) auto;
        gap: 6px;
        font-size: 13px;
    }

    .expense-share-weight-control {
        gap: 4px;
    }

    .expense-share-weight-stepper {
        width: 26px;
        height: 26px;
        font-size: 15px;
    }

    .expense-share-weight-value {
        min-width: 22px;
        font-size: 12px;
    }

    .expense-share-weight-input {
        width: 52px;
        padding-inline: 6px;
    }
}

.receipt-payer-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.receipt-payer-chip span {
    display: flex;
    min-height: 2.75rem;
    align-items: center;
    justify-content: center;
    border: 1px solid #cbd5e1;
    border-radius: 0.875rem;
    padding: 0.625rem 0.875rem;
    background: #f8fafc;
    color: #334155;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 120ms ease;
}

.receipt-payer-chip input:checked + span {
    border-color: var(--blue-600);
    background: var(--blue-600);
    color: #ffffff;
}

.receipt-payer-chip input:focus-visible + span {
    outline: 2px solid var(--blue-500);
    outline-offset: 2px;
}

.receipt-item-title {
    display: -webkit-box;
    min-width: 0;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    color: #0f172a;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25rem;
}

.receipt-scans-section {
    margin-top: 32px;
}

.receipt-scan-add-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 14px;
    background: var(--blue-100);
    padding: 10px 14px;
    color: var(--blue-700);
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    transition: background 160ms ease;
}

.receipt-scan-add-link:hover {
    background: var(--blue-200);
}

.receipt-scan-disabled-note {
    margin: -4px 0 14px;
    color: #94a3b8;
    font-size: 14px;
}

.receipt-scan-list {
    display: grid;
    gap: 12px;
}

.receipt-scan-card {
    position: relative;
    display: flex;
    gap: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    background: #ffffff;
    padding: 12px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03), 0 8px 20px rgba(15, 23, 42, 0.04);
}

.receipt-scan-thumb-link {
    display: block;
    width: 86px;
    height: 86px;
    flex: 0 0 86px;
    border-radius: 16px;
    outline: none;
}

.receipt-scan-thumb-link:focus-visible {
    box-shadow: 0 0 0 3px rgba(9, 110, 250, 0.28);
}

.receipt-scan-thumb {
    width: 86px;
    height: 86px;
    flex: 0 0 86px;
    border-radius: 16px;
    object-fit: cover;
    background: #f8fafc;
}

.receipt-scan-thumb-placeholder,
.receipt-scan-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed #cbd5e1;
    color: #94a3b8;
    text-align: center;
}

.receipt-scan-thumb-placeholder {
    padding: 10px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
}

.receipt-scan-card-body {
    min-width: 0;
    flex: 1;
}

.receipt-scan-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.receipt-scan-uploaded-at {
    color: #64748b;
    font-size: 13px;
    line-height: 1.35;
}

.receipt-scan-status {
    margin-top: 4px;
    color: #0f172a;
    font-size: 16px;
    font-weight: 800;
}

.receipt-scan-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    margin-top: 8px;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
}

.receipt-scan-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin-top: 10px;
}

.receipt-scan-delete-form {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1;
}

.receipt-scan-delete-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    padding: 0;
    color: #64748b;
    font: inherit;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.receipt-scan-delete-button:hover {
    border-color: #fecaca;
    background: #fef2f2;
    color: #dc2626;
}

.receipt-scan-image-actions .receipt-scan-delete-button {
    width: auto;
    height: auto;
    padding: 8px 12px;
    font-size: 14px;
}

.receipt-scan-empty {
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    background: #ffffff;
    padding: 20px;
    text-align: center;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.receipt-scan-empty-title {
    color: #334155;
    font-weight: 800;
}

.receipt-scan-empty-text {
    margin-top: 6px;
    color: #94a3b8;
    font-size: 14px;
    line-height: 1.45;
}

.receipt-scan-image-card {
    margin-bottom: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    background: #ffffff;
    padding: 10px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03), 0 8px 20px rgba(15, 23, 42, 0.04);
}

.receipt-scan-image {
    display: block;
    width: 100%;
    max-height: 620px;
    border-radius: 18px;
    object-fit: contain;
    background: #f8fafc;
}

.receipt-scan-image-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.receipt-scan-image-placeholder {
    min-height: 180px;
    border-radius: 18px;
    padding: 24px;
    background: #f8fafc;
    font-weight: 700;
    line-height: 1.45;
}

.event-photos-entry-link,
.event-photos-entry-upsell {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 16px;
    border-radius: 18px;
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 800;
}

.event-photos-entry-link {
    border: 1px solid var(--blue-200);
    background: var(--blue-50);
    color: var(--blue-700);
    text-decoration: none;
    transition: background 160ms ease, border-color 160ms ease;
}

.event-photos-entry-link:hover {
    border-color: var(--blue-300);
    background: var(--blue-100);
}

.event-photos-entry-upsell {
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #94a3b8;
}

.event-photos-header {
    margin-bottom: 18px;
}

.back-link {
    display: inline-flex;
    margin: 0 0 18px;
    color: #64748b;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    transition: color 160ms ease;
}

.back-link:hover {
    color: var(--blue-700);
}

.event-photos-title {
    color: #0f172a;
    font-size: 30px;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.event-photos-subtitle {
    margin-top: 6px;
    color: #64748b;
    font-size: 14px;
    line-height: 1.45;
}

.event-photo-upload-card,
.event-photo-empty {
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    background: #ffffff;
    padding: 16px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.event-photo-upload-card {
    margin-bottom: 18px;
}

.event-photo-upload-form {
    display: grid;
    gap: 12px;
}

.event-photo-upload-label {
    display: block;
    margin-bottom: 8px;
    color: #334155;
    font-size: 14px;
    font-weight: 800;
}

.event-photo-upload-input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    clip-path: inset(50%);
}

.event-photo-file-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: var(--blue-50);
    padding: 12px 14px;
    color: var(--blue-700);
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: background 160ms ease;
}

.event-photo-file-button:hover {
    background: var(--blue-100);
}

.event-photo-upload-selected {
    overflow-wrap: anywhere;
    margin-top: 8px;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}

.event-photo-upload-button {
    border: 0;
    border-radius: 14px;
    background: var(--blue-600);
    padding: 12px 16px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

.event-photo-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.event-photo-card {
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.event-photo-link {
    display: block;
    aspect-ratio: 1;
    background: #f8fafc;
}

.event-photo-missing {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    background: #f8fafc;
    color: #94a3b8;
    padding: 16px;
    text-align: center;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.35;
}

.event-photo-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.event-photo-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.event-photo-delete-button {
    border: 0;
    background: transparent;
    padding: 0;
    color: #dc2626;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.event-photo-empty {
    color: #64748b;
    text-align: center;
}

.event-photo-empty-title {
    color: #334155;
    font-weight: 900;
}

.event-photo-empty-text {
    margin-top: 6px;
    font-size: 14px;
}

@media (max-width: 480px) {
    .receipt-scan-card {
        align-items: stretch;
    }

    .receipt-scan-thumb {
        width: 74px;
        height: 74px;
        flex-basis: 74px;
    }

    .receipt-scan-thumb-link {
        width: 74px;
        height: 74px;
        flex-basis: 74px;
    }
}

.expense-enter {
    animation: expense-enter 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes expense-enter {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.expense-highlight {
    animation: expense-highlight 1200ms ease;
}

@keyframes expense-highlight {
    0% {
        background-color: var(--blue-100);
        box-shadow: 0 0 0 2px var(--blue-300);
    }

    100% {
        background-color: transparent;
        box-shadow: none;
    }
}

.expense-remove {
    animation: expense-remove 160ms ease-in forwards;
}

@keyframes expense-remove {
    to {
        opacity: 0;
        transform: scale(0.98);
    }
}

.fab-button {
    position: fixed;
    right: max(
            22px,
            calc((100vw - 720px) / 2 + 22px)
    );
    bottom: 28px;
    z-index: 40;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 64px;
    height: 64px;
    min-width: 56px;
    min-height: 56px;

    border-radius: 9999px;
    background: var(--blue-500);
    color: white;

    font-size: 40px;
    line-height: 1;
    text-decoration: none;

    box-shadow: 0 14px 32px rgba(31, 132, 252, 0.35);
    transition: transform 160ms ease, background 160ms ease;
}

.fab-button:active {
    transform: scale(0.95);
}

.fab-button:hover {
    background: var(--blue-600);
}

.expense-card:hover {
    transform: translateY(-1px);

    box-shadow:
            0 2px 4px rgba(0,0,0,0.05),
            0 12px 28px rgba(0,0,0,0.06);
}

.expense-card-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.expense-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.expense-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 16px;
    background: #f8fafc;
    font-size: 22px;
}

.expense-info {
    min-width: 0;
}

.expense-meta-secondary {
    margin-top: 3px;
    font-size: 12px;
    color: #cbd5e1;
}

.expense-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.expense-chevron {
    color: #cbd5e1;
    font-size: 22px;
    line-height: 1;
}


.status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
}

.status-confirmed {
    background: #dcfce7;
    color: #15803d;
}

.status-pending {
    background: #fef3c7;
    color: #b45309;
}

.avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;

    border-radius: 9999px;
    overflow: hidden;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 12px;
    font-weight: 700;
}



.empty-balance {
    background: #f8fafc;
    border-radius: 22px;
    padding: 32px 20px;
    text-align: center;
}

.empty-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 12px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: white;
    border-radius: 18px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);

    font-size: 24px;
}

.empty-title {
    font-weight: 700;
    color: #334155;
}

.empty-text {
    margin-top: 4px;
    font-size: 14px;
    color: #94a3b8;
}

.avatar-blue {
    background: var(--blue-100);
    color: var(--blue-700);
}

.avatar-green {
    background: #dcfce7;
    color: #15803d;
}

.avatar-amber {
    background: #fef3c7;
    color: #b45309;
}

.avatar-purple {
    background: #f3e8ff;
    color: #7e22ce;
}

.avatar-pink {
    background: #fce7f3;
    color: #be185d;
}

.avatar-cyan {
    background: #cffafe;
    color: #0e7490;
}
.event-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    min-width: 0;
}

.event-header > div:first-child {
    min-width: 0;
}

.event-title {
    margin: 0;
    font-size: 34px;
    line-height: 1.05;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: #0f172a;
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: none;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.event-subtitle {
    margin: 6px 0 0;
    font-size: 16px;
    color: #94a3b8;
    white-space: nowrap;
}

.settings-button {
    width: 42px;
    height: 42px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    font-size: 20px;
    text-decoration: none;
    transition:
            background 160ms ease,
            transform 120ms ease;
}

.settings-button:hover {
    background: #f1f5f9;
}

.settings-button:active {
    transform: scale(0.94);
}

.event-status-row {
    margin-bottom: 16px;
}

.event-status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 700;
}

.event-status-confirmed {
    background: #dcfce7;
    color: #15803d;
}

.event-status-pending {
    background: #fef3c7;
    color: #b45309;
}

.event-status-draft {
    background: #f1f5f9;
    color: #64748b;
}

.state-banner {
    display: flex;
    gap: 14px;
    align-items: flex-start;

    border-radius: 24px;
    padding: 18px;
    margin-bottom: 22px;
}

.state-banner-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
}

.state-banner-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.state-banner-icon {
    font-size: 24px;
    line-height: 1;
}

.state-banner-title {
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
}

.state-banner-text {
    margin-top: 4px;
    font-size: 14px;
    color: #64748b;
}

.state-banner-time {
    color: #94a3b8;
    font-size: 13px;
}

.event-progress-card {
    margin: 0 0 14px;
    border: 1px solid rgba(226,232,240,0.9);
    border-radius: 18px;
    background: rgba(255,255,255,0.96);
    padding: 12px 14px;
    box-shadow:
            0 1px 2px rgba(15,23,42,0.03),
            0 8px 20px rgba(15,23,42,0.04);
}

.event-progress-title {
    margin: 0 0 8px;
    color: #0f172a;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0;
}

.event-progress-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.event-progress-item {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
}

.event-progress-item-done {
    color: #166534;
}

.event-progress-item-current {
    color: #0f172a;
    font-weight: 800;
}

.event-progress-summary {
    margin: 0;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
}

.event-progress-marker {
    flex: 0 0 auto;
    line-height: 1;
}

.confirm-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;

    padding: 14px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    border-top: 1px solid #e2e8f0;

    z-index: 30;
}

body:has(#confirm_bar .confirm-bar) .fab-button {
    bottom: 82px;
}

.confirm-bar-inner {
    max-width: 480px;
    margin: 0 auto;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.confirm-title {
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
}

.confirm-text {
    margin-top: 2px;
    font-size: 12px;
    color: #94a3b8;
}

.confirm-button {
    border: 0;
    border-radius: 16px;
    background: var(--blue-500);
    color: white;

    padding: 13px 22px;
    font-size: 15px;
    font-weight: 800;

    cursor: pointer;
    box-shadow: 0 8px 20px rgba(31, 132, 252, 0.25);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 32px;
    margin-bottom: 14px;
}

.section-title {
    margin: 0;

    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.03em;

    color: #0f172a;
}

.section-subtitle {
    margin-top: 4px;

    font-size: 14px;
    color: #94a3b8;
}

#expenses {
    margin-top: 28px;
    padding-bottom: 96px;
}

.expenses-empty-state {
    display: grid;
    gap: 16px;
    border: 1px solid rgba(226,232,240,0.9);
    border-radius: 24px;
    background:
            linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.96));
    padding: 24px;
    text-align: center;
    box-shadow:
            0 1px 2px rgba(15,23,42,0.03),
            0 14px 30px rgba(15,23,42,0.05);
}

.expenses-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin: 0 auto;
    border-radius: 22px;
    background: var(--blue-50);
    font-size: 32px;
}

.expenses-empty-title {
    margin: 0;
    color: #0f172a;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0;
}

.expenses-empty-text {
    margin: 8px 0 0;
    color: #64748b;
    font-size: 15px;
    line-height: 1.55;
}

.expenses-empty-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.expenses-empty-primary-action,
.expenses-empty-secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border-radius: 16px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    transition:
            background 160ms ease,
            color 160ms ease,
            transform 160ms ease;
}

.expenses-empty-primary-action {
    background: var(--blue-500);
    color: white;
}

.expenses-empty-primary-action:hover {
    background: var(--blue-600);
}

.expenses-empty-secondary-action {
    background: var(--blue-100);
    color: var(--blue-700);
}

.expenses-empty-secondary-action:hover {
    background: var(--blue-200);
}

.expenses-empty-primary-action:active,
.expenses-empty-secondary-action:active {
    transform: scale(0.98);
}

.settlements-empty-state {
    margin-bottom: 28px;
}

.settlements-change-description {
    font-weight: 700;
    color: #475569;
}

.settlements-change-time {
    margin: 4px 0 0;
    color: #94a3b8;
    font-size: 13px;
    line-height: 1.4;
}

.participants-card {
    margin: 0 0 22px;
    border: 1px solid rgba(226,232,240,0.92);
    border-radius: 20px;
    background:
            linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.96));
    padding: 16px;
    box-shadow:
            0 1px 2px rgba(15,23,42,0.03),
            0 10px 24px rgba(15,23,42,0.04);
}

.participants-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.participants-card-title {
    margin: 0;
    color: #0f172a;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0;
}

.participants-empty-state {
    margin-bottom: 12px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    padding: 14px;
}

.participants-empty-title {
    margin: 0;
    color: #334155;
    font-size: 14px;
    font-weight: 800;
}

.participants-empty-text {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.4;
}

.participants-avatar-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    margin-bottom: 14px;
    max-width: 100%;
    /* Visible: the name tips stick out below the avatars (at most 6 avatars and "+N" fit). */
    overflow: visible;
    padding: 4px 4px 8px;
}

.participant-tip-anchor {
    position: relative;
}

.participant-tip-anchor:hover,
.participant-tip-anchor:focus-within,
.participant-tip-anchor.is-tipped {
    z-index: 5;
}

.participant-avatar-link {
    overflow: hidden;
}

/* Name under the avatar: on hover/focus with a mouse, on the first tap on touch screens. */
.participant-tip {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    z-index: 20;

    max-width: 180px;
    padding: 5px 9px;
    border-radius: 8px;

    background: #0f172a;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -2px);
    transition: opacity 0.12s ease, transform 0.12s ease;
}

.participant-tip::before {
    content: "";
    position: absolute;
    top: -4px;
    left: 50%;
    width: 8px;
    height: 8px;
    background: #0f172a;
    transform: translateX(-50%) rotate(45deg);
}

@media (hover: hover) {
    .participant-tip-anchor:hover .participant-tip {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.participant-tip-anchor:focus-within .participant-tip,
.participant-tip-anchor.is-tipped .participant-tip {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* The first and last avatars keep their tip inside the card. */
.participant-tip-anchor:first-child .participant-tip {
    left: 0;
    transform: translate(0, 0);
}

.participant-tip-anchor:first-child .participant-tip::before {
    left: 18px;
}

.avatar-picture {
    width: 100%;
    height: 100%;
    border-radius: 9999px;
    object-fit: cover;
}

.participants-avatar-row > * {
    flex: 0 0 auto;
}

.participants-avatar-row > * + * {
    margin-left: -8px;
}

.participants-avatar-row > *:last-child {
    margin-right: 12px;
}

.participants-avatar-row .participants-overflow-link {
    margin-left: 4px;
}

.confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;

    display: flex;
    align-items: flex-end;
    justify-content: center;

    background: rgba(15, 23, 42, 0.35);
}

.confirm-sheet {
    width: 100%;
    max-width: 480px;

    background: white;
    border-radius: 28px 28px 0 0;
    padding: 18px 20px 22px;

    box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.18);
}

.confirm-handle {
    width: 44px;
    height: 5px;

    margin: 0 auto 20px;

    border-radius: 9999px;
    background: #cbd5e1;
}

.confirm-title {
    margin: 0;

    font-size: 22px;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.03em;

    color: #0f172a;
}

.confirm-message {
    margin: 10px 0 22px;

    font-size: 15px;
    line-height: 1.4;

    color: #64748b;
}

.confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.confirm-cancel,
.confirm-delete {
    border: 0;
    border-radius: 18px;

    padding: 15px 16px;

    font-size: 15px;
    font-weight: 800;

    cursor: pointer;
}

.confirm-cancel {
    background: #f1f5f9;
    color: #334155;
}

.confirm-delete {
    background: #ef4444;
    color: white;
    box-shadow: 0 10px 22px rgba(239, 68, 68, 0.22);
}

.confirm-cancel:active,
.confirm-delete:active {
    transform: scale(0.98);
}

.event-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.claim-event-form {
    margin: 0;
}

.claim-event-button {
    height: 42px;
    border: 0;
    border-radius: 9999px;
    padding: 0 16px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    background: var(--blue-50);
    color: var(--blue-600);

    font-size: 14px;
    font-weight: 800;

    cursor: pointer;

    transition:
            background 160ms ease,
            transform 120ms ease;
}

.claim-event-button:hover {
    background: var(--blue-100);
}

.claim-event-button:active {
    transform: scale(0.96);
}

.account-prompt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    margin-bottom: 20px;
    padding: 16px;

    border: 1px solid var(--blue-200);
    border-radius: 20px;

    background: var(--blue-50);
}

.account-prompt-title {
    margin-bottom: 4px;
    color: #0f172a;
    font-size: 15px;
    font-weight: 800;
}

.account-prompt-text {
    color: #64748b;
    font-size: 13px;
    line-height: 1.35;
}

.account-prompt-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.account-prompt-link,
.account-prompt-button {
    min-height: 38px;
    border-radius: 9999px;
    padding: 0 14px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.account-prompt-link {
    color: var(--blue-600);
}

.account-prompt-button {
    background: var(--blue-600);
    color: white;
}

@media (max-width: 520px) {
    .account-prompt {
        align-items: stretch;
        flex-direction: column;
    }

    .account-prompt-actions {
        justify-content: flex-start;
    }
}

.share-icon-button {
    width: 42px;
    height: 42px;

    border: 0;
    border-radius: 9999px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--blue-50);
    color: var(--blue-600);

    font-size: 20px;
    font-weight: 700;

    cursor: pointer;

    transition:
            background 160ms ease,
            transform 120ms ease;
}

.share-icon-button:hover {
    background: var(--blue-100);
}

.share-icon-button:active {
    transform: scale(0.94);
}

.fab-button-disabled {
    background: #cbd5e1;
    box-shadow: none;
    cursor: not-allowed;
}

.locked-state-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;

    margin-bottom: 24px;
    padding: 18px;

    border-radius: 24px;

    background: #fff7ed;
    border: 1px solid #fed7aa;
}

.locked-state-icon {
    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 14px;

    background: white;

    font-size: 20px;

    flex-shrink: 0;
}

.locked-state-title {
    font-size: 15px;
    font-weight: 800;
    color: #9a3412;
}

.locked-state-text {
    margin-top: 4px;

    font-size: 14px;
    line-height: 1.4;

    color: #c2410c;
}

.settlements-list {
    display: flex;
    flex-direction: column;
    gap: 12px;

    margin-bottom: 28px;
}

.settlement-card {
    background: white;
    border-radius: 24px;
    padding: 16px;
    border: 1px solid rgba(226,232,240,0.7);
    box-shadow:
            0 1px 2px rgba(15,23,42,0.03),
            0 10px 24px rgba(15,23,42,0.05);
    max-width: 100%;
    overflow: hidden;
}

.settlement-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-width: 0;
}

.settlement-people {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1 1 auto;
    min-width: 0;
}

.settlement-flow {
    flex: 1 1 auto;
    min-width: 0;
}

.settlement-names {
    display: flex;
    align-items: center;
    gap: 8px;

    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    max-width: 100%;
}

.settlement-arrow {
    flex: 0 0 auto;
    color: var(--blue-500);
}

.settlement-names span:not(.settlement-arrow) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settlement-caption {
    margin-top: 3px;

    font-size: 12px;
    color: #94a3b8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settlement-amount {
    flex-shrink: 0;
    max-width: 100%;
    white-space: nowrap;

    font-size: 20px;
    font-weight: 800;
    color: var(--blue-600);
}

.settlement-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
}

.settlement-pay-button {
    width: 100%;

    border: 0;
    border-radius: 16px;

    background: var(--blue-500);
    color: white;

    padding: 13px 16px;

    font-size: 14px;
    font-weight: 800;

    cursor: pointer;
}

.settlement-paid {
    width: 100%;

    border-radius: 16px;

    background: #dcfce7;
    color: #15803d;

    padding: 13px 16px;

    text-align: center;

    font-size: 14px;
    font-weight: 800;
}

.settlement-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.why-actions {
    margin-top: 28px;
    margin-bottom: 40px;
}

.expense-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.expense-receipt-link {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-top: 12px;
    border-radius: 999px;
    background: #f8fafc;
    padding: 6px 10px;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
    transition: background 160ms ease, color 160ms ease;
}

.expense-receipt-link:hover {
    background: var(--blue-100);
    color: var(--blue-700);
}

.expense-card {
    background: white;
    border-radius: 24px;
    padding: 16px;
    border: 1px solid rgba(226,232,240,0.8);
    box-shadow:
            0 1px 2px rgba(15,23,42,0.03),
            0 10px 24px rgba(15,23,42,0.05);
    transition:
            transform 160ms ease,
            box-shadow 160ms ease;
}

.expense-card:hover {
    transform: translateY(-1px);
}

.expense-main {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.expense-content {
    flex: 1;
    min-width: 0;
}

.expense-top {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.expense-top-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.expense-meta {
    margin-top: 3px;
    font-size: 13px;
    color: #94a3b8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.expense-amount {
    font-size: 20px;
    line-height: 1.1;
    font-weight: 900;
    letter-spacing: -0.03em;
    color: #0f172a;
}

.expense-bottom {
    margin-top: 18px;

    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.expense-bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 14px;

    margin-top: 14px;
}

.expense-participants {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.expense-paid-by {
    margin-top: 4px;
    font-size: 14px;
    line-height: 1.25;
    color: #94a3b8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.expense-meta-row {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.avatar-small {
    width: 28px;
    height: 28px;
    font-size: 10px;
    border: 2px solid white;
}

.expense-participants > * + * {
    margin-left: -6px;
}

.expense-hidden-count {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: #e2e8f0;
    color: #475569;
    font-size: 10px;
    font-weight: 800;
    border: 2px solid white;
    margin-left: -6px;
}

.expense-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.expense-split {
    font-size: 12px;
    font-weight: 600;

    color: #64748b;
}

.expense-shared {
    min-width: 0;
    font-size: 13px;
    line-height: 1.25;
    font-weight: 650;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.expense-presets {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 0 4px;
    margin-top: -2px;
    margin-bottom: 4px;
}

.expense-preset {
    flex: 0 0 auto;

    display: inline-flex;
    align-items: center;
    gap: 6px;

    border: 0;
    border-radius: 9999px;

    padding: 9px 12px;

    background: #f1f5f9;
    color: #334155;

    font-size: 14px;
    font-weight: 700;

    cursor: pointer;
}

.expense-preset:active {
    transform: scale(0.96);
}

.expense-preset:hover {
    background: #e2e8f0;
}

.settlement-card-active {
    border-color: var(--blue-300);
    box-shadow:
            0 0 0 3px rgba(31, 132, 252,0.12),
            0 10px 24px rgba(15,23,42,0.05);
}
.settlement-unpay-button {
    width: 100%;

    border: 1px solid #e2e8f0;
    border-radius: 16px;

    background: white;
    color: #64748b;

    padding: 12px 16px;

    font-size: 14px;
    font-weight: 700;

    cursor: pointer;

    transition:
            background 160ms ease,
            border-color 160ms ease,
            color 160ms ease;
}

.settlement-unpay-button:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.settlement-unpay-button:active {
    transform: scale(0.98);
}

.settlement-card {
    max-width: 100%;
    overflow: hidden;
}

.settlement-main,
.expense-top-row {
    min-width: 0;
}

.settlement-names {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.expense-title {
    font-size: 17px;
    line-height: 1.2;
    font-weight: 800;
    color: #0f172a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.participant-form {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.participant-name-input {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    background: white;
    padding: 10px 12px;
    color: #0f172a;
    font-size: 14px;
    font-weight: 600;
    outline: none;
}

.participant-name-input::placeholder {
    color: #94a3b8;
    font-weight: 500;
}

.participant-name-input:focus {
    border-color: var(--blue-300);
    box-shadow: 0 0 0 3px rgba(147,197,253,0.24);
}

.participant-submit {
    flex: 0 0 auto;
    border: 1px solid var(--blue-200);
    border-radius: 14px;
    background: var(--blue-100);
    padding: 10px 14px;
    color: var(--blue-700);
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

.participant-submit:hover {
    background: var(--blue-200);
}

@media (max-width: 420px) {
    .participant-form {
        align-items: stretch;
        flex-direction: column;
    }

    .participant-submit {
        align-self: flex-start;
    }
}

.toast {
    position: fixed;
    top: 16px;
    left: 50%;
    z-index: 1000;

    transform: translateX(-50%);

    border-radius: 9999px;
    background: #0f172a;
    color: white;

    padding: 10px 16px;

    font-size: 14px;
    font-weight: 700;

    box-shadow: 0 12px 30px rgba(15,23,42,0.18);

    transition:
            opacity 300ms ease,
            transform 300ms ease;
}

.toast-hide {
    opacity: 0;
    transform: translateX(-50%) translateY(-8px);
}

.participant-danger-zone {
    margin-top: 28px;
    padding-top: 20px;

    border-top: 1px solid #e2e8f0;
}

.participant-delete-button {
    width: 100%;

    border: none;
    border-radius: 18px;

    background: #fee2e2;
    color: #dc2626;

    padding: 14px 18px;

    font-size: 15px;
    font-weight: 800;

    cursor: pointer;

    transition:
            background 160ms ease,
            transform 160ms ease;
}

.participant-delete-button:hover {
    background: #fecaca;
}

.participant-delete-button:active {
    transform: scale(0.98);
}

.expense-submit-button {
    width: 100%;
    border: 0;
    border-radius: 12px;
    background: var(--blue-500);
    color: white;
    padding: 12px 16px;
    font-weight: 700;
    cursor: pointer;
}

.expense-submit-button:disabled {
    background: #cbd5e1;
    color: #64748b;
    cursor: not-allowed;
    box-shadow: none;
}

@media (max-width: 560px) {
    .event-header {
        flex-direction: column;
        gap: 10px;
    }

    .event-title {
        font-size: 28px;
        line-height: 1.08;
        letter-spacing: -0.03em;
    }

    .event-header-actions {
        width: 100%;
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .claim-event-button {
        height: 36px;
        padding: 0 12px;
        font-size: 13px;
    }

    .settings-button,
    .share-icon-button {
        width: 36px;
        height: 36px;
        font-size: 17px;
    }

    .settlement-main {
        align-items: flex-start;
        flex-direction: row;
        gap: 12px;
    }

    .settlement-people {
        align-items: flex-start;
        flex-direction: column;
        gap: 0;
        flex: 1 1 auto;
        width: auto;
    }

    .settlement-people .avatar {
        display: none;
    }

    .settlement-flow {
        width: 100%;
    }

    .settlement-names {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
        line-height: 1.18;
    }

    .settlement-names span:not(.settlement-arrow) {
        display: -webkit-box;
        overflow: hidden;
        text-overflow: clip;
        white-space: normal;
        word-break: normal;
        overflow-wrap: break-word;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .settlement-arrow {
        font-size: 0;
        line-height: 1;
    }

    .settlement-arrow::after {
        content: "↓";
        font-size: 16px;
        font-weight: 800;
    }

    .settlement-caption {
        display: none;
    }

    .settlement-caption-paid {
        display: block;
        margin-top: 5px;
        color: #15803d;
        font-size: 12px;
        font-weight: 800;
        line-height: 1.25;
        white-space: normal;
    }

    .settlement-amount {
        flex: 0 0 auto;
        width: auto;
        font-size: 20px;
        line-height: 1.1;
        text-align: right;
    }

    .settlement-card {
        border-left: 3px solid var(--blue-100);
        padding: 14px 16px;
    }

    .settlement-card-paid {
        border-left-color: #bbf7d0;
    }
}

.expenses-total {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 16px;
    padding: 16px;
    border-top: 1px solid #e2e8f0;
    color: #334155;
    font-weight: 600;
}

/* Sharing uses native details so the QR remains available without JavaScript. */
.event-qr { margin: 0 0 20px; }
.event-qr summary {
    width: fit-content;
    padding: 10px 14px;
    border-radius: 14px;
    background: var(--blue-50);
    color: var(--blue-600);
    font-weight: 600;
    cursor: pointer;
}
.event-qr summary:focus-visible { outline: 2px solid var(--blue-600); outline-offset: 3px; }
.event-qr-card {
    margin-top: 12px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: #fff;
    text-align: center;
    color: #475569;
}
.event-qr-card h2, .event-qr-title { color: #0f172a; font-weight: 700; overflow-wrap: anywhere; }
.event-qr-card p { margin: 10px 0; }
.event-qr-image { width: min(100%, 288px); margin: 16px auto; }
.event-qr-image svg { display: block; width: 100%; height: auto; }
.event-qr-link { display: block; margin-top: 12px; color: var(--blue-600); overflow-wrap: anywhere; }

.event-share-button {
    margin-top: 8px;
    min-height: 44px;
    padding: 10px 20px;
    border-radius: 14px;
    background: var(--blue-600);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}
.event-share-button:focus-visible { outline: 2px solid var(--blue-600); outline-offset: 3px; }
.event-share-button:disabled { opacity: 0.6; cursor: wait; }

.create-own-event {
    margin: 20px 0;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
    color: #475569;
    font-size: 14px;
}
.create-own-event-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin: 8px 0;
    padding: 8px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    color: #334155;
    font-weight: 600;
}
.create-own-event-link:hover { background: #f1f5f9; }
.create-own-event-link:focus-visible { outline: 2px solid var(--blue-600); outline-offset: 3px; }
.create-own-event-hint { font-size: 12px; }

/* The calculation reference stays accessible with keyboard and without JavaScript. */
.balance-explanation { overflow-wrap: anywhere; }
.balance-explanation summary:focus-visible { outline: 2px solid var(--blue-600); outline-offset: 4px; border-radius: 4px; }
.balance-explanation-content > .section-header { margin-top: 1.5rem; }

/* Shared event calculation and transfer rows. */
.calculation-card { background: white; border: 1px solid #e2e8f0; border-radius: 1rem; padding: 1rem; margin: 1rem 0; overflow-wrap: anywhere; }
.calculation-transfer-group { margin: 1rem 0; }
.calculation-transfer-group h3 { font-weight: 600; margin-bottom: .75rem; }
.calculation-transfer-group summary { cursor: pointer; min-height: 44px; padding: .75rem 0; }
.settlement-detail-link { color: var(--blue-600); font-size: .875rem; }
.calculation-transfer .settlement-names { flex-direction: row; align-items: baseline; flex-wrap: wrap; gap: .4rem; white-space: normal; }
.calculation-transfer .settlement-arrow { font-size: 16px; }
.calculation-transfer .settlement-arrow::after { content: none; }
.calculation-transfer .settlement-names span:not(.settlement-arrow) { display: inline; white-space: normal; overflow: visible; overflow-wrap: anywhere; }
.calculation-transfer .settlement-caption { white-space: normal; }
.calculation-transfer .settlement-actions { display: flex; flex-direction: row; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.calculation-transfer .settlement-actions form { margin-left: auto; }
.calculation-transfer .settlement-paid { width: auto; }
@media (max-width: 639px) {
  .calculation-transfer .settlement-main { flex-wrap: wrap; }
  .calculation-transfer .settlement-flow { flex-basis: 100%; }
  .calculation-transfer .settlement-amount { margin-left: auto; }
}

/* "Это я" */
.me-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    padding: 16px;
    border: 1px solid var(--blue-200);
    border-radius: 20px;
    background: var(--blue-50);
}

.me-card-choose {
    flex-direction: column;
    align-items: stretch;
    border-color: #e2e8f0;
    background: white;
}

.me-card-title {
    color: #0f172a;
    font-size: 15px;
    font-weight: 800;
}

.me-card-balance {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 4px;
    color: #334155;
    font-size: 14px;
}

.me-card-balance strong {
    color: #0f172a;
    font-size: 22px;
}

.me-card-note {
    margin-top: 4px;
    color: #64748b;
    font-size: 12px;
}

.me-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.me-card-reset {
    background: transparent;
    border: 0;
    cursor: pointer;
}

.me-card-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.me-choice {
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid #cbd5e1;
    border-radius: 9999px;
    background: white;
    color: #0f172a;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.me-choice:hover,
.me-choice:focus-visible {
    border-color: var(--blue-600);
    color: var(--blue-600);
}

.participant-avatar-me {
    box-shadow: 0 0 0 3px var(--blue-600);
}

.settlement-card-mine {
    border-color: var(--blue-300);
    background: #f8fbff;
}

.me-badge {
    display: inline-flex;
    margin-left: 8px;
    padding: 2px 10px;
    border-radius: 9999px;
    background: var(--blue-100);
    color: var(--blue-700);
    font-size: 13px;
    font-weight: 700;
    vertical-align: middle;
}

.dashboard-event-me {
    color: var(--blue-700);
    font-weight: 600;
}

@media (max-width: 520px) {
    .me-card {
        align-items: stretch;
        flex-direction: column;
    }
}

/* Реквизиты СБП */
.me-payment {
    margin: -8px 0 20px;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: white;
}

.me-payment-title,
.payment-details-title {
    color: #0f172a;
    font-size: 14px;
    font-weight: 700;
}

.me-payment-current {
    margin-top: 4px;
    color: #0f172a;
    font-size: 15px;
    font-weight: 600;
}

.me-payment .account-prompt-text {
    margin: 6px 0 10px;
}

.me-payment-edit summary {
    margin-top: 8px;
    color: var(--blue-600);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.me-payment-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.me-payment-form .participant-name-input {
    flex: 1 1 180px;
    min-width: 0;
}

.payment-details {
    margin-top: 12px;
    padding: 12px;
    border-radius: 16px;
    background: #f8fafc;
}

.payment-details-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    margin-top: 4px;
    color: #0f172a;
    font-size: 15px;
}

.payment-details-phone {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.payment-details-bank {
    color: #475569;
}

.payment-details-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.payment-copy-button {
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid #cbd5e1;
    border-radius: 9999px;
    background: white;
    color: #0f172a;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.payment-copy-button:hover,
.payment-copy-button:focus-visible {
    border-color: var(--blue-600);
    color: var(--blue-600);
}

.payment-details-hint {
    margin-top: 8px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.4;
}

/* Сообщение для мессенджеров */
.event-share-preview-label {
    margin-top: 12px;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
}

.event-share-preview {
    margin-top: 4px;
    padding: 12px;
    border-radius: 14px;
    background: #f1f5f9;
    color: #0f172a;
    font-size: 14px;
    line-height: 1.45;
    text-align: left;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.event-share-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

.event-share-copy-text {
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid #cbd5e1;
    border-radius: 9999px;
    background: white;
    color: #0f172a;
    font-weight: 600;
    cursor: pointer;
}

.event-share-actions .event-share-button {
    margin-top: 0;
}

.event-share-copy-text {
    border-radius: 14px;
}

/* Новое мероприятие с теми же участниками */
.event-copy-entry {
    margin-top: 12px;
    color: #64748b;
    font-size: 13px;
    line-height: 1.4;
}

.event-copy-entry a {
    color: var(--blue-600);
    font-weight: 600;
}

.event-copy-participants {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.event-copy-participant {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: white;
    color: #0f172a;
    cursor: pointer;
}

.event-copy-participant input {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--blue-600);
}

/* Траты по дням */
.expense-day {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.expense-day + .expense-day {
    margin-top: 8px;
}

.expense-day-heading {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 4px 0;
    color: #475569;
    font-size: 13px;
    font-weight: 700;
    text-transform: none;
}

.expense-day-heading span:first-child::first-letter {
    text-transform: uppercase;
}

.expense-day-total {
    color: #64748b;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Общий фонд в карточке «Это я» */
.me-card-fund {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
    gap: 8px 16px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--blue-100);
}

.me-card-fund dt {
    color: #64748b;
    font-size: 12px;
}

.me-card-fund dd {
    color: #0f172a;
    font-size: 15px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* Итоги в картинке */
.recap-share { display: grid; grid-template-columns: 72px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 14px; row-gap: 10px; align-items: center; margin: .75rem 0 1rem; padding: 14px; border: 1px solid #e0e7ff; border-radius: 16px; background: linear-gradient(135deg, var(--blue-50), #f5f3ff); }
.recap-share[hidden] { display: none; }
.recap-share-preview { grid-row: 1 / 3; width: 72px; height: 90px; border-radius: 10px; background: var(--brand-gradient); object-fit: cover; box-shadow: 0 4px 12px rgba(76, 29, 149, .18); }
.recap-share-body { align-self: end; min-width: 0; }
.recap-share-title { font-weight: 700; color: #0f172a; }
.recap-share-text { margin-top: 2px; color: #475569; font-size: .875rem; line-height: 1.4; }
.recap-share-actions { align-self: start; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.recap-share-button { min-height: 40px; padding: 8px 16px; border-radius: 12px; background: var(--blue-600); color: white; font-weight: 700; }
.recap-share-button:hover { background: var(--blue-700); }
.recap-share-download { color: var(--blue-600); font-size: .875rem; font-weight: 600; }
.recap-share-download[hidden] { display: none; }
.recap-share-status { flex-basis: 100%; color: #15803d; font-size: .8125rem; }
.recap-share-status:empty { display: none; }
@media (max-width: 480px) {
  .recap-share { grid-template-columns: 56px minmax(0, 1fr); padding: 12px; }
  .recap-share-preview { grid-row: 1; width: 56px; height: 70px; }
  .recap-share-body { align-self: center; }
  .recap-share-actions { grid-column: 1 / -1; }
  .recap-share-button { flex: 1 1 100%; }
  .recap-share-download { margin: 0 auto; }
}

/* Отчёт PDF */
.report-download { display: flex; align-items: center; gap: 12px; margin: -.25rem 0 1rem; padding: 12px 14px; border: 1px solid #e2e8f0; border-radius: 16px; background: white; }
.report-download-icon { flex: none; font-size: 26px; line-height: 1; }
.report-download-body { flex: 1; min-width: 0; }
.report-download-title { font-weight: 700; color: #0f172a; }
.report-download-text { margin-top: 2px; color: #475569; font-size: .875rem; line-height: 1.4; }
.report-download-button { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 14px; border: 1px solid #cbd5e1; border-radius: 12px; color: #0f172a; font-weight: 700; white-space: nowrap; }
.report-download-button:hover { border-color: var(--blue-600); color: var(--blue-700); }
@media (max-width: 480px) {
  .report-download { flex-wrap: wrap; }
  .report-download-button { flex: 1 1 100%; justify-content: center; }
}

/* Закрытые мероприятия */
.closed-event { max-width: 480px; margin: 0 auto; padding: 32px 24px; border: 1px solid #e2e8f0; border-radius: 24px; background: white; text-align: center; box-shadow: 0 8px 24px rgba(15, 23, 42, .06); }
.closed-event-icon { font-size: 40px; }
.closed-event h1 { margin-top: 8px; font-size: 24px; font-weight: 800; color: #0f172a; }
.closed-event p { margin-top: 10px; color: #475569; line-height: 1.5; }
.closed-event-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 20px; }
.closed-event-button { display: inline-flex; padding: 12px 20px; border-radius: 12px; background: var(--blue-600); color: white; font-weight: 700; }
.closed-event-secondary { display: inline-flex; padding: 12px 20px; border: 1px solid #cbd5e1; border-radius: 12px; color: #0f172a; font-weight: 600; background: white; }
.closed-event .closed-event-note { margin-top: 20px; color: #94a3b8; font-size: 13px; }
.event-access { margin: .75rem 0 1rem; padding: 12px 16px; border: 1px solid #ddd6fe; border-radius: 16px; background: #faf5ff; }
.event-access summary { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; cursor: pointer; font-weight: 700; color: #4c1d95; list-style: none; }
.event-access summary::-webkit-details-marker { display: none; }
.event-access-summary { color: #6d28d9; font-size: .875rem; font-weight: 600; }
.event-access-text { margin-top: 8px; color: #475569; font-size: .875rem; }
.event-access-heading { margin-top: 14px; color: #0f172a; font-size: .875rem; font-weight: 700; }
.event-access-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.event-access-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 8px 12px; border-radius: 12px; background: white; color: #0f172a; }
.event-access-role { margin-left: 6px; color: var(--brand-violet); font-size: .75rem; font-weight: 600; }
.event-access-actions { display: flex; gap: 8px; }
.event-access-approve { padding: 6px 12px; border-radius: 10px; background: var(--blue-600); color: white; font-size: .875rem; font-weight: 700; }
.event-access-decline { padding: 6px 12px; border: 1px solid #cbd5e1; border-radius: 10px; background: white; color: #334155; font-size: .875rem; font-weight: 600; }
.event-access-footer { margin-top: 14px; padding-top: 12px; border-top: 1px solid #ede9fe; }
.event-access-footer p { margin-bottom: 10px; color: #64748b; font-size: .8125rem; line-height: 1.45; }
.closed-event-option { margin-top: 14px; }
.closed-event-option label { display: flex; align-items: flex-start; gap: 10px; color: #334155; font-size: .875rem; line-height: 1.45; cursor: pointer; }
.closed-event-option input[type=checkbox] { margin-top: 3px; width: 18px; height: 18px; flex: none; }
.closed-event-option-disabled { cursor: default; color: #64748b; }
.closed-event-option a { color: var(--blue-600); font-weight: 600; }
.closed-event-form { display: flex; flex-direction: column; align-items: stretch; gap: 8px; margin-top: 20px; text-align: left; }
.closed-event-form label { color: #334155; font-size: .875rem; font-weight: 600; }
.closed-event-form input[type=text] { padding: 12px 14px; border: 1px solid #cbd5e1; border-radius: 12px; font-size: 1rem; }
.closed-event-form .closed-event-button { justify-content: center; cursor: pointer; }
.closed-event .closed-event-as { margin-top: 0; font-size: .875rem; }
.closed-event-as a { color: var(--blue-600); font-weight: 600; }
.closed-event-name { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 0 28px; max-width: 360px; }
.closed-event-name label { color: #334155; font-size: .8125rem; font-weight: 600; cursor: default; }
.closed-event-name input { width: 100%; padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 12px; background: white; }
