/* =========================================================
   Design tokens
   ========================================================= */
:root {
  --bg: #f3f4f0;            /* page */
  --surface: #f8f8f6;       /* sidebar / inset areas */
  --panel: #ffffff;         /* cards */
  --line: #e8e9e3;
  --line-strong: #d9dbd3;
  --text: #16201c;
  --muted: #6c736d;
  --faint: #9aa09a;

  --brand: #1e4a40;          /* deep green: primary buttons, FAB */
  --brand-hover: #173b33;
  --lime: #cfec90;           /* active nav pill */
  --lime-ink: #1f3510;
  --coral: #ff7a59;          /* highlighted bar */

  --yellow: #fbe593; --yellow-ink: #5a4500;
  --pink: #f8d5f2;   --pink-ink: #6b1f5f;
  --blue: #d7e4ff;   --blue-ink: #1f3f8a;
  --mint: #cdeee2;   --mint-ink: #145040;
  --peach: #ffdccc;  --peach-ink: #8a3412;
  --lavender: #e6e2ff; --lavender-ink: #4b3fb0;

  --up-bg: #e7f6e6; --up-ink: #1a8a3a; --up-line: #c2e7c6;
  --down-bg: #fdeaea; --down-ink: #d23c3c; --down-line: #f6c9c9;
  --amber: #c27a0e;

  --r-sm: 10px; --r: 16px; --r-lg: 22px;
  --shadow: 0 1px 2px rgba(22, 32, 28, .04), 0 4px 16px rgba(22, 32, 28, .04);
  --shadow-lg: 0 12px 40px rgba(22, 32, 28, .14);
  --font: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
  --side-w: 264px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.5 var(--font); color: var(--text); background: var(--bg); min-height: 100vh; min-height: 100dvh; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; }
.hidden { display: none !important; }
.ico { width: 18px; height: 18px; flex-shrink: 0; display: inline-block; vertical-align: middle; }
.ico.sm { width: 15px; height: 15px; }
.ico.lg { width: 22px; height: 22px; }
[data-icon] { display: inline-flex; }

/* =========================================================
   Shell
   ========================================================= */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }

.sidebar { background: var(--surface); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; padding: 22px 16px 16px; gap: 18px; z-index: 30; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--brand); font-weight: 700; font-size: 25px; letter-spacing: -.03em; padding: 0 8px; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--brand); color: var(--lime); display: grid; place-items: center; font-size: 19px; line-height: 1; padding-bottom: 3px; }

.ws-card { display: flex; gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
.ws-card .ws-ico { width: 34px; height: 34px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); flex-shrink: 0; }
.ws-card .ws-title { font-weight: 600; font-size: 13.5px; }
.ws-card .ws-sub { font-size: 12px; color: var(--muted); }
.ws-card .ws-bar { height: 5px; border-radius: 99px; background: var(--line); margin-top: 6px; overflow: hidden; }
.ws-card .ws-bar span { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.ws-card > div:last-child { flex: 1; min-width: 0; }

.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; color: #34403b; font-weight: 500; font-size: 14.5px; position: relative; transition: background .15s; }
.side-nav a:hover { background: #eeefea; }
.side-nav a.active { background: var(--lime); color: var(--lime-ink); font-weight: 600; }
.side-nav .count { margin-left: auto; background: var(--brand); color: #fff; border-radius: 99px; font-size: 11px; font-weight: 600; padding: 1px 7px; }
.side-nav .sep { height: 1px; background: var(--line); margin: 10px 6px; }

.side-foot { border-top: 1px solid var(--line); padding: 14px 6px 0; display: flex; align-items: center; gap: 10px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--lime); color: var(--lime-ink); display: grid; place-items: center; font-weight: 700; flex-shrink: 0; position: relative; }
.avatar .online { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: #22c55e; border: 2px solid var(--surface); }
.side-foot .who { min-width: 0; flex: 1; }
.side-foot .who b { display: block; font-size: 13.5px; font-weight: 600; }
.side-foot .who span { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 14px 32px; background: rgba(243, 244, 240, .86); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); }
.brand-mobile { display: none; }
.search { position: relative; flex: 0 1 420px; display: flex; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 0 10px 0 12px; height: 42px; }
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(30, 74, 64, .1); }
.search-icon { color: var(--faint); }
.search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; height: 100%; padding: 0 10px; font: inherit; color: var(--text); width: 100%; box-shadow: none !important; }
.search input::-webkit-search-cancel-button { display: none; }
.kbd { font: 500 11.5px var(--font); color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; white-space: nowrap; }
.search-results { position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 6px; max-height: 70vh; overflow-y: auto; min-width: 280px; z-index: 5; }
.search-results .grp { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); padding: 8px 10px 4px; }
.search-results a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; }
.search-results a > div { min-width: 0; flex: 1; }
.search-results a:hover, .search-results a.on { background: var(--surface); }
.search-results .sr-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-results .empty { padding: 16px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); display: grid; place-items: center; color: #3b4741; cursor: pointer; position: relative; padding: 0; }
.icon-btn:hover { border-color: var(--line-strong); }
.icon-btn .dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--coral); border: 2px solid var(--panel); }
.menu-btn { display: none; }
.profile { display: flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; border-radius: 99px; }
.profile:hover { background: #eaebe5; }
.profile .avatar { width: 36px; height: 36px; font-size: 14px; }
.profile b { display: block; font-size: 13.5px; font-weight: 600; line-height: 1.2; }
.profile span { display: block; font-size: 12px; color: var(--muted); line-height: 1.2; }

#view { padding: 8px 32px 64px; width: 100%; max-width: 1360px; }
.tabbar { display: none; }

/* org switcher (sidebar) */
.ws-card { padding: 0; border: 0; background: transparent; display: block; }
.org-btn { width: 100%; height: auto; display: flex; align-items: center; justify-content: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); text-align: left; color: var(--text); }
.org-btn:hover { background: var(--panel); border-color: var(--line-strong); }
.org-btn > svg { color: var(--muted); }
.org-chip { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 12.5px; flex-shrink: 0; letter-spacing: .02em; }
.org-chip.yellow { background: var(--yellow); color: var(--yellow-ink); } .org-chip.pink { background: var(--pink); color: var(--pink-ink); }
.org-chip.blue { background: var(--blue); color: var(--blue-ink); } .org-chip.mint { background: var(--mint); color: var(--mint-ink); }
.org-chip.peach { background: var(--peach); color: var(--peach-ink); } .org-chip.lavender { background: var(--lavender); color: var(--lavender-ink); }
.org-chip.plain { background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.org-txt { min-width: 0; flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.org-txt b { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-txt span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-pop { position: absolute; top: 122px; left: 16px; width: 280px; max-width: calc(100vw - 32px); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 6px; z-index: 50; max-height: 70vh; overflow-y: auto; }
.org-pop .grp, .grp { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); padding: 8px 10px 4px; }
.org-pop .sep { height: 1px; background: var(--line); margin: 6px 4px; }
.org-item { width: 100%; height: auto; display: flex; align-items: center; justify-content: flex-start; gap: 10px; padding: 8px; border: 0; border-radius: 10px; background: transparent; text-align: left; color: var(--text); font-weight: 400; }
.org-item:hover { background: var(--surface); }
.org-item.on { background: var(--surface); }
.org-item > svg { color: var(--brand); }
.org-list { border: 1px solid var(--line); border-radius: var(--r); padding: 4px; margin-bottom: 8px; }

/* =========================================================
   Typography + page heads
   ========================================================= */
h1 { font-size: 30px; line-height: 1.15; letter-spacing: -.025em; font-weight: 600; margin: 0; }
h2 { font-size: 19px; letter-spacing: -.015em; font-weight: 600; margin: 0 0 4px; }
h3 { font-size: 15px; font-weight: 600; margin: 0; }
.sub { color: var(--muted); margin: 6px 0 0; }
.sub b { color: var(--text); font-weight: 600; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.page-head { display: flex; align-items: flex-end; gap: 12px; margin: 14px 0 24px; flex-wrap: wrap; }
.page-head .grow { flex: 1; min-width: 240px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 500; margin-top: 12px; }
.back:hover { color: var(--text); }
.head { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.head .grow { flex: 1; }
.card-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 18px; }
.card-head .grow { flex: 1; min-width: 0; }

/* =========================================================
   Controls
   ========================================================= */
button, .btn { font: 500 14px var(--font); border: 1px solid var(--line); background: var(--panel); color: var(--text); padding: 0 16px; height: 40px; border-radius: 12px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; transition: background .15s, border-color .15s; }
button:hover, .btn:hover { border-color: var(--line-strong); background: #fcfcfb; }
button.primary, .btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
button.primary:hover, .btn.primary:hover { background: var(--brand-hover); }
button.lime { background: var(--lime); border-color: var(--lime); color: var(--lime-ink); font-weight: 600; }
button.danger { color: var(--down-ink); }
button.ghost { border-color: transparent; background: transparent; }
button.ghost:hover { background: #eceee8; }
button.small, .btn.small { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 10px; }
button.icon { width: 36px; padding: 0; }
button:disabled { opacity: .55; cursor: default; }
.btn-lg { height: 46px !important; padding: 0 20px !important; border-radius: 14px !important; font-size: 14.5px !important; }

input, select, textarea { font: 15px var(--font); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; width: 100%; background: var(--panel); color: var(--text); transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(30, 74, 64, .1); }
select { appearance: none; -webkit-appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236c736d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
textarea { resize: vertical; min-height: 220px; line-height: 1.55; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--brand); padding: 0; flex-shrink: 0; }
label { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin: 0 0 6px; }
.field { margin-bottom: 16px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 14px; }
.check { display: flex; gap: 10px; align-items: center; font-size: 14.5px; color: var(--text); font-weight: 400; margin-bottom: 12px; cursor: pointer; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

/* =========================================================
   Cards, chips, badges
   ========================================================= */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; margin-bottom: 18px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 18px; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; }
.dash-grid > .card { margin-bottom: 0; }
.section { margin-top: 18px; }

.chip { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 8px; border: 1px solid transparent; white-space: nowrap; }
.chip.up { background: var(--up-bg); color: var(--up-ink); border-color: var(--up-line); }
.chip.down { background: var(--down-bg); color: var(--down-ink); border-color: var(--down-line); }
.chip.flat { background: var(--surface); color: var(--muted); border-color: var(--line); }
.tag { display: inline-block; font-size: 12px; font-weight: 500; padding: 2px 9px; border-radius: 7px; }
.tag.yellow { background: var(--yellow); color: var(--yellow-ink); }
.tag.pink { background: var(--pink); color: var(--pink-ink); }
.tag.blue { background: var(--blue); color: var(--blue-ink); }
.tag.mint { background: var(--mint); color: var(--mint-ink); }
.tag.peach { background: var(--peach); color: var(--peach-ink); }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 3px 10px; border-radius: 99px; background: var(--surface); color: var(--muted); font-weight: 500; text-transform: capitalize; border: 1px solid var(--line); white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.b-active, .b-replied { background: var(--up-bg); color: var(--up-ink); border-color: var(--up-line); }
.b-paused { background: #fff4df; color: var(--amber); border-color: #f5ddb0; }
.b-completed { background: var(--lavender); color: var(--lavender-ink); border-color: #d3cdfb; }
.b-bounced, .b-error { background: var(--down-bg); color: var(--down-ink); border-color: var(--down-line); }
.b-unsubscribed, .b-manual { background: #f1f1ef; color: #7d827e; }

.ichip { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; flex-shrink: 0; }
.ichip.yellow { background: var(--yellow); color: var(--yellow-ink); }
.ichip.pink { background: var(--pink); color: var(--pink-ink); }
.ichip.blue { background: var(--blue); color: var(--blue-ink); }
.ichip.mint { background: var(--mint); color: var(--mint-ink); }
.ichip.peach { background: var(--peach); color: var(--peach-ink); }
.ichip.lavender { background: var(--lavender); color: var(--lavender-ink); }

/* =========================================================
   Dashboard
   ========================================================= */
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.metric { padding: 18px 20px 4px; border-right: 1px solid var(--line); min-width: 0; }
.metric:first-child { padding-left: 0; }
.metric:last-child { border-right: 0; }
.metric .label { color: var(--muted); font-size: 13.5px; }
.metric .val { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.metric .num { font-size: 30px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; }
.metric .foot { font-size: 12px; color: var(--faint); margin-top: 4px; }

.big-num { font-size: 40px; font-weight: 600; letter-spacing: -.035em; line-height: 1.05; }
.vs { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }

.chart { position: relative; display: flex; align-items: flex-end; gap: 10px; height: 230px; padding: 30px 0 0; margin-top: 18px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; min-width: 0; }
.chart .track { flex: 1; width: 100%; max-width: 64px; background: #f3f3f0; border-radius: 16px; position: relative; display: flex; align-items: flex-end; overflow: hidden; }
.chart .fill { width: 100%; background: #e3e5de; border-radius: 16px; position: relative; min-height: 8px; transition: height .4s ease; }
.chart .col.hi .fill { background: var(--coral); }
.chart .val { position: absolute; top: 8px; left: 0; right: 0; text-align: center; font-size: 12px; color: var(--muted); font-weight: 500; z-index: 1; }
.chart .col.hi .val { color: #fff; }
.chart .x { font-size: 12.5px; color: var(--faint); margin-top: 10px; height: 18px; white-space: nowrap; }
.chart .col.hi .x { color: var(--text); font-weight: 600; }
.chart .avg { position: absolute; left: 0; right: 0; border-top: 1.5px dashed #b9bdb4; z-index: 2; pointer-events: none; }
.chart .avg span { position: absolute; left: 0; top: -12px; background: var(--brand); color: #fff; font-size: 11.5px; font-weight: 600; padding: 3px 14px 3px 8px; border-radius: 6px 0 0 6px; clip-path: polygon(0 0, 86% 0, 100% 50%, 86% 100%, 0 100%); }

.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; margin: 4px 0 14px; }
.week button { flex-direction: column; height: auto; padding: 6px 0; border: 0; background: transparent; gap: 6px; border-radius: 12px; }
.week button:hover { background: var(--surface); }
.week .dow { font-size: 12.5px; color: var(--muted); }
.week .dnum { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; font-weight: 500; font-size: 15px; }
.week button.sel .dnum { background: var(--lavender); color: var(--lavender-ink); font-weight: 600; }
.week .pip { width: 5px; height: 5px; border-radius: 50%; background: var(--coral); margin-top: -2px; }
.week .pip.none { background: transparent; }
.sched-label { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); margin: 6px 0 10px; }
.sched-label::after { content: ""; flex: 1; border-top: 1px dashed var(--line-strong); }
.event { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; margin-bottom: 10px; }
.event .ev-ico { width: 34px; height: 34px; border-radius: 10px; background: rgba(255, 255, 255, .7); display: grid; place-items: center; flex-shrink: 0; }
.event b { display: block; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event span { font-size: 12.5px; opacity: .85; }
.event > div { min-width: 0; flex: 1; }
.event.yellow { background: var(--yellow); color: var(--yellow-ink); }
.event.pink { background: var(--pink); color: var(--pink-ink); }
.event.blue { background: var(--blue); color: var(--blue-ink); }
.event.mint { background: var(--mint); color: var(--mint-ink); }
.event.peach { background: var(--peach); color: var(--peach-ink); }
.event.lavender { background: var(--lavender); color: var(--lavender-ink); }

.mini-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.mini { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: flex; gap: 12px; align-items: center; box-shadow: var(--shadow); min-width: 0; }
.mini .ichip { width: 40px; height: 40px; border-radius: 12px; }
.mini .label { font-size: 12.5px; color: var(--muted); }
.mini .num { font-size: 20px; font-weight: 600; letter-spacing: -.02em; }

/* =========================================================
   Campaign cards
   ========================================================= */
.camp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.camp { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; cursor: pointer; transition: border-color .15s, transform .15s, box-shadow .15s; box-shadow: var(--shadow); display: flex; flex-direction: column; min-width: 0; }
.camp:hover { border-color: var(--line-strong); transform: translateY(-1px); box-shadow: 0 10px 28px rgba(22, 32, 28, .08); }
.camp-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.camp h3 { font-size: 18px; letter-spacing: -.015em; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.camp .desc { color: var(--muted); font-size: 13.5px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: 40px; word-break: break-word; }
.qgrid { display: grid; grid-template-columns: 1fr 1fr; margin-top: 16px; border-top: 1px solid var(--line); }
.qgrid > div { padding: 12px 0; min-width: 0; }
.qgrid > div:nth-child(odd) { border-right: 1px solid var(--line); padding-right: 14px; }
.qgrid > div:nth-child(even) { padding-left: 18px; }
.qgrid > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
.qgrid b { display: block; font-size: 22px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.qgrid span { font-size: 13px; color: var(--muted); }
.camp-foot { display: flex; gap: 14px; align-items: center; color: var(--muted); font-size: 13px; margin-top: auto; padding-top: 12px; }
.camp-foot span { display: inline-flex; align-items: center; gap: 5px; }
.camp-foot .grow { flex: 1; }
.progress { height: 6px; background: #eeefea; border-radius: 99px; overflow: hidden; margin-top: 12px; }
.progress span { display: block; height: 100%; background: var(--brand); border-radius: 99px; }

.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pills button { height: 36px; border-radius: 99px; padding: 0 14px; font-size: 13.5px; }
.pills button.on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* type chooser */
.type-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.type-tabs span { padding: 0 2px 12px; font-weight: 500; color: var(--muted); }
.type-tabs span.on { color: var(--text); border-bottom: 2px solid var(--brand); }
.types { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.type { background: var(--panel); border: 1.5px solid var(--line); border-radius: var(--r-lg); padding: 22px; text-align: left; height: auto; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 0; white-space: normal; font-weight: 400; box-shadow: var(--shadow); min-height: 220px; }
.type:hover { border-color: var(--brand); background: var(--panel); }
.type h3 { font-size: 18px; margin: 18px 0 8px; letter-spacing: -.015em; }
.type p { margin: 0 0 14px; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.type .type-foot { margin-top: auto; display: flex; width: 100%; justify-content: space-between; align-items: center; color: var(--brand); }

/* =========================================================
   Tables
   ========================================================= */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 500; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface); white-space: nowrap; }
td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #fafaf8; }
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.empty { text-align: center; color: var(--muted); padding: 48px 16px; }
.empty .ichip { margin: 0 auto 14px; }
.empty h3 { color: var(--text); margin-bottom: 6px; }
.meter { height: 6px; background: #eeefea; border-radius: 99px; overflow: hidden; width: 90px; display: inline-block; vertical-align: middle; margin-right: 8px; }
.meter > span { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.ok-ico { color: var(--up-ink); }
.warn-ico { color: var(--amber); }
.err-ico { color: var(--down-ink); }

/* =========================================================
   Campaign tabs, sequence editor, unibox
   ========================================================= */
.tabs { display: flex; gap: 4px; background: #e9eae4; padding: 4px; border-radius: 14px; margin-bottom: 22px; overflow-x: auto; width: fit-content; max-width: 100%; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 8px 16px; color: var(--muted); font-weight: 500; border-radius: 10px; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a.active { background: var(--panel); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }

.seq { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px; align-items: start; }
.seq > .card { margin: 0; }
.step-list { min-width: 0; }
.step-list .step { background: var(--panel); border: 1.5px solid var(--line); border-radius: var(--r); padding: 14px; cursor: pointer; margin-bottom: 4px; }
.step-list .step:hover { border-color: var(--line-strong); }
.step-list .step.active { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(30, 74, 64, .08); }
.step .t { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.step .t .n { width: 22px; height: 22px; border-radius: 7px; background: var(--lime); color: var(--lime-ink); font-size: 12px; display: grid; place-items: center; }
.step .s { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 4px; }
.wait { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 12.5px; padding: 6px 0 10px; }
.wait input { width: 58px; padding: 4px 8px; font-size: 13px; border-radius: 8px; text-align: center; }
.vars { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.vars button { height: 28px; font-size: 12px; padding: 0 10px; background: var(--surface); color: var(--brand); border-color: var(--line); border-radius: 8px; font-family: ui-monospace, Menlo, monospace; }

.unibox { display: grid; grid-template-columns: 360px minmax(0, 1fr); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); min-height: 580px; overflow: hidden; box-shadow: var(--shadow); }
.ub-list { border-right: 1px solid var(--line); overflow-y: auto; max-height: 76vh; background: var(--surface); }
.ub-item { padding: 14px 16px; border-bottom: 1px solid var(--line); cursor: pointer; display: flex; gap: 12px; }
.ub-item:hover { background: #f1f2ee; }
.ub-item.sel { background: var(--panel); box-shadow: inset 3px 0 0 var(--brand); }
.ub-item .avatar { width: 36px; height: 36px; font-size: 13px; background: var(--mint); color: var(--mint-ink); }
.ub-item > div { min-width: 0; flex: 1; }
.ub-item.unread .who { font-weight: 700; }
.ub-item.unread .avatar::after { content: ""; position: absolute; top: -1px; right: -1px; width: 10px; height: 10px; border-radius: 50%; background: var(--coral); border: 2px solid var(--surface); }
.ub-item .subj { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ub-item .snip { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ub-item .meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.ub-item .meta .who { color: var(--text); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ub-view { padding: 24px; overflow-y: auto; }
.mail-text { white-space: pre-wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin: 16px 0; word-break: break-word; }
.ub-back { display: none; }

/* misc */
.preview-frame { border: 1px solid var(--line); border-radius: var(--r); padding: 18px; background: #fff; overflow-x: auto; }
.days { display: flex; gap: 8px; flex-wrap: wrap; }
.days label { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; color: var(--text); font-weight: 500; margin: 0; cursor: pointer; background: var(--panel); }
.days label:has(input:checked) { background: var(--lime); border-color: var(--lime); color: var(--lime-ink); }
.sys-row { display: flex; align-items: flex-start; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.sys-row:last-of-type { border-bottom: 0; }
.timeline-row { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.timeline-row .ichip { width: 32px; height: 32px; border-radius: 10px; }
.timeline-row > div { min-width: 0; }

/* modal + toast */
.modal { position: fixed; inset: 0; background: rgba(16, 24, 21, .4); display: grid; place-items: center; z-index: 60; padding: 16px; }
.modal-box { background: var(--panel); border-radius: var(--r-lg); padding: 26px; width: 640px; max-width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal-box h2 { margin-bottom: 8px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--brand); color: #fff; padding: 12px 18px; border-radius: 12px; z-index: 70; max-width: 420px; box-shadow: var(--shadow-lg); font-weight: 500; }
.toast.err { background: var(--down-ink); }
.sheet-nav a { display: flex; align-items: center; gap: 12px; padding: 14px 6px; border-bottom: 1px solid var(--line); font-weight: 500; font-size: 15px; }
.sheet-nav a:last-child { border-bottom: 0; }
.sheet-search { position: relative; margin-bottom: 8px; }
.sheet-search .search-results { position: static; box-shadow: none; border: 0; padding: 4px 0 0; min-width: 0; }

/* =========================================================
   Responsive
   ========================================================= */
@media (min-width: 1700px) {
  #view { max-width: 1560px; padding: 8px 48px 64px; }
  .topbar { padding: 16px 48px; }
}

@media (max-width: 1200px) {
  .dash-grid { grid-template-columns: 1fr; }
  .mini-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* tablet: icon rail */
@media (max-width: 1024px) {
  :root { --side-w: 84px; }
  .sidebar { padding: 20px 12px 14px; align-items: center; }
  .brand-name, .side-nav .lbl, .side-foot .who, .org-btn .org-txt, .org-btn > svg { display: none; }
  .ws-card { width: 100%; }
  .org-btn { padding: 6px; justify-content: center; border: 0; background: transparent; }
  .org-pop { left: 12px; top: 112px; }
  .side-foot { flex-direction: column; }
  .brand { padding: 0; }
  .side-nav { width: 100%; }
  .side-nav a { justify-content: center; padding: 13px 0; }
  .side-nav .count { position: absolute; top: 4px; right: 8px; margin: 0; padding: 0 5px; font-size: 10px; }
  .side-foot { padding: 14px 0 0; justify-content: center; width: 100%; }
  .topbar { padding: 14px 24px; }
  #view { padding: 8px 24px 64px; }
  .profile .who { display: none; }
  .profile { padding: 0; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); padding-bottom: 16px; }
  .metric:nth-child(3) { padding-left: 0; }
  .unibox { grid-template-columns: 300px minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .seq { grid-template-columns: 1fr; }
  .step-list { display: flex; align-items: center; overflow-x: auto; gap: 8px; padding-bottom: 6px; scrollbar-width: thin; }
  .step-list .step { flex: 0 0 190px; margin: 0; }
  .step-list .wait { flex: 0 0 auto; padding: 0; white-space: nowrap; }
  .step-list #add { flex: 0 0 auto; width: auto !important; margin: 0 !important; }
  .unibox { grid-template-columns: 1fr; min-height: 0; }
  .ub-list { max-height: none; border-right: 0; }
  .unibox .ub-view { display: none; }
  .unibox.show-view .ub-list { display: none; }
  .unibox.show-view .ub-view { display: block; }
  .ub-back { display: inline-flex; margin-bottom: 14px; }
}

/* phone: top bar + bottom tab bar with center action */
@media (max-width: 640px) {
  .app { display: block; }
  .sidebar { display: none; }
  .topbar { padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top)); gap: 8px; }
  .brand-mobile { display: inline-flex; font-size: 22px; padding: 0; }
  .brand-mobile .brand-mark { width: 28px; height: 28px; font-size: 17px; }
  .brand-mobile .brand-name { display: inline; }
  .search { display: none; }
  .profile { display: none; }
  .menu-btn { display: grid; }
  .icon-btn { width: 40px; height: 40px; }

  #view { padding: 4px 16px calc(104px + env(safe-area-inset-bottom)); }
  h1 { font-size: 26px; }
  .page-head { margin: 6px 0 18px; }
  .page-head > .btn, .page-head > button { flex: 1 1 auto; }
  .card { padding: 16px; border-radius: 18px; }
  .card-head { flex-wrap: wrap; }

  input, select, textarea { font-size: 16px; }
  button, .btn { height: 44px; }
  button.small, .btn.small { height: 36px; }
  .row { grid-template-columns: 1fr; }
  .head input:not([type=checkbox]), .head select { max-width: none !important; flex: 1 1 140px; }
  .head .check { white-space: nowrap; }

  .metrics { grid-template-columns: 1fr 1fr; border-top: 0; gap: 10px; }
  .metric, .metric:first-child, .metric:nth-child(3) { padding: 14px; border: 1px solid var(--line) !important; border-radius: 16px; background: var(--panel); }
  .metric .num { font-size: 24px; }
  .perf-card { background: transparent; border: 0; padding: 0; box-shadow: none; }
  .perf-card .card-head { padding: 0 2px; }
  .big-num { font-size: 32px; }
  .chart { gap: 5px; height: 190px; }
  .chart .track { border-radius: 10px; }
  .chart .fill { border-radius: 10px; }
  .chart .val { font-size: 10px; }
  .chart .x { font-size: 10.5px; }
  .chart .col:nth-child(even) .x { visibility: hidden; }
  .mini-stats { gap: 10px; }
  .mini { padding: 12px; gap: 10px; }
  .mini .ichip { width: 34px; height: 34px; }
  .camp-grid, .types { grid-template-columns: 1fr; gap: 12px; }
  .type { min-height: 0; }
  .pills { flex-wrap: nowrap; overflow-x: auto; width: 100%; scrollbar-width: none; }
  .pills::-webkit-scrollbar { display: none; }

  /* tables -> stacked cards */
  .table-wrap { background: transparent; border: 0; overflow: visible; box-shadow: none; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: 100%; }
  .table-wrap thead { display: none; }
  .table-wrap tr { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 6px 14px; margin-bottom: 10px; }
  .table-wrap td { border: 0; padding: 7px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: right; min-width: 0; }
  .table-wrap td::before { content: attr(data-label); font-size: 12px; font-weight: 500; color: var(--muted); text-align: left; flex-shrink: 0; }
  .table-wrap td[data-label=""]::before { content: none; }
  .table-wrap td[data-label=""] { justify-content: flex-end; }
  .table-wrap td:first-child { font-size: 15px; text-align: left; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 2px; word-break: break-word; }
  .table-wrap td:first-child::before { content: none; }
  tr.click:hover td { background: transparent; }

  .tabs { width: 100%; }
  textarea { min-height: 180px; }
  .ub-view { padding: 16px; }

  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: rgba(255, 255, 255, .95); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line); border-radius: 22px 22px 0 0;
    padding: 6px 8px calc(8px + env(safe-area-inset-bottom));
    box-shadow: 0 -6px 24px rgba(22, 32, 28, .06);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11.5px; color: var(--faint); font-weight: 500; padding: 6px 0 2px; position: relative; }
  .tabbar a.active { color: var(--brand); font-weight: 600; }
  .tabbar .fab { width: 58px; height: 58px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; margin: -30px auto 0; box-shadow: 0 8px 20px rgba(30, 74, 64, .35); border: 4px solid var(--bg); padding: 0; }
  .tabbar .count { position: absolute; top: 0; left: calc(50% + 6px); background: var(--coral); color: #fff; font-size: 10px; font-weight: 700; border-radius: 99px; padding: 0 5px; line-height: 16px; }

  .modal { padding: 0; place-items: end stretch; }
  .modal-box { width: 100%; max-height: 92vh; max-height: 92dvh; border-radius: 22px 22px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
  .modal-box::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 99px; background: var(--line-strong); margin: -6px auto 14px; }
  .modal-actions > * { flex: 1 1 auto; }
  .toast { left: 16px; right: 16px; bottom: calc(92px + env(safe-area-inset-bottom)); max-width: none; }
}

@media (max-width: 360px) {
  #view { padding-left: 12px; padding-right: 12px; }
  .metric .num { font-size: 21px; }
  .tabbar a { font-size: 10.5px; }
}

/* logo mark holds a lightning-bolt svg */
.brand-mark svg { width: 58%; height: 58%; }

/* ---------- sidebar section labels ---------- */
.nav-label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding: 14px 14px 4px; }

/* ---------- Team inbox ---------- */
.ti-filters { gap: 10px; }
.ti-box { min-height: 620px; }
.ti-box .ub-item { align-items: flex-start; position: relative; }
.ti-owner { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 99px; padding: 1px 8px; margin-top: 6px; }
.ti-owner .ico.sm { width: 12px; height: 12px; }
.ti-count { position: absolute; right: 14px; bottom: 14px; background: var(--coral); color: #fff; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 0 7px; line-height: 18px; }
.ti-box .ub-view { display: flex; flex-direction: column; max-height: 78vh; }
.ti-head { display: flex; gap: 12px; align-items: center; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.ti-thread { flex: 1; overflow-y: auto; padding: 18px 2px; display: flex; flex-direction: column; gap: 10px; min-height: 200px; }
.bubble { max-width: min(78%, 560px); padding: 10px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); align-self: flex-start; word-break: break-word; }
.bubble.out { align-self: flex-end; background: #e6f2dc; border-color: #d3e8c3; border-bottom-right-radius: 6px; }
.bubble.in { border-bottom-left-radius: 6px; }
.b-subj { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.b-body { white-space: pre-wrap; font-size: 14px; line-height: 1.5; }
.b-meta { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.ti-compose { border-top: 1px solid var(--line); padding-top: 12px; }
.ti-compose textarea { min-height: 84px; }

/* ---------- Connections ---------- */
.conn-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.conn-grid .card { margin: 0; display: flex; flex-direction: column; }
.conn-grid .card > p { flex: 1; margin: 0 0 16px; font-size: 13.5px; line-height: 1.55; }
.conn-grid .card-head h2 { margin-bottom: 4px; }
.qr-wrap { text-align: center; min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.qr-img { width: min(280px, 100%); height: auto; image-rendering: pixelated; border: 1px solid var(--line); border-radius: 16px; padding: 10px; background: #fff; }
pre.code { white-space: pre-wrap; word-break: break-all; background: #16201c; color: #e8f5d0; border-radius: 12px; padding: 12px 14px; margin: 0; line-height: 1.6; }

@media (max-width: 1200px) { .conn-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 1024px) { .nav-label { display: none; } }
@media (max-width: 860px) {
  .ti-box .ub-view { max-height: none; }
  .ti-thread { max-height: 60vh; }
}
@media (max-width: 640px) {
  .conn-grid { grid-template-columns: 1fr; gap: 12px; }
  .bubble { max-width: 90%; }
  .ti-filters .pills { order: -1; }
}

/* ---------- loading: top progress bar + skeletons ---------- */
#topbar { position: fixed; left: 0; top: 0; height: 3px; width: 0; background: var(--brand); z-index: 100; opacity: 0; transition: width .25s ease, opacity .3s ease; pointer-events: none; }
#topbar.on { width: 70%; opacity: 1; transition: width 6s cubic-bezier(.1,.6,.2,1), opacity .1s; }
.skel { padding-top: 14px; }
.sk { background: linear-gradient(90deg, #ebece7 0%, #f5f5f2 50%, #ebece7 100%); background-size: 200% 100%; animation: sk 1.2s ease-in-out infinite; border-radius: 14px; }
.sk-h { height: 34px; width: 240px; margin-bottom: 10px; }
.sk-s { height: 16px; width: 360px; max-width: 80%; margin-bottom: 26px; }
.sk-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.sk-card { height: 96px; border-radius: 18px; }
.sk-block { height: 280px; border-radius: 22px; }
@keyframes sk { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@media (max-width: 640px) { .sk-row { grid-template-columns: 1fr 1fr; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } #topbar { transition: none; } }

/* ---------- LinkedIn outreach ---------- */
.setup-steps { margin: 0 0 14px; padding-left: 20px; line-height: 1.6; }
.setup-steps li { margin-bottom: 12px; }
.li-chart { display: flex; align-items: flex-end; gap: 6px; height: 190px; }
.li-day { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; height: 100%; }
.li-bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; background: #f3f3f0; border-radius: 10px; padding: 4px 3px 0; }
.li-bars span { flex: 1; max-width: 9px; min-height: 2px; border-radius: 4px 4px 0 0; }
.li-day small { font-size: 11px; color: var(--faint); margin-top: 6px; }
.funnel-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) 48px; gap: 10px; align-items: center; padding: 7px 0; font-size: 13.5px; }
.funnel-row b { text-align: right; }
.funnel-bar { height: 10px; background: #eeefea; border-radius: 99px; overflow: hidden; }
.funnel-bar i { display: block; height: 100%; background: var(--brand); border-radius: 99px; min-width: 2px; }
.li-step { border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 12px; background: var(--surface); }
.li-step .head input { height: 34px; padding: 4px 8px; text-align: center; }
@media (max-width: 640px) { .li-chart { gap: 3px; height: 150px; } .li-day:nth-child(even) small { visibility: hidden; } }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }

/* ---------- Team inbox, WhatsApp style ---------- */
.wa { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); height: calc(100vh - 120px); min-height: 520px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
.wa.has-people { grid-template-columns: 220px minmax(280px, 360px) minmax(0, 1fr); }
.wa-av { flex: none; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 600; }
.wa-av.all { width: 40px; height: 40px; background: #00a884; color: #fff; }
.wa-people { background: #f7f8f5; border-right: 1px solid var(--line); overflow-y: auto; padding: 8px; }
.wa-people-head { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 8px 10px; }
.wa-person { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 0; background: none; border-radius: 10px; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.wa-person:hover { background: #eceee9; }
.wa-person.on { background: #e1f3ec; }
.wa-pname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.wa-side { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.wa-side-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 8px; font-size: 18px; }
.wa-search { margin: 4px 12px 8px; display: flex; align-items: center; gap: 8px; background: #f0f2f5; border-radius: 10px; padding: 0 12px; color: var(--muted); }
.wa-search input { border: 0; background: none; padding: 9px 0; box-shadow: none; flex: 1; min-width: 0; }
.wa-filters { display: flex; gap: 6px; padding: 0 12px 10px; overflow-x: auto; scrollbar-width: none; }
.wa-filters button { flex: none; border: 0; background: #f0f2f5; color: #54656f; padding: 6px 12px; border-radius: 99px; font-size: 13px; cursor: pointer; }
.wa-filters button.on { background: #d9fdd3; color: #008069; font-weight: 600; }
.wa-list { overflow-y: auto; flex: 1; min-height: 0; }
.wa-item { display: flex; gap: 12px; align-items: center; padding: 0 0 0 14px; cursor: pointer; }
.wa-item:hover { background: #f5f6f6; }
.wa-item.sel { background: #f0f2f5; }
.wa-item-body { flex: 1; min-width: 0; padding: 12px 14px 12px 0; border-bottom: 1px solid #f0f2f5; }
.wa-row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.wa-name { font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-time { font-size: 12px; color: #667781; flex: none; }
.wa-item.unread .wa-time { color: #1fa855; font-weight: 600; }
.wa-item.unread .wa-name { font-weight: 600; }
.wa-snip { font-size: 13.5px; color: #667781; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.wa-ch { font-size: 11px; background: #eef0ff; color: #5b5fc7; padding: 1px 6px; border-radius: 6px; }
.wa-tick { color: #53bdeb; letter-spacing: -3px; margin-right: 3px; }
.wa-badge { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: #25d366; color: #fff; font-size: 12px; display: inline-grid; place-items: center; font-weight: 600; }
.wa-owner { font-size: 11.5px; color: #8696a0; margin-top: 2px; }
.wa-empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.wa-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: #efeae2; }
.wa-blank { margin: auto; text-align: center; padding: 30px; max-width: 420px; }
.wa-blank .ichip { margin: 0 auto 12px; }
.wa-head { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: #f0f2f5; border-bottom: 1px solid #e3e5e0; }
.wa-hname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-hsub { font-size: 12.5px; color: #667781; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-back { display: none; border: 0; background: none; padding: 6px; cursor: pointer; }
.wa-thread { flex: 1; overflow-y: auto; padding: 16px 6%; display: flex; flex-direction: column; gap: 3px;
  background-color: #efeae2; background-image: radial-gradient(rgba(0,0,0,.035) 1px, transparent 1px); background-size: 18px 18px; }
.wa-day { align-self: center; margin: 10px 0 6px; }
.wa-day span { background: #fff; color: #54656f; font-size: 12px; padding: 5px 12px; border-radius: 8px; box-shadow: 0 1px .5px rgba(11,20,26,.13); }
.wa-msg { max-width: min(75%, 560px); padding: 6px 8px 8px 9px; border-radius: 8px; font-size: 14.2px; line-height: 1.38; box-shadow: 0 1px .5px rgba(11,20,26,.13); position: relative; word-wrap: break-word; }
.wa-msg.in { align-self: flex-start; background: #fff; border-top-left-radius: 0; }
.wa-msg.out { align-self: flex-end; background: #d9fdd3; border-top-right-radius: 0; }
.wa-text { white-space: pre-wrap; }
.wa-meta { float: right; font-size: 11px; color: #667781; margin: 6px 0 -4px 10px; white-space: nowrap; }
.wa-sender { font-size: 12.5px; font-weight: 600; margin-bottom: 2px; }
.wa-sender.out { color: #008069; }
.wa-subj { font-weight: 600; margin-bottom: 4px; }
.wa-compose { display: flex; align-items: flex-end; gap: 8px; padding: 10px 14px; background: #f0f2f5; }
.wa-compose textarea { flex: 1; resize: none; border: 0; border-radius: 22px; padding: 11px 16px; background: #fff; min-height: 44px; max-height: 140px; box-shadow: none; line-height: 1.35; }
.wa-send { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: #00a884; color: #fff; display: grid; place-items: center; cursor: pointer; }
.wa-send:hover { background: #008f72; }
@media (max-width: 1100px) { .wa.has-people { grid-template-columns: 76px minmax(260px, 340px) minmax(0, 1fr); } .wa-people .wa-pname, .wa-people-head { display: none; } .wa-person { justify-content: center; position: relative; } .wa-person .wa-badge { position: absolute; top: 2px; right: 4px; } }
@media (max-width: 760px) {
  .wa, .wa.has-people { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); height: calc(100dvh - 130px); border-radius: 12px; }
  .wa-people { display: flex; gap: 4px; padding: 6px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; }
  .wa-person { flex: none; width: auto; flex-direction: column; gap: 3px; padding: 4px 6px; }
  .wa-people .wa-pname { display: block; font-size: 11px; max-width: 64px; text-align: center; }
  .wa-main { display: none; }
  .wa.show-view .wa-main { display: flex; grid-row: 1 / -1; }
  .wa.show-view .wa-side, .wa.show-view .wa-people { display: none; }
  .wa-back { display: inline-grid; }
  .wa-thread { padding: 12px 10px; }
  .wa-msg { max-width: 86%; }
}
/* spacing polish */
.wa-people { padding: 12px 10px; display: flex; flex-direction: column; gap: 4px; }
.wa-person { padding: 10px 10px; gap: 12px; }
.wa-side-head { padding: 18px 18px 10px; }
.wa-search { margin: 4px 14px 10px; }
.wa-filters { padding: 0 14px 12px; flex-wrap: wrap; }
.wa-filters button { padding: 5px 11px; font-size: 12.5px; }
.wa-filters button:focus { outline: none; }
.wa-filters button:focus-visible { outline: 2px solid #00a884; outline-offset: 1px; }
.wa-item { padding-left: 16px; }
.wa-head { padding: 12px 20px; min-height: 64px; }
.wa-thread { padding: 20px 7% 24px; gap: 4px; }
.wa-msg.in + .wa-msg.out, .wa-msg.out + .wa-msg.in { margin-top: 8px; }
.wa-compose { padding: 12px 18px; }
@media (max-width: 1100px) { .wa-people { padding: 10px 6px; } .wa-person { padding: 8px 4px; } }
@media (max-width: 760px) { .wa-people { flex-direction: row; } .wa-filters { flex-wrap: nowrap; } }
/* QR loading animation */
.qr-loading { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 0; }
.qr-loading h3 { margin: 14px 0 0; }
.qr-loading p { margin: 0; }
.qr-ghost { position: relative; width: 220px; height: 220px; border-radius: 16px; border: 1px solid var(--line); background: #fff; overflow: hidden;
  background-image: repeating-linear-gradient(90deg, #eef1ec 0 10px, transparent 10px 20px), repeating-linear-gradient(0deg, #eef1ec 0 10px, transparent 10px 20px); animation: qrpulse 1.6s ease-in-out infinite; }
.qr-ghost span { position: absolute; width: 52px; height: 52px; border: 9px solid #d5dad3; border-radius: 10px; background: #fff; }
.qr-ghost span:nth-child(1) { top: 14px; left: 14px; } .qr-ghost span:nth-child(2) { top: 14px; right: 14px; } .qr-ghost span:nth-child(3) { bottom: 14px; left: 14px; }
.qr-ghost span:nth-child(4) { width: 34px; height: 34px; border-width: 0; border-radius: 50%; background: #25d366; top: calc(50% - 17px); left: calc(50% - 17px); box-shadow: 0 0 0 6px #fff; }
.qr-ghost i { position: absolute; left: 0; right: 0; height: 46px; top: -46px; background: linear-gradient(180deg, transparent, rgba(37,211,102,.28), transparent); animation: qrscan 1.4s linear infinite; }
.qr-dots { display: flex; gap: 6px; margin-top: 4px; }
.qr-dots b { width: 7px; height: 7px; border-radius: 50%; background: #25d366; animation: qrdot 1s infinite ease-in-out; }
.qr-dots b:nth-child(2) { animation-delay: .15s; } .qr-dots b:nth-child(3) { animation-delay: .3s; }
.qr-img { animation: qrin .35s ease-out; }
@keyframes qrscan { to { top: 100%; } }
@keyframes qrpulse { 50% { opacity: .75; } }
@keyframes qrdot { 0%, 80%, 100% { transform: scale(.5); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }
@keyframes qrin { from { opacity: 0; transform: scale(.96); } }
@media (prefers-reduced-motion: reduce) { .qr-ghost, .qr-ghost i, .qr-dots b, .qr-img { animation: none; } }
/* inbox fits the screen; chips on one row; teammate list states */
.wa { height: auto; }
.wa-filters { flex-wrap: nowrap; }
.wa-filters::-webkit-scrollbar { display: none; }
.wa-people { gap: 2px; }
.wa-person { position: relative; border-radius: 12px; padding: 8px 10px; transition: background .15s, box-shadow .15s; }
.wa-person:hover { background: rgba(30, 74, 64, .06); }
.wa-person.on { background: #fff; box-shadow: 0 1px 2px rgba(16, 24, 20, .06), 0 0 0 1px var(--line); }
.wa-person.on::before { content: ''; position: absolute; left: -10px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: #00a884; }
.wa-person.on .wa-pname { font-weight: 600; }
.wa-person .wa-av { width: 36px !important; height: 36px !important; font-size: 13px !important; }
.wa-av.all { width: 36px; height: 36px; }
@media (max-width: 1100px) { .wa-person.on::before { left: -6px; } }
@media (max-width: 760px) { .wa-person.on::before { left: 10px; right: 10px; top: auto; bottom: -6px; width: auto; height: 3px; border-radius: 3px 3px 0 0; } .wa-person.on { box-shadow: none; background: rgba(30,74,64,.06); } }
#view:has(> .wa) { padding-bottom: 0; }

/* ===== Team inbox v3 ===== */
/* teammate column: consistent spacing */
.wa .wa-people { display: flex; flex-direction: column; gap: 2px; padding: 16px 12px; background: #f7f8f5; }
.wa .wa-people-head { padding: 0 10px 10px; margin: 0; font-size: 11.5px; letter-spacing: .06em; }
.wa .wa-person { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px; margin: 0; border-radius: 12px; min-height: 52px; }
.wa .wa-person .wa-av, .wa .wa-av.all { width: 36px !important; height: 36px !important; font-size: 13px !important; }
.wa .wa-person i { font-style: normal; color: var(--muted); font-weight: 400; }
.wa .wa-person:hover { background: rgba(30, 74, 64, .06); }
.wa .wa-person.on { background: #fff; box-shadow: 0 1px 3px rgba(16, 24, 20, .08), 0 0 0 1px #e6e8e3; }
.wa .wa-person.on::before { left: -12px; top: 12px; bottom: 12px; }
@media (max-width: 1100px) {
  .wa .wa-people { padding: 12px 8px; align-items: center; }
  .wa .wa-person { justify-content: center; padding: 8px; width: 52px; }
  .wa .wa-person.on::before { left: -8px; }
}
@media (max-width: 760px) {
  .wa .wa-people { flex-direction: row; padding: 8px 10px; gap: 4px; align-items: stretch; }
  .wa .wa-person { flex-direction: column; width: 68px; min-height: 0; gap: 4px; padding: 6px 4px; }
  .wa .wa-person.on::before { left: 14px; right: 14px; top: auto; bottom: 0; width: auto; height: 3px; }
}
/* side header + small icon buttons */
.wa-side-actions, .wa-head-actions { display: flex; align-items: center; gap: 4px; }
.wa-icon { width: 36px; height: 36px; border-radius: 50%; border: 0; background: none; color: #54656f; display: inline-grid; place-items: center; cursor: pointer; font-size: 20px; line-height: 1; text-decoration: none; }
.wa-icon:hover { background: rgba(11, 20, 26, .06); }
.wa-sub { padding-top: 0; }
.wa-sub button { background: #fff; border: 1px solid #e3e6e1; }
/* list item options */
.wa-flags { display: flex; align-items: center; gap: 6px; flex: none; }
.wa-pin { font-size: 12px; }
.wa-chev { width: 0; overflow: hidden; border: 0; background: none; padding: 0; color: #8696a0; cursor: pointer; transition: width .12s; display: inline-grid; place-items: center; }
.wa-item:hover .wa-chev, .wa-chev:focus-visible { width: 20px; }
@media (pointer: coarse) { .wa-chev { width: 20px; } }
/* popup menu */
.wa-pop { position: fixed; z-index: 200; min-width: 190px; background: #fff; border-radius: 10px; padding: 6px 0; box-shadow: 0 8px 28px rgba(11, 20, 26, .18), 0 0 0 1px rgba(11, 20, 26, .05); animation: qrin .12s ease-out; }
.wa-pop button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 10px 18px; font: inherit; font-size: 14.5px; color: #3b4a54; cursor: pointer; }
.wa-pop button:hover { background: #f5f6f6; }
.wa-pop button.danger { color: #d92d20; }
/* chat header */
.wa-head-who { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; border: 0; background: none; padding: 0; cursor: pointer; font: inherit; color: inherit; }
.wa-findbar { display: flex; align-items: center; gap: 8px; padding: 8px 16px; background: #fff; border-bottom: 1px solid #e9edef; color: #54656f; }
.wa-findbar input { flex: 1; border: 0; box-shadow: none; padding: 6px 0; background: none; }
.wa-msg.dim { opacity: .35; }
.wa-msg.hit { box-shadow: 0 0 0 2px #ffd279; }
/* message options */
.wa-msg { position: relative; }
.wa-mchev { position: absolute; top: 3px; right: 3px; width: 24px; height: 22px; border: 0; border-radius: 6px; cursor: pointer; color: #8696a0; background: inherit; opacity: 0; display: grid; place-items: center; z-index: 2; }
.wa-msg:hover .wa-mchev { opacity: 1; }
@media (pointer: coarse) { .wa-mchev { opacity: .7; } }
.wa-replying { display: flex; align-items: center; gap: 10px; margin: 0 14px; padding: 8px 12px; background: #fff; border-left: 4px solid #06cf9c; border-radius: 8px 8px 0 0; font-size: 13px; color: #54656f; }
.wa-replying > div { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* media */
.wa-msg.has-media { padding: 4px 4px 6px; }
.wa-msg.has-media .wa-text { display: block; padding: 6px 6px 0; }
.wa-msg.has-media .wa-meta { margin-right: 4px; }
.wa-msg.sticker { background: none !important; box-shadow: none; }
.wa-media { position: relative; width: min(330px, 62vw); max-height: 420px; border-radius: 6px; overflow: hidden; background: #dfe5e7; cursor: pointer; display: grid; place-items: center; }
.wa-media.sticker { width: 150px; background: none; }
.wa-media img, .wa-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.wa-media.sticker img { object-fit: contain; }
.wa-media img.blur { filter: blur(6px); transform: scale(1.08); position: absolute; inset: 0; }
.wa-media.ready img { animation: qrin .25s ease-out; }
.wa-media video { background: #000; object-fit: contain; }
.wa-media.failed { cursor: default; }
.wa-merr { position: absolute; left: 8px; right: 8px; bottom: 8px; background: rgba(11, 20, 26, .65); color: #fff; font-size: 12px; padding: 6px 8px; border-radius: 6px; }
.wa-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .5); border-top-color: #fff; animation: spin .8s linear infinite; position: relative; z-index: 1; background: rgba(11, 20, 26, .25); }
.wa-play .wa-spin, .wa-dl .wa-spin { width: 18px; height: 18px; border-width: 2px; background: none; border-color: rgba(0, 0, 0, .15); border-top-color: #00a884; }
.wa-play { position: relative; z-index: 1; width: 52px; height: 52px; border-radius: 50%; border: 0; background: rgba(11, 20, 26, .55); color: #fff; font-size: 20px; cursor: pointer; display: grid; place-items: center; }
.wa-play.sm { width: 38px; height: 38px; font-size: 15px; background: #00a884; flex: none; }
.wa-dur { position: absolute; left: 8px; bottom: 6px; color: #fff; font-size: 12px; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); z-index: 1; }
.wa-audio { display: flex; align-items: center; gap: 10px; width: min(300px, 62vw); padding: 6px 6px 2px; cursor: pointer; }
.wa-audio .wa-dur { position: static; color: #667781; text-shadow: none; }
.wa-audio audio { width: 100%; height: 40px; }
.wa-wave { flex: 1; height: 24px; background: repeating-linear-gradient(90deg, #b5c0c6 0 3px, transparent 3px 6px); -webkit-mask: linear-gradient(0deg, transparent 20%, #000 20% 80%, transparent 80%); border-radius: 2px; opacity: .8; }
.wa-doc { display: flex; align-items: center; gap: 12px; width: min(320px, 62vw); padding: 10px; background: rgba(11, 20, 26, .04); border-radius: 6px; cursor: pointer; }
.wa-doc-ico { flex: none; width: 40px; height: 48px; border-radius: 4px; background: #fff; color: #e05a47; font-size: 10px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 1px 2px rgba(0, 0, 0, .1); }
.wa-doc-name { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-doc-sub { font-size: 12px; color: #667781; }
.wa-dl { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 1px solid #c9d1d5; background: none; color: #54656f; cursor: pointer; display: grid; place-items: center; }
.wa-viewer { display: grid; place-items: center; background: #0b141a; border-radius: 12px; overflow: hidden; margin: -6px -6px 0; }
.wa-viewer img { max-width: 100%; max-height: 72vh; display: block; }
.wa-info { text-align: center; padding: 6px 0 4px; }
.wa-info .wa-av { margin: 0 auto 10px; }
.wa-info h3 { margin: 0 0 4px; }
.wa-info p { margin: 2px 0; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Teams & modules ===== */
.search.no-mod { visibility: hidden; }
select.slim { width: auto; min-width: 116px; height: 34px; padding: 0 30px 0 10px; font-size: 13px; }
.teams-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.team-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.team-top { display: flex; align-items: center; gap: 12px; }
.team-top .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.team-top .grow b { font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-top .grow span { font-size: 12.5px; }
.team-ppl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow-y: auto; }
.team-ppl li { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 10px; font-size: 13.5px; }
.team-ppl li:hover { background: var(--surface); }
.team-ppl li .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-ppl li button { opacity: .55; } .team-ppl li:hover button { opacity: 1; }
.team-add { align-self: flex-start; }
.mods { display: flex; flex-wrap: wrap; gap: 6px; }
.mod { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 99px; font-size: 12.5px; font-weight: 500;
  border: 1px dashed var(--line); background: transparent; color: var(--faint); cursor: pointer; white-space: nowrap; transition: background .12s, color .12s, border-color .12s; }
.mod:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.mod.on { background: var(--mint); color: var(--mint-ink); border: 1px solid transparent; }
.mod.on:hover:not(:disabled) { background: #bfe6d7; color: var(--mint-ink); }
.mod:disabled { cursor: default; }
.mod-all { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.people-tbl td .tag { margin: 2px 2px 2px 0; background: var(--surface); color: var(--muted); }
.people-tbl td .tag.mint { background: var(--mint); color: var(--mint-ink); }
.pick-list { display: flex; flex-direction: column; gap: 4px; max-height: 340px; overflow-y: auto; margin: 4px 0 8px; }
.pick { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; font-weight: 400; margin: 0; }
.pick:has(input:checked) { border-color: var(--brand); background: var(--surface); }
.pick input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--brand); flex-shrink: 0; }
.pick .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13.5px; }
.pick .grow span { font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.wa-group { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); padding: 14px 10px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1100px) { .wa-group { font-size: 0; padding: 8px 0 4px; border-top: 1px solid var(--line); margin: 6px 8px 0; } }
@media (max-width: 760px) { .teams-grid { grid-template-columns: 1fr; } .people-tbl .mod span { display: none; } .people-tbl .mod { padding: 0 9px; } }

/* ===== Team inbox: channel spaces with their own colours ===== */
/* default (All chats) = Outbolt green; each channel overrides the palette */
.wa, .wa-main.th-all { --acc: #1e4a40; --acc-ink: #1e4a40; --acc-soft: #e4efe6; --acc-hover: #f3f6f2; --badge: #1e4a40; --wall: #f1f2ee; --wall-dot: rgba(30,74,64,.05); --bubble: #e3f0e6; --head: #f4f5f2; }
.wa.th-whatsapp, .wa-main.th-whatsapp { --acc: #00a884; --acc-ink: #008069; --acc-soft: #d9fdd3; --acc-hover: #f5f6f6; --badge: #25d366; --wall: #efeae2; --wall-dot: rgba(0,0,0,.035); --bubble: #d9fdd3; --head: #f0f2f5; }
.wa.th-email, .wa-main.th-email { --acc: #5b4fd6; --acc-ink: #4338ca; --acc-soft: #e8e6fc; --acc-hover: #f6f5fe; --badge: #6d5ef0; --wall: #f5f5fb; --wall-dot: rgba(67,56,202,.045); --bubble: #e6e3fb; --head: #f2f1fa; }
.wa.th-linkedin, .wa-main.th-linkedin { --acc: #0a66c2; --acc-ink: #004182; --acc-soft: #dce8f6; --acc-hover: #f3f6f9; --badge: #0a66c2; --wall: #f4f2ee; --wall-dot: rgba(10,102,194,.045); --bubble: #dce8f6; --head: #eef3f8; }

.wa { grid-template-columns: 78px minmax(300px, 380px) minmax(0, 1fr); }
.wa.has-people { grid-template-columns: 78px 220px minmax(280px, 360px) minmax(0, 1fr); }
.wa-rail { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 0; background: #f7f8f5; border-right: 1px solid var(--line); }
.wa-rail-btn { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 66px; padding: 8px 0 6px; border: 0; background: none; border-radius: 14px; cursor: pointer; color: #54656f; font: inherit; }
.wa-rail-btn:hover { background: rgba(11,20,26,.05); }
.wa-rail-ic { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: #e9ece8; color: #54656f; transition: background .15s, color .15s, transform .15s; }
.wa-rail-lbl { font-size: 11px; font-weight: 500; }
.rail-all .wa-rail-ic { --c: #1e4a40; } .rail-whatsapp .wa-rail-ic { --c: #00a884; } .rail-email .wa-rail-ic { --c: #5b4fd6; } .rail-linkedin .wa-rail-ic { --c: #0a66c2; }
.wa-rail-btn:hover .wa-rail-ic { color: var(--c); }
.wa-rail-btn.on .wa-rail-ic { background: var(--c); color: #fff; transform: scale(1.04); box-shadow: 0 4px 12px -4px var(--c); }
.wa-rail-btn.on .wa-rail-lbl { color: var(--c); font-weight: 600; }
.wa-rail-btn.none:not(.on) { opacity: .55; }
.wa-rail-n { position: absolute; top: 2px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: #e5484d; color: #fff; font-size: 10.5px; display: grid; place-items: center; box-shadow: 0 0 0 2px #f7f8f5; }

/* palette applied to the list and chat */
.wa .wa-filters button.on { background: var(--acc-soft); color: var(--acc-ink); }
.wa .wa-filters button:focus-visible { outline-color: var(--acc); }
.wa .wa-badge { background: var(--badge); }
.wa .wa-item:hover { background: var(--acc-hover); }
.wa .wa-item.sel { background: var(--acc-soft); }
.wa .wa-item.unread .wa-time { color: var(--acc); }
.wa .wa-person.on::before { background: var(--acc); }
.wa .wa-av.all { background: var(--acc); }
.wa-side-head b { color: var(--acc-ink); transition: color .15s; }
.wa .wa-main { background: var(--wall); }
.wa .wa-head, .wa .wa-compose { background: var(--head); }
.wa .wa-thread { background-color: var(--wall); background-image: radial-gradient(var(--wall-dot) 1px, transparent 1px); }
.wa .wa-msg.out { background: var(--bubble); }
.wa .wa-sender.out { color: var(--acc-ink); }
.wa .wa-send { background: var(--acc); } .wa .wa-send:hover { filter: brightness(.92); background: var(--acc); }
.wa-main.th-email .wa-msg, .wa-main.th-linkedin .wa-msg { border-radius: 12px; }
.wa-main.th-email .wa-msg.in, .wa-main.th-linkedin .wa-msg.in { border-top-left-radius: 4px; }
.wa-main.th-email .wa-msg.out, .wa-main.th-linkedin .wa-msg.out { border-top-right-radius: 4px; }
/* channel badge on avatars in "All chats" */
.wa-avw { position: relative; flex: none; display: inline-grid; }
.wa-chb { position: absolute; right: -3px; bottom: -3px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; color: #fff; box-shadow: 0 0 0 2px #fff; }
.wa-chb .ico { width: 12px; height: 12px; stroke-width: 2.2; }
.wa-chb.ch-whatsapp { background: #25d366; } .wa-chb.ch-email { background: #6d5ef0; } .wa-chb.ch-linkedin { background: #0a66c2; }
.wa-item.ch-email .wa-tick, .wa-item.ch-linkedin .wa-tick { color: #8696a0; }
/* ticks */
.wa-tick.grey { color: #8696a0; } .wa-tick.read { color: #53bdeb; } .wa-tick.one { letter-spacing: 0; }
.wa-err { clear: both; font-size: 11.5px; color: #c0392b; margin-top: 4px; }
/* quoted reply inside a bubble / above the composer */
.wa-quote { display: flex; flex-direction: column; gap: 1px; background: rgba(11,20,26,.05); border-left: 4px solid var(--acc); border-radius: 6px; padding: 5px 9px; margin: 0 0 5px; font-size: 13px; max-height: 76px; overflow: hidden; }
.wa-quote b { color: var(--acc-ink); font-size: 12.5px; }
.wa-quote span { color: #54656f; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: pre-wrap; }
.wa-replying { display: flex; align-items: center; gap: 8px; padding: 8px 18px 0; background: var(--head); }
.wa-replying > .wa-quote { flex: 1; margin: 0; }
/* load older + emoji */
.wa-older { align-self: center; display: inline-flex; align-items: center; gap: 6px; margin: 2px 0 10px; padding: 6px 14px; border: 0; border-radius: 99px; background: rgba(255,255,255,.85); color: var(--acc-ink); font-size: 12.5px; font-weight: 500; box-shadow: 0 1px .5px rgba(11,20,26,.13); cursor: pointer; }
.wa-older:hover { background: #fff; } .wa-older:disabled { cursor: default; opacity: .8; }
.spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; display: inline-block; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.wa-emoji { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 2px; padding: 10px 14px; max-height: 190px; overflow-y: auto; background: var(--head); border-top: 1px solid rgba(11,20,26,.06); }
.wa-emoji button { border: 0; background: none; font-size: 22px; height: 40px; border-radius: 8px; cursor: pointer; }
.wa-emoji button:hover { background: rgba(11,20,26,.06); }
.wa-compose { align-items: center; }
@media (max-width: 1100px) { .wa.has-people { grid-template-columns: 78px 76px minmax(260px, 340px) minmax(0, 1fr); } }
@media (max-width: 760px) {
  .wa, .wa.has-people { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .wa.has-people { grid-template-rows: auto auto minmax(0, 1fr); }
  .wa-rail { flex-direction: row; justify-content: space-around; padding: 6px 4px; border-right: 0; border-bottom: 1px solid var(--line); }
  .wa-rail-btn { width: auto; flex: 1; flex-direction: row; justify-content: center; gap: 6px; padding: 6px 4px; }
  .wa-rail-ic { width: 30px; height: 30px; border-radius: 10px; }
  .wa-rail-n { top: 0; right: 2px; }
  .wa.show-view .wa-rail { display: none; }
}
.wa-rail-btn { height: auto; min-height: 0; box-shadow: none; }
.wa-rail-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.wa-older, .wa-emoji button { height: auto; }
.wa-emoji button { height: 40px; }
.wa-icon { padding: 0; flex: none; min-width: 36px; }
.wa-icon .ico { flex: none; width: 18px; height: 18px; }
.wa-nc .wa-nc-ic { width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--acc-soft); color: var(--acc); }
.wa-nc .wa-nc-ic .ico { width: 28px; height: 28px; }
.wa-nc h3 { margin: 0 0 6px; }
.wa-nc .btn { margin-top: 12px; background: var(--acc); border-color: var(--acc); }

/* ===== WhatsApp Web features ===== */
.wa-av.pic { position: relative; overflow: hidden; padding: 0; background: none; }
.wa-av.pic > .wa-av { width: 100% !important; height: 100% !important; }
.wa-av.pic > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.wa-text a, .wa-gdesc a { color: #027eb5; text-decoration: none; word-break: break-all; }
.wa-text a:hover, .wa-gdesc a:hover { text-decoration: underline; }
.wa-fwd { font-size: 12px; font-style: italic; color: #667781; margin-bottom: 2px; }
.wa-edited { font-size: 11px; color: #8696a0; margin-right: 5px; }
.wa-star { color: #8696a0; margin-right: 4px; font-size: 11px; }
.wa-msg.deleted .wa-text { font-style: italic; color: #8696a0; }
.wa-msg.deleted .wa-mchev { display: none; }
.wa-sending { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #54656f; padding: 8px 4px; }
.wa-msg.has-rx { margin-bottom: 14px; }
.wa-rx { position: absolute; bottom: -14px; display: flex; gap: 2px; background: #fff; border-radius: 99px; padding: 1px 6px; box-shadow: 0 1px 3px rgba(11,20,26,.18); font-size: 13px; line-height: 20px; white-space: nowrap; z-index: 1; }
.wa-msg.in .wa-rx { left: 8px; } .wa-msg.out .wa-rx { right: 8px; }
.wa-rx span { cursor: default; color: #54656f; font-size: 12px; }
.wa-pv { display: flex; gap: 10px; margin: 0 0 6px; padding: 6px; background: rgba(11,20,26,.05); border-radius: 6px; color: inherit; text-decoration: none; max-width: 420px; }
.wa-pv img { width: 72px; height: 72px; object-fit: cover; border-radius: 4px; flex: none; }
.wa-pv div { min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.wa-pv b { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.wa-pv span { color: #54656f; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 12.5px; }
.wa-pv small { color: #8696a0; }
.wa-react-pop { display: flex; gap: 2px; padding: 6px 8px; border-radius: 99px; min-width: 0; }
.wa-react-pop button { width: 38px; height: 38px; padding: 0; border: 0; background: none; border-radius: 50%; font-size: 22px; cursor: pointer; display: grid; place-items: center; transition: transform .1s; }
.wa-react-pop button:hover { background: #f0f2f5; transform: scale(1.15); }
.wa-react-pop button.on { background: #e1f3ec; }
.wa-react-pop button.more { font-size: 20px; color: #54656f; background: #f0f2f5; }
.wa-react-pop.grid { display: grid; grid-template-columns: repeat(8, 38px); border-radius: 14px; max-height: 240px; overflow-y: auto; }
.wa-rec { flex: 1; display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 12px; background: #fff; border-radius: 22px; font-variant-numeric: tabular-nums; }
.wa-rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #e5484d; animation: recblink 1s infinite; }
@keyframes recblink { 50% { opacity: .25; } }
#wa-mic { background: var(--acc); }
.wa-main.drop { outline: 3px dashed var(--acc); outline-offset: -10px; }
.wa-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; max-height: 320px; overflow-y: auto; }
.wa-file { display: flex; flex-direction: column; gap: 6px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 12px; }
.wa-file img, .wa-file video { width: 100%; height: 110px; object-fit: cover; border-radius: 8px; background: #f0f2f5; }
.wa-file .wa-doc-ico { width: 56px; height: 66px; display: grid; place-items: center; }
.wa-file-name { font-size: 12px; text-align: center; word-break: break-all; display: flex; flex-direction: column; }
.wa-blockbar { padding: 14px 18px; background: var(--head); text-align: center; font-size: 13.5px; color: #54656f; }
.link-btn { border: 0; background: none; padding: 0; height: auto; color: var(--acc-ink); font-weight: 600; cursor: pointer; }
.wa-live { color: #54656f; } .wa-live.typing { color: var(--acc); font-weight: 500; }
.wa-muted { font-size: 12px; }
.wa-info { text-align: center; }
.wa-info .wa-av { margin: 6px auto 10px; }
.wa-gdesc { white-space: pre-wrap; text-align: left; background: var(--surface); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; margin: 10px 0 0; }
.wa-members { display: flex; flex-direction: column; gap: 2px; max-height: 340px; overflow-y: auto; margin-top: 14px; }
.wa-member { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-radius: 10px; }
.wa-member:hover { background: var(--surface); }
.wa-member .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13.5px; }
.wa-member .grow span { font-size: 12px; }
.wa-starred { display: flex; flex-direction: column; gap: 6px; max-height: 420px; overflow-y: auto; }
.wa-st { display: block; width: 100%; height: auto; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; font: inherit; }
.wa-st:hover { background: var(--surface); }
.wa-st-top { display: flex; gap: 6px; font-size: 12.5px; align-items: baseline; }
.wa-st-body { margin-top: 4px; font-size: 13.5px; white-space: pre-wrap; }
.wa-send { padding: 0; }
