/* Quelld Split - shared expenses */

#quelld-split-root {
    max-width: 640px;
    margin: 0 auto;
    background: #FFFFFF;
}

.qsp-wrap { padding: 8px 4px 40px; }

.qsp-title {
    font-size: 26px;
    font-weight: 700;
    color: #2D2D3A;
    line-height: 1.25 !important;
    margin: 6px 0 12px !important;
}

.qsp-sub {
    font-size: 15px;
    color: #7A7A8A;
    line-height: 1.6;
    margin: 0 0 20px;
}

.qsp-hint {
    font-size: 13px;
    color: #8A8A98;
    line-height: 1.5;
    margin: 0 0 10px;
}

/* ── Inputs ─────────────────────────────── */

.qsp-input {
    width: 100%;
    box-sizing: border-box;
    padding: 13px 15px;
    border: 1px solid #EAEAEF;
    border-radius: 12px;
    background: #FFFFFF;
    font-size: 15px;
    font-family: inherit;
    color: #2D2D3A;
    margin-bottom: 8px;
    -webkit-appearance: none;
}

.qsp-input:focus {
    outline: none;
    border-color: var(--quelld-purple, #9a4fe0);
}

.qsp-mrow { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.qsp-input--name { flex: 1 1 40%; margin-bottom: 0; }
.qsp-input--email { flex: 1 1 60%; margin-bottom: 0; }

.qsp-mrow__del {
    flex-shrink: 0;
    width: 34px; height: 34px;
    border: none !important;
    background: #F7F7FA !important;
    color: #B0B0BE !important;
    border-radius: 9px !important;
    cursor: pointer !important;
    font-size: 13px !important;
    font-family: inherit !important;
    padding: 0 !important;
}

.qsp-add-link {
    background: none !important;
    border: none !important;
    color: var(--quelld-purple, #9a4fe0) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    font-family: inherit !important;
    cursor: pointer !important;
    padding: 8px 0 !important;
}

/* ── Group list ─────────────────────────── */

.qsp-card {
    border: 1px solid #EAEAEF;
    border-radius: 16px;
    padding: 16px 18px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.qsp-card:active { background: #FAF7FF; border-color: var(--quelld-purple, #9a4fe0); }

.qsp-card__top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.qsp-card__name { font-size: 17px; font-weight: 700; color: #2D2D3A; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qsp-card__bal { font-size: 13px; font-weight: 600; flex-shrink: 0; }
.qsp-card__meta { font-size: 13px; color: #9A9AA8; margin-top: 4px; }

.is-pos { color: #34A853; }
.is-neg { color: #E04F4F; }
.is-zero { color: #9A9AA8; }

/* ── Group header ───────────────────────── */

.qsp-ghead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }

.qsp-edit-link {
    background: none !important;
    border: none !important;
    color: var(--quelld-purple, #9a4fe0) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    font-family: inherit !important;
    cursor: pointer !important;
    padding: 8px !important;
    flex-shrink: 0;
}

/* ── Balances ───────────────────────────── */

.qsp-bal {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    margin-bottom: 6px;
    border-radius: 12px;
    background: #F7F7FA;
    overflow: hidden;
}

.qsp-bal__avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--quelld-purple-light, #EDE5FF);
    color: var(--quelld-purple, #9a4fe0);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700;
    flex-shrink: 0;
}

.qsp-bal__name {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    font-weight: 600;
    color: #2D2D3A;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qsp-bal__amt { font-size: 13px; font-weight: 600; flex-shrink: 0; }

.qsp-settled {
    padding: 14px 18px;
    border-radius: 14px;
    background: #E6F4EA;
    color: #34A853;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 8px;
}

/* ── Expenses ───────────────────────────── */

.qsp-exp {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 6px;
    border-radius: 12px;
    background: #FFFFFF;
    border: 1px solid #EFEFF3;
    overflow: hidden;
}

.qsp-exp--settle { background: #FAFAFC; }

.qsp-exp__left { flex: 1; min-width: 0; }
.qsp-exp__title { font-size: 14px; font-weight: 600; color: #2D2D3A; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qsp-exp__meta { font-size: 12px; color: #9A9AA8; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qsp-exp__amt { font-size: 15px; font-weight: 700; color: #2D2D3A; flex-shrink: 0; }
.qsp-exp__amt.is-settle { color: #34A853; }

.qsp-exp__del {
    flex-shrink: 0;
    background: none !important;
    border: none !important;
    color: #C0C0CC !important;
    font-size: 14px !important;
    padding: 6px !important;
    cursor: pointer !important;
    font-family: inherit !important;
}

/* ── Chips ──────────────────────────────── */

.qsp-chiprow {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.qsp-chip {
    padding: 9px 15px;
    border-radius: 999px;
    border: 1px solid #EAEAEF;
    background: #FFFFFF;
    color: #3A3A4A;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.qsp-chip.is-active {
    border: 2px solid var(--quelld-purple, #9a4fe0);
    background: var(--quelld-purple-light, #EDE5FF);
    color: var(--quelld-purple, #9a4fe0);
    font-weight: 600;
}

/* ── Per person value rows ──────────────── */

.qsp-vrow { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.qsp-vrow__name { flex: 1; min-width: 0; font-size: 14px; color: #3A3A4A; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qsp-input--val { width: 120px; flex-shrink: 0; margin-bottom: 0; text-align: right; }

.qsp-running {
    font-size: 13px;
    font-weight: 600;
    color: #7A7A8A;
    padding: 10px 14px;
    background: #F7F7FA;
    border-radius: 10px;
    margin-bottom: 12px;
}

/* ── Actions / empty ────────────────────── */

.qsp-actions { display: flex; flex-direction: column; gap: 10px; margin: 20px 0 8px; }

.qsp-danger-link {
    background: none !important;
    border: none !important;
    color: #E04F4F !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    font-family: inherit !important;
    cursor: pointer !important;
    padding: 10px !important;
}

.qsp-empty { text-align: center; padding: 34px 20px; }
.qsp-empty__icon { font-size: 40px; margin-bottom: 10px; }
.qsp-empty__title { font-size: 17px; font-weight: 700; color: #2D2D3A; margin-bottom: 6px; }
.qsp-empty__text { font-size: 14px; color: #8A8A98; line-height: 1.6; }
