:root {
  --bg: #0f1115; --panel: #181b22; --border: #2a2f3a;
  --text: #e8eaf0; --muted: #8b93a5;
  --accent: #7c5cff; --accent-hover: #6a4be6;
  --good: #4ade80; --bad: #f87171;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px;
  overflow-x: clip;
}
main { max-width: 1000px; margin: 0 auto; padding: 24px 20px 80px; }
h1 { font-size: 26px; margin: 18px 0 14px; }
h2 { font-size: 17px; margin: 28px 0 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 12px 20px; background: var(--panel); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 700; font-size: 18px; }
.brand.big { font-size: 28px; }
.topbar nav { display: flex; gap: 4px; flex: 1; }
.topbar nav a { color: var(--muted); padding: 7px 13px; border-radius: 8px; }
.topbar nav a:hover { color: var(--text); text-decoration: none; background: #21252e; }
.topbar nav a.active { color: var(--text); background: #262b36; }

button, .button {
  font: inherit; cursor: pointer; border: 1px solid var(--border);
  background: #21252e; color: var(--text); padding: 8px 16px; border-radius: 8px;
  display: inline-block;
}
button:hover, .button:hover { background: #2a2f3a; text-decoration: none; }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.primary:hover { background: var(--accent-hover); }
button.danger { border-color: #5c2a2a; color: var(--bad); }
button.ghost { background: transparent; }
button.small { padding: 4px 10px; font-size: 13px; }
button.full { width: 100%; }
.big-btn { padding: 12px 22px; font-size: 16px; margin-top: 14px; }

input[type=text], input[type=password], textarea, select, input[type=file] {
  font: inherit; background: #12151b; color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px;
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { width: 100%; resize: vertical; line-height: 1.45; }

.stats { display: flex; gap: 14px; flex-wrap: wrap; margin: 16px 0; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px 22px; min-width: 130px; }
.stat .num { font-size: 26px; font-weight: 700; }
.stat .label { color: var(--muted); font-size: 13px; margin-top: 2px; }

table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: none; }
tr.dim td { opacity: .45; }

.badge { padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; text-transform: capitalize; }
.badge.sending { background: #2b2360; color: #b0a4ff; }
.badge.done { background: #143a26; color: var(--good); }
.badge.paused { background: #3a3214; color: #fbbf24; }
.badge.canceled, .badge.draft { background: #2a2f3a; color: var(--muted); }

.flash { background: #1d2436; border: 1px solid #34406b; padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; }
.flash.error { background: #361d1d; border-color: #6b3434; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 14px; }
.good { color: var(--good); }
.bad { color: var(--bad); }
.inline { display: inline; }

.row-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 14px 0; }
.filter-bar { display: flex; gap: 8px; margin: 14px 0; }
.filter-bar input[type=text] { flex: 1; }
.upload-form { display: flex; gap: 8px; align-items: center; }
.pager { display: flex; gap: 16px; justify-content: center; margin: 18px 0; }

.compose-form label { display: block; margin: 14px 0 6px; color: var(--muted); font-size: 13px; }
.compose-form input[type=text] { width: 100%; }
.seg-info { margin-top: 6px; font-size: 13px; }
.test-form { display: flex; gap: 8px; }
.message-preview { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px; white-space: pre-wrap; font-family: inherit; }

.login-page { display: grid; place-items: center; min-height: 100vh; }
.login-card { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 36px; width: 340px; text-align: center; }
.login-card input { width: 100%; margin: 16px 0 12px; }

.audience-bar { display: flex; gap: 14px; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.audience-bar label { display: block; margin: 0 0 5px; color: var(--muted); font-size: 12px; }
.audience-bar select, .audience-bar input { min-width: 150px; }
input[type=date] { font: inherit; background: #12151b; color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; }

.event-picker { min-width: 260px; }
.event-list { max-height: 150px; overflow-y: auto; background: #12151b; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; }
.event-item { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); cursor: pointer; margin: 0; }
.event-item input { accent-color: var(--accent); }
.audience-bar label.event-item { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; color: var(--text); }
.audience-bar .event-item input { min-width: 0; width: auto; }
.event-item.all-item { border-bottom: 1px solid var(--border); padding-bottom: 7px; margin-bottom: 2px; }
button:disabled { opacity: .45; cursor: not-allowed; }

.header-counts { display: flex; gap: 16px; align-items: center; margin-right: 6px; white-space: nowrap; }
.hc { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.hc strong { color: var(--text); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-good { background: var(--good); }
.dot-bad { background: var(--bad); }
@media (max-width: 820px) { .header-counts { display: none; } }
@media (max-width: 700px) {
  /* nav scrolls sideways inside the bar instead of widening the page */
  .topbar { overflow-x: auto; gap: 14px; padding: 10px 14px; }
  .topbar nav a { padding: 7px 10px; font-size: 14px; white-space: nowrap; }
  .topbar .brand { white-space: nowrap; }
}

/* ---- replies inbox (two-pane) ---- */
.inbox {
  display: flex; height: calc(100vh - 200px); min-height: 420px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
}
.inbox-list { width: 320px; flex: 0 0 320px; border-right: 1px solid var(--border); overflow-y: auto; }
.inbox-filter { display: flex; gap: 6px; padding: 12px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--panel); z-index: 2; flex-wrap: wrap; }
.pill { padding: 4px 12px; border-radius: 20px; border: 1px solid var(--border); color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.pill:hover { text-decoration: none; color: var(--text); }
.pill.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.thread-item { display: block; padding: 11px 14px; border-bottom: 1px solid var(--border); color: var(--text); }
.thread-item:hover { background: #1e232e; text-decoration: none; }
.thread-item.sel { background: #232a3a; }
.thread-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.thread-who { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-time { font-size: 11px; white-space: nowrap; }
.thread-preview { font-size: 13px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-empty { padding: 30px; text-align: center; }
.inbox-thread { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.thread-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.thread-head-name { font-weight: 700; }
.thread-back { display: none; font-size: 20px; padding: 4px 8px; }
.thread-msgs { flex: 1; overflow-y: auto; padding: 18px 18px 8px; }
.msg-row { display: flex; flex-direction: column; margin-bottom: 12px; align-items: flex-start; }
.msg-row.out { align-items: flex-end; }
.msg-bubble {
  background: #262c38; color: var(--text); border-radius: 16px; border-bottom-left-radius: 5px;
  padding: 8px 13px; max-width: 72%; font-size: 14px; line-height: 1.4;
  white-space: pre-wrap; overflow-wrap: break-word;
}
.msg-row.out .msg-bubble { background: var(--accent); color: #fff; border-radius: 16px; border-bottom-right-radius: 5px; }
.msg-time { font-size: 10.5px; margin-top: 3px; }
.thread-compose { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--border); }
.thread-compose input[type=text] { flex: 1; }
@media (max-width: 820px) {
  .inbox { height: calc(100vh - 160px); }
  .inbox-list { width: 100%; flex: 1; border-right: none; }
  .inbox-thread { display: none; }
  .inbox.thread-open .inbox-list { display: none; }
  .inbox.thread-open .inbox-thread { display: flex; }
  .inbox.thread-open .thread-back { display: inline-block; }
}

/* ---- campaign audience list ---- */
.aud-list { line-height: 1.9; }
.aud-ev {
  display: inline-block; background: #1c212c; border: 1px solid var(--border);
  border-radius: 8px; padding: 2px 9px; margin: 2px 4px 2px 0; font-size: 13px;
}

/* ---- notification bell ---- */
.notif-wrap { position: relative; }
.notif-bell { position: relative; font-size: 15px; padding: 6px 10px; }
.notif-badge {
  position: absolute; top: -5px; right: -5px;
  background: var(--bad); color: #fff; font-size: 10px; font-weight: 700;
  border-radius: 10px; padding: 1px 5px; line-height: 1.4;
}
.notif-panel {
  position: absolute; right: 0; top: 42px; width: 330px; max-height: 430px; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  z-index: 60; box-shadow: 0 14px 36px #000a;
}
.notif-head { padding: 11px 14px; font-weight: 600; border-bottom: 1px solid var(--border); }
.notif-item { padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: #202741; }
.notif-title { font-weight: 600; }
.notif-body { margin-top: 2px; line-height: 1.35; }
.notif-time { font-size: 11px; margin-top: 3px; }
.notif-empty { padding: 18px 14px; text-align: center; font-size: 13px; }
@media (max-width: 700px) {
  /* the topbar scrolls horizontally on phones, which would clip an absolute
     panel — fixed positioning escapes it */
  .notif-panel { position: fixed; left: 10px; right: 10px; top: 60px; width: auto; }
}

.when-bar { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.when-opt { display: flex; align-items: center; gap: 8px; margin: 0 !important; font-size: 14px !important; color: var(--text) !important; cursor: pointer; }
.when-opt input { accent-color: var(--accent); }
input[type=datetime-local] { font: inherit; background: #12151b; color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; }
input[type=datetime-local]:disabled { opacity: .4; }
.badge.scheduled { background: #16324a; color: #7cc4fa; }

.tag-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 12px; border-radius: 20px; font-size: 13px; font-weight: 600; border: 1px solid var(--border); background: transparent; color: var(--muted); }
.tag-chip.clickable { cursor: pointer; }
.tag-chip.off { background: transparent; border-color: var(--border); color: var(--muted); }
.tag-chip.off:hover { border-color: var(--muted); color: var(--text); }
.tag-x { background: none; border: none; color: inherit; font-size: 14px; padding: 0 0 0 2px; cursor: pointer; line-height: 1; }
.tag-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-left: 2px; }
.tag-filter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.tag-manager { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.tag-pill-form { display: inline-flex; }
.new-tag-form { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.new-tag-form input[type=color] { width: 42px; height: 36px; padding: 3px; background: #12151b; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
td .inline + .inline { margin-left: 4px; }

.reply-form { display: flex; gap: 8px; padding: 4px 0 8px; }
.reply-form input[type=text] { flex: 1; }
.reply-row td { border-bottom: 1px solid var(--border); background: #14171e; }

.ctag-row { display: flex; gap: 6px; flex-wrap: wrap; max-width: 220px; }
.tag-add { min-width: 0 !important; width: 52px; padding: 3px 6px !important; font-size: 13px; }
.small-text { font-size: 12px; }
.nowrap { white-space: nowrap; }
.reply-form select { min-width: 110px; }

/* ---- compose: two columns with live phone preview ---- */
.compose-cols {
  display: grid; grid-template-columns: minmax(0, 560px) auto;
  column-gap: 44px; align-items: start;
}
.compose-top { grid-column: 1; min-width: 0; }
.compose-rest { grid-column: 1; min-width: 0; }
.compose-top select, .compose-top input[type=text] { width: 100%; max-width: 100%; }
.compose-left { max-width: 560px; }
.phone-wrap { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: 76px; margin-top: 24px; }
@media (max-width: 980px) {
  .compose-cols { grid-template-columns: 1fr; }
  /* phone sits directly under the message box, before scheduling */
  .phone-wrap { grid-column: 1; grid-row: auto; position: static; margin: 20px auto 8px; }
}
.phone {
  width: 300px; background: #111; border-radius: 46px; padding: 11px;
  border: 1px solid #3a3f4a; box-shadow: 0 14px 44px #00000088;
}
.phone-screen {
  background: #fff; border-radius: 36px; overflow: hidden;
  display: flex; flex-direction: column; min-height: 500px;
}
.phone-pill { width: 86px; height: 22px; background: #111; border-radius: 12px; margin: 10px auto 2px; }
.phone-header { text-align: center; padding: 4px 10px 10px; border-bottom: 1px solid #e5e5ea; }
.phone-avatar {
  width: 44px; height: 44px; margin: 0 auto 4px; background: #e5e5ea;
  border-radius: 50%; display: grid; place-items: center; font-size: 22px;
}
.phone-sender { color: #000; font-size: 12px; }
.phone-thread { padding: 14px 12px; flex: 1; }
.phone-date { text-align: center; color: #8e8e93; font-size: 11px; margin-bottom: 10px; }
.bubble {
  background: #e9e9eb; color: #000; border-radius: 18px; border-bottom-left-radius: 6px;
  padding: 8px 12px; max-width: 86%; width: fit-content;
  font-size: 14px; line-height: 1.35; white-space: pre-wrap; overflow-wrap: break-word;
}
.bubble .bubble-link { color: #007aff; text-decoration: underline; }
.bubble .bubble-placeholder { color: #8e8e93; }

/* ---- fine-tune the list (compose) ---- */
.tune { margin: 14px 0 4px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); overflow: hidden; }
.tune.active { border-color: #3a3350; }
.tune-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; background: linear-gradient(90deg, #1c2029, var(--panel)); }
.tune-head:hover { background: linear-gradient(90deg, #21252e, var(--panel)); }
.tune-head:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tune-head .caret { color: var(--muted); font-size: 11px; }
.tune-title { font-weight: 600; font-size: 14.5px; }
.tune-sub { margin-left: auto; color: var(--muted); font-size: 13px; }
.tune.active .tune-sub { color: var(--text); }
.tune-body { border-top: 1px solid var(--border); }
.lanes { display: grid; grid-template-columns: 1fr 1fr; }
.lane { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.lane + .lane { border-left: 1px solid var(--border); }
.lane-top { display: flex; align-items: center; gap: 9px; }
.lane-badge { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-size: 14px; font-weight: 700; line-height: 1; flex: none; }
.lane.cut .lane-badge { background: #f8717118; color: var(--bad); border: 1px solid #f8717140; }
.lane.add .lane-badge { background: #4ade8018; color: var(--good); border: 1px solid #4ade8040; }
.lane-t { font-weight: 600; font-size: 14.5px; }
.lane-hint { margin-left: auto; color: var(--muted); font-size: 12.5px; }
.lane textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.55; min-height: 104px; }
.lane.cut textarea:focus { border-color: var(--bad); }
.lane.add textarea:focus { border-color: var(--good); }
.lane-tools { display: flex; gap: 8px; align-items: center; }
.file-btn { cursor: pointer; font-size: 13px; padding: 4px 10px; }
.readout { font-size: 13px; line-height: 1.7; color: var(--muted); min-height: 40px; }
.readout b { color: var(--text); font-variant-numeric: tabular-nums; }
.readout .good { color: var(--good); }
.readout .bad { color: var(--bad); }
.readout .warn { color: #fbbf24; }
.readout .idle { color: #6a7184; }
.tally { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--border); background: #14171e; }
.tally-math { display: flex; align-items: baseline; gap: 10px; font-variant-numeric: tabular-nums; }
.tally-base { color: var(--muted); font-size: 15px; }
.tally-arrow { color: #6a7184; }
.tally-final { font-size: 24px; font-weight: 700; }
.tally-lbl { color: var(--muted); font-size: 13px; }
.tally-delta { margin-left: auto; font-size: 13px; display: flex; gap: 14px; }
.tally-delta .good { color: var(--good); }
.tally-delta .bad { color: var(--bad); }
.tally-delta .idle { color: #6a7184; }
.tune-foot { padding: 10px 16px 14px; margin: 0; font-size: 12.5px; border-top: 1px solid var(--border); }
@media (max-width: 760px) {
  .lanes { grid-template-columns: 1fr; }
  .lane + .lane { border-left: none; border-top: 1px solid var(--border); }
}
.file-note { font-size: 12.5px; min-height: 0; }
.file-note .good { color: var(--good); }
.file-note .bad { color: var(--bad); }
.file-note .warn { color: #fbbf24; }

/* ---- reblast ---- */
.redo-cell { width: 40px; text-align: right; }
a.redo {
  display: inline-block; width: 28px; height: 28px; line-height: 26px; text-align: center;
  border: 1px solid var(--border); border-radius: 8px; color: var(--muted);
  font-size: 15px; text-decoration: none;
}
a.redo:hover { background: var(--accent); border-color: var(--accent); color: #fff; text-decoration: none; }
.reblast-card {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid #3a3350; border-left: 3px solid var(--accent);
  border-radius: 12px; padding: 14px 16px;
}
.reblast-main { display: flex; align-items: center; gap: 13px; flex: 1; min-width: 260px; }
.reblast-icon {
  width: 34px; height: 34px; flex: none; display: grid; place-items: center;
  border-radius: 9px; background: #7c5cff22; border: 1px solid #7c5cff55; color: var(--accent); font-size: 18px;
}
.reblast-t { font-size: 15px; }
.reblast-sub { font-size: 12.5px; margin-top: 2px; }
.reblast-sub .bad { color: var(--bad); }
[hidden] { display: none !important; }

/* ---- tagged (VIP) conversations in the inbox ---- */
.tag-chip.tiny { font-size: 10.5px; padding: 1px 7px; font-weight: 700; letter-spacing: .03em; }
/* inset shadow rather than a real border, so nothing shifts by 3px */
.thread-item.tagged { box-shadow: inset 3px 0 0 var(--tagc); background: #1c1b16; }
.thread-item.tagged { background: color-mix(in srgb, var(--tagc) 7%, #181b22); }
.thread-item.tagged .thread-who { color: var(--tagc); }
.thread-item.tagged:hover { background: color-mix(in srgb, var(--tagc) 12%, #1e232e); }
.thread-item.tagged.sel { background: color-mix(in srgb, var(--tagc) 16%, #232a3a); }
.thread-head.tagged { box-shadow: inset 3px 0 0 var(--tagc); }
.msg-row.tagged .msg-bubble { border: 1px solid color-mix(in srgb, var(--tagc) 45%, transparent); }
.pill.vip-pill { border-color: #fbbf2455; color: #fbbf24; }
.pill.vip-pill:hover { border-color: #fbbf24; }
.pill.vip-pill.on { background: #fbbf24; border-color: #fbbf24; color: #1a1408; }
.inbox-filter .pill { padding: 4px 10px; font-size: 12px; }

/* ---- last sheet sync line (dashboard) ---- */
.sync-line {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  margin: -4px 0 18px; padding: 9px 14px; font-size: 13.5px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--panel); color: var(--muted);
}
.sync-line strong { color: var(--text); font-weight: 600; }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--good); }
.sync-line.stale { border-color: #5c4a1e; }
.sync-line.stale .sync-dot, .sync-line.never .sync-dot { background: #fbbf24; }
.sync-line.old { border-color: #5c2a2a; }
.sync-line.old .sync-dot { background: var(--bad); }
.sync-warn { color: #fbbf24; }
.sync-line.old .sync-warn { color: var(--bad); }

/* ---- split a blast into parts ---- */
.parts-panel { margin-top: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); overflow: hidden; }
.parts-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 13px 16px; border-bottom: 1px solid var(--border); background: linear-gradient(90deg, #1c2029, var(--panel)); }
.parts-top label { color: var(--muted); font-size: 13px; }
.parts-top input[type=number] { width: 74px; background: #12151b; color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font: inherit; }
.parts-top .muted { font-size: 13px; }
.parts-rows { display: flex; flex-direction: column; }
.part-row { display: flex; align-items: center; gap: 14px; padding: 9px 16px; border-bottom: 1px solid var(--line-soft, #22262f); }
.part-row:last-child { border-bottom: none; }
.part-n { font-weight: 600; font-size: 14px; width: 62px; flex: none; }
.part-size { color: var(--muted); font-size: 13px; width: 120px; flex: none; font-variant-numeric: tabular-nums; }
.part-row input[type=datetime-local] { background: #12151b; color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font: inherit; font-size: 14px; }
.parts-order { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--border); background: #1a1d24; font-size: 12.5px; color: var(--muted); }
.parts-sort { background: transparent; border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 5px 10px; font: inherit; font-size: 12.5px; cursor: pointer; }
.parts-sort:hover { border-color: var(--accent, #7c5cff); }
.parts-foot { padding: 11px 16px 14px; margin: 0; font-size: 12.5px; border-top: 1px solid var(--border); }
@media (max-width: 620px) { .part-row { flex-wrap: wrap; gap: 8px; } .part-size { width: auto; } }

/* ---- credit guard on the compose page ---- */
/* Sits directly above the send button so the money question is answered in the
   same glance as the recipient count. */
.funds-box { margin: 0 0 12px; padding: 11px 14px; border-radius: 10px; font-size: 14px; line-height: 1.5;
  border: 1px solid var(--border); background: #1d2436; color: var(--muted); }
.funds-box b { color: var(--text); }
.funds-box .warn { color: #fbbf24; }
.funds-box.ok { border-color: #2c4a3a; background: #16241d; }
.funds-box.warn-box { border-color: #6b5518; background: #2b2412; color: #fcd34d; }
.funds-box.warn-box b { color: #fde68a; }
.funds-box.short { border-color: var(--bad); background: #361d1d; color: #fca5a5; }
.funds-box.short b { color: #fecaca; }
/* The red "paused, out of credit" banner on a campaign page. */
.flash.funds-halt { line-height: 1.6; }

/* Small third line on a stat tile, e.g. "incl. $166.72 carrier fees". */
.stat .sub-label { font-size: 11px; margin-top: 3px; line-height: 1.3; }


/* ---- "Don't text people who…" rule lane (fine-tune card) ---------------- */
/* Full width above the two paste lanes: its rules apply to the whole send, so
   it shouldn't read as a third peer of remove/add. */
.lane.rule { border-color: #6b2b3a; background: #2a1a20; margin-bottom: 12px; }
.rule-row { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0; flex-wrap: wrap; }
.rule-lbl { font-size: 12px; color: #b9a3aa; padding-top: 5px; min-width: 170px; }
.rule-chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 200px; }
.xtag-chip { cursor: pointer; user-select: none; }
/* An active exclusion is red no matter what color the tag itself is. */
.xtag-chip:not(.off) {
  background: #4a1220; border-color: #e06a84; color: #ff9fb0; font-weight: 600;
}
.rule-camps {
  flex: 1; min-width: 220px; max-height: 168px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px;
  border: 1px solid #3d2a31; border-radius: 8px; padding: 6px; background: #20141a;
}
/* .compose-form label sets display:block + a 14px top margin and wins on
   specificity, so this has to be scoped the same depth to undo it. */
.lane.rule .camp-pick {
  display: flex; align-items: baseline; gap: 8px; cursor: pointer;
  margin: 0; padding: 4px 6px; border-radius: 6px; font-size: 13px;
}
.lane.rule .camp-pick:hover { background: #2e1d24; }
.lane.rule .camp-pick input { margin: 0; flex: none; }
.camp-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.camp-m { font-size: 11px; color: #9a8189; flex: none; }
@media (max-width: 820px) {
  .rule-row { flex-direction: column; gap: 4px; }
  .rule-lbl { min-width: 0; padding-top: 0; }
  .rule-camps { max-height: 200px; }
}
