:root {
  /* Matrix brand: black, white and greys; colour only for status. */
  --bg: #0a0a0a;
  --panel: #171717;
  --panel-2: #242424;
  --line: #3d3d3d;
  --text: #f5f5f5;
  --muted: #b0b0b0;
  --accent: #ffffff;
  --accent-2: #d9d9d9;
  --top: #000000;
  --ok: #34c77b;
  --warn: #f5a524;
  --danger: #ef3d5a;
  --bot: #2e2e2e;
  --page: #1f1f1f;
  --in: #202020;
  --radius: 10px;
  --display: "Archivo", "Inter", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 15px/1.45 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--text); text-underline-offset: 3px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }

.btn { background: var(--accent); color: #000; border: 0; border-radius: 8px; padding: 9px 16px; font-weight: 600; }
.btn:hover { background: var(--accent-2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn.danger { background: transparent; border: 1px solid var(--danger); color: var(--danger); }
.btn.small { padding: 5px 10px; font-size: 13px; }
input[type=text], input[type=email], input[type=password], input[type=search], select {
  width: 100%; background: var(--panel-2); border: 1px solid #555; border-radius: 8px; padding: 10px 12px; }
input::placeholder, textarea::placeholder { color: #8a8a8a; }
select.inline { width: auto; max-width: 180px; padding: 4px 8px; font-size: 13px; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

/* Shell */
.shell { display: grid; grid-template-columns: 84px 1fr; grid-template-rows: 56px 1fr; height: 100vh; height: 100dvh; }
.topbar { grid-column: 1 / -1; background: var(--top); border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 16px; gap: 12px; }
.topbar .brand { font-family: var(--display); font-weight: 800; text-transform: uppercase; letter-spacing: -.2px; }
.topbar .spacer { flex: 1; }
.topbar .who { color: var(--muted); font-size: 13px; }
.nav { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 8px 6px; gap: 4px; }
.nav a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 8px;
  color: var(--muted); text-decoration: none; font-size: 12px; }
.nav a.active { background: var(--panel-2); color: var(--text); }
.nav svg { width: 24px; height: 24px; }
.main { overflow: auto; min-width: 0; }
.page { padding: 20px; max-width: 1400px; }
.page h1 { font: 800 24px/1.1 var(--display); text-transform: uppercase; letter-spacing: -.3px; margin: 0 0 16px; }

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: 52px 1fr 60px; }
  .nav { grid-row: 3; flex-direction: row; justify-content: space-around; border-right: 0; border-top: 1px solid var(--line); padding: 4px; }
  .nav a { flex: 1; padding: 6px 2px; }
  .page { padding: 16px; }
}

/* Notices */
.notice { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--warn); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 16px; }
.notice.error { border-left-color: var(--danger); }
.notice.ok { border-left-color: var(--ok); }
.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 40px 16px; text-align: center; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login form { width: 100%; max-width: 360px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 24px;
  display: grid; gap: 12px; }
.login h1 { margin: 0 0 4px; font: 800 26px/1.1 var(--display); text-transform: uppercase; letter-spacing: -.3px; }

/* Channel cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; }
.card .head { display: flex; gap: 12px; align-items: center; padding: 16px; border-bottom: 1px solid var(--line); }
.card .head img, .avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; background: var(--panel-2); flex: none;
  display: grid; place-items: center; font-weight: 700; color: var(--muted); }
.card .title { font-size: 17px; color: var(--text); font-weight: 700; }
.card .sub { color: var(--muted); font-size: 13px; }
.card .count { margin-left: auto; background: var(--panel-2); border-radius: 999px; min-width: 28px; height: 28px; display: grid;
  place-items: center; font-size: 13px; padding: 0 8px; }
.card .foot { display: flex; align-items: center; gap: 8px; padding: 12px 16px; flex-wrap: wrap; }
.card.add { align-items: center; justify-content: center; min-height: 150px; border-style: dashed; color: var(--text); text-decoration: none;
  font-weight: 600; gap: 6px; }
.card.add .plus { font-size: 32px; color: var(--muted); line-height: 1; }
.pill { font-size: 12px; border-radius: 999px; padding: 3px 9px; background: var(--panel-2); color: var(--muted); }
.pill.ok { color: var(--ok); }
.pill.off { color: var(--danger); }
.toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.toggle input { accent-color: var(--accent); width: 18px; height: 18px; }

/* Pick pages */
.picklist { display: grid; gap: 8px; max-width: 640px; }
.pick { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.pick input { width: 20px; height: 20px; accent-color: var(--accent); }
.pick img { width: 40px; height: 40px; border-radius: 50%; }

/* Inbox */
.inbox { display: grid; grid-template-columns: 360px 1fr; height: 100%; min-height: 0; }
.inbox .list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.inbox .filters { padding: 12px; display: grid; gap: 8px; border-bottom: 1px solid var(--line); }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.chip { flex: none; border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 5px 12px; font-size: 13px; color: var(--muted); }
.chip.on { background: var(--panel-2); color: var(--text); border-color: var(--accent); }
.rows { overflow-y: auto; flex: 1; }
.row { display: flex; gap: 12px; padding: 12px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.row.active { background: var(--panel-2); }
.row .avatar { width: 44px; height: 44px; }
.row .body { min-width: 0; flex: 1; }
.row .line1 { display: flex; gap: 8px; align-items: baseline; }
.row .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.row .time { color: var(--muted); font-size: 12px; flex: none; }
.row .preview { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .meta { display: flex; gap: 6px; margin-top: 4px; }
.unread { background: var(--warn); color: #000; border-radius: 999px; font-size: 11px; padding: 0 6px; font-weight: 700; }

.thread { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.thread .bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.thread .bar .back { display: none; }
.thread .msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: min(560px, 85%); padding: 8px 12px; border-radius: 14px; white-space: pre-wrap; word-wrap: break-word; }
.bubble.in { background: var(--in); align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble.out { background: var(--page); align-self: flex-end; border-bottom-right-radius: 4px; }
.bubble.bot { background: var(--bot); }
.bubble { position: relative; }
.bubble .cut { position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--muted); font-size: 11px; line-height: 1; padding: 0; opacity: 0; transition: opacity .15s; }
.bubble:hover .cut, .bubble .cut:focus { opacity: 1; }
.bubble .cut:hover { color: var(--danger); border-color: var(--danger); }
@media (hover: none) { .bubble .cut { opacity: .7; } }
.bubble .who { font-size: 11px; color: var(--muted); margin-top: 4px; }
.bubble img { max-width: 240px; border-radius: 8px; display: block; }
.marker { align-self: center; display: flex; gap: 10px; align-items: baseline; max-width: 92%; font-size: 12px; padding: 5px 12px;
  border: 1px dashed var(--line); border-radius: 999px; color: var(--muted); margin: 4px 0; text-align: center; }
.marker.on { border-color: var(--ok); color: #9fe3bf; }
.marker.off { border-color: var(--danger); color: #ffb3c0; }
.marker .t { opacity: .7; flex: none; }
.botline { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-top: 2px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot.on { background: var(--ok); }
.dot.off { background: var(--danger); }
.day { align-self: center; font-size: 12px; color: var(--muted); margin: 8px 0; }
.thread .readonly { padding: 12px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
details.log { border-top: 1px solid var(--line); padding: 8px 16px; font-size: 13px; }
details.log summary { cursor: pointer; color: var(--muted); }
details.log ul { margin: 8px 0; padding-left: 18px; max-height: 200px; overflow: auto; }

@media (max-width: 760px) {
  .inbox { grid-template-columns: 1fr; }
  .inbox.has-thread .list { display: none; }
  .inbox:not(.has-thread) .thread { display: none; }
  .thread .bar .back { display: inline-flex; }
}

/* ---- step 2/3 screens ---- */
textarea { width: 100%; background: var(--panel-2); border: 1px solid #555; border-radius: 8px; padding: 10px 12px; font: inherit; color: inherit; resize: vertical; }
textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
textarea.big { min-height: 55vh; font-size: 14px; line-height: 1.5; }
input[type=number] { width: 90px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.ok { color: var(--ok); }
.warn, .pill.warn { color: var(--warn); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h1 { margin: 0; }

.table { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.tr { display: grid; grid-template-columns: 1.2fr 1fr 1.6fr .6fr .8fr auto; gap: 12px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); }
.tr.th { border-top: 0; color: var(--muted); font-size: 13px; font-weight: 600; }
.tr .actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; }
@media (max-width: 760px) {
  .tr { grid-template-columns: 1fr 1fr; }
  .tr.th { display: none; }
  .tr .actions { grid-column: 1 / -1; justify-content: flex-start; }
  .tr .clamp { grid-column: 1 / -1; }
}

.form { display: grid; gap: 14px; max-width: 640px; }
.form.wide { max-width: 980px; }
.form label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.form label :is(input, select, textarea), .form label .muted { font-weight: 400; }
.form label.inline { display: flex; align-items: center; gap: 8px; }
.toggle.block { display: flex !important; gap: 10px; align-items: flex-start; color: var(--text); font-size: 14px; }
.toggle.block input { margin-top: 2px; flex: none; }
.toggle.big { font-size: 16px; font-weight: 600; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; } }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; gap: 10px; background: var(--panel); margin: 0; }
fieldset.killed { border-color: var(--danger); }
legend { padding: 0 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
fieldset h3 { margin: 10px 0 0; font-size: 15px; }
.buttons { display: flex; gap: 10px; align-items: center; }
.buttons.sticky { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; }
.condition { border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: grid; gap: 8px; background: var(--panel-2); }
.condition.failed { border-color: #6b2333; }
.exit-actions { display: flex; gap: 16px; flex-wrap: wrap; }

.chain { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 12px 16px; font-size: 12px; }
.chain .blk { border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; background: var(--panel-2); }
.chain .trig { color: var(--text); }
.chain .ai { color: var(--text); border-color: var(--accent); }
.chain .act { color: var(--muted); }
.chain .arrow { color: var(--muted); }
.flowcard { text-decoration: none; color: inherit; }
a.pill { text-decoration: none; }

.banner { background: #3a1d27; color: #ffb3c0; padding: 8px 16px; font-size: 13px; border-bottom: 1px solid var(--line); }
.typing { align-self: flex-start; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; padding: 6px 4px; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; }
.dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .dots i { animation: none; opacity: .6; } }
.composer { border-top: 1px solid var(--line); padding: 10px 12px; display: grid; gap: 8px; background: var(--panel); }
.composer-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.testwin { display: flex; flex-direction: column; height: 100%; }
.testwin .msgs { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 12px 0; min-height: 200px; }

.nav span { text-align: center; }
@media (max-width: 760px) {
  .nav a { font-size: 10px; }
  .nav svg { width: 22px; height: 22px; }
}

/* Contacts (CRM) */
.funnel { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.funnel .step { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 8px; display: grid; gap: 2px; text-align: center; color: var(--text); }
.funnel .step b { font: 800 22px/1 var(--display); }
.funnel .step span { font-size: 12px; color: var(--muted); }
.funnel .step i { font-style: normal; font-size: 11px; color: var(--muted); opacity: .8; }
.funnel .step.on { border-color: var(--accent); background: var(--panel-2); }
.table.crm .tr { grid-template-columns: 1.6fr 1.1fr 1fr .8fr 1.2fr; }
.table.crm .who { display: flex; gap: 10px; align-items: center; color: var(--text); text-decoration: none; min-width: 0; }
select.stage.s5 { border-color: var(--ok); color: #9fe3bf; }
select.stage.s4 { border-color: #9a9a9a; }
fieldset.bookings { margin-bottom: 14px; }
.booking { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 6px 0; border-top: 1px solid var(--line); }
@media (max-width: 760px) { .funnel { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.copyrow { display: flex; gap: 8px; }
.copyrow input { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }

/* CRM board */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { background: transparent; border: 0; color: var(--muted); padding: 6px 14px; font-weight: 600; }
.seg button.on { background: var(--accent); color: #000; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(180px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.board .col { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px; min-height: 160px; }
.board .col.over { border-color: var(--accent); background: var(--panel-2); }
.board .col.s5 { border-top: 3px solid var(--ok); }
.board .colhead { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.board .colhead span { font: 800 18px/1 var(--display); }
.board .reached { margin: 2px 0 10px; }
.cards-col { display: grid; gap: 8px; }
.kcard { display: grid; gap: 6px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; color: var(--text); text-decoration: none; cursor: grab; }
.kcard:hover { border-color: #777; }
.kcard .kname { display: flex; gap: 8px; align-items: center; min-width: 0; }
.kcard .kmeta { display: flex; gap: 4px; flex-wrap: wrap; }
.kcard .kstage { width: 100%; max-width: none; font-size: 12px; }
.board .none { text-align: center; padding: 14px 0; }

/* Chat pop-up over the CRM */
.modal-back { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); display: grid; place-items: center; z-index: 50; padding: 24px; }
.modal { width: min(880px, 100%); height: min(860px, 100%); background: var(--bg); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); }
@media (max-width: 760px) { .modal-back { padding: 0; } .modal { border-radius: 0; height: 100%; } }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.crm-filters { display: grid; gap: 10px; margin-bottom: 14px; }
.crm-filters .frow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.crm-filters .frow .chips { flex: 1; min-width: 0; }
.crm-filters .flabel { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); min-width: 64px; }
.crm-filters .fgroup { display: inline-flex; align-items: center; gap: 10px; margin-right: 18px; }
.crm-filters .fgroup .flabel { min-width: 0; }
@media (max-width: 760px) {
  .crm-filters .frow > .flabel { min-width: 0; width: 100%; }
  .crm-filters .fgroup { width: 100%; justify-content: space-between; margin-right: 0; }
  .table.crm .tr { grid-template-columns: 1fr 1fr; gap: 8px 12px; }
  .table.crm .tr .who { grid-column: 1 / -1; }
  .table.crm .tr select.stage { max-width: none; width: 100%; }
}
.crm-filters select.pagepick { max-width: 260px; padding: 7px 10px; }
@media (max-width: 760px) { .crm-filters select.pagepick { max-width: none; flex: 1; } }
.media-row { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); }
.media-row img { width: 72px; height: 48px; object-fit: cover; border-radius: 6px; background: var(--panel-2); }
.funnel .step.lost b { color: var(--danger); }
.board .col.lost { border-top: 3px solid var(--danger); }
.exit-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 8px; }
.form .exit-actions label.toggle { display: inline-flex; font-weight: 600; }
.seg.small button { padding: 5px 12px; font-size: 13px; }

/* Chat header: who on the left, controls on the right; on a phone the controls get their own row */
.thread .bar .who-info { min-width: 0; flex: 1; }
.who-name, .who-page, .botline { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-name { font-weight: 600; }
.who-page { font-size: 13px; }
.botline b, .botline .muted { overflow: hidden; text-overflow: ellipsis; }
.bar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.btn { white-space: nowrap; }
.simtop { display: flex; gap: 8px; }
.simtop .btn { flex: none; }
.phone-only { display: none; }
.row .meta { align-items: center; flex-wrap: wrap; }
.unread { display: inline-grid; place-items: center; min-width: 18px; height: 18px; }
.inbox { grid-template-columns: 360px minmax(0, 1fr); }
.inbox .list { min-width: 0; }
@media (max-width: 760px) {
  .inbox { grid-template-columns: minmax(0, 1fr); }
  .thread .bar { flex-wrap: wrap; gap: 8px 10px; padding: 10px 12px; }
  .thread .bar .avatar { width: 40px; height: 40px; }
  .bar-actions { flex: 1 1 100%; min-width: 0; flex-wrap: nowrap; }
  .bar-actions select.inline { flex: 1 1 0; min-width: 0; max-width: none; padding: 7px 8px; }
  .bar-actions .btn { flex: none; padding: 7px 12px; }
  .composer-row .hint { display: none; }
  .composer-row { justify-content: flex-end; }
  .composer { padding: 8px 10px; }
  details.log { padding: 6px 12px; }
  .phone-only { display: inline; }
  /* iPhone zooms into any field under 16px when you tap it */
  input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], select, textarea { font-size: 16px; }
  .btn.small { padding: 7px 12px; }
}

/* Reply box: starts at one line and grows as you type */
.composer textarea { resize: none; min-height: 44px; overflow-y: auto; line-height: 1.4; }
/* Phone: hide the bottom menu while typing so the chat keeps its room above the keyboard */
@media (max-width: 760px) {
  .shell:has(.composer textarea:focus) { grid-template-rows: 52px 1fr 0; }
  .shell:has(.composer textarea:focus) .nav { display: none; }
}
.btn.icon { display: inline-grid; place-items: center; padding: 6px 9px; }

/* Full-screen home-screen app: keep clear of the notch and the home bar */
.shell { grid-template-rows: calc(56px + env(safe-area-inset-top)) 1fr; }
.topbar { padding-top: env(safe-area-inset-top); padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
@media (max-width: 760px) {
  .shell { grid-template-rows: calc(52px + env(safe-area-inset-top)) 1fr calc(60px + env(safe-area-inset-bottom)); }
  .nav { padding-bottom: calc(4px + env(safe-area-inset-bottom)); }
  .shell:has(.composer textarea:focus) { grid-template-rows: calc(52px + env(safe-area-inset-top)) 1fr 0; }
  .modal { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
}
.login { padding-top: max(16px, env(safe-area-inset-top)); }
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 170px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 4px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); display: grid; }
.menu button { display: flex; align-items: center; gap: 8px; background: transparent; border: 0; color: var(--text); text-align: left;
  padding: 10px 12px; border-radius: 6px; font-size: 14px; }
.menu button:hover { background: var(--panel-2); }
.menu button.danger { color: var(--danger); }
.banner .btn { margin-left: 8px; }
.who-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.who-row .who { flex: 1; }
.chat-open svg { width: 18px; height: 18px; }
@media (max-width: 760px) { .table.crm .tr .who-row { grid-column: 1 / -1; } .chat-open { padding: 8px 12px; } }
@media (max-width: 760px) { .nav a.desk-only { display: none; } }
@media (max-width: 760px) { .nav a { font-size: 12px; } .nav svg { width: 24px; height: 24px; } }
/* Phone: bottom menu in pure black, so it blends with the strip iOS leaves under home-screen apps */
@media (max-width: 760px) { .nav { background: #000; } }
.dropfilters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.dropfilters.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dropfilters select { padding: 8px 6px; font-size: 14px; min-width: 0; text-overflow: ellipsis; }
.dropfilters select.set { border-color: var(--accent); }
.toggle.live-on { color: var(--ok); font-weight: 700; }
/* Inbox: swipe a chat left for Block / Delete */
.swipe { position: relative; overflow: hidden; }
.swipe-actions { position: absolute; top: 0; right: 0; bottom: 0; display: flex; }
.swipe-actions button { flex: 1; border: 0; color: #fff; font-weight: 700; font-size: 14px; }
.swipe-block { background: #5a5a5a; }
.swipe-delete { background: var(--danger); }
.swipe-front { position: relative; background: var(--bg); touch-action: pan-y; }
.searchrow { display: flex; gap: 8px; }
.searchrow .btn { flex: none; }
.bulkbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--panel); }
.bulk-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.row .pick-box { width: 20px; height: 20px; accent-color: var(--accent); align-self: center; flex: none; pointer-events: none; }
.row.picked { background: var(--panel-2); }
@media (max-width: 760px) { .bulk-actions { margin-left: 0; width: 100%; } .bulk-actions .btn { flex: 1; } }
.row { -webkit-tap-highlight-color: transparent; }
.nav-ext { margin-top: auto; }
.nav-ext img { border-radius: 6px; display: block; }
.banner.ok-banner { background: #15382a; color: #9fe3bf; }
.bulk-info { margin: 10px 12px; font-size: 14px; }
.bulk-info .btn { margin-left: 6px; }
.selecting .thread .bot-toggle { display: none; }
.waitrow { display: flex; align-items: center; gap: 8px; }
.waitrow select { width: auto; flex: 1; padding: 7px 8px; font-size: 14px; }
