:root {
  --bg: #f6f6f3;
  --surface: #ffffff;
  --sunk: #f1f1ed;
  --text: #191917;
  --muted: #6e6e68;
  --faint: #a3a39c;
  --line: #e7e7e1;
  --line-strong: #d8d8d0;
  --accent: #1f6f4a;
  --accent-ink: #ffffff;
  --accent-soft: #e6f2ec;
  --wa: #1a8a4d;
  --wa-soft: #e5f4ea;
  --mail: #2f5fc4;
  --mail-soft: #e8eefb;
  --amber: #9a6510;
  --amber-soft: #fbf1dc;
  --red: #b42a2a;
  --red-soft: #fbe8e6;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 20, 15, .04);
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121211; --surface: #1a1a18; --sunk: #222220; --text: #ededE8; --muted: #a2a29a; --faint: #6c6c66;
    --line: #2a2a27; --line-strong: #383834; --accent: #4fb985; --accent-ink: #0d1f16; --accent-soft: #19301f;
    --wa: #5fcf8e; --wa-soft: #17301f; --mail: #8aa9f0; --mail-soft: #1a2440; --amber: #e3b25c;
    --amber-soft: #33270f; --red: #f08a80; --red-soft: #3a1a17; --shadow: none; color-scheme: dark;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a.link { color: var(--accent); }
a.link:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: 15px; }
p { margin: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }

/* layout: top bar with three sections, a sub-menu under it */
.masthead { position: sticky; top: 0; z-index: 10; background: var(--surface); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; gap: 22px; padding: 12px 32px; max-width: 1240px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 650; font-size: 15px; padding: 6px 4px; }
.brand .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.sections { display: flex; gap: 6px; }
.sections a {
  display: flex; align-items: center; gap: 9px; padding: 9px 16px; border-radius: 11px; font-weight: 600;
  font-size: 15px; color: var(--muted);
}
.sections a:hover { background: var(--sunk); color: var(--text); }
.sections a.on { background: var(--text); color: var(--bg); }
.sections a.on .badge { background: var(--bg); color: var(--text); }
.bar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.links { display: flex; gap: 2px; }
.links a { padding: 7px 11px; border-radius: 9px; color: var(--muted); font-weight: 550; }
.links a:hover, .links a.on { background: var(--sunk); color: var(--text); }
.subnav { display: flex; gap: 4px; padding: 0 32px 10px; max-width: 1240px; margin: 0 auto; overflow-x: auto; }
.subnav a { display: flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 9px; color: var(--muted); font-weight: 550; white-space: nowrap; }
.subnav a:hover { background: var(--sunk); color: var(--text); }
.subnav a.on { background: var(--accent-soft); color: var(--accent); }
.ic { width: 18px; height: 18px; flex-shrink: 0; }
.badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent);
  color: var(--accent-ink); font-size: 11.5px; font-weight: 650; display: inline-flex; align-items: center; justify-content: center;
}
.badge.soft { background: var(--accent); }
.main { max-width: 1240px; margin: 0 auto; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 26px 32px 4px; }
.page-head h1 { font-size: 22px; }
.content { padding: 18px 32px 64px; }

/* toast */
.toast {
  margin: 10px 32px 0; padding: 11px 16px; border-radius: var(--radius-sm); font-weight: 500;
  max-width: 1108px; transition: opacity .4s;
}
.toast.ok { background: var(--accent-soft); color: var(--accent); }
.toast.err { background: var(--red-soft); color: var(--red); }
.toast.hide { opacity: 0; }

/* switch (kill switch) */
.switch {
  display: inline-flex; align-items: center; gap: 9px; height: 34px; padding: 0 14px 0 6px; border-radius: 17px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 550; cursor: pointer;
}
.switch .knob { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); display: inline-block; }
.switch.off { border-color: var(--red); color: var(--red); background: var(--red-soft); }
.switch.off .knob { background: var(--red); }

/* cards & grids */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.card + .card, .stack > * + * { margin-top: 14px; }
.grid > .card + .card { margin-top: 0; }
[hidden] { display: none !important; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { display: flex; align-items: center; gap: 8px; }
.grid { display: grid; gap: 14px; align-items: start; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.section { margin-top: 30px; }
.section > h2 { margin-bottom: 12px; color: var(--muted); font-size: 13px; font-weight: 600; }

.stat { display: block; }
.stat .n { font-size: 30px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.1; }
.stat .l { color: var(--muted); margin-top: 4px; }
a.stat:hover { border-color: var(--line-strong); }
.meter { height: 6px; background: var(--sunk); border-radius: 3px; overflow: hidden; margin-top: 10px; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.meter.full i { background: var(--amber); }

/* lists */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.rows li:first-child { border-top: 0; padding-top: 0; }
.rows li:last-child { padding-bottom: 0; }
.rows .grow { flex: 1; min-width: 0; }
.rows .title { font-weight: 550; }
.clip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* table */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: 550; color: var(--muted); font-size: 12.5px; padding: 0 12px 10px; }
.table td { padding: 12px; border-top: 1px solid var(--line); vertical-align: middle; }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: var(--sunk); }
.table td:first-child, .table th:first-child { padding-left: 4px; }

/* pills */
.pill, .ch {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 11px;
  font-size: 12px; font-weight: 550; white-space: nowrap; background: var(--sunk); color: var(--muted);
}
.pill.green { background: var(--accent-soft); color: var(--accent); }
.pill.blue { background: var(--mail-soft); color: var(--mail); }
.pill.amber { background: var(--amber-soft); color: var(--amber); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.muted { color: var(--faint); }
.ch.whatsapp { background: var(--wa-soft); color: var(--wa); }
.ch.email { background: var(--mail-soft); color: var(--mail); }

/* buttons & forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 15px;
  border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--faint); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--muted); }
.btn.quiet:hover { background: var(--sunk); color: var(--text); }
.btn.danger { color: var(--red); }
.btn.danger:hover { border-color: var(--red); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 13px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions.end { justify-content: flex-end; }
form.inline { display: inline; }

label.f { display: block; }
label.f > span { display: block; font-weight: 550; margin-bottom: 6px; }
label.f > em { display: block; font-style: normal; color: var(--muted); font-size: 12.5px; margin: -2px 0 6px; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=password], input[type=search],
select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); padding: 8px 11px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; min-height: 90px; line-height: 1.55; }
.fields { display: grid; gap: 14px; align-content: start; }
.fields.two { grid-template-columns: 1fr 1fr; }
.check { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--accent); }
.check em { display: block; font-style: normal; color: var(--muted); font-size: 12.5px; }

details.drawer > summary { list-style: none; cursor: pointer; display: inline-flex; }
details.drawer > summary::-webkit-details-marker { display: none; }
details.drawer[open] > summary { margin-bottom: 14px; }

/* chips (filters) */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips a { padding: 6px 12px; border-radius: 16px; color: var(--muted); font-weight: 550; font-size: 13px; }
.chips a:hover { background: var(--sunk); color: var(--text); }
.chips a.on { background: var(--text); color: var(--bg); }
.toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 16px; }
.search { max-width: 260px; }

/* empty state */
.empty { text-align: center; padding: 34px 10px; }
.empty p { font-weight: 550; }
.empty span { display: block; color: var(--muted); margin-top: 4px; }

/* drafts */
.draft-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.draft-meta .who { font-weight: 600; font-size: 15px; }
.quote {
  border-left: 3px solid var(--line-strong); padding: 8px 12px; color: var(--muted); background: var(--sunk);
  border-radius: 0 8px 8px 0; white-space: pre-wrap; margin: 12px 0 0;
}
.fixed-text { white-space: pre-wrap; background: var(--sunk); border-radius: var(--radius-sm); padding: 12px 14px; }
.note { color: var(--muted); font-size: 12.5px; }

/* conversation */
.convo { display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 78%; padding: 10px 14px; border-radius: 16px; word-wrap: break-word; }
.bubble .text { white-space: pre-wrap; }
.bubble.in { align-self: flex-start; background: var(--sunk); border-bottom-left-radius: 5px; }
.bubble.out { align-self: flex-end; background: var(--accent-soft); border-bottom-right-radius: 5px; }
.bubble.out.email { background: var(--mail-soft); }
.bubble .subj { font-weight: 600; margin-bottom: 4px; }
.bubble-meta { font-size: 11.5px; color: var(--muted); margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.bubble.out .bubble-meta { justify-content: flex-end; }
.bubble.dim { opacity: .55; }
.lead-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; align-items: start; }
.kv { display: grid; grid-template-columns: 90px 1fr; gap: 8px 12px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.banner {
  display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 16px;
  border-radius: var(--radius-sm); background: var(--amber-soft); color: var(--amber); font-weight: 550; margin-bottom: 14px;
}
.tabs { display: inline-flex; background: var(--sunk); padding: 3px; border-radius: 10px; gap: 2px; }
.tabs label { padding: 5px 12px; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 550; font-size: 13px; }
.tabs input { display: none; }
.tabs input:checked + span { color: var(--text); }
.tabs label:has(input:checked) { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* campaign steps */
.steps { position: relative; }
.step { display: grid; grid-template-columns: 66px 1fr; gap: 16px; }
.step + .step { margin-top: 14px; }
.step .day { text-align: right; padding-top: 18px; }
.step .day b { display: block; font-size: 17px; }
.step .day span { color: var(--muted); font-size: 12px; }
.type-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.type-cards label {
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 12px 14px; cursor: pointer;
}
.type-cards label:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.type-cards input { display: none; }
.type-cards b { display: block; }
.type-cards span { color: var(--muted); font-size: 12.5px; }

.setup { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.setup .item { display: flex; align-items: center; gap: 7px; }
.setup .tick { width: 16px; height: 16px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; }
.setup .tick.yes { background: var(--accent); color: var(--accent-ink); }
.setup .tick.no { border: 1.5px solid var(--faint); }

.event { display: grid; grid-template-columns: 110px 92px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.event:first-child { border-top: 0; }
.who-you { color: var(--accent); font-weight: 550; }
.who-assistant { color: var(--mail); font-weight: 550; }
.who-system { color: var(--muted); }

.copy { display: flex; gap: 8px; }
.copy input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; background: var(--sunk); padding: 1px 5px; border-radius: 5px; }

@media (max-width: 980px) {
  .grid.four { grid-template-columns: repeat(2, 1fr); }
  .grid.three, .grid.two, .lead-layout, .fields.two, .type-cards { grid-template-columns: 1fr; }
}
@media (max-width: 1020px) {
  .bar { flex-wrap: wrap; gap: 10px; }
  .bar-right { margin-left: 0; width: 100%; justify-content: space-between; }
}
@media (max-width: 760px) {
  .bar, .subnav, .page-head, .content { padding-left: 16px; padding-right: 16px; }
  .sections { width: 100%; }
  .sections a { flex: 1; justify-content: center; padding: 9px 8px; font-size: 14px; }
  .sections a .ic { display: none; }
  .links a { padding: 6px 8px; }
  .toast { margin-left: 16px; margin-right: 16px; }
  .event { grid-template-columns: 1fr; gap: 2px; }
}

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.section-card { display: block; }
.section-card .stat .n { font-size: 26px; }
details > summary::-webkit-details-marker { display: none; }

/* dashboards */
.num { text-align: right; font-variant-numeric: tabular-nums; }
.table th.num { text-align: right; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi-grid .hero { grid-column: span 2; grid-row: span 2; display: flex; flex-direction: column; }
.kpi { display: block; }
a.kpi:hover { border-color: var(--line-strong); }
.kpi-l { color: var(--muted); font-weight: 550; }
.kpi-n { font-size: 28px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.15; margin-top: 6px; }
.kpi-s { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.hero-n { font-size: 60px; font-weight: 650; letter-spacing: -0.03em; line-height: 1; margin: 14px 0 16px; }
.hero-split { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.hero-today { display: flex; gap: 28px; margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); align-items: flex-end; }
.hero-today b { display: block; font-size: 22px; font-weight: 650; margin-top: 2px; }
.hero-today .grow { flex: 1; max-width: 320px; }
.hero-today .meter { margin-top: 8px; }
.kpi-grid .hero .kpi-s { margin-bottom: 18px; }
.hero-split span { display: inline-flex; align-items: center; gap: 7px; font-weight: 550; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.sw.s1, .viz-stack .s1 { background: var(--s1); }
.sw.s2, .viz-stack .s2 { background: var(--s2); }
.sw.s3, .viz-stack .s3 { background: var(--s3); }

.strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0; padding: 4px; margin-top: 14px; }
.strip > * { display: block; padding: 12px 14px; border-radius: var(--radius-sm); }
.strip > a:hover { background: var(--sunk); }
.strip b { display: block; font-size: 20px; font-weight: 650; letter-spacing: -0.01em; }
.strip span { color: var(--muted); font-size: 12.5px; }

.dash-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; margin-top: 14px; align-items: stretch; }
.dash-row > .card + .card { margin-top: 0; }

.viz { margin: 0; }
.viz-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.viz-legend { list-style: none; margin: 0; padding: 0; display: flex; gap: 14px; flex-wrap: wrap; }
.viz-legend li { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; font-weight: 550; }
.viz-plot { position: relative; height: 180px; margin-left: 30px; }
.viz-grid span { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--line); }
.viz-grid span:first-child { border-top-color: var(--line-strong); }
.viz-grid em { position: absolute; right: calc(100% + 8px); top: -8px; font-style: normal; font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
.viz-cols { position: absolute; inset: 0; display: flex; align-items: stretch; }
.viz-col { flex: 1; min-width: 0; display: flex; align-items: flex-end; justify-content: center; border-radius: 6px; outline: none; cursor: default; }
.viz-col:hover, .viz-col:focus-visible { background: color-mix(in srgb, var(--text) 5%, transparent); }
.viz-stack { width: min(24px, 64%); display: flex; flex-direction: column; gap: 2px; }
.viz-stack i { display: block; min-height: 2px; flex-basis: 0; }
.viz-stack i:first-child { border-radius: 4px 4px 0 0; }
.viz-x { display: flex; margin: 8px 0 0 30px; }
.viz-x span { flex: 1; min-width: 0; display: flex; justify-content: center; white-space: nowrap; font-size: 11px; color: var(--faint); }
.viz-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); font-weight: 550; }
.viz-table { margin-top: 14px; }
.viz-table > summary { cursor: pointer; color: var(--muted); font-size: 12.5px; font-weight: 550; list-style: none; display: inline-block; }
.viz-table > summary:hover { color: var(--text); }
.viz-table[open] > summary { margin-bottom: 10px; }
.viz-table .table td, .viz-table .table th { padding-top: 7px; padding-bottom: 7px; }

.viz-tip {
  position: fixed; z-index: 50; pointer-events: none; background: var(--surface); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: 10px; padding: 9px 12px; min-width: 140px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .12); font-size: 12.5px;
}
.viz-tip .t { color: var(--muted); margin-bottom: 6px; font-weight: 550; }
.viz-tip .r { display: flex; align-items: center; gap: 8px; }
.viz-tip .r + .r { margin-top: 3px; }
.viz-tip .r i { width: 12px; height: 2px; border-radius: 1px; }
.viz-tip .r i.s1 { background: var(--s1); } .viz-tip .r i.s2 { background: var(--s2); } .viz-tip .r i.s3 { background: var(--s3); }
.viz-tip .r b { font-variant-numeric: tabular-nums; min-width: 18px; }
.viz-tip .r span { color: var(--muted); }

.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.hbars li { display: grid; grid-template-columns: 116px minmax(0, 1fr); align-items: center; gap: 12px; }
.hb-label { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-track { display: flex; align-items: center; gap: 8px; min-height: 14px; }
.hb-track i { display: block; height: 14px; background: var(--s1); border-radius: 0 4px 4px 0; }
.hb-track b { font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; }

.dot-ic { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--faint); }
.dot-ic.out { background: var(--s1); }
.dot-ic.in { background: var(--s3); }

.ch.call { background: var(--amber-soft); color: var(--amber); }
.fu-card { padding: 12px 20px; }
.table.fu td { vertical-align: top; }
.table.fu td:first-child { font-weight: 550; }

@media (max-width: 980px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-row { grid-template-columns: minmax(0, 1fr); }
  .fu-card { overflow-x: auto; }
  .table.fu { min-width: 820px; }
}
.scroll-x { overflow-x: auto; }
.scroll-x > .table { min-width: 640px; }
@media (max-width: 560px) {
  .viz-x span.alt { visibility: hidden; }
  .bar-right { flex-wrap: wrap; row-gap: 8px; }
  .kpi-grid .hero { grid-row: auto; }
  .hero-n { font-size: 48px; }
  .viz-plot { height: 150px; }
}

/* sign-in pages */
body.solo { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.solo-box { width: 100%; max-width: 380px; }
.solo-box .brand { justify-content: center; margin-bottom: 16px; font-size: 18px; }
code { background: var(--sunk); padding: 1px 5px; border-radius: 5px; font-size: 12.5px; }
.who-menu { position: relative; }
.who-menu summary { list-style: none; cursor: pointer; }
.who-menu summary::-webkit-details-marker { display: none; }
.who-menu .menu { position: absolute; right: 0; top: 40px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 6px; min-width: 180px; box-shadow: 0 8px 24px rgba(0,0,0,.08); z-index: 20; }
.who-menu .menu a, .who-menu .menu button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 7px;
  background: none; border: 0; font: inherit; color: var(--text); cursor: pointer; }
.who-menu .menu a:hover, .who-menu .menu button:hover { background: var(--sunk); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 650; }
.link-card { display: block; }
.link-card:hover { border-color: var(--line-strong); background: var(--sunk); }
.chips-check { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chips-check label { cursor: pointer; }
.chips-check input { display: none; }
.chips-check span { display: inline-block; padding: 5px 11px; border-radius: 14px; border: 1px solid var(--line-strong);
  font-size: 13px; color: var(--muted); }
.chips-check input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.f > span { font-weight: 550; }
.fields.three-col { grid-template-columns: 170px 1fr 1.4fr; gap: 8px; }
@media (max-width: 760px) { .fields.three-col { grid-template-columns: 1fr; } }

/* inbox */
.inbox { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 16px; align-items: start; }
.inbox-list { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow-y: auto; }
.inbox-views { margin-bottom: 8px; }
.inbox-views a b { font-weight: 650; }
.inbox-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.inbox-filters select, .inbox-filters input { flex: 1; min-width: 0; height: 34px; padding: 4px 8px; }
.conv-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.conv-list li + li { border-top: 1px solid var(--line); }
.conv-list a { display: block; padding: 11px 14px; }
.conv-list li.on a { background: var(--accent-soft); }
.conv-list a:hover { background: var(--sunk); }
.conv-top { display: flex; justify-content: space-between; gap: 8px; }
.conv-name { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-time { color: var(--faint); font-size: 12px; white-space: nowrap; }
.conv-snip { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.unread .conv-name { font-weight: 700; }
.unread .conv-snip { color: var(--text); }
.unread .conv-time { color: var(--accent); font-weight: 650; }
.conv-tags { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.conv-tags .pill { font-size: 11px; padding: 1px 7px; }
.ch-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: middle; background: var(--faint); }
.ch-dot.whatsapp { background: var(--wa); } .ch-dot.email { background: var(--mail); } .ch-dot.instagram { background: #c13584; }
.convo-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 16px; }
.convo-head .grow { flex: 1; min-width: 160px; }
.convo-head h2 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.back-link { display: none; }
.label-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.tag-x { border: 0; cursor: pointer; font: inherit; font-size: 12.5px; }
.add-tag input { height: 28px; width: 110px; padding: 2px 8px; font-size: 13px; }
form.inline { display: inline; }
.inbox-grid { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 14px; align-items: start; }
.thread { max-height: 60vh; overflow-y: auto; }
.bubble.instagram.out { background: #f6e3ef; }
@media (prefers-color-scheme: dark) { .bubble.instagram.out { background: #3a1f31; } }
.ch-name { font-weight: 600; }
.draft-card { margin-top: 12px; border-color: var(--amber); }
.composer { margin-top: 12px; display: grid; gap: 10px; }
.composer-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.composer-tools select { height: 34px; padding: 4px 8px; max-width: 220px; }
.window-note.closed { color: var(--amber); }
.convo-side .card + .card { margin-top: 12px; }
.ch.instagram { background: #f6e3ef; color: #a1286e; }
@media (max-width: 1100px) { .inbox-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .inbox { grid-template-columns: 1fr; }
  .inbox-list { position: static; max-height: none; }
  .inbox.has-convo .inbox-list { display: none; }
  .inbox:not(.has-convo) .inbox-pane { display: none; }
  .back-link { display: inline-flex; }
  .thread { max-height: none; }
  .sec-inbox .page-head { display: none; }
}

.phone-only { display: none !important; }
@media (max-width: 760px) {
  .phone-only { display: block !important; }
  .links { display: none; }
  .bar { padding-top: 8px; padding-bottom: 8px; }
  .brand { display: none; }
  .sections { overflow-x: auto; scrollbar-width: none; order: 2; }
  .sections::-webkit-scrollbar { display: none; }
  .sections a { flex: 0 0 auto; padding: 8px 12px; }
  .bar-right { order: 1; width: 100%; justify-content: space-between; gap: 8px; }
  .switch { height: 30px; font-size: 13px; }
  .switch .knob { width: 20px; height: 20px; }
}

/* pipeline board: one column per stage, scrolls sideways on small screens */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.board-col { background: var(--sunk); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-height: 160px; }
.board-head { display: flex; align-items: center; justify-content: space-between; margin: 2px 2px 10px; }
.board-head h2 { font-size: 14px; }
.board-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; display: grid; gap: 4px; }
.board-card + .board-card { margin-top: 8px; }
.board-card .title { font-weight: 600; }
.board-foot { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.board-foot select { width: 100%; font-size: 13px; padding: 5px 8px; }
.board-empty { padding: 6px 2px; }
@media (max-width: 720px) { .board { grid-auto-columns: 82%; } }
