:root {
  --bg: #0b0b10;
  --bg2: #13131b;
  --panel: #181822;
  --panel2: #20202c;
  --line: #2a2a38;
  --text: #f2f2f7;
  --muted: #9a9aad;
  --dim: #6c6c80;
  --accent: #9b7bff;
  --accent2: #c9b8ff;
  --blue: #0a84ff;
  --green: #30d158;
  --red: #ff453a;
  --amber: #ffb340;
  --bubble-in: #26262f;
  --radius: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif; }
body { overscroll-behavior: none; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent2); }
.hidden { display: none !important; }

/* ---------- layout ---------- */
#app { display: grid; grid-template-columns: 220px 1fr; height: 100dvh; }
nav.side { background: var(--bg2); border-right: 1px solid var(--line); padding: 18px 10px; display: flex; flex-direction: column; gap: 2px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 800; letter-spacing: .14em; font-size: 15px; }
.brand svg { width: 26px; height: 26px; }
.navbtn { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border: 0; background: none; border-radius: 10px; cursor: pointer; color: var(--muted); text-align: left; width: 100%; }
.navbtn svg { width: 19px; height: 19px; flex: none; }
.navbtn:hover { background: var(--panel); color: var(--text); }
.navbtn.on { background: var(--panel2); color: var(--text); }
.navbtn .badge { margin-left: auto; }
.side .spacer { flex: 1; }
.bridge-pill { font-size: 12px; color: var(--muted); padding: 10px 12px; display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); flex: none; }
.dot.ok { background: var(--green); box-shadow: 0 0 8px var(--green); }
.dot.bad { background: var(--red); }
.dot.mock { background: var(--amber); }
main { overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.view { flex: 1; overflow: auto; min-height: 0; }
.page { padding: 22px 26px 40px; max-width: 1100px; }
.page-h { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-h h1 { font-size: 26px; margin: 0; letter-spacing: -.02em; flex: 1; min-width: 160px; }
.sub { color: var(--muted); font-size: 13px; }

nav.tabs { display: none; }

/* ---------- controls ---------- */
.btn { border: 1px solid var(--line); background: var(--panel2); padding: 8px 14px; border-radius: 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn:hover { border-color: #3a3a4c; }
.btn svg { width: 16px; height: 16px; flex: none; }
a.btn { text-decoration: none; color: inherit; }
optgroup { color: var(--muted); font-weight: 600; }
optgroup option { color: var(--text); font-weight: 400; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.blue { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
.btn.danger { color: var(--red); }
.btn.ghost { background: none; border-color: transparent; color: var(--muted); }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .45; cursor: default; }
input[type=text], input[type=tel], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; width: 100%; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 70px; }
label.f { display: block; margin-bottom: 12px; }
label.f > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; font-weight: 600; letter-spacing: .02em; }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { min-width: 0; }
.grow { flex: 1; }
.badge { background: var(--red); color: #fff; font-size: 11px; font-weight: 700; border-radius: 10px; padding: 1px 7px; min-width: 20px; text-align: center; }
.badge.soft { background: var(--panel2); color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 3px 9px; border-radius: 20px; background: var(--panel2); color: var(--muted); white-space: nowrap; }
.pill i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 6px; background: #2b2540; color: var(--accent2); }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { border: 1px solid var(--line); background: none; border-radius: 20px; padding: 5px 12px; font-size: 13px; cursor: pointer; white-space: nowrap; color: var(--muted); }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.cards { display: grid; gap: 12px; }
.empty { color: var(--muted); text-align: center; padding: 50px 20px; }
.empty b { color: var(--text); display: block; font-size: 17px; margin-bottom: 6px; }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 20px; transition: .2s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(18px); }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stat b { display: block; font-size: 24px; letter-spacing: -.02em; }
.stat span { font-size: 12px; color: var(--muted); }

/* ---------- inbox ---------- */
.inbox { display: grid; grid-template-columns: 340px 1fr; height: 100%; }
.convos { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.convos .head { padding: 16px 14px 10px; display: grid; gap: 10px; }
.convos .head h1 { margin: 0; font-size: 24px; letter-spacing: -.02em; }
.convo-list { overflow: auto; flex: 1; }
.convo { display: flex; gap: 11px; padding: 11px 14px; cursor: pointer; border-bottom: 1px solid #1a1a24; align-items: center; }
.convo:hover { background: var(--bg2); }
.convo.on { background: var(--panel2); }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 15px; flex: none; color: #fff;
  background: linear-gradient(160deg, #7a7a90, #4c4c5e); }
.convo .meta { flex: 1; min-width: 0; }
.convo .top { display: flex; gap: 8px; align-items: baseline; }
.convo .nm { font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.convo .when { font-size: 12px; color: var(--dim); flex: none; }
.convo .prev { font-size: 13.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.convo.unread .nm { color: #fff; }
.convo.unread .prev { color: var(--text); }
.convo .ud { width: 9px; height: 9px; border-radius: 50%; background: var(--blue); flex: none; }
.convo .tagline { display: flex; gap: 5px; margin-top: 4px; flex-wrap: wrap; }

.thread { display: flex; flex-direction: column; min-height: 0; min-width: 0; position: relative; }
.thread-h { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: rgba(11,11,16,.85); backdrop-filter: blur(14px); }
.thread-h .who { flex: 1; min-width: 0; cursor: pointer; }
.thread-h .who b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-h .who small { color: var(--muted); font-size: 12px; }
.thread-h select { width: auto; padding: 5px 8px; font-size: 13px; }
.iconbtn.back { display: none; }
.msgs { flex: 1; overflow: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 3px; }
.daymark { text-align: center; color: var(--dim); font-size: 11.5px; margin: 14px 0 6px; font-weight: 600; }
.b { max-width: min(76%, 520px); padding: 8px 13px; border-radius: 19px; white-space: pre-wrap; word-wrap: break-word; line-height: 1.33; font-size: 15.5px; position: relative; }
.b.in { background: var(--bubble-in); align-self: flex-start; border-bottom-left-radius: 6px; }
.b.out { background: var(--blue); color: #fff; align-self: flex-end; border-bottom-right-radius: 6px; }
.b.out.sms { background: var(--green); }
.b.out.failed { background: #3a1d1d; color: #ffb4ae; }
.b.out.sending { opacity: .65; }
.b.queued { background: none; border: 1.5px dashed #3a5d8f; color: #a9c8f5; align-self: flex-end; border-bottom-right-radius: 6px; }
.bmeta { font-size: 11px; color: var(--dim); align-self: flex-end; margin: 1px 4px 6px; display: flex; gap: 6px; }
.bmeta.left { align-self: flex-start; }
.qactions { display: flex; gap: 6px; align-self: flex-end; margin: 4px 0 10px; flex-wrap: wrap; justify-content: flex-end; }
.composer { border-top: 1px solid var(--line); padding: 10px 12px calc(10px + var(--safe-b)); display: flex; gap: 8px; align-items: flex-end; background: var(--bg); }
.composer textarea { min-height: 40px; max-height: 160px; border-radius: 20px; padding: 9px 14px; resize: none; }
.sendbtn { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--blue); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }
.sendbtn:disabled { background: var(--panel2); color: var(--dim); }
.iconbtn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); display: grid; place-items: center; cursor: pointer; flex: none; color: var(--muted); }
.iconbtn svg, .sendbtn svg { width: 19px; height: 19px; }
.optout-banner { background: #3a1d1d; color: #ffb4ae; padding: 8px 14px; font-size: 13px; }

/* ---------- drawer / modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 50; display: flex; justify-content: center; align-items: center; animation: fade .15s; }
@keyframes fade { from { opacity: 0 } }
@keyframes up { from { transform: translateY(40px); opacity: 0 } }
@keyframes slide { from { transform: translateX(40px); opacity: 0 } }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; width: min(640px, 94vw); max-height: 88dvh; overflow: auto; animation: up .2s; }
.modal.wide { width: min(860px, 96vw); }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index: 2; }
.modal-h h2 { margin: 0; font-size: 18px; flex: 1; }
.modal-b { padding: 18px; }
.modal-f { padding: 12px 18px calc(14px + var(--safe-b)); border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; position: sticky; bottom: 0; background: var(--panel); flex-wrap: wrap; }
.drawer { position: fixed; right: 0; top: 0; bottom: 0; width: min(420px, 100vw); background: var(--panel); border-left: 1px solid var(--line); z-index: 51; overflow: auto; animation: slide .2s; padding-bottom: var(--safe-b); }
.sheet-list { display: grid; gap: 4px; }
.sheet-list button { text-align: left; padding: 12px 14px; border-radius: 10px; border: 0; background: var(--panel2); cursor: pointer; display: flex; gap: 10px; align-items: center; }
.toast { position: fixed; left: 50%; bottom: calc(90px + var(--safe-b)); transform: translateX(-50%); background: #2c2c3a; border: 1px solid var(--line); padding: 10px 16px; border-radius: 12px; z-index: 100; animation: up .2s; max-width: 90vw; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.toast.err { background: #3a1d1d; color: #ffd0cc; }

/* ---------- pipeline ---------- */
.board { display: flex; gap: 12px; padding: 0 26px 24px; overflow-x: auto; align-items: flex-start; min-height: calc(100% - 80px); scroll-snap-type: x mandatory; }
.col { width: 270px; flex: none; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100dvh - 120px); scroll-snap-align: start; }
.col-h { display: flex; align-items: center; gap: 8px; padding: 12px 14px; font-weight: 600; font-size: 14px; }
.col-h i { width: 9px; height: 9px; border-radius: 50%; }
.col-b { padding: 4px 8px 10px; overflow: auto; display: grid; gap: 8px; min-height: 60px; }
.col.drop { border-color: var(--accent); }
.kcard { background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; cursor: grab; }
.kcard:active { cursor: grabbing; }
.kcard b { display: block; font-size: 14px; }
.kcard .prev { font-size: 12.5px; color: var(--muted); margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kcard .foot { display: flex; gap: 6px; margin-top: 7px; font-size: 11.5px; color: var(--dim); align-items: center; flex-wrap: wrap; }

/* ---------- lists / tables ---------- */
.list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.li { display: flex; gap: 12px; align-items: center; padding: 11px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.li:last-child { border-bottom: 0; }
.li:hover { background: var(--panel2); }
.li .meta { flex: 1; min-width: 0; }
.li .meta b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .meta small { color: var(--muted); font-size: 12.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.bulkbar { position: sticky; bottom: 0; background: var(--panel2); border: 1px solid var(--accent); border-radius: 12px; padding: 10px 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; box-shadow: 0 -10px 30px rgba(0,0,0,.4); }

.qcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 10px; }
.qcard .top { display: flex; gap: 10px; align-items: center; }
.qcard .top .meta { flex: 1; min-width: 0; }
.qcard .top b { display: block; }
.qcard .top small { color: var(--muted); font-size: 12px; }
.qcard .ctx { font-size: 12.5px; color: var(--muted); background: var(--bg2); border-radius: 9px; padding: 7px 10px; }
.qcard textarea { min-height: 64px; }
.qcard .acts { display: flex; gap: 8px; flex-wrap: wrap; }

.step { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; position: relative; }
.step-h { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.step-h .num { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.step-h input[type=number] { width: 70px; }
.step-h select { width: auto; }
.rule { display: grid; grid-template-columns: 1.2fr 1fr 1fr auto; gap: 8px; margin-bottom: 8px; align-items: center; }
.hint { font-size: 12px; color: var(--dim); margin-top: 4px; }
.hint code { background: var(--panel2); padding: 1px 5px; border-radius: 5px; color: var(--accent2); }
.seg-swatch { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.timeline { display: grid; gap: 8px; font-size: 13px; }
.timeline div { display: flex; gap: 8px; color: var(--muted); }
.timeline div time { color: var(--dim); flex: none; width: 74px; font-size: 12px; }
.section-t { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin: 18px 0 8px; }

/* ---------- login ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(900px 500px at 50% -10%, rgba(155,123,255,.18), transparent 60%), var(--bg); }
.login .card { width: min(380px, 100%); padding: 28px; }
.login h1 { margin: 10px 0 4px; letter-spacing: .2em; font-size: 22px; }

/* ---------- mobile ---------- */
@media (max-width: 820px) {
  #app { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  nav.side { display: none; }
  nav.tabs { display: flex; border-top: 1px solid var(--line); background: rgba(19,19,27,.94); backdrop-filter: blur(16px); padding: 6px 4px calc(6px + var(--safe-b)); }
  nav.tabs button { flex: 1; border: 0; background: none; color: var(--dim); display: grid; justify-items: center; gap: 2px; font-size: 10.5px; padding: 4px 0; position: relative; cursor: pointer; }
  nav.tabs button svg { width: 24px; height: 24px; }
  nav.tabs button.on { color: var(--accent2); }
  nav.tabs .badge { position: absolute; top: 0; left: 55%; font-size: 10px; padding: 0 5px; min-width: 16px; }
  .page { padding: calc(14px + var(--safe-t)) 14px 30px; }
  .page-h h1 { font-size: 28px; }
  .inbox { grid-template-columns: 1fr; }
  .convos .head { padding-top: calc(14px + var(--safe-t)); }
  .inbox.open .convos { display: none; }
  .inbox:not(.open) .thread { display: none; }
  .thread-h { padding-top: calc(10px + var(--safe-t)); }
  .iconbtn.back { display: grid; }
  .thread-h select { max-width: 112px; }
  .thread-h .who small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
  .composer { padding-bottom: 10px; }
  .board { padding: 0 14px 20px; }
  .col { width: 84vw; max-height: none; }
  .modal { width: 100vw; max-height: 94dvh; border-radius: 18px 18px 0 0; align-self: flex-end; }
  .overlay { align-items: flex-end; }
  .rule { grid-template-columns: 1fr 1fr; }
  .toast { bottom: calc(80px + var(--safe-b)); }
  .b { max-width: 82%; }
}

/* ---------- v3: Launch Control, campaigns, AI, calls ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.kpi { text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: 14px; padding: 14px; cursor: pointer; color: var(--text); }
.kpi b { display: block; font-size: 30px; letter-spacing: -.03em; line-height: 1.1; color: var(--muted); }
.kpi span { font-size: 12.5px; color: var(--muted); }
.kpi.live b { color: var(--text); }
.kpi.live.blue { border-color: #0a84ff66; } .kpi.live.blue b { color: #3ea0ff; }
.kpi.live.violet { border-color: #9b7bff66; } .kpi.live.violet b { color: var(--accent2); }
.kpi.live.orange { border-color: #ff6b3d66; } .kpi.live.orange b { color: #ff8a5c; }
.kpi.live.green { border-color: #30d15866; } .kpi.live.green b { color: var(--green); }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 10px; }
.qa { border: 1px solid var(--line); background: var(--bg2); border-radius: 12px; padding: 12px 6px; display: grid; justify-items: center; gap: 6px; cursor: pointer; color: var(--text); font-size: 12.5px; }
.qa svg { width: 22px; height: 22px; color: var(--accent2); }
.banner { display: flex; gap: 10px; align-items: center; background: #3a2e12; color: #ffd98a; border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; cursor: pointer; font-size: 13.5px; }
.banner.bad { background: #3a1d1d; color: #ffb4ae; } .banner span:nth-child(2) { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.list.flat { border: 0; background: none; } .list.flat .li { padding: 9px 2px; }
.stats3 { gap: 10px; margin: 10px 0 4px; } .stats3 > div { flex: 1; } .stats3 b { display: block; font-size: 22px; letter-spacing: -.02em; } .stats3 span { font-size: 12px; color: var(--muted); }
.legend { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; } .sw.sent { background: #0a84ff; } .sw.recv { background: #30d158; }
.chart { width: 100%; height: auto; display: block; margin-top: 6px; }
.chart .grid { stroke: var(--line); stroke-width: 1; } .chart .axis { fill: var(--dim); font-size: 11px; }
.chart .bar-sent { fill: #0a84ff; } .chart .bar-recv { fill: #30d158; }
.stagebar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 2px; margin-top: 12px; }
.camprow { padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; display: grid; gap: 6px; }
.camprow:last-child { border-bottom: 0; }
.progress { height: 6px; border-radius: 4px; background: var(--line); overflow: hidden; } .progress i { display: block; height: 100%; background: var(--blue); border-radius: 4px; }
.stat b small { font-size: 14px; color: var(--muted); font-weight: 500; }
.aiwrite { display: flex; gap: 8px; margin-bottom: 10px; } .aiwrite input { flex: 1; }
.pill.intent { background: transparent; border: 1px solid; font-weight: 600; }
.aibar { display: flex; gap: 10px; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); background: var(--bg2); }
.aibar .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iconbtn.ai { color: var(--accent2); border-color: #9b7bff55; }
a.iconbtn { text-decoration: none; }
.iconbtn.sm { width: 32px; height: 32px; } .iconbtn.sm svg { width: 16px; height: 16px; }
.callmark { align-self: center; display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); background: var(--bg2); border: 1px solid var(--line); border-radius: 20px; padding: 4px 12px; margin: 8px 0; max-width: 90%; }
.callmark svg { width: 13px; height: 13px; flex: none; }
.xbtn { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 0 0 2px; font-size: 11px; }
code.cmd, pre.code { display: block; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--accent2); white-space: pre-wrap; overflow-x: auto; }
@media (max-width: 820px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi b { font-size: 26px; }
  .grid2 { grid-template-columns: 1fr; }
  .quick { gap: 8px; }
  .aiwrite { flex-direction: column; }
  .thread-h select { max-width: 92px; }
}
/* inline icons inside titles */
b > svg, h2 > svg, .section-t > svg { width: 1.1em; height: 1.1em; vertical-align: -0.18em; margin-right: 2px; }
.step .row.wrap { flex-wrap: wrap; } .step .row.wrap > * { min-width: 120px; flex: 1; } .step .row.wrap > .btn { flex: none; min-width: 0; }
.chanbtn { height: 38px; padding: 0 10px; border-radius: 19px; border: 1px solid var(--line); background: var(--panel); color: #3ea0ff; font-weight: 700; font-size: 12px; cursor: pointer; flex: none; }
.chanbtn.sms { color: var(--green); border-color: #30d15855; }
.vmplay{display:block;width:min(320px,90%);margin:4px auto 10px;height:36px}
/* private team notes (amber = internal, never sent) */
.notecard { align-self: center; width: min(460px, 92%); background: #2c2614; border: 1px solid #6b5a22; color: #f3e6b0; border-radius: 12px; padding: 8px 12px; margin: 8px 0; font-size: 14px; }
.notecard .nh { font-size: 11.5px; color: #d6b85a; margin-bottom: 3px; }
.notecard .nb { white-space: pre-wrap; word-break: break-word; }
.notecard .sub { color: #c9b57a; }
.notecard.pinned { border-color: #c99a2e; box-shadow: inset 3px 0 0 #c99a2e; }
.list .notecard { width: auto; margin: 0 0 6px; }
.pinbar { display: flex; gap: 8px; align-items: center; background: #2c2614; color: #f3e6b0; border-bottom: 1px solid #6b5a22; padding: 7px 14px; font-size: 13px; cursor: pointer; }
.pinbar .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer.notemode { background: #231e10; border-top: 1px solid #6b5a22; }
.composer.notemode textarea { background: #2c2614; border-color: #c99a2e; color: #f3e6b0; }
.notebtn.on { background: #c99a2e; border-radius: 50%; }
.chanbtn.phone { color: var(--text); border-color: var(--line); }
