/* Styles copied from the React site (src_react/bms-web/src/bms.css) for the pages that match it:
   Udhar Khata, Staff Attendance (free) and the menu. Keep in step with the React file. */

.sh-avatar {
    flex: none;
    display: grid;
    place-items: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
}

.sh-avatar.is-small {
    width: 1.9rem;
    height: 1.9rem;
    font-size: 0.72rem;
}

.page-panel.cd-head {
    display: grid;
    gap: 0.55rem;
    padding: 0.75rem 0.85rem;
    margin-bottom: 0.6rem;
}

.cd-head-top {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 2.2rem;
}

.cd-head-top h1 {
    flex: 1;
    margin: 0;
    font-size: 1.15rem;
}

.cd-icon-btn {
    flex: none;
    display: grid;
    place-items: center;
    width: 2.2rem;
    height: 2.2rem;
    border: 1px solid var(--bms-border);
    border-radius: 50%;
    background: #fff;
    color: var(--bms-primary);
    font-size: 1.05rem;
    cursor: pointer;
}

.cd-head-top .cd-add {
    flex: none;
    width: auto;
    min-height: 0;
    height: 2.2rem;
    padding: 0 0.9rem;
    font-size: 0.88rem;
    border-radius: 9px;
}

.cd-search {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    height: 2.2rem;
    padding: 0 0.3rem 0 0.6rem;
    border: 1.5px solid #9fbde6;
    border-radius: 9px;
    background: #fff;
}

.cd-search i {
    color: var(--bms-muted);
}

.cd-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: none;
    font: inherit;
    font-size: 0.92rem;
}

.cd-search button {
    border: 0;
    background: none;
    color: var(--bms-muted);
    font-size: 1.05rem;
    cursor: pointer;
}

.cd-seg {
    display: flex;
    gap: 0.2rem;
    padding: 0.2rem;
    border-radius: 10px;
    background: #f4f7fc;
}

.cd-seg button {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    min-height: 1.95rem;
    padding: 0.2rem 0.3rem;
    border: 0;
    border-radius: 8px;
    background: none;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--bms-muted);
    cursor: pointer;
}

.cd-seg button small {
    color: #94a3b8;
    font-size: 0.7rem;
    font-weight: 700;
}

.cd-seg button.is-on {
    background: #fff;
    color: var(--bms-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

@media (min-width: 901px) {
    .cd-head .cd-totals,
    .cd-head .cd-seg {
        max-width: 34rem;
    }
}

.cd-req {
    color: #c0392b;
    font-weight: 700;
}

.page-panel.te-head {
    display: grid;
    gap: 0.55rem;
    padding: 0.8rem 0.9rem;
}

.te-head-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}

.te-head-top h1 {
    margin: 0;
    font-size: 1.2rem;
}

.te-head .te-add {
    width: auto;
    flex: none;
    height: 2.2rem;
    min-height: 0;
    padding: 0 0.85rem;
    font-size: 0.88rem;
    border-radius: 9px;
}

.te-desc {
    margin: 0;
    color: var(--bms-muted);
    font-size: 0.85rem;
}

.ev-detail-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.ev-back {
    display: inline-flex;
    align-items: center;
    gap: 0.1rem;
    min-width: 0;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--bms-text, #1e293b);
    cursor: pointer;
}

.ev-back span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ev-back i {
    font-size: 1.3rem;
}

.ev-kind {
    margin-bottom: 0.7rem;
}

.cd-seg.ev-kind button.is-in { background: #dcfce7; color: #15803d; }

.cd-seg.ev-kind button.is-out { background: #ffedd5; color: #c2410c; }

.ev-delete-entry {
    margin-top: 0.6rem;
    font-size: 0.85rem;
}

.ev-toast {
    position: fixed;
    left: 50%;
    bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
    z-index: 60;
    transform: translateX(-50%);
    max-width: calc(100vw - 2rem);
    padding: 0.55rem 1rem;
    border-radius: 999px;
    background: #14532d;
    color: #fff;
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sh-head-icon,
.sh-head-chev {
    flex: none;
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border-radius: 8px;
    background: #fff;
    font: inherit;
    cursor: pointer;
}

.sh-head-icon {
    border: 1px solid var(--bms-border, #e2e8f0);
    color: var(--bms-primary);
}

.nav-badge {
    margin-left: 0.4rem;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    background: #dcfce7;
    color: #15803d;
    font-size: 0.66rem;
    font-weight: 700;
    vertical-align: 0.1rem;
}

.ud-bookbar {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.ud-book {
    position: relative;
    flex: 1;
    min-width: 0;
}

.ud-book i {
    position: absolute;
    left: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--bms-primary);
    pointer-events: none;
}

.ud-book select {
    width: 100%;
    height: 2.4rem;
    padding-left: 2rem;
    font-weight: 600;
}

.ud-bookbar .sh-head-icon {
    width: 2.4rem;
    height: 2.4rem;
}

.ud-bookbar .ud-danger {
    color: #b42318;
    border-color: #fecaca;
}

.ud-totals {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
}

.ud-totals div {
    display: grid;
    padding: 0.4rem 0.65rem;
    border-radius: 10px;
    font-size: 0.74rem;
    font-weight: 600;
}

.ud-totals strong {
    font-size: 1.1rem;
}

.ud-totals .is-get { background: #ffedd5; color: #c2410c; }

.ud-totals .is-got { background: #dcfce7; color: #15803d; }

.page-panel.ud-list {
    padding: 0;
    overflow: hidden;
}

.ud-customer + .ud-customer {
    border-top: 1px solid var(--bms-border, #e2e8f0);
}

.ud-head {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 0;
    background: none;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.ud-customer.is-open .ud-head {
    background: #f4f7fc;
}

.ud-who {
    flex: 1;
    min-width: 0;
    display: grid;
}

.ud-who b {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ud-who small {
    color: var(--bms-muted);
    font-size: 0.76rem;
}

.ud-bal {
    display: grid;
    text-align: right;
    font-weight: 800;
    color: var(--bms-muted);
}

.ud-bal small {
    font-size: 0.68rem;
    font-weight: 600;
}

.ud-bal.is-due { color: #c2410c; }

.ud-bal.is-adv { color: #15803d; }

.ud-body {
    padding: 0.2rem 0.9rem 0.8rem;
}

.ud-acts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
    margin: 0.4rem 0 0.5rem;
}

.ud-acts .login-btn {
    width: auto;
    height: 2.3rem;
    min-height: 0;
    margin: 0;
    padding: 0 0.4rem;
    font-size: 0.85rem;
    text-decoration: none;
    justify-content: center;
}

.ud-acts .ud-paid,
.ud-acts .ud-wa {
    color: #15803d;
    border-color: #bbf7d0;
}

.ud-lines {
    margin: 0;
    padding: 0;
    list-style: none;
    border: 1px solid var(--bms-border, #e2e8f0);
    border-radius: 10px;
    overflow: hidden;
}

.ud-lines li + li {
    border-top: 1px solid var(--bms-border, #e2e8f0);
}

.ud-lines button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    width: 100%;
    padding: 0.5rem 0.7rem;
    border: 0;
    background: #fff;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.ud-lines span {
    display: grid;
    min-width: 0;
}

.ud-lines b {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ud-lines small {
    color: var(--bms-muted);
    font-size: 0.74rem;
}

.ud-lines strong {
    flex: none;
    color: #c2410c;
}

.ud-lines strong.is-paid {
    color: #15803d;
}

.ud-none {
    margin: 0.3rem 0;
    color: var(--bms-muted);
    font-size: 0.85rem;
}

.ud-foot {
    display: flex;
    justify-content: space-between;
    margin-top: 0.55rem;
    font-size: 0.85rem;
}

.fa-datebar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.fa-datebar > button {
    flex: none;
    display: grid;
    place-items: center;
    width: 2.3rem;
    height: 2.3rem;
    padding: 0;
    border: 1px solid var(--bms-border, #e2e8f0);
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
}

.fa-datebar > button:disabled {
    opacity: 0.35;
    cursor: default;
}

.fa-arrow {
    display: block;
    width: 0.5rem;
    height: 0.5rem;
    margin-left: -0.15rem;
    border-top: 2px solid var(--bms-primary);
    border-right: 2px solid var(--bms-primary);
    transform: rotate(45deg);
}

.fa-arrow.is-left {
    margin: 0 -0.15rem 0 0;
    transform: rotate(-135deg);
}

.fa-date {
    position: relative;
    flex: 1;
    min-width: 0;
    display: grid;
    place-items: center;
    height: 2.3rem;
    border: 1px solid var(--bms-border, #e2e8f0);
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.92rem;
    overflow: hidden;
}

.fa-date input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.fa-counts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.fa-counts span {
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.78rem;
}

.fa-counts .is-present { background: #dcfce7; color: #15803d; }

.fa-counts .is-half { background: #fef9c3; color: #a16207; }

.fa-counts .is-absent { background: #fee2e2; color: #b91c1c; }

.fa-counts.is-small span {
    font-size: 0.74rem;
}

.page-panel.fa-list {
    padding: 0;
    overflow: hidden;
}

.fa-row,
.fa-month {
    display: grid;
    gap: 0.55rem;
    padding: 0.8rem 0.9rem;
}

.fa-row + .fa-row,
.fa-month + .fa-month {
    border-top: 1px solid var(--bms-border, #e2e8f0);
}

.fa-row.is-present { box-shadow: inset 4px 0 0 #22c55e; }

.fa-row.is-half { box-shadow: inset 4px 0 0 #eab308; }

.fa-row.is-absent { box-shadow: inset 4px 0 0 #ef4444; }

.fa-who {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.fa-name {
    flex: 1;
    min-width: 0;
    display: grid;
}

.fa-name b {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fa-name small {
    color: var(--bms-muted);
    font-size: 0.78rem;
}

.fa-status {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
}

.fa-status button {
    height: 2.4rem;
    border: 1px solid var(--bms-border, #e2e8f0);
    border-radius: 10px;
    background: #fff;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
}

.fa-status button.is-on.is-present { background: #16a34a; border-color: #16a34a; color: #fff; }

.fa-status button.is-on.is-half { background: #eab308; border-color: #eab308; color: #fff; }

.fa-status button.is-on.is-absent { background: #dc2626; border-color: #dc2626; color: #fff; }

.fa-times {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.fa-times label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
}

.fa-times span {
    flex: none;
    width: 1.9rem;
    color: var(--bms-muted);
    font-size: 0.8rem;
    font-weight: 600;
}

.fa-times input {
    min-width: 0;
    height: 2.3rem;
}

.fa-cal {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.25rem;
}

.fa-cell {
    position: relative;
    height: 2.2rem;
    padding: 0.85rem 0 0;
    border: 1px solid var(--bms-border, #e2e8f0);
    border-radius: 7px;
    background: #fff;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}

.fa-cell small {
    position: absolute;
    top: 0.1rem;
    left: 0.3rem;
    color: #94a3b8;
    font-size: 0.6rem;
    font-weight: 600;
}

.fa-cell:disabled {
    opacity: 0.35;
    cursor: default;
}

.fa-cell.is-today { border-color: var(--bms-primary); }

.fa-cell.is-present { background: #dcfce7; color: #15803d; }

.fa-cell.is-half { background: #fef9c3; color: #a16207; }

.fa-cell.is-absent { background: #fee2e2; color: #b91c1c; }

.nav-link .nav-badge {
    margin-left: 0.3rem;
    padding: 0 0.35rem;
    font-size: 0.6rem;
}

.fa-times label {
    display: grid;
    gap: 0.15rem;
}

.fa-times span {
    width: auto;
}

.fa-times input {
    width: 100%;
    padding: 0 0.5rem;
}

.ud-head-panel {
    display: grid;
    gap: 0.6rem;
}

.ud-add {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.ud-add .login-btn {
    width: auto;
    height: 2.4rem;
    min-height: 0;
    margin: 0;
    font-size: 0.9rem;
}

.ud-go {
    flex: none;
    width: 0.45rem;
    height: 0.45rem;
    margin-left: 0.1rem;
    border-top: 2px solid #94a3b8;
    border-right: 2px solid #94a3b8;
    transform: rotate(45deg);
}

.page-panel.ud-detail-head {
    display: grid;
    gap: 0.55rem;
    padding: 0.8rem 0.9rem;
}

.ud-detail-head .ev-back {
    gap: 0.45rem;
}

.ud-detail-sub {
    margin-top: -0.35rem;
    color: var(--bms-muted);
    font-size: 0.82rem;
}

.ud-big {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 0.55rem 0.8rem;
    border-radius: 12px;
    background: #f1f5f9;
    color: #475569;
    font-weight: 600;
}

.ud-big strong {
    font-size: 1.45rem;
    font-weight: 800;
}

.ud-big.is-due { background: #ffedd5; color: #c2410c; }

.ud-big.is-adv { background: #dcfce7; color: #15803d; }

.ud-lines.is-page {
    border: 0;
    border-radius: 0;
}

.ud-remove {
    display: block;
    margin: 0.2rem auto 0.8rem;
    font-size: 0.88rem;
}

.nav-link .nav-text { white-space: nowrap; }

/* Family / Friend (React layout). */
.ff-head {
    display: grid;
    gap: 0.6rem;
}

.ff-head-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.ff-head-top h1 {
    margin: 0;
}

.ff-head .ff-add {
    width: auto;
}

.ff-head p {
    margin: 0;
    color: var(--bms-muted);
    font-size: 0.88rem;
}

.ff-head .page-search {
    max-width: 22rem;
}

.ff-list {
    padding: 0;
    overflow: hidden;
}

.ff-empty {
    margin: 0;
    padding: 1rem;
    color: var(--bms-muted);
}

.ff-row {
    display: grid;
    grid-template-columns: 2.5rem minmax(0, 1fr) auto;
    grid-template-areas:
        "avatar who actions"
        ". label label"
        ". access access";
    column-gap: 0.75rem;
    align-items: center;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--bms-border);
}

.ff-row:not(.has-access) {
    grid-template-areas: "avatar who actions";
}

.ff-avatar {
    grid-area: avatar;
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
}

.ff-who {
    grid-area: who;
    display: grid;
    min-width: 0;
}

.ff-who b {
    font-size: 0.98rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ff-who span,
.ff-who small {
    color: var(--bms-muted);
    font-size: 0.8rem;
}

.ff-actions {
    grid-area: actions;
    display: flex;
}

.ff-list .ff-access-note {
    margin: 0;
    padding: 0.7rem 1rem;
}

.ff-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.ff-chip {
    height: 2rem;
    padding: 0 0.75rem;
    border: 1px solid var(--bms-border);
    border-radius: 999px;
    background: #fff;
    font: inherit;
    font-size: 0.85rem;
    color: inherit;
    cursor: pointer;
}

.ff-chip.is-on {
    border-color: #9fbde6;
    background: #e9f1fb;
    color: var(--bms-primary);
    font-weight: 600;
}

@media (min-width: 901px) {
    .ff-row,
    .ff-row.has-access {
        grid-template-columns: 2.5rem minmax(10rem, 1fr) 19.5rem auto;
        grid-template-areas: "avatar who access actions";
    }
    .ff-row:not(.has-access) {
        grid-template-columns: 2.5rem minmax(10rem, 1fr) auto;
        grid-template-areas: "avatar who actions";
    }
}

.ff-books {
    grid-area: label;
    margin-top: 0.3rem;
    color: var(--bms-muted);
    font-size: 0.8rem;
}

.ff-books b.is-edit {
    color: #15803d;
    font-weight: 600;
}

.ff-books b.is-view {
    color: #a35a00;
    font-weight: 600;
}

@media (min-width: 901px) {
    .ff-books {
        grid-area: access;
        margin-top: 0;
    }
}

.ff-head-search {
    flex: 1;
    min-width: 0;
}

.ff-head-search .page-search-wrap,
.ff-head-search .page-search {
    width: 100%;
    max-width: 22rem;
}

.ff-head-top .ff-head-search .page-search {
    height: 2.2rem;
    min-width: 0;
}

.ff-head-search input {
    min-width: 0;
    width: 100%;
}

.ff-head .ff-head-top {
    min-width: 0;
}

.ff-head .ff-head-top .ff-add {
    flex: none;
}

.ff-head .ff-head-top h1 {
    flex: none;
    font-size: 1.15rem;
}

.ff-head .ff-add {
    height: 2.2rem;
    min-height: 0;
    padding: 0 0.85rem;
    font-size: 0.88rem;
    border-radius: 9px;
}

.page-panel.ff-head {
    padding: 0.7rem 0.85rem;
}

.ff-line {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    min-width: 0;
}

.ff-line b {
    flex: none;
    max-width: 55%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ff-line span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--bms-muted);
    font-size: 0.8rem;
}

.ff-add-short {
    display: none;
}

@media (max-width: 600px) {
    .ff-head .ff-add-long {
        display: none;
    }
    .ff-head .ff-add-short {
        display: inline;
    }
    .ff-head .ff-add {
        padding: 0 0.75rem;
    }
}

/* Credit / Due (React layout). */
.cd-head-top .cd-add {
    flex: none;
    width: auto;
    min-height: 0;
    height: 2.2rem;
    padding: 0 0.9rem;
    font-size: 0.88rem;
    border-radius: 9px;
}

.cd-totals {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
}

.cd-total {
    display: grid;
    gap: 0.05rem;
    padding: 0.4rem 0.65rem;
    border: 0;
    border-radius: 10px;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.cd-total span {
    font-size: 0.72rem;
    font-weight: 600;
}

.cd-total strong {
    font-size: 1.1rem;
}

.cd-total.is-get {
    background: #dcfce7;
    color: #15803d;
}

.cd-total.is-pay {
    background: #ffedd5;
    color: #c2410c;
}

.cd-list {
    padding: 0;
    overflow: hidden;
}

.cd-empty {
    margin: 0;
    padding: 1rem;
    color: var(--bms-muted);
}

.cd-row {
    border-bottom: 1px solid var(--bms-border);
}

.cd-row:last-child {
    border-bottom: 0;
}

.cd-row.is-open {
    background: #fbfdff;
}

.cd-row-main {
    display: grid;
    grid-template-columns: 2.1rem minmax(0, 1fr) auto 1.2rem;
    grid-template-areas:
        "avatar who amount chev"
        ". bar bar bar";
    column-gap: 0.6rem;
    align-items: center;
    width: 100%;
    padding: 0.6rem 0.6rem 0.55rem 0.8rem;
    border: 0;
    background: none;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.cd-avatar {
    grid-area: avatar;
    display: grid;
    place-items: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
}

.cd-who {
    grid-area: who;
    display: grid;
    min-width: 0;
}

.cd-name {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}

.cd-name b {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.92rem;
}

.cd-sub {
    color: var(--bms-muted);
    font-size: 0.74rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cd-chip {
    flex: none;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 700;
}

.cd-chip.is-late { background: #fee2e2; color: #b91c1c; }

.cd-chip.is-soon { background: #fef9c3; color: #a16207; }

.cd-chip.is-later { background: #e0ecfb; color: var(--bms-primary); }

.cd-chip.is-done { background: #f1f5f9; color: #475569; }

.cd-amount {
    grid-area: amount;
    display: grid;
    text-align: right;
    font-size: 0.98rem;
    font-weight: 800;
    white-space: nowrap;
}

.cd-amount small {
    color: var(--bms-muted);
    font-size: 0.66rem;
    font-weight: 600;
}

.cd-amount.is-get { color: #15803d; }

.cd-amount.is-pay { color: #c2410c; }

.cd-row.is-settled .cd-amount { color: #64748b; }

.cd-chev {
    grid-area: chev;
    color: var(--bms-muted);
    font-size: 1.1rem;
}

.cd-bar {
    grid-area: bar;
    height: 4px;
    margin-top: 0.4rem;
    border-radius: 9px;
    background: #e2e8f0;
    overflow: hidden;
}

.cd-bar i {
    display: block;
    height: 100%;
    background: #22c55e;
}

.cd-detail {
    margin: 0 0.8rem;
    padding: 0.5rem 0 0.75rem;
    border-top: 1px dashed var(--bms-border);
}

.cd-detail-label {
    margin-bottom: 0.25rem;
    color: #94a3b8;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.cd-timeline {
    list-style: none;
    margin: 0 0 0 0.45rem;
    padding: 0 0 0 0.85rem;
    border-left: 2px solid var(--bms-border);
}

.cd-timeline li {
    position: relative;
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.22rem 0;
    font-size: 0.82rem;
}

.cd-timeline li::before {
    content: "";
    position: absolute;
    left: -1.15rem;
    top: 0.55rem;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: #94a3b8;
}

.cd-timeline li.is-pay::before { background: #22c55e; }

.cd-timeline li.is-pay b { color: #15803d; }

.cd-timeline li small { color: var(--bms-muted); }

.cd-timeline li.is-left { font-weight: 700; }

.cd-timeline li.is-left::before { background: var(--bms-primary); }

.cd-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.6rem;
}

.cd-act {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    height: 1.95rem;
    padding: 0 0.6rem;
    border: 1px solid var(--bms-border);
    border-radius: 8px;
    background: #fff;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--bms-primary);
    cursor: pointer;
}

.cd-act.is-share { color: #15803d; border-color: #bbf7d0; }

.cd-act.is-danger { color: #b42318; border-color: #fecaca; }

.cd-pay-note {
    margin: 0 0 0.5rem;
    color: var(--bms-muted);
    font-size: 0.85rem;
}

.cd-share-text {
    width: 100%;
    min-height: 6rem;
    font-size: 0.9rem;
    line-height: 1.45;
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.cd-share-apps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-top: 0.8rem;
}

.cd-app {
    display: grid;
    justify-items: center;
    gap: 0.25rem;
    border: 0;
    background: none;
    font: inherit;
    font-size: 0.78rem;
    color: var(--bms-muted);
    text-decoration: none;
    cursor: pointer;
}

.cd-app i {
    display: grid;
    place-items: center;
    width: 2.7rem;
    height: 2.7rem;
    border-radius: 12px;
    color: #fff;
    font-size: 1.35rem;
}

.cd-app.is-wa i { background: #22c55e; }

.cd-app.is-sms i { background: var(--bms-primary); }

.cd-app.is-copy i { background: #64748b; }

.cd-app.is-more i { background: #94a3b8; }

@media (min-width: 901px) {
    .cd-head .cd-totals,
    .cd-head .cd-seg {
        max-width: 34rem;
    }
}

.exp-form .cd-type-hint {
    margin-top: -0.3rem;
    color: var(--bms-muted);
    font-size: 0.75rem;
}

.exp-form .form-grid > .cd-type-hint {
    grid-column: 1 / -1;
}

/* Team / Event, Event, Share Expenditure (React layout). */
.pexp-add-long {
    display: none;
}

.pexp-book {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.6rem;
}

.pexp-book > i {
    color: var(--bms-primary);
    font-size: 1.1rem;
}

.pexp-book select {
    flex: 1;
    min-width: 0;
    height: 2.4rem;
    font-weight: 600;
}

.pexp-book-pill {
    flex: none;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: #dcfce7;
    color: #15803d;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.pexp-book-pill.is-view {
    background: #fdf1e3;
    color: #a35a00;
}

.pexp-by {
    flex: none;
    color: #be185d;
    font-weight: 600;
}

.pexp-by::before {
    content: " · ";
    white-space: pre;
    color: var(--bms-muted);
    font-weight: 400;
}

.sh-panel {
    padding: 0;
    overflow: hidden;
}

.sh-team + .sh-team {
    border-top: 1px solid var(--bms-border);
}

.sh-team-head {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    padding: 0.8rem 1rem;
    border: 0;
    background: none;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.sh-team.is-open .sh-team-head {
    background: #f4f7fc;
}

.sh-who {
    flex: 1;
    min-width: 0;
    display: grid;
}

.sh-who b {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sh-who span {
    color: var(--bms-muted);
    font-size: 0.8rem;
}

.sh-pill {
    flex: none;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #334155;
    font-size: 0.72rem;
    font-weight: 700;
}

.sh-pill.is-blue { background: #e0ecfb; color: var(--bms-primary); }

.sh-pill.is-ok { background: #dcfce7; color: #15803d; }

.sh-pill.is-warn { background: #fdf1e3; color: #a35a00; }

.sh-team-body {
    padding: 0.3rem 1rem 0.9rem;
}

.sh-member {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--bms-border);
}

.sh-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.8rem;
}

.sh-actions .stock-action-btn {
    width: auto;
    min-height: 0;
    height: 2.3rem;
    padding: 0 0.85rem;
    font-size: 0.85rem;
    gap: 0.35rem;
}

.sh-danger {
    color: #b42318 !important;
}

.sh-note {
    margin: 0.6rem 0 0;
    color: var(--bms-muted);
    font-size: 0.8rem;
}

.sh-settled {
    color: #15803d;
}

.sh-empty-panel {
    display: grid;
    justify-items: start;
    gap: 0.6rem;
}

.sh-banner {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    margin-top: 0.6rem;
    padding: 0.45rem 0.7rem;
    border-radius: 10px;
    background: #e9f1fb;
    color: var(--bms-primary);
    font-size: 0.82rem;
}

.sh-stat-good strong { color: #15803d; }

.sh-stat-bad strong { color: #c0392b; }

.sh-settle {
    list-style: none;
    margin: 0.6rem 0 0;
    padding: 0;
    border: 1px solid var(--bms-border);
    border-radius: 10px;
    overflow: hidden;
    font-size: 0.88rem;
}

.sh-settle li {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.45rem 0.7rem;
}

.sh-settle li + li {
    border-top: 1px solid var(--bms-border);
}

.sh-settle li.is-mine {
    background: #fffbeb;
}

.sh-exp {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid var(--bms-border);
}

.sh-exp-main {
    flex: 1;
    min-width: 0;
}

.sh-exp-l1 {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

.sh-exp-l1 strong {
    color: var(--bms-primary-dark);
    white-space: nowrap;
}

.sh-exp-l2 {
    margin-top: 0.15rem;
    color: var(--bms-muted);
    font-size: 0.8rem;
}

.sh-exp-l2 b {
    color: var(--bms-text);
    font-weight: 600;
}

.sh-exp-actions {
    display: flex;
    flex: none;
}

.sh-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.sh-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    height: 2rem;
    padding: 0 0.7rem;
    border: 1px solid var(--bms-border);
    border-radius: 999px;
    background: #fff;
    font: inherit;
    font-size: 0.85rem;
    color: inherit;
    cursor: pointer;
}

.sh-chip.is-on {
    border-color: #9fbde6;
    background: #e9f1fb;
    color: var(--bms-primary);
    font-weight: 600;
}

.sh-chip small {
    color: var(--bms-muted);
    font-weight: 400;
}

.sh-pick-group + .sh-pick-group {
    margin-top: 0.5rem;
}

.sh-pick-label {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--bms-muted);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sh-other {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 0.4rem;
    margin-top: 0.7rem;
}

.sh-other .stock-action-btn {
    width: auto;
}

.sh-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.sh-tabs {
    display: flex;
    gap: 0.25rem;
    margin: 0.2rem 0 0.5rem;
    padding: 0.2rem;
    border-radius: 10px;
    background: #f4f7fc;
}

.sh-tabs button {
    flex: 1;
    height: 2rem;
    border: 0;
    border-radius: 8px;
    background: none;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--bms-muted);
    cursor: pointer;
}

.sh-tabs button.is-on {
    background: #fff;
    color: var(--bms-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.sh-split {
    margin-bottom: 0.8rem;
    border: 1px solid var(--bms-border);
    border-radius: 10px;
    overflow: hidden;
    font-size: 0.9rem;
}

.sh-split-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-height: 2.4rem;
    padding: 0.25rem 0.7rem;
}

.sh-split-row + .sh-split-row {
    border-top: 1px solid var(--bms-border);
}

.sh-split-row .form-input {
    width: 7.5rem;
    height: 2rem;
    text-align: right;
}

.sh-split-left {
    background: #fdf1e3;
    color: #a35a00;
}

.sh-split-left.is-ok {
    background: #dcfce7;
    color: #15803d;
}

.sh-link-page {
    min-height: 100vh;
    background: var(--bms-bg, #eef2f7);
}

.sh-link-top {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1rem;
    background: #0f2f5c;
    color: #fff;
}

.sh-link-top b {
    flex: 1;
}

.sh-link-top .stock-action-btn {
    width: auto;
}

.sh-link-foot {
    text-align: center;
}

@media (max-width: 560px) {
    .sh-other {
        grid-template-columns: 1fr 1fr;
    }
    .sh-other .stock-action-btn {
        grid-column: 1 / -1;
    }
}

@media (min-width: 901px) {
    .pexp-by {
        display: none;
    }
    .pexp-head:has(> .pexp-book) {
        grid-template-areas:
            "title stats"
            "book book"
            "search add";
    }
    .pexp-head > .pexp-book {
        grid-area: book;
        max-width: 30rem;
        margin-top: 0;
    }
    .pexp-head.sh-head {
        display: block;
    }
    .sh-head .pexp-head-top {
        display: flex;
    }
    .sh-head > .pexp-book {
        max-width: 30rem;
        margin-top: 0.6rem;
    }
    .sh-head .pexp-stats {
        margin-top: 0.7rem;
        grid-template-columns: repeat(3, 11rem);
    }
    .sh-head .sh-settle {
        max-width: 34.5rem;
    }
    .pexp-add-short {
        display: none;
    }
    .pexp-add-long {
        display: inline;
    }
}

.pexp-book {
    position: relative;
    flex-wrap: nowrap;
}

.pexp-book-btn {
    flex: none;
    display: grid;
    place-items: center;
    width: 2.4rem;
    height: 2.4rem;
    border: 1px solid var(--bms-border);
    border-radius: 10px;
    background: #fff;
    color: var(--bms-primary);
    font-size: 1.05rem;
    cursor: pointer;
}

.pexp-book-menu-wrap {
    position: relative;
    flex: none;
}

.pexp-book-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 0.3rem);
    z-index: 30;
    min-width: 11rem;
    border: 1px solid var(--bms-border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 61, 122, 0.14);
    overflow: hidden;
}

.pexp-book-menu button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 0;
    border-bottom: 1px solid var(--bms-border);
    background: none;
    font: inherit;
    font-size: 0.9rem;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.pexp-book-menu button:last-child {
    border-bottom: 0;
}

.pexp-book-menu button.is-danger {
    color: #b42318;
}

.pexp-booktag {
    flex: none;
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    background: #ede9fe;
    color: #6d28d9;
    font-size: 0.68rem;
    font-weight: 700;
}

@media (max-width: 900px) {
    .pexp-head > .pexp-book {
        margin-top: 0;
        gap: 0.4rem;
    }
    .pexp-head > .pexp-book select.form-input {
        height: 2.15rem;
        min-height: 0;
        padding-top: 0;
        padding-bottom: 0;
        font-size: 0.9rem;
    }
    .pexp-head .pexp-book-btn {
        width: 2.15rem;
        height: 2.15rem;
        font-size: 1rem;
    }
}

.ev-events {
    padding: 0;
    overflow: hidden;
}

.ev-row {
    display: grid;
    grid-template-columns: 2.2rem minmax(0, 1fr) auto;
    gap: 0.1rem 0.7rem;
    align-items: center;
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 0;
    border-bottom: 1px solid var(--bms-border, #e2e8f0);
    background: #fff;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.ev-row:last-child {
    border-bottom: 0;
}

.ev-avatar {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
}

.ev-row-text {
    display: grid;
    min-width: 0;
}

.ev-row-text b,
.ev-entry-text b {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--bms-text, #1e293b);
}

.ev-row-text small,
.ev-entry-text small {
    color: var(--bms-muted);
    font-size: 0.76rem;
}

.ev-row-amt {
    display: grid;
    text-align: right;
    font-weight: 800;
    color: #15803d;
}

.ev-row-amt small {
    color: var(--bms-muted);
    font-size: 0.7rem;
    font-weight: 600;
}

.ev-bar {
    display: block;
    height: 5px;
    border-radius: 9px;
    background: #e2e8f0;
    overflow: hidden;
}

.ev-bar i {
    display: block;
    height: 100%;
    background: #22c55e;
}

.ev-row-bar {
    grid-column: 2 / -1;
    margin-top: 0.35rem;
}

.page-panel.ev-detail-head {
    display: grid;
    gap: 0.6rem;
    padding: 0.8rem 0.9rem;
}

.ev-detail-actions {
    display: inline-flex;
    gap: 0.3rem;
    flex: none;
}

.ev-totals {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
}

.ev-totals div {
    display: grid;
    border-radius: 10px;
    padding: 0.4rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 600;
}

.ev-totals strong {
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ev-totals .is-in { background: #dcfce7; color: #15803d; }

.ev-totals .is-out { background: #ffedd5; color: #c2410c; }

.ev-totals .is-left { background: #e0ecfb; color: var(--bms-primary); }

.ev-goal {
    display: grid;
    gap: 0.3rem;
    color: var(--bms-muted);
    font-size: 0.78rem;
}

.ev-add {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.ev-add .login-btn {
    margin: 0;
    width: auto;
    height: 2.3rem;
    min-height: 0;
    font-size: 0.9rem;
}

.page-panel.ev-list {
    padding: 0;
    overflow: hidden;
}

.ev-day {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--bms-border, #e2e8f0);
    color: #475569;
    font-size: 0.76rem;
    font-weight: 700;
}

.ev-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    width: 100%;
    padding: 0.6rem 0.9rem;
    border: 0;
    border-bottom: 1px solid var(--bms-border, #e2e8f0);
    background: #fff;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.ev-entry-text {
    display: grid;
    min-width: 0;
}

.ev-in,
.ev-out {
    flex: none;
    font-weight: 800;
}

.ev-in { color: #15803d; }

.ev-out { color: #c2410c; }

.ev-modes {
    display: flex;
    gap: 0.4rem;
}

.ev-modes button {
    padding: 0.35rem 0.85rem;
    border: 1px solid var(--bms-border, #e2e8f0);
    border-radius: 999px;
    background: #fff;
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
}

.ev-modes button.is-on {
    background: #e9f1fb;
    border-color: #9fbde6;
    color: var(--bms-primary);
    font-weight: 600;
}

.ev-receipt {
    margin: 0 0 0.8rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    background: #f0fdf4;
    color: #14532d;
    font-size: 0.9rem;
    line-height: 1.45;
}

.ev-wa {
    text-decoration: none;
    justify-content: center;
}

.sh-team .sh-team-head {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.55rem 0.6rem 0.55rem 1rem;
    cursor: default;
}

.sh-team-main {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.25rem 0;
    border: 0;
    background: none;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.sh-name-line {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
}

.sh-who .sh-name-line b {
    min-width: 0;
    color: var(--bms-text, #1e293b);
    font-size: 0.98rem;
}

.sh-who .sh-name-line .sh-pill {
    color: #334155;
    font-size: 0.68rem;
}

.sh-who .sh-name-line .sh-pill.is-blue {
    color: var(--bms-primary);
}

.sh-head-chev {
    border: 0;
    background: none;
    color: var(--bms-muted);
    font-size: 1.2rem;
}

.sh-member .sh-who b {
    font-weight: 500;
}

.sh-actions .stock-action-btn {
    margin: 0;
}

.sh-actions .icon-action.danger {
    width: 2.3rem;
    height: 2.3rem;
    border: 1px solid #fecaca;
    border-radius: 9px;
    display: inline-grid;
    place-items: center;
}

.sh-team .sh-head-chev {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #eef3fa;
    transition: background 0.15s ease;
}

.sh-team .sh-head-chev:hover {
    background: #e0ecfb;
}

.sh-team .sh-head-chev.is-open {
    background: var(--bms-primary);
}

.sh-chev {
    display: block;
    width: 0.5rem;
    height: 0.5rem;
    margin-top: -0.2rem;
    border-right: 2px solid var(--bms-primary);
    border-bottom: 2px solid var(--bms-primary);
    transform: rotate(45deg);
    transition: transform 0.2s ease, margin 0.2s ease;
}

.sh-head-chev.is-open .sh-chev {
    margin-top: 0.2rem;
    border-color: #fff;
    transform: rotate(-135deg);
}

/* Personal Expenditure books (React layout). */
.pexp-byline {
    grid-area: by;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #be185d;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}

@media (min-width: 901px) {
    .pexp-byline {
        font-size: 0.75rem;
        margin-top: -0.15rem;
    }
}

.pexp-book-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 0.3rem);
    z-index: 30;
    min-width: 11rem;
    border: 1px solid var(--bms-border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 61, 122, 0.14);
    overflow: hidden;
}

.pexp-book-menu button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 0;
    border-bottom: 1px solid var(--bms-border);
    background: none;
    font: inherit;
    font-size: 0.9rem;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.pexp-book-menu button:last-child {
    border-bottom: 0;
}

.pexp-book-menu button.is-danger {
    color: #b42318;
}

.book-share-note {
    margin: 0 0 0.6rem;
    color: var(--bms-muted);
    font-size: 0.85rem;
}

.book-share-row {
    display: grid;
    gap: 0.35rem;
    padding: 0.65rem 0;
    border-top: 1px solid var(--bms-border);
}

.book-share-who {
    display: grid;
}

.book-share-who span {
    color: var(--bms-muted);
    font-size: 0.8rem;
}

.pexp-bookbar {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.pexp-bookbar .pexp-book {
    position: relative;
    flex: 1;
    min-width: 0;
}

.pexp-bookbar .pexp-book i {
    position: absolute;
    left: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--bms-primary);
    pointer-events: none;
}

.pexp-bookbar .pexp-book select {
    width: 100%;
    height: 2.4rem;
    padding-left: 2rem;
    font-weight: 600;
}

.pexp-bookbar .sh-head-icon {
    width: 2.4rem;
    height: 2.4rem;
}

.pexp-book-menu {
    position: static;
    display: grid;
    margin-top: 0.4rem;
}

.pexp-book-menu button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.8rem;
    border: 0;
    border-bottom: 1px solid var(--bms-border, #e2e8f0);
    background: #fff;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.pexp-book-menu button.is-danger {
    color: #b42318;
}

.pexp-by-chip {
    display: inline-block;
    margin: 0 0.25rem 0.2rem 0;
    padding: 0.1rem 0.55rem;
    border: 1px solid var(--bms-border, #e2e8f0);
    border-radius: 999px;
    font-size: 0.78rem;
}

.pexp-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.4rem 0 0.6rem;
    font-size: 0.9rem;
}

.book-share-row {
    flex-wrap: wrap;
}

.book-share-seg {
    flex: 1 1 100%;
}

.cd-seg.book-share-seg button.is-on.is-edit { background: #dcfce7; color: #15803d; }
.cd-seg.book-share-seg button.is-on.is-view { background: #fdf1e3; color: #a35a00; }

.book-share-need {
    flex: 1 1 100%;
    color: #a35a00;
    font-size: 0.78rem;
}

/* Quick Add expenditure form (React layout) */
.exp-quick .exp-amount-box { display: flex; align-items: center; gap: 6px; border: 1px solid var(--border, #d7dce3); border-radius: 10px; padding: 0 10px; background: var(--surface, #fff); }
.exp-quick .exp-amount-box .form-input { border: 0; padding-left: 0; font-size: 1.15rem; font-weight: 700; min-width: 0; box-shadow: none; }
.exp-quick .exp-amount-box span { font-weight: 700; opacity: .7; }
.exp-cats, .exp-pay-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.exp-cats button { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 64px; padding: 6px 8px; border: 1px solid var(--border, #d7dce3); border-radius: 10px; background: var(--surface, #fff); font-size: .75rem; cursor: pointer; color: inherit; }
.exp-cats button b { font-size: 1.2rem; font-weight: 400; }
.exp-pay-chips button { padding: 5px 12px; border: 1px solid var(--border, #d7dce3); border-radius: 999px; background: var(--surface, #fff); font-size: .8rem; cursor: pointer; color: inherit; }
.exp-cats button.is-on, .exp-pay-chips button.is-on { border-color: var(--primary, #2563eb); background: color-mix(in srgb, var(--primary, #2563eb) 12%, transparent); color: var(--primary, #2563eb); font-weight: 600; }
.exp-more { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 8px 10px; border: 1px dashed var(--border, #d7dce3); border-radius: 10px; background: transparent; color: inherit; font-size: .85rem; cursor: pointer; text-align: left; }
.exp-more small { opacity: .65; }
.exp-quick .cd-req, .cd-req { color: #dc2626; }

/* Family list on desktop: the books line sits under the name, same as on phone. */
@media (min-width: 901px) {
    .ff-row.has-access {
        grid-template-columns: 2.5rem minmax(0, 1fr) auto;
        grid-template-areas: "avatar who actions" ". label label";
    }
    .ff-row.has-access .ff-books {
        grid-area: label;
        margin-top: 0.3rem;
    }
}
