  /* Palette and type match Weston Davis Inventory (wdinventory/css/app.css)
     so the practice apps read as one program — the A/R ledger used to be
     cream, hunter green and brass with a serif face, which looked like a
     different product sitting next to the rest. Token NAMES are unchanged on
     purpose: every rule and every inline style in app.js already refers to
     them, so this is a palette swap rather than a rewrite. The names no
     longer describe their colours (--cream is grey, --brass is teal); they
     are kept as role names, and the comment on each says the role. */
  :root{
    --ink:#111827;          /* body text            (WD --txt)  */
    --hunter:#0F5E63;       /* primary / headers    (WD --acc)  */
    --hunter-deep:#0F2F33;  /* header gradient end             */
    --cream:#F4F5F7;        /* page background      (WD --bg)   */
    --cream-2:#F1F3F5;      /* inset / subtle fill  (WD --surf2)*/
    --paper:#FFFFFF;        /* cards                (WD --surf) */
    --brass:#0F5E63;        /* accent text / eyebrow           */
    --brass-light:#5E9CA1;  /* accent on dark                  */
    --rust:#B42318;         /* danger               (WD --red)  */
    --rust-bg:#FDECEA;
    --amber:#92400E;        /* warning              (WD --amb)  */
    --amber-bg:#FEF3C7;
    --sage:#166534;         /* success              (WD --grn)  */
    --sage-bg:#E7F5EC;
    --blue:#2A78D6;         /* info                            */
    --blue-bg:#E8F1FB;
    --violet:#4F46A0;       /* accent 2             (WD --pur)  */
    --violet-bg:#F0EEFF;
    --line:#E3E6EA;         /* borders              (WD --bdr)  */
    --mut:#5B6472;          /* secondary text       (WD --mut)  */
    --fnt:#8A929E;          /* tertiary text        (WD --fnt)  */
    --shadow: 0 1px 3px rgba(16,24,40,.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,.10), 0 2px 8px rgba(0,0,0,.06);
  }  *{box-sizing:border-box;}
  html,body{margin:0;padding:0;}
  body{
    background:var(--cream);
    color:var(--ink);
    font-family:'IBM Plex Sans',sans-serif;
    -webkit-font-smoothing:antialiased;
  }
  .display{font-family:'IBM Plex Sans', system-ui, sans-serif;}
  .mono{font-family:'IBM Plex Mono',monospace;}

  /* ===== Login ===== */
  .login-screen{
    min-height:100vh; display:flex; align-items:center; justify-content:center;
    background: linear-gradient(180deg, var(--hunter) 0%, var(--hunter-deep) 100%);
    padding:20px;
  }
  .login-box{
    background:var(--paper); border-radius:14px; box-shadow:0 20px 60px rgba(0,0,0,.3);
    padding:32px 30px; width:100%; max-width:360px;
  }
  .login-title{font-size:24px; font-weight:600; color:var(--hunter-deep); margin:2px 0 4px;}
  .login-sub{font-size:13px; color:var(--mut); margin:0 0 20px;}
  .login-box label{font-size:11px; text-transform:uppercase; letter-spacing:.06em; color:var(--fnt); font-weight:700; display:block; margin-bottom:5px;}
  .login-box input{width:100%; border-radius:8px; border:1px solid var(--line); outline:none;}
  .login-box input:focus{border-color:var(--brass);}
  .boot-spinner{
    width:32px; height:32px; margin:0 auto; border-radius:50%;
    border:3px solid var(--line); border-top-color:var(--hunter);
    animation:boot-spin .8s linear infinite;
  }
  @keyframes boot-spin{ to{ transform:rotate(360deg); } }

  /* ===== 2FA / recovery codes ===== */
  /* ===== Collections dry run ===== */
  .dry-run-banner{
    font-size:12.5px; line-height:1.45; padding:9px 11px; border-radius:8px;
    background:var(--cream-2); border-left:3px solid var(--hunter); color:var(--ink);
  }
  .dry-run-headline{font-size:13.5px; line-height:1.5; margin:12px 0 2px;}
  .dry-run-headline.ok{color:var(--sage);}
  .dry-run-headline.warn{color:var(--rust);}
  .dry-run-gates{display:flex; flex-wrap:wrap; gap:6px; margin:8px 0 2px;}
  .dry-run-gate{
    font-size:11.5px; padding:3px 8px; border-radius:999px;
    background:var(--cream-2); color:var(--mut); border:1px solid var(--line);
  }
  .dry-run-gate.warn{border-color:var(--rust); color:var(--rust);}

  .recovery-codes-grid{
    display:grid; grid-template-columns:1fr 1fr; gap:8px;
    background:var(--cream-2); border-radius:8px; padding:14px;
    font-family:'IBM Plex Mono',monospace; font-size:13px; margin:12px 0;
  }
  /* One tap/click grabs a whole code, so they can still be copied off a
     phone via the native long-press callout if the Copy button's clipboard
     access is blocked. Dragging across still selects several. */
  .recovery-codes-grid > div{ -webkit-user-select:all; user-select:all; }
  .mfa-qr-wrap{display:flex; justify-content:center; margin:14px 0;}
  .mfa-qr-wrap svg{width:180px; height:180px;}
  .mfa-secret{
    font-family:'IBM Plex Mono',monospace; font-size:12.5px; text-align:center;
    background:var(--cream-2); border-radius:8px; padding:8px; word-break:break-all;
    user-select:all;
  }

  /* ===== Header ===== */
  header.top{
    background: linear-gradient(180deg, var(--hunter) 0%, var(--hunter-deep) 100%);
    color:var(--paper);
    padding:16px 20px 14px;
    position:relative;
    overflow:hidden;
  }
  /* The old look ended the header with a dashed brass rule. Carried into the
     new palette it reads as an artefact rather than a flourish, so the header
     now just ends. */
  .top-inner{max-width:1020px; margin:0 auto; display:flex; justify-content:space-between; align-items:flex-start; gap:12px; flex-wrap:wrap;}
  .eyebrow{
    text-transform:uppercase; letter-spacing:.14em; font-size:11px; font-weight:600;
    color:var(--brass-light); margin:0 0 6px;
  }
  h1.title{
    font-size:19px; font-weight:600; margin:0 0 1px; letter-spacing:.005em;
  }
  .subtitle{
    font-size:13px; color:rgba(255,255,255,.85); margin:0;
  }
  .as-of{
    font-size:11.5px; color:rgba(255,255,255,.60); margin-top:5px;
  }
  .header-actions{display:flex; gap:8px; flex-shrink:0;}
  .ghost-btn{
    background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.25); color:rgba(255,255,255,.92);
    font-size:11.5px; font-weight:600; padding:8px 12px; border-radius:8px; cursor:pointer;
    display:flex; align-items:center; gap:6px; font-family:'IBM Plex Sans',sans-serif;
  }
  .ghost-btn:hover{background:rgba(255,255,255,.16);}
  input#importFile, input#importVaultFile, input#importArDataFile, input#verifyArDataFile{display:none;}
  .tools-grid{display:grid; grid-template-columns:1fr 1fr; gap:8px;}
  .tools-grid .btn{width:100%; justify-content:flex-start; text-align:left;}
  @media(max-width:520px){ .tools-grid{grid-template-columns:1fr;} }

  /* ===== Summary strip ===== */
  .summary-wrap{max-width:1020px; margin:-18px auto 0; padding:0 20px 6px; position:relative; z-index:2;}
  /* Message previews in the dry run. The body is shown as written, in a
     monospace block, so line breaks and length are visible — a text that
     runs to three segments is three texts, and that should be obvious
     before it goes to 200 people. */
  .msg-card{border:1px solid var(--line); border-radius:9px; margin-bottom:9px; overflow:hidden; background:var(--paper);}
  .msg-head{
    display:flex; justify-content:space-between; gap:10px; flex-wrap:wrap;
    padding:7px 10px; background:var(--cream-2); font-size:12px; color:var(--mut);
  }
  .msg-subject{padding:8px 10px 0; font-size:12.5px; font-weight:600; color:var(--ink);}
  .msg-body{
    margin:0; padding:8px 10px; font-family:'IBM Plex Mono',monospace; font-size:11.5px;
    line-height:1.55; color:var(--ink); white-space:pre-wrap; word-break:break-word;
  }
  .msg-missing{padding:10px; font-size:12px; color:var(--rust);}
  .msg-flags{display:flex; gap:6px; flex-wrap:wrap; padding:0 10px 9px;}
  .msg-flag{font-size:10.5px; font-weight:600; padding:2px 7px; border-radius:5px;}
  .msg-flag.ok{background:var(--sage-bg); color:var(--sage);}
  .msg-flag.draft{background:var(--amber-bg); color:var(--amber);}
  .msg-flag.warn{background:var(--rust-bg); color:var(--rust);}

  /* One strip of figures across the top, replacing the stacked
     outstanding / collected-today / queue cards. Three tiles on desktop,
     stacking on a phone. Numbers use tabular figures so columns of money
     line up instead of jittering as digits change. */
  .stat-strip{
    display:grid; grid-template-columns:repeat(3, 1fr); gap:1px;
    background:var(--line); border:1px solid var(--line); border-radius:10px;
    overflow:hidden; margin-bottom:14px;
  }
  .stat-tile{background:var(--paper); padding:12px 14px; min-width:0;}
  .stat-tile.met .stat-value{color:var(--sage);}
  .stat-label{
    font-size:10.5px; font-weight:600; letter-spacing:.08em; text-transform:uppercase;
    color:var(--mut); margin-bottom:5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  }
  .stat-value{
    font-size:23px; font-weight:600; color:var(--ink); line-height:1.1;
    font-variant-numeric:tabular-nums; letter-spacing:-.01em;
  }
  .stat-sub{font-size:11.5px; color:var(--fnt); margin-top:4px;}
  .stat-sub b{color:var(--mut); font-weight:600;}
  @media (max-width:720px){ .stat-strip{grid-template-columns:1fr;} }

  .summary-card{
    background:var(--paper);
    border:1px solid var(--line);
    border-radius:14px;
    box-shadow:var(--shadow);
    padding:15px 18px;
  }
  .summary-top{
    display:flex; align-items:baseline; justify-content:space-between; flex-wrap:wrap; gap:10px;
    margin-bottom:12px;
  }
  .total-figure{
    font-family:'IBM Plex Sans', system-ui, sans-serif; font-weight:600; font-size:27px; color:var(--ink); line-height:1; font-variant-numeric:tabular-nums;
  }
  .total-label{font-size:12px; color:var(--mut); text-transform:uppercase; letter-spacing:.1em; margin-bottom:4px;}
  .account-count{font-size:13px; color:var(--mut);}
  .account-count b{color:var(--ink);}

  .gate-bar{
    display:flex; width:100%; height:20px; border-radius:6px; overflow:hidden;
    border:1px solid var(--line); background:var(--cream-2);
  }
  .gate-seg{
    height:100%; position:relative; cursor:pointer; transition:filter .15s ease;
    border-right:1px solid rgba(255,255,255,.35);
  }
  .gate-seg:last-child{border-right:none;}
  .gate-seg:hover{filter:brightness(1.08);}
  .gate-legend{
    display:flex; flex-wrap:wrap; gap:14px; margin-top:10px; font-size:11.5px; color:var(--mut);
  }
  .gate-legend .item{display:flex; align-items:center; gap:6px;}
  .gate-legend .dot{width:9px; height:9px; border-radius:2px; display:inline-block;}
  .gate-legend .amt{font-family:'IBM Plex Mono',monospace; color:var(--ink);}

  .c-new{background:#6FB894;}
  .c-030{background:#2F8F5B;}
  .c-3160{background:#D9A441;}
  .c-6190{background:#C4861D;}
  .c-91120{background:#D4762C;}
  .c-121150{background:#C2492B;}
  .c-151{background:var(--rust);}

  /* status pill strip in summary */
  .status-strip{display:flex; gap:7px; flex-wrap:wrap; margin-top:12px; padding-top:12px; border-top:1px solid var(--line);}
  .status-pill{
    display:flex; align-items:center; gap:6px; font-size:11.5px; color:var(--mut); cursor:pointer;
    padding:5px 10px; border-radius:999px; background:var(--cream-2); border:1px solid transparent;
  }
  .status-pill:hover{border-color:var(--brass);}
  .status-pill b{color:var(--ink); font-family:'IBM Plex Mono',monospace;}
  .status-dot{width:8px; height:8px; border-radius:50%;}

  /* ===== Collections goal ===== */
  .goal-wrap{max-width:1020px; margin:14px auto 0; padding:0 20px;}
  .queue-wrap{max-width:1020px; margin:14px auto 0; padding:0 20px;}
  .goal-card{
    background:var(--paper); border:1px solid var(--line); border-radius:12px;
    box-shadow:var(--shadow); padding:16px 20px;
  }
  .goal-card.met{border-color:var(--sage);}
  .goal-top{display:flex; align-items:baseline; justify-content:space-between; flex-wrap:wrap; gap:8px; margin-bottom:10px;}
  .goal-figure{font-family:'IBM Plex Sans', system-ui, sans-serif; font-weight:600; font-size:26px; color:var(--hunter-deep);}
  .goal-target{font-size:12px; color:var(--mut); font-weight:600;}
  .goal-card.met .goal-target{color:var(--sage);}
  .goal-bar-track{position:relative; height:5px; border-radius:3px; background:var(--cream-2); margin:8px 0 0;}
  .goal-bar-fill{height:100%; border-radius:3px; background:var(--sage); transition:width .3s;}
  .goal-tick{position:absolute; top:-2px; width:2px; height:9px; background:var(--rust); border-radius:1px;}
  .goal-tick span{position:absolute; top:-17px; left:50%; transform:translateX(-50%); font-size:10px; font-weight:700; color:var(--rust); white-space:nowrap;}

  /* ===== Today's collection queue ===== */
  .queue-card{
    background:var(--paper); border:1px solid var(--line); border-radius:12px;
    box-shadow:var(--shadow); padding:16px 20px;
  }
  .queue-head{margin-bottom:10px;}
  .queue-head h3{margin:0 0 3px; font-size:14px; font-family:'IBM Plex Sans', system-ui, sans-serif; color:var(--hunter-deep);}
  .queue-sub{font-size:11.5px; color:var(--fnt);}
  .queue-rows{display:flex; flex-direction:column; gap:6px;}
  .queue-row{
    display:flex; align-items:center; justify-content:space-between; gap:10px;
    padding:9px 10px; border-radius:8px; cursor:pointer; border:1px solid transparent;
  }
  .queue-row:hover{background:var(--cream-2); border-color:var(--line);}
  .queue-name{font-size:13.5px; font-weight:600; color:var(--ink);}
  .queue-meta{margin-top:2px;}
  .queue-badge{
    display:inline-block; padding:2px 7px; border-radius:6px; font-size:10px; font-weight:600;
    background:var(--sage-bg); color:var(--sage);
  }
  .queue-row-right{text-align:right; flex-shrink:0;}
  .queue-balance{font-family:'IBM Plex Mono',monospace; font-weight:600; font-size:14px; color:var(--hunter-deep);}
  .queue-running{font-family:'IBM Plex Mono',monospace; font-size:10.5px; color:var(--fnt);}
  .queue-divider{
    text-align:center; font-size:10.5px; font-weight:700; color:var(--sage); letter-spacing:.04em;
    padding:4px 0;
  }
  .queue-divider.stretch{color:var(--brass);}
  .queue-empty{font-size:13px; color:var(--fnt); padding:10px 0;}

  /* ===== Controls ===== */
  .controls-wrap{max-width:1020px; margin:18px auto 0; padding:0 20px;}
  .controls-top{display:flex; gap:10px; align-items:center;}
  .filters-toggle{
    flex-shrink:0; display:flex; align-items:center; gap:6px; padding:11px 14px;
    font-size:13px; font-weight:600; white-space:nowrap;
  }
  .filters-badge{
    background:var(--hunter); color:var(--paper); font-size:10.5px; font-weight:700;
    border-radius:999px; padding:1px 7px; line-height:1.5;
  }
  .filters-summary{
    font-size:12px; color:var(--fnt); margin:8px 2px 0; display:flex; flex-wrap:wrap; gap:6px; align-items:center;
  }
  .filters-summary .fs-tag{
    background:var(--cream-2); color:var(--hunter-deep); border-radius:999px; padding:3px 10px; font-weight:600;
  }
  .filters-panel{
    margin-top:12px; padding:14px; border-radius:12px; border:1px solid var(--line); background:var(--cream);
  }
  .controls{
    display:flex; gap:10px; flex-wrap:wrap; align-items:center; margin-bottom:14px;
  }
  .search-box{flex:1 1 220px; position:relative;}
  .search-box input{
    width:100%; padding:11px 14px 11px 36px; border-radius:10px; border:1px solid var(--line);
    background:var(--paper); font-family:'IBM Plex Sans',sans-serif; font-size:14px; color:var(--ink);
    outline:none; transition:border-color .15s;
  }
  .search-box input:focus{border-color:var(--brass);}
  .search-box svg{position:absolute; left:12px; top:50%; transform:translateY(-50%); opacity:.45;}
  .filter-group{display:flex; flex-direction:column; gap:4px;}
  .filter-group label{
    font-size:10px; text-transform:uppercase; letter-spacing:.07em; color:var(--fnt); font-weight:700;
  }
  .filter-group select{
    padding:10px 14px; border-radius:10px; border:1px solid var(--line); background:var(--paper);
    font-family:'IBM Plex Sans',sans-serif; font-size:13.5px; color:var(--ink); outline:none; cursor:pointer;
  }
  .chip-section{margin-bottom:14px;}
  .chip-section-label{
    font-size:10px; text-transform:uppercase; letter-spacing:.07em; color:var(--fnt); font-weight:700;
    margin-bottom:6px;
  }
  .chip-row{display:flex; flex-wrap:wrap; gap:8px;}
  .chip-row.secondary{margin-bottom:0;}
  .chip{
    padding:7px 13px; border-radius:999px; border:1px solid var(--line); background:var(--paper);
    font-size:12.5px; font-weight:500; color:var(--mut); cursor:pointer; transition:all .15s; user-select:none;
  }
  .chip:hover{border-color:var(--brass);}
  .chip.active{background:var(--hunter); color:var(--paper); border-color:var(--hunter);}
  .result-count{font-size:12.5px; color:var(--fnt); margin: 0 0 10px 2px;}

  /* ===== Client list ===== */
  .list-wrap{max-width:1020px; margin:0 auto; padding:0 20px 60px;}
  .client-card{
    background:var(--paper); border:1px solid var(--line); border-radius:12px;
    margin-bottom:6px; box-shadow:var(--shadow); overflow:hidden;
  }
  .client-card.is-followup{border-color:var(--rust);}
  .client-head{
    display:flex; align-items:center; justify-content:space-between; gap:12px;
    padding:9px 14px; cursor:pointer;
  }
  .client-left{display:flex; align-items:center; gap:12px; min-width:0;}
  .rank-badge{
    width:26px; height:26px; border-radius:7px; background:var(--cream-2); color:var(--mut);
    display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:700;
    flex-shrink:0; font-family:'IBM Plex Mono',monospace; position:relative;
  }
  .check-mark{
    position:absolute; top:-5px; right:-5px; width:15px; height:15px; border-radius:50%;
    background:var(--sage); color:#fff; display:flex; align-items:center; justify-content:center;
    font-size:9px; border:2px solid var(--paper);
  }
  .client-name-wrap{min-width:0;}
  .client-name{font-weight:600; font-size:14px; color:var(--ink); white-space:nowrap; text-overflow:ellipsis; overflow:hidden;}
  .client-meta{font-size:12px; color:var(--fnt); margin-top:2px; display:flex; gap:6px; flex-wrap:wrap; align-items:center;}
  .badge{
    display:inline-block; padding:2px 8px; border-radius:6px; font-size:10.5px; font-weight:600;
    text-transform:uppercase; letter-spacing:.03em; white-space:nowrap;
  }
  .badge-current{background:var(--sage-bg); color:var(--sage);}
  .badge-watch{background:var(--amber-bg); color:var(--amber);}
  .badge-overdue{background:var(--rust-bg); color:var(--rust);}
  .badge-priority-high{background:var(--rust-bg); color:var(--rust);}
  .badge-priority-medium{background:var(--amber-bg); color:var(--amber);}
  .badge-priority-low{background:var(--sage-bg); color:var(--sage);}
  .note-count{font-size:11px; color:var(--fnt); display:flex; align-items:center; gap:3px;}
  .followup-flag{font-size:10.5px; font-weight:700; color:var(--rust); display:flex; align-items:center; gap:3px;}

  .phone-inline{font-family:'IBM Plex Mono',monospace; font-size:11.5px; color:var(--ink);}
  .phone-inline.muted{font-family:'IBM Plex Sans',sans-serif; color:var(--fnt); font-style:italic;}

  .client-right{display:flex; align-items:center; gap:10px; flex-shrink:0;}
  .client-balance{font-family:'IBM Plex Mono',monospace; font-weight:600; font-size:16px; color:var(--hunter-deep); text-align:right;}
  .quick-call{
    width:32px; height:32px; border-radius:50%; background:var(--sage-bg); color:var(--sage);
    display:flex; align-items:center; justify-content:center; font-size:14px; text-decoration:none;
    border:1px solid transparent; transition:all .15s; flex-shrink:0;
  }
  .quick-call:hover{background:var(--sage); color:#fff;}
  .chevron{transition:transform .2s; opacity:.5; flex-shrink:0;}
  .client-card.open .chevron{transform:rotate(180deg);}

  .client-detail{max-height:0; overflow:hidden; transition:max-height .3s ease; border-top:1px solid transparent;}
  .client-card.open .client-detail{border-top-color:var(--line); max-height:900px;}
  .detail-inner{padding:16px; display:grid; grid-template-columns:1fr 1fr; gap:18px;}
  @media(max-width:640px){ .detail-inner{grid-template-columns:1fr;} }

  .detail-block h4{
    font-size:10.5px; text-transform:uppercase; letter-spacing:.08em; color:var(--fnt); margin:0 0 8px; font-weight:700;
  }
  .mini-bar{display:flex; height:8px; border-radius:4px; overflow:hidden; margin-bottom:8px; background:var(--cream-2);}
  .aging-rows{display:flex; flex-direction:column; gap:4px; font-size:12px;}
  .aging-row{display:flex; justify-content:space-between; color:var(--mut);}
  .aging-row .val{font-family:'IBM Plex Mono',monospace; color:var(--ink);}
  .aging-row.zero{opacity:.35;}

  .action-row{display:flex; gap:8px; margin-top:2px; flex-wrap:wrap;}
  .btn{
    display:inline-flex; align-items:center; gap:6px; padding:8px 13px; border-radius:8px;
    font-size:12.5px; font-weight:600; text-decoration:none; border:1px solid var(--line);
    background:var(--cream-2); color:var(--ink); cursor:pointer; transition:all .15s;
  }
  .btn:hover{border-color:var(--brass); background:#fff;}
  .btn.primary{background:var(--hunter); color:var(--paper); border-color:var(--hunter);}
  .btn.primary:hover{background:var(--hunter-deep);}
  .btn.big{padding:12px 16px; font-size:14px; border-radius:10px;}

  .phone-card{
    background:var(--cream-2); border:1px solid var(--line); border-radius:10px;
    padding:10px 14px; margin-bottom:4px;
  }
  .phone-card-label{font-size:11px; color:var(--mut); text-transform:uppercase; letter-spacing:.05em; margin-bottom:2px;}
  .phone-card-number{font-family:'IBM Plex Mono',monospace; font-size:19px; font-weight:600; color:var(--hunter-deep);}

  .boarding-tags{display:flex; flex-wrap:wrap; gap:6px;}
  .tag{font-size:11px; padding:3px 8px; background:var(--cream-2); border-radius:6px; color:var(--mut);}

  .field-row{display:flex; gap:8px; margin-bottom:12px; flex-wrap:wrap;}
  .field-col{flex:1 1 140px;}
  .field-col label{display:block; font-size:10px; color:var(--fnt); text-transform:uppercase; letter-spacing:.06em; margin-bottom:4px; font-weight:700;}
  select.status-select, input.followup-input{
    width:100%; padding:8px 10px; border-radius:8px; border:1px solid var(--line); background:var(--paper);
    font-family:'IBM Plex Sans',sans-serif; font-size:12.5px; color:var(--ink); outline:none;
  }
  select.status-select:focus, input.followup-input:focus{border-color:var(--brass);}

  /* The date input and its Clear button. A native date field gives no
     reliable way to empty it — Safari shows no clear affordance at all — so
     removing a follow-up set by mistake needs a button of its own. */
  .followup-row{display:flex; gap:6px; align-items:center;}
  .followup-row input.followup-input{flex:1; min-width:0;}
  .followup-clear{
    flex-shrink:0; padding:8px 10px; border-radius:8px;
    border:1px solid var(--line); background:var(--paper);
    font-family:'IBM Plex Sans',sans-serif; font-size:12.5px; color:var(--fnt);
    cursor:pointer; line-height:1;
  }
  .followup-clear:hover{border-color:var(--rust); color:var(--rust);}
  .followup-clear:focus-visible{outline:2px solid var(--hunter); outline-offset:1px;}

  /* Putting a client on the promissory note list, from their own card. */
  .promissory-row{display:flex; gap:8px; align-items:center; margin:10px 0 2px;}
  .promissory-btn{
    padding:7px 12px; border-radius:8px; border:1px solid var(--hunter);
    background:var(--paper); color:var(--hunter);
    font-family:'IBM Plex Sans',sans-serif; font-size:12.5px; font-weight:600;
    cursor:pointer; line-height:1;
  }
  .promissory-btn:hover{background:var(--hunter); color:#fff;}
  .promissory-btn.off{border-color:var(--line); color:var(--fnt); font-weight:400;}
  .promissory-btn.off:hover{border-color:var(--rust); color:var(--rust); background:var(--paper);}
  .promissory-btn:focus-visible{outline:2px solid var(--hunter); outline-offset:1px;}
  .promissory-on{
    flex:0 0 auto; font-size:12.5px; font-weight:600; color:var(--hunter);
    margin-right:2px;
  }
  /* Shortlisted but not yet agreed — amber, like the status pill. */
  .promissory-on.maybe{flex:0 0 auto; color:var(--amber); margin-right:2px;}
  .promissory-on.in-collections{flex:0 0 auto; color:var(--brass); margin-right:2px;}
  /* Sending an account to an agency is the most consequential button on the
     card, so it does not look like the others until you mean it. */
  .promissory-btn.danger{border-color:var(--line); color:var(--fnt); font-weight:400;}
  .promissory-btn.danger:hover{border-color:var(--rust); background:var(--rust); color:#fff;}
  .collections-row{margin-top:10px;}
  .promissory-row{flex-wrap:wrap;}

  .add-note-row{display:flex; gap:6px; margin-bottom:10px;}
  .add-note-row input{
    flex:1; padding:8px 10px; border-radius:8px; border:1px solid var(--line); background:var(--paper);
    font-family:'IBM Plex Sans',sans-serif; font-size:12.5px; color:var(--ink); outline:none;
  }
  .add-note-row input:focus{border-color:var(--brass);}
  .add-note-row button{
    padding:8px 12px; border-radius:8px; border:1px solid var(--hunter); background:var(--hunter); color:var(--paper);
    font-size:12px; font-weight:600; cursor:pointer;
  }
  .add-note-row button:hover{background:var(--hunter-deep);}

  .activity-log{max-height:150px; overflow-y:auto; display:flex; flex-direction:column; gap:8px; padding-right:4px;}
  .log-entry{font-size:12px; padding:8px 10px; background:var(--cream); border-radius:8px; border:1px solid var(--line); position:relative;}
  .log-entry .log-when{font-size:10px; color:var(--fnt); font-family:'IBM Plex Mono',monospace; margin-bottom:2px;}
  .log-entry .log-text{color:var(--ink); padding-right:44px;}
  .log-empty{font-size:12px; color:var(--fnt); font-style:italic;}
  .log-edit-btn{
    position:absolute; top:6px; right:8px; background:none; border:none; cursor:pointer;
    font-size:11px; color:var(--fnt); padding:2px 4px;
  }
  .log-edit-btn:hover{color:var(--hunter);}
  .log-edit-row{display:flex; gap:6px; align-items:center;}
  .log-edit-row input{
    flex:1; padding:5px 7px; border-radius:6px; border:1px solid var(--line);
    font-family:'IBM Plex Sans',sans-serif; font-size:12px; background:var(--paper); color:var(--ink);
  }
  .log-edit-row button{
    padding:5px 8px; border-radius:6px; border:1px solid var(--hunter); background:var(--hunter);
    color:var(--paper); font-size:11px; font-weight:600; cursor:pointer;
  }
  .log-edit-row button.cancel{background:var(--paper); color:var(--ink); border-color:var(--line);}

  .empty-state{text-align:center; padding:60px 20px; color:var(--fnt);}
  .empty-state .display{font-size:20px; color:var(--ink); margin-bottom:6px;}

  footer.foot{max-width:1020px; margin:0 auto; padding:0 20px 40px; text-align:center; font-size:11.5px; color:var(--fnt);}

  /* ===== Vonage text compose modal ===== */
  .modal-overlay{
    position:fixed; inset:0; background:rgba(21,42,30,.55); z-index:50;
    display:flex; align-items:center; justify-content:center; padding:20px;
  }
  .modal-box{
    background:var(--paper); border-radius:14px; width:100%; max-width:440px;
    box-shadow:0 20px 60px rgba(0,0,0,.3); overflow:hidden;
  }
  .modal-head{
    background:var(--hunter); color:var(--paper); padding:16px 18px; display:flex; align-items:center; gap:8px;
  }
  .modal-head .vonage-badge{
    font-size:10px; font-weight:700; letter-spacing:.06em; text-transform:uppercase;
    background:var(--brass); color:var(--hunter-deep); padding:2px 8px; border-radius:5px;
  }
  .modal-head h3{margin:0; font-size:15px; font-weight:600; flex:1;}
  .modal-body{padding:18px;}
  .modal-to{font-size:12.5px; color:var(--mut); margin-bottom:10px;}
  .modal-to b{color:var(--ink); font-family:'IBM Plex Mono',monospace;}
  textarea.modal-textarea{
    width:100%; min-height:110px; border-radius:10px; border:1px solid var(--line); background:var(--cream-2);
    font-family:'IBM Plex Sans',sans-serif; font-size:13.5px; padding:12px; resize:vertical; outline:none; color:var(--ink);
  }
  textarea.modal-textarea:focus{border-color:var(--brass);}
  .modal-char-count{font-size:11px; color:var(--fnt); text-align:right; margin-top:4px;}
  .modal-status{font-size:12.5px; margin-top:10px; min-height:18px;}
  .modal-status.err{color:var(--rust);}
  .modal-status.ok{color:var(--sage);}
  .modal-actions{display:flex; flex-wrap:wrap; gap:8px; justify-content:flex-end; margin-top:14px;}
  .modal-actions .btn{padding:10px 16px;}
  .btn:disabled{opacity:.55; cursor:not-allowed;}

  /* ===== Conversation thread ===== */
  .thread-box{
    background:var(--cream); border:1px solid var(--line); border-radius:10px;
    padding:10px; max-height:220px; overflow-y:auto; display:flex; flex-direction:column; gap:6px;
  }
  .thread-empty{font-size:12px; color:var(--fnt); font-style:italic; padding:6px 2px;}
  .thread-loading{font-size:12px; color:var(--fnt); padding:6px 2px;}
  .bubble-row{display:flex;}
  .bubble-row.out{justify-content:flex-end;}
  .bubble-row.in{justify-content:flex-start;}
  .bubble{
    max-width:80%; padding:8px 11px; border-radius:12px; font-size:12.5px; line-height:1.4;
  }
  .bubble-row.out .bubble{background:var(--hunter); color:var(--paper); border-bottom-right-radius:3px;}
  .bubble-row.in .bubble{background:var(--cream-2); color:var(--ink); border-bottom-left-radius:3px;}
  .bubble-when{font-size:9.5px; opacity:.7; margin-top:3px;}
  .thread-refresh{
    font-size:11px; color:var(--brass); background:none; border:none; cursor:pointer; padding:0;
    text-decoration:underline; margin-bottom:8px;
  }
  .responded-flag{font-size:10.5px; font-weight:700; color:var(--sage); display:flex; align-items:center; gap:3px;}

  /* ===== Payment section ===== */
  .vault-row{display:flex; gap:8px; align-items:flex-end; margin-bottom:10px;}
  .vault-row .field-col{flex:1;}
  input.vault-input{
    width:100%; padding:8px 10px; border-radius:8px; border:1px solid var(--line); background:var(--paper);
    font-family:'IBM Plex Mono',monospace; font-size:12.5px; color:var(--ink); outline:none;
  }
  input.vault-input:focus{border-color:var(--brass);}
  .collectjs-field{
    width:100%; min-height:38px; padding:2px 10px; border-radius:8px; border:1px solid var(--line);
    background:var(--paper);
  }
  .payment-history{display:flex; flex-direction:column; gap:6px; margin-top:8px;}
  .payment-row{
    display:flex; justify-content:space-between; align-items:center; font-size:12px;
    background:var(--sage-bg); color:var(--sage); border-radius:8px; padding:6px 10px;
  }
  .payment-row .pay-amt{font-family:'IBM Plex Mono',monospace; font-weight:700;}
  .payment-row.declined{background:var(--rust-bg); color:var(--rust);}

  /* ===== Mobile ===== */
  @media(max-width:640px){
    .top-inner{flex-direction:column; align-items:stretch;}
    .header-actions{flex-wrap:wrap; gap:6px;}
    .header-actions .ghost-btn{font-size:10.5px; padding:7px 9px;}
    .summary-top{flex-direction:column; align-items:flex-start; gap:6px;}
    .total-figure{font-size:30px;}
    .controls{flex-direction:column; align-items:stretch;}
    .controls select, .controls .search-box, .controls .filter-group{width:100%;}
    .field-row{flex-direction:column;}
    .field-col{min-width:0;}
    .client-head{flex-wrap:wrap; gap:8px;}
    .client-right{width:100%; justify-content:space-between;}
    .detail-inner{padding:12px;}
    .action-row .btn{flex:1 1 auto; justify-content:center;}
    .queue-row{flex-wrap:wrap; gap:4px;}
    .queue-row-right{text-align:left;}
    .modal-box{max-width:100% !important;}
    .goal-top{flex-direction:column; align-items:flex-start;}
  }

  /* ===== One sign-in with WD Inventory (practice-link) ===== */
  .wd-link-hint{margin:0 0 14px; padding:10px 12px; border-radius:10px; background:var(--cream-2); border:1px solid var(--line); color:#0f2f33; font-size:13px; line-height:1.45;}
