
/* settings */
.settings { display: grid; gap: 14px; }
.settings-list { display: none; }
.settings-list a { display: flex; align-items: center; min-height: 48px; padding: 0 14px; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; justify-content: space-between; }
.settings-list a:hover { background: var(--hover); text-decoration: none; }
.settings .tabs { margin-bottom: 4px; }
.setting-card { max-width: 860px; }
.matrix th, .matrix td { text-align: center; } .matrix th:first-child, .matrix td:first-child { text-align: left; }
.session-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--border); }
.danger-zone { border-color: #7f1d1d; }
.connector { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.export-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.export-grid > div { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: space-between; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; }
@media (max-width: 767px) { .settings .tabs.top { display: none; } .settings-list.on { display: block; } .settings-back { display: inline-flex; } }
.settings-back { display: none; }
.notice, .inline-error { overflow-wrap: anywhere; } .setting-card { min-width: 0; }
.settings { grid-template-columns: minmax(0, 1fr); } .settings .stack, .settings .stack > * { min-width: 0; }

/* Delivery confirmations found in the inbox: the consent card, the email details on the delivery card, and the Settings switch. */
.inbox-consent .btn, .inbox-mail .btn, .delivery-email .btn { min-height: 44px; }
.inbox-reads { margin: 4px 0 8px; padding-left: 18px; display: grid; gap: 4px; line-height: 1.45; }
.inbox-mail { display: grid; gap: 8px; min-width: 0; margin: 4px 0 8px; }
.inbox-mail .chat-card-kv dd { overflow-wrap: anywhere; min-width: 0; }
.inbox-mail .chat-doc { margin: 0; }
.inbox-toggle { display: flex; gap: 12px; align-items: flex-start; min-height: 44px; cursor: pointer; }
.inbox-toggle input { width: 24px; height: 24px; flex: none; margin-top: 2px; }
.inbox-toggle .block { display: block; }
.delivery-email.resolved { overflow: hidden; }
@media (max-width: 640px) { .inbox-consent .chat-card-actions .btn { width: 100%; } }
.icon-svg.flip { transform: scaleX(-1); } /* the back arrow turned into a forward chevron on the Settings list */

/* Terms, Privacy and Acceptable Use links at the foot of Settings: shown at every width, unlike the phone-only section list. */
.settings-list.settings-legal { display: block; margin-top: 16px; }
.settings-legal a:last-child { border-bottom: 0; }

/* Phone polish. The Settings lists were caught by the phone rule that makes a link inside a card an inline chip, so rows ran together as ragged chips. They are real rows again: one per line, full width, same height, chevron at the right. */
.card.settings-list > a.settings-link { display: flex; width: 100%; box-sizing: border-box; min-height: 48px; align-items: center; justify-content: space-between; gap: 12px; padding: 0 14px; background: none; text-align: left; }
.card.settings-list > a.settings-link .icon-svg { flex: none; width: 18px; height: 18px; color: var(--muted); }
.card.settings-list > a.settings-link:last-child { border-bottom: 0; }
/* Hover only where a pointer can hover: on a phone a tapped row kept its "selected" look (Privacy Policy). */
.settings-list a:hover { background: none; }
@media (hover: hover) { .card.settings-list > a.settings-link:hover { background: var(--hover); } }
.card.settings-list > a.settings-link:active { background: var(--hover); }

/* Lists on a phone: search, each filter, CSV and the main button share one column at the same width with even gaps. */
@media (max-width: 767px) {
  .toolbar { flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 8px; }
  .toolbar > .input, .toolbar > select.input, .toolbar > .btn, .toolbar > input.input:not([type="date"]):not([type="month"]) { flex: none; width: 100%; max-width: none; min-width: 0; box-sizing: border-box; justify-content: center; }
  .toolbar > .grow { display: none; }
}

/* Money found (Carrier) and Margin (Broker). One column, same card style as the Command Center. */
.money-page { max-width: 980px; width: 100%; margin: 0 auto; min-width: 0; }
.money-head { align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.money-head p { margin: 4px 0 0; }
.money-month { width: auto; min-width: 170px; flex: none; }
.money-totals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.money-total .value { font-size: 1.7rem; font-weight: 700; }
.money-total.warn, .money-row.warn { border-color: #b45309; }
.money-sec { gap: 10px; min-width: 0; }
.money-sec h2 { font-size: 1.05rem; margin: 8px 0 0; }
.money-row { display: grid; gap: 8px; min-width: 0; }
.money-row.quiet { opacity: .92; }
.money-top { align-items: baseline; gap: 12px; flex-wrap: wrap; }
.money-amt { font-size: 1.5rem; font-weight: 700; }
.money-act { display: flex; justify-content: flex-end; }
.money-act .btn { min-height: 44px; }
.money-line { padding: 8px 0; border-bottom: 1px solid var(--border); align-items: center; gap: 12px; }
.money-line:last-child { border-bottom: 0; }
.money-hero { display: grid; gap: 8px; }
.money-hero .value { font-size: 2rem; font-weight: 700; }
.money-pct { font-size: 1.3rem; font-weight: 600; }
.money-bar { position: relative; height: 12px; border-radius: 999px; background: var(--hover); margin: 14px 0 26px; }
.money-bar .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--agent-fill, #15803d); }
.money-bar .mark { position: absolute; top: -5px; width: 2px; height: 22px; background: #f59e0b; }
.money-bar .mark em { position: absolute; top: 24px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-style: normal; font-size: .75rem; color: #f59e0b; }
.bad-text { color: #fca5a5; }
@media (max-width: 640px) {
  .money-totals { grid-template-columns: minmax(0, 1fr); }
  .money-act .btn { width: 100%; justify-content: center; }
  .money-month { width: 100%; }
}

/* The first step on a new account: one card, one green button. */
.setup-first { display: grid; gap: 8px; }
.setup-first h3 { margin: 0; font-size: 1.15rem; }
.setup-first p { margin: 0; }
.setup-act { display: flex; }
.setup-act .btn { min-height: 44px; }
@media (max-width: 640px) { .setup-act .btn { width: 100%; justify-content: center; } .setup-card .setup-row { flex-direction: column; align-items: stretch; } .setup-card .setup-row .btn { width: 100%; min-height: 44px; justify-content: center; } }
