:root {
    --navy: #100070;
    --ink: #1c1917;
    --muted: #57534e;
    --bg: #f4f1ea;
    --card: #fff;
    --line: #e7e5e4;
    --lime: #b0d828;
    --accent: #4f5c0e;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Segoe UI, sans-serif;
    background: var(--bg);
    color: var(--ink);
    overflow-x: hidden;
}

header {
    background: var(--navy);
    color: #fff;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    min-height: 64px;
}

.hdr-left { display: flex; align-items: center; gap: 14px; min-width: 0; overflow: visible; flex-wrap: nowrap; }
.hdr-end { display: flex; justify-content: flex-end; align-items: center; min-width: 0; }
a.brand { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; flex: none; }

header nav {
    display: flex;
    gap: 4px;
}

header nav button {
    background: transparent;
    color: rgba(255,255,255,.82);
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 20px 14px 16px;
    cursor: pointer;
    font: inherit;
}

header nav button.active {
    color: #fff;
    font-weight: 700;
    border-bottom-color: #fff;
    background: transparent;
}

.co-chip {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    flex: 1 1 auto;
    background: transparent;
    color: #fff;
    border-radius: 0;
    padding: 0;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.25;
    white-space: normal;
    max-width: 100%;
    min-width: 0;
}
.co-chip bdi {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
}
.co-status { display: block; margin-left: 0; white-space: normal; }
.co-status::before { content: none; }

#btnAccount {
    background: #fff;
    color: var(--navy);
    border: 0;
    border-radius: 999px;
    padding: 8px 16px;
    font-weight: 600;
}

main {
    max-width: 1100px;
    margin: 20px auto;
    padding: 0 16px 80px;
}

.card {
    background: var(--card);
    border-radius: 12px;
    padding: 16px;
    margin: 0 0 10px;
    box-shadow: 0 1px 3px #0001;
}

.todo.card {
    border-left: 4px solid var(--lime);
}

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

.muted {
    color: var(--muted);
    font-size: 13px;
}

.money {
    font-weight: 600;
    font-size: 22px;
}

button, input, select, textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

input, select, textarea {
    padding: 8px;
    width: 100%;
}
select {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid var(--navy);
    border-radius: 8px;
    background-color: #fff;
    color: var(--ink);
    padding-right: 32px;
    background-image: linear-gradient(45deg, transparent 50%, var(--navy) 50%), linear-gradient(135deg, var(--navy) 50%, transparent 50%);
    background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

    .btn-row button {
        padding: 8px 10px;
    }

.aging {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(150px,1fr));
    gap: 10px;
}

    .aging .card {
        margin: 0;
        cursor: pointer;
    }

        .aging .card:hover {
            outline: 2px solid var(--navy);
        }

.split {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 12px;
}

@media (max-width:800px) {
    .split {
        grid-template-columns: 1fr;
    }
}

.clist {
    background: #fff;
    border-radius: 12px;
    max-height: 70vh;
    overflow: auto;
}

    .clist button {
        display: block;
        width: 100%;
        text-align: left;
        border: 0;
        border-bottom: 1px solid var(--line);
        background: #fff;
        padding: 10px 12px;
    }

        .clist button.on {
            background: #eef3f9;
        }

.tabs {
    display: flex;
    gap: 6px;
    margin: 12px 0;
}

    .tabs button {
        padding: 8px 12px;
    }

        .tabs button.on {
            background: var(--navy);
            color: #fff;
            border: 0;
        }

dialog {
    border: 0;
    border-radius: 12px;
    padding: 20px;
    width: min(480px,92vw);
}

    dialog::backdrop {
        background: #0006;
    }

#loginBox input {
    width: 100%;
    margin: 6px 0;
}

.why {
    color: var(--accent);
    font-size: 13px;
    margin: 4px 0 8px;
}

.hidden {
    display: none !important;
}

a {
    color: var(--navy);
}

h3 {
    margin: 24px 0 8px;
    font-size: 16px;
}

.pill {
    display: inline-block;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 99px;
    background: #f4f8c8;
    color: var(--accent);
}

details.ai-sum {
    margin-top: 8px;
}

    details.ai-sum p {
        margin: 8px 0 0;
        font-size: 14px;
        line-height: 1.45;
    }

.menu { position: relative; }
.menu-pop {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background: #fff;
    color: var(--navy);
    min-width: 230px;
    border-radius: 10px;
    box-shadow: 0 8px 24px #0003;
    padding: 6px;
    z-index: 30;
}
.menu.open .menu-pop { display: flex; flex-direction: column; }
.menu-pop button {
    background: #fff;
    color: var(--navy);
    border: 0;
    text-align: left;
    padding: 10px 12px;
    border-radius: 8px;
}
.menu-pop button:hover { background: #eef3f9; }
header .right > .menu > button.active { background: #fff; }
.dash {
    background: #fff;
    border-radius: 18px;
    padding: 28px 32px 24px;
    box-shadow: 0 8px 28px #1000700d;
}
.dash-total {
    font-size: 52px;
    line-height: 1;
    font-weight: 700;
    color: var(--navy);
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
    margin-top: 4px;
}
.dash-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 12px;
}
.dash-insight { margin: 0; font-weight: 600; font-size: 16px; }
.dash-note { flex: 1 1 100%; margin: 4px 0 0; color: var(--ink); font-size: 14px; line-height: 1.45; }
.dash-note:empty { display: none; }
button.text-btn {
    display: inline;
    width: auto;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--navy);
    font: inherit;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}
.dash-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 700;
    background: #e7e5e4;
    color: #1c1917;
    font-variant-numeric: tabular-nums;
}
button.chip {
    border: 0;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    width: auto;
    line-height: 1.35;
    text-align: left;
}
button.chip:not(.chip-link) { cursor: default; }
.chip-ok { background: #d9f0c0; color: #1a3a0a; }
.chip-bad { background: #fde8e8; color: #9f1239; }
.chip-link { cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.dash-sec { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 16px; }
.dash-label { margin-bottom: 10px; }
.age-bar {
    display: flex;
    height: 16px;
    border-radius: 6px;
    overflow: hidden;
    background: #eee;
}
.age-bar i { display: block; height: 100%; min-width: 0; }
.age-legend {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-top: 12px;
}
.age-item {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    text-align: left;
    cursor: pointer;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}
.age-item:hover { border-color: var(--navy); }
.age-item .age-k { display: block; color: var(--muted); font-size: 13px; }
.age-item .age-amt { display: block; margin-top: 4px; font-size: 15px; font-weight: 600; }
.age-item .age-n { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.age-item.empty { color: #a8a29e; }
.age-item.empty .age-amt { font-weight: 600; }
.age-item.bad { margin-left: 0; text-align: left; color: #b42318; border-color: #f3c7c3; background: #fff7f6; }
.age-item.bad .age-k, .age-item.bad .age-amt { color: #b42318; }
.age-note { margin: 10px 0 0; }
.sched {
    display: flex;
    align-items: stretch;
    background: var(--navy);
    color: #fff;
    border-radius: 14px;
    overflow: hidden;
    min-height: 118px;
}
.sched-now {
    background: transparent;
    color: #fff;
    border: 0;
    text-align: left;
    padding: 16px 22px;
    min-width: 168px;
    cursor: pointer;
}
.sched-k { display: block; font-size: 15px; font-weight: 600; }
.sched-n {
    display: block;
    font-size: 44px;
    line-height: 1;
    font-weight: 700;
    margin: 8px 0 4px;
    font-variant-numeric: tabular-nums;
}
.sched-s { font-size: 14px; opacity: .85; }
.sched-rest {
    display: flex;
    flex: 1;
    border-left: 1px solid rgba(255,255,255,.22);
}
.sched-rest button {
    flex: 1;
    background: transparent;
    color: rgba(255,255,255,.72);
    border: 0;
    padding: 16px 6px;
    font-size: 13px;
    cursor: pointer;
}
.sched-rest .sched-c {
    display: block;
    margin-top: 10px;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

body.guest header {
    background: #fff;
    color: var(--navy);
    border-bottom: 1px solid var(--line);
}
body.guest #who { display: none; }
#pubNav { display: none; align-items: center; gap: 8px; flex-wrap: wrap; }
body.guest #pubNav { display: flex; }
body.door-open #pubNav { display: none !important; }
#pubNav a { color: var(--navy); text-decoration: none; padding: 8px 10px; }
.btn-solid, .btn-line { border-radius: 8px; padding: 10px 16px; }
.btn-solid { background: var(--navy); color: #fff; border: 0; }
.btn-line { background: #fff; color: var(--navy); border: 1px solid var(--navy); }
.brand { display: inline-flex; align-items: center; gap: 8px; }
.action-sample { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; pointer-events: none; }
.action-sample span { border: 1px dashed #d6d3d1; color: #a8a29e; border-radius: 8px; padding: 4px 8px; font-size: 13px; }
.action-sample span:first-child { border-style: solid; background: #f6f3ea; letter-spacing: .04em; text-transform: uppercase; font-size: 11px; font-weight: 700; }
.field-err { color: #9f1239; margin: 8px 0; font-size: 14px; white-space: pre-line; }
.field-err.hidden { display: none; }
label.muted { display: block; margin-top: 8px; font-size: 14px; color: #44403c; font-weight: 600; }
.brand-mark { width: 28px; height: 28px; display: block; }
.company-logo { height: 36px; width: auto; display: block; margin-top: 8px; }
.hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; padding: 42px 0 8px; }
.hero h1 { font-size: 52px; line-height: 1.02; margin: 8px 0 10px; color: var(--navy); letter-spacing: -0.03em; }
.lede { font-size: 22px; line-height: 1.35; margin: 0 0 12px; color: var(--navy); }
.eyebrow { color: var(--navy); font-weight: 600; margin: 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 22px 0 0; }
.hero-name { color: var(--navy); font-weight: 700; }
.proof { margin: 14px 0 0; color: var(--muted); font-size: 16px; line-height: 1.5; }
.hero-copy { font-size: 16px; line-height: 1.5; }
.home-block { margin-top: 64px; }
.home-kicker { margin: 0 0 10px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.home-title { margin: 0 0 16px; font-size: 32px; line-height: 1.15; color: var(--navy); letter-spacing: -0.02em; }
.qb-names { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.qb-names strong { color: var(--navy); font-size: 18px; font-weight: 700; }
.qb-rule { width: 1px; height: 28px; background: #d6d3d1; }
.books-split h3, #pricing h3, .legal h3 { margin: 0 0 8px; font-size: 18px; }
.books-split p, #pricing p, .legal p { margin: 0; line-height: 1.5; }
.books-split {
    display: grid;
    grid-template-columns: 1fr 1px 1fr;
    gap: 28px;
    background: #fff;
    border-radius: 16px;
    padding: 28px 32px;
}
.books-line { background: var(--line); }
#pricing .lede { font-size: 40px; margin: 0 0 10px; }
#pricing > p { margin-top: 10px; }
.price-list { list-style: none; margin: 8px 0 0; padding: 0; }
.price-list li { padding: 14px 0; border-top: 1px solid var(--line); }
.price-list li:last-child { border-bottom: 1px solid var(--line); }
.price-list strong { color: var(--navy); font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.price-list span { display: block; margin-top: 2px; }
.faq { margin-top: 16px; }
.faq details { border: 0; border-top: 1px solid var(--line); padding: 12px 0; outline: none; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; color: var(--navy); font-weight: 600; outline: none; }
.faq summary:focus, .faq summary:focus-visible, .faq details:focus { outline: none; }
.faq p { margin: 8px 0 0; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 36px; }
.steps > div { display: flex; gap: 14px; align-items: flex-start; }
.steps span {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--navy);
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.steps strong { display: block; color: var(--navy); font-size: 18px; }
.steps p { margin: 4px 0 0; color: var(--ink); font-weight: 400; font-size: 16px; line-height: 1.45; }
.home-end { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line); }
.foot-links { margin-top: 12px; }
.foot-links a { margin-right: 14px; }
.legal { margin-top: 28px; }
.int-log {
    margin: 10px 0 0;
    min-height: 88px;
    max-height: 200px;
    overflow: auto;
    background: #f6f3ec;
    border-radius: 8px;
    padding: 10px;
    white-space: pre-wrap;
    font-family: Consolas, monospace;
    font-size: 13px;
}
#msg {
    position: fixed;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    z-index: 50;
    max-width: min(480px, 92vw);
    margin: 0;
    background: var(--navy);
    color: #fff;
    padding: 12px 16px;
    border-radius: 10px;
    white-space: pre-wrap;
    word-break: break-word;
    box-shadow: 0 12px 32px #10007044;
    font-family: Segoe UI, sans-serif;
    font-size: 14px;
}
.admin-head h2 { margin: 0 0 4px; color: var(--navy); font-size: 32px; letter-spacing: -0.03em; }
.admin-head { margin-bottom: 6px; }
.admin-tabs {
    display: flex;
    gap: 4px 28px;
    flex-wrap: wrap;
    margin: 0 0 18px;
    border-bottom: 1px solid var(--line);
}
.admin-tabs button {
    width: auto;
    background: transparent;
    color: var(--muted);
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    padding: 12px 0 10px;
    font-weight: 600;
}
.admin-tabs button.on {
    color: var(--navy);
    border-bottom-color: var(--lime);
}
#page-billing { display: flex; flex-direction: column; gap: 12px; }
#page-billing.hidden { display: none !important; }
.field-row { display: flex; flex-wrap: wrap; gap: 16px; }
.field-row > div { flex: 1; min-width: 140px; }
.field-row input { width: 100%; max-width: none; }
.rule { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 8px 0; background: #fff; }
.rule select, .rule input { width: auto; margin: 0; padding: 8px 10px; border: 1px solid var(--navy); border-radius: 8px; color: var(--ink); }
.rule input { background: #fff; }
.rule select { min-height: 36px; padding-right: 32px; max-width: 100%; background-image: linear-gradient(45deg, transparent 50%, var(--navy) 50%), linear-gradient(135deg, var(--navy) 50%, transparent 50%); background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.rule input[type="number"] { width: 76px; }
.rule input[type="text"] { flex: 1 1 180px; min-width: 140px; }
.rule input.day { flex: 0 0 76px; width: 76px; min-width: 0; }
.rule input.amt { flex: 0 1 180px; width: 11em; min-width: 9em; }
.rule input::placeholder { color: #a8a29e; opacity: 1; }
.rule-hint { flex: 1 1 100%; margin: 0; font-size: 13px; color: var(--muted); line-height: 1.4; }
.char-count { flex: 1 1 100%; margin: 0; font-size: 12px; color: var(--muted); }
.char-count.at-limit { color: #b42318; }
.rule .trash { border: 0; background: transparent; color: var(--muted); padding: 6px 8px; }
.seg { display: inline-flex; border: 1px solid var(--navy); border-radius: 10px; overflow: hidden; margin: 8px 0 12px; }
.rule .seg { flex: 1 1 100%; margin: 0; }
.rule-lab { flex: 1 1 100%; font-size: 14px; font-weight: 650; color: #44403c; margin-top: 6px; }
.empty-rules { margin: 8px 0 0; color: var(--muted); }
.draft-err { flex: 1 1 100%; margin: 4px 0 0; }
.empty-cust p { margin: 0 0 10px; }
.empty-cust .btn-solid { width: auto; }
.rule-co { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; }
.rule-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.rule-section-head h3 { margin: 0; }
.rule-section-head .muted { margin: 4px 0 0; }
.rule-section-head .btn-solid, .rule-section-head .btn-line { width: auto; flex: 0 0 auto; white-space: nowrap; }
.qb-contact { margin: 4px 0 0; }
.qb-contact div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px; margin: 0 0 6px; }
.qb-contact dt { color: var(--muted); font-size: 13px; }
.qb-contact dd { margin: 0; }
.qb-contact a { color: var(--navy); }
.rule-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px 16px;
    margin: 10px 0;
    min-width: 0;
}
.rule-card-co { background: #fcfbf8; }
.rule-copy { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.rule-title-row { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.rule-title-row strong {
    color: var(--navy);
    font-size: 16px;
    min-width: 0;
    flex: 1 1 12em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.rule-badge {
    font-size: 11px;
    letter-spacing: .04em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--navy);
    background: #f4f1ea;
    border-radius: 999px;
    padding: 3px 8px;
}
.rule-meta { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.rule-note { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.rule-actions { display: flex; gap: 8px; align-items: center; flex: 0 0 auto; }
.rule-actions .linkish { padding: 8px 4px; }
.switch { position: relative; width: 44px; height: 26px; flex: 0 0 44px; margin-top: 2px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch input:disabled { cursor: default; }
.switch span { position: absolute; inset: 0; background: #e7e5e4; border-radius: 999px; }
.switch span:before {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 2px #00000022;
    transition: transform .15s;
}
.switch input:checked + span { background: var(--navy); }
.switch input:checked + span:before { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--navy); outline-offset: 2px; }
.switch input:disabled + span { opacity: .45; }
.more-btn { width: 36px; min-width: 36px; padding: 6px 0; background: transparent; color: var(--navy); border: 0; font-size: 18px; line-height: 1; }
.ov-name { display: inline; width: auto; background: transparent; color: var(--navy); border: 0; padding: 0; font-weight: 650; text-align: left; }
.ov-off, .ov-on { margin-top: 8px; }
.ov-on .ov-name { display: block; margin: 2px 0; }
.seg button { border: 0; background: #fff; color: var(--navy); border-radius: 0; padding: 8px 12px; }
.seg button.on { background: var(--navy); color: #fff; }
.cred { background: #f6f3ec; border-radius: 10px; padding: 12px 14px; margin: 10px 0; }
.cred p { margin: 0 0 8px; }
.cred p:last-child { margin: 0; }
.people .row { border-top: 1px solid var(--line); padding: 10px 0; margin: 0; align-items: center; }
.people .row:first-child { border-top: 0; padding-top: 0; }
.invite-row { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.invite-row input, .invite-row select { width: auto; flex: 1; }
.invite-row select { flex: 0 0 130px; }
.invite-row button { width: auto; }
.mail-ok { color: #14532d; font-weight: 650; margin: 10px 0 0; }
#forgotOk:empty, #profOk:empty { display: none; }
#forgotOk:not(:empty) { display: inline-block; background: #d9f0c0; color: #14532d; padding: 8px 10px; border-radius: 8px; }
.mail-bad { color: #9f1239; margin: 10px 0 0; }
@media (max-width: 800px) {
    .admin-tabs { gap: 0 18px; }
}
.action-card {
    background: #fff;
    border-radius: 16px;
    border-left: 6px solid var(--lime);
    box-shadow: 0 18px 40px #10007012;
    padding: 20px;
}
.action-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.action-kicker { color: #8a8478; font-size: 14px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.action-name { color: var(--navy); font-size: 22px; font-weight: 700; margin-top: 4px; }
.action-money { color: var(--navy); font-size: 26px; font-weight: 700; letter-spacing: -0.03em; }
.action-why { margin: 12px 0 0; color: var(--accent); font-size: 16px; }
.action-meta, .action-note { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.action-who { margin: 10px 0 0; color: var(--navy); font-size: 14px; font-weight: 600; }
.action-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.action-btns span {
    border: 1px solid #e4dfd6;
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 13px;
    color: #78716c;
    background: transparent;
}
.cust-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.cust-head h2 { margin: 0 0 6px; }
.cust-contacts { margin-top: 10px; }
.btn-line.on { background: var(--navy); color: #fff; }

main:has(#page-cust:not(.hidden)) { max-width: 1180px; }
.cust-split { display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: start; }
.cust-list, .cust-detail {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 1px 2px #0000000d;
}
.cust-list { max-height: calc(100vh - 110px); overflow: auto; position: sticky; top: 12px; padding-bottom: 8px; }
.cust-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px 8px;
    color: #a8a29e;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}
.cust-search input {
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    padding: 8px 4px;
    background: transparent;
}
.cust-search input:focus { outline: none; border-bottom-color: var(--navy); }
#custList button.cust-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    border: 0;
    border-left: 3px solid transparent;
    background: transparent;
    padding: 12px 16px;
    font-weight: 600;
    color: var(--ink);
}
#custList button.cust-row.on { background: #f6f3ea; border-left-color: var(--lime); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #d6d3d1; flex: none; }
.cust-row.on .dot { background: #84b318; }
.cust-detail { padding: 28px 32px 36px; min-height: 520px; }
.cust-detail.cust-detail-empty { min-height: 0; padding: 8px 4px 16px; background: transparent; box-shadow: none; display: block; }
.cust-detail:not(:has(.cust-top)) {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
}
.cust-top { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.cust-title { margin: 0; color: var(--navy); font-size: 34px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; }
.cust-who { margin: 6px 0 0; }
.cust-bal { display: flex; align-items: center; gap: 12px; margin: 6px 0 18px; }
.cust-sum { color: var(--navy); font-size: 40px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.age-pill { color: #fff; border-radius: 8px; padding: 4px 9px; font-size: 13px; font-weight: 700; }
.age-pill.b0 { background: #a8a29e; }
.age-pill.b30 { background: #78716c; }
.age-pill.b60 { background: #d97706; }
.age-pill.b90 { background: #a16207; }
.age-pill.b120 { background: #b42318; }
.cust-tools { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: flex-end; padding-top: 8px; }
.cust-tools .linkish, .more-link, .person {
    background: transparent;
    border: 0;
    color: #44403c;
    padding: 0;
    font: inherit;
}
.cust-tools .linkish { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.cust-tools .linkish:hover, .more-link:hover, .person:hover { color: var(--navy); }
.people-list { display: flex; flex-direction: column; gap: 14px; }
.person { display: flex; gap: 10px; align-items: flex-start; text-align: left; }
.person strong, .person .muted { display: block; }
.person .muted { margin-top: 1px; }
.more-link { margin: 2px 0 0 26px; color: var(--muted); font-size: 14px; }
.sec-h { margin: 26px 0 10px; font-size: 18px; font-weight: 700; }
.cust-tabs { display: flex; gap: 4px 22px; flex-wrap: wrap; margin: 22px 0 14px; border-bottom: 1px solid var(--line); }
.cust-tabs button {
    width: auto;
    background: transparent;
    color: var(--muted);
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    padding: 10px 0 8px;
    font-weight: 600;
}
.cust-tabs button.on { color: var(--navy); border-bottom-color: var(--lime); }
.plain { width: 100%; border-collapse: collapse; font-size: 14px; }
.plain th {
    text-align: left;
    font-weight: 600;
    color: #57534e;
    background: #f6f3ea;
    padding: 8px 12px;
}
.plain td { padding: 11px 12px; border-bottom: 1px solid #f3efe7; }
.plain th.num, .plain td.num { text-align: right; }
.plain a { color: var(--navy); font-weight: 700; text-decoration: none; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 8px; }
.chips button {
    border: 0;
    background: #f4f1ea;
    color: var(--ink);
    border-radius: 999px;
    padding: 6px 14px;
}
.chips button.on { background: #e7f3c4; font-weight: 700; }
.amt-in { color: #3f6212; font-weight: 600; }
.amt-out { color: var(--ink); }
.td-board { background: #fff; border-radius: 18px; padding: 6px 8px 10px; box-shadow: 0 1px 2px #0000000d; }
.td-head, .td-row {
    display: grid;
    grid-template-columns: 36px 1fr 120px 72px 64px;
    gap: 8px;
    align-items: center;
    width: 100%;
    background: transparent;
    border: 0;
    text-align: left;
    font: inherit;
    color: inherit;
}
.td-head { padding: 14px 12px 8px; border-top: 1px solid #f0ece4; }
.td-sec:first-child .td-head { border-top: 0; }
.td-count {
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    border-radius: 8px;
    background: #1c1917;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.td-count.zero { background: #eceae6; color: #a8a29e; }
.td-title { font-weight: 700; font-size: 16px; }
.td-k { text-align: right; color: #a8a29e; font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.td-item { margin: 0 8px 4px 0; }
.td-item.on { background: #f4f1fb; border: 1px solid #e4e0f2; border-radius: 12px; margin: 4px 8px 8px; }
.td-row { padding: 13px 12px; border-top: 1px solid #f3efe7; }
.td-item.on .td-row { border-top-color: transparent; background: transparent; }
.td-name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-item.on .td-name { font-weight: 700; }
.td-bal, .td-age, .td-inv, .td-k { text-align: right; }
.td-open { padding: 2px 16px 14px 56px; }
.td-line { display: flex; gap: 8px; align-items: flex-start; margin: 7px 0; font-size: 14px; color: #44403c; }
.td-why .td-line { margin: 2px 0; }
.td-why .td-line + .td-line { padding-left: 2.4em; }
.td-line svg { flex: none; margin-top: 2px; color: #78716c; }
.td-actions { display: flex; align-items: center; gap: 18px; margin-top: 12px; flex-wrap: wrap; }
.td-actions .rec {
    background: var(--navy);
    color: #fff;
    border: 0;
    border-radius: 10px;
    padding: 8px 14px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.td-actions .linkish { background: transparent; border: 0; padding: 0; color: #44403c; font: inherit; }
.td-actions .linkish:hover { color: var(--navy); }
.td-empty { padding: 4px 16px 12px 56px; }
.chev { justify-self: end; color: #a8a29e; }
#todoBar:empty { display: none; }
#todoBar button {
    background: transparent;
    border: 0;
    color: var(--muted);
    padding: 0 0 8px;
}
@media (max-width: 800px) {
    .cust-split { grid-template-columns: 1fr; }
    .cust-list { position: static; max-height: 280px; }
    .cust-title { font-size: 28px; }
    .cust-sum { font-size: 32px; }
    .cust-detail { padding: 20px 16px 28px; }
    .cust-top { flex-direction: column; }
    .td-head, .td-row { grid-template-columns: 32px 1fr 88px 52px 40px; gap: 4px; }
    .td-open { padding-left: 12px; }
}
#twoFaSecret { word-break: break-all; overflow-wrap: anywhere; }
@media (max-width: 800px) {
    header {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: "brand account" "nav nav" "chip chip";
        padding: 4px 10px;
        gap: 2px 8px;
        min-height: 0;
        align-items: center;
    }
    .hdr-left { display: contents; }
    a.brand { grid-area: brand; }
    .hdr-end { grid-area: account; }
    header nav { grid-area: nav; min-width: 0; align-items: center; flex-wrap: nowrap; }
    .co-chip { grid-area: chip; max-width: 100%; min-width: 0; justify-self: stretch; align-self: center; flex-direction: row; gap: 8px; padding: 0; background: transparent; }
    header nav button { padding: 6px 8px; min-height: 36px; }
    #btnAccount { min-height: 36px; padding: 6px 12px; }
    .foot-links a { display: inline-block; padding: 12px 6px; }
    .co-status { display: none; }
    .hero, .books-split, .steps { grid-template-columns: 1fr; }
    .books-line { display: none; }
    .hero h1 { font-size: 36px; }
    .dash { padding: 20px 16px; }
    .dash-total { font-size: 36px; }
    .sched { flex-direction: column; }
    .sched-rest { border-left: 0; border-top: 1px solid rgba(255,255,255,.22); flex-wrap: wrap; }
    .sched-rest button { flex: 1 1 30%; }
    .age-legend { grid-template-columns: 1fr 1fr; }
    .age-item.bad { margin-left: 0; text-align: left; }
}

select {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    border: 1px solid var(--navy);
    border-radius: 8px;
    color: var(--ink);
    background-color: #fff !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23100070' d='M1.2.2 6 5 10.8.2 12 1.4 6 7.4 0 1.4z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
    background-size: 12px 8px !important;
    padding-right: 32px;
}
select::-ms-expand { display: none; }
.pick { position: relative; display: inline-block; max-width: 100%; vertical-align: middle; }
.pick-btn {
    appearance: none;
    border: 1px solid var(--navy);
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23100070' d='M1.2.2 6 5 10.8.2 12 1.4 6 7.4 0 1.4z'/%3E%3C/svg%3E") no-repeat right 10px center;
    background-size: 12px 8px;
    border-radius: 8px;
    color: var(--ink);
    font: inherit;
    text-align: left;
    padding: 8px 32px 8px 10px;
    min-height: 40px;
    max-width: 100%;
    cursor: pointer;
}
.pick-menu {
    display: none;
    position: absolute;
    z-index: 30;
    left: 0;
    top: calc(100% + 4px);
    min-width: min(280px, calc(100vw - 24px));
    width: max-content;
    max-width: min(440px, calc(100vw - 24px));
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 8px 24px #0002;
    padding: 4px;
}
.pick.open .pick-menu { display: block; }
.pick-opt {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    border-radius: 8px;
    padding: 8px 10px;
    font: inherit;
    color: var(--ink);
    cursor: pointer;
}
.pick-opt.on, .pick-opt:hover { background: #f4f1ea; color: var(--navy); }
.ai-line { display: flex; align-items: center; gap: 8px; margin: 8px 0; width: fit-content; max-width: 100%; }
.ai-line input { width: 18px; height: 18px; flex: none; margin: 0; padding: 0; }
.menu-pop button.active { font-weight: 700; background: #f4f1ea; }
#btnAccount.on-profile { box-shadow: inset 0 -3px 0 var(--lime); }
.connect-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.connect-actions button { width: auto; }
.empty-page p { margin: 0 0 6px; }
.fine { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
@media (max-width: 520px) {
    .td-head, .td-row { grid-template-columns: 28px minmax(0, 1fr) 76px 42px; gap: 4px; min-width: 0; }
    .td-inv, .td-k-inv { display: none; }
    .cust-detail.cust-detail-empty { display: none; }
}
    
