/* ScraperPro — same visual language as AutomarketingPro: graphite surfaces, thin borders, green accent. */
:root, [data-theme="dark"] {
  --bg: #1b1c1f;
  --side: #202125;
  --surface: #25272b;
  --surface-2: #2c2e33;
  --border: #33363b;
  --border-strong: #42454b;
  --text: #ececee;
  --text-2: #a3a6ac;
  --text-3: #71757c;
  --accent: #22c55e;
  --accent-hover: #16a34a;
  --accent-text: #4ade80;
  --accent-soft: rgba(34, 197, 94, .13);
  --on-accent: #06140b;
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, .13);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, .13);
  --info: #60a5fa;
  --info-soft: rgba(96, 165, 250, .13);
  --neutral-soft: rgba(255, 255, 255, .07);
  --shadow: 0 12px 32px rgba(0, 0, 0, .45);
  --map-filter: invert(1) hue-rotate(180deg) brightness(.9) contrast(.85) saturate(.6);
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f5f6f7;
  --side: #ffffff;
  --surface: #ffffff;
  --surface-2: #f1f2f4;
  --border: #e4e6e9;
  --border-strong: #d2d5da;
  --text: #16171a;
  --text-2: #5c6067;
  --text-3: #8b9097;
  --accent: #16a34a;
  --accent-hover: #15803d;
  --accent-text: #15803d;
  --accent-soft: rgba(22, 163, 74, .1);
  --on-accent: #ffffff;
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, .08);
  --warn: #b45309;
  --warn-soft: rgba(217, 119, 6, .1);
  --info: #2563eb;
  --info-soft: rgba(37, 99, 235, .08);
  --neutral-soft: rgba(0, 0, 0, .05);
  --shadow: 0 12px 32px rgba(15, 23, 42, .12);
  --map-filter: none;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.45 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:where(.side, .page-head, .toolbar, .row-actions, .sheet, .drawer) svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
.muted { color: var(--text-3); }

/* ───────── shell ───────── */
.shell { display: flex; min-height: 100%; }
.side {
  position: sticky; top: 0; height: 100vh; width: 232px; flex: none;
  display: flex; flex-direction: column; gap: 24px; padding: 20px 14px 16px;
  background: var(--side); border-right: 1px solid var(--border);
  transition: width .18s ease, padding .18s ease;
}
.brand-mini { display: none; }
.side { z-index: 20; }
.side-toggle {
  position: absolute; top: 24px; right: -13px; z-index: 2; display: grid; place-items: center;
  width: 26px; height: 26px; padding: 0; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--side); color: var(--text-2); box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}
.side-toggle:hover { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.side .side-toggle svg { width: 15px; height: 15px; transition: transform .18s; }
.brand { font-size: 19px; font-weight: 700; letter-spacing: -.01em; text-decoration: none; padding: 2px 10px; }
.brand b, .dialog h2 b { color: var(--accent); font-weight: 700; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 7px;
  color: var(--text-2); text-decoration: none; font-weight: 500;
}
.nav a:hover { background: var(--neutral-soft); color: var(--text); }
.nav a.on { background: var(--accent-soft); color: var(--accent-text); }
.nav-count { margin-left: auto; font-size: 12px; color: var(--text-3); }
.nav a.on .nav-count { color: var(--accent-text); }
.nav-badge {
  margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 10px; text-align: center;
  font-size: 11px; font-weight: 600; line-height: 20px; background: var(--info-soft); color: var(--info);
}
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; padding-top: 14px; border-top: 1px solid var(--border); }
.theme-seg { display: flex; gap: 2px; padding: 3px; margin-bottom: 8px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border); }
.theme-seg button {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; padding: 0 8px;
  border: 0; border-radius: 6px; background: none; color: var(--text-3); font-size: 12px; font-weight: 500; cursor: pointer;
}
.theme-seg button svg { width: 15px; height: 15px; }
.theme-seg button:hover { color: var(--text); }
[data-theme="light"] [data-theme-set="light"], [data-theme="dark"] [data-theme-set="dark"] {
  background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .18);
}
[data-theme="dark"] [data-theme-set="dark"] { background: var(--border-strong); }
.side-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 7px;
  background: none; color: var(--text-2); font-size: 13px; font-weight: 500; text-align: left; cursor: pointer;
}
.side-item:hover { background: var(--neutral-soft); color: var(--text); }
.side-item svg { width: 17px; height: 17px; transition: transform .18s; }
.side-status { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 10px 0; }
.ver { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.health { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.health i { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--text-3); }
.health.ok i { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.health.down i { background: var(--danger); }
.health.down { color: var(--danger); }

/* collapsed menu: icons only (big screens; phones use the top bar) */
@media (min-width: 761px) {
  .shell.collapsed .side { width: 68px; padding-inline: 10px; }
  .collapsed .side .lbl, .collapsed .nav-count, .collapsed .brand-full { display: none; }
  .collapsed .brand-mini { display: inline; }
  .collapsed .brand { padding: 2px 0; text-align: center; }
  .collapsed .nav a, .collapsed .side-item { justify-content: center; padding-inline: 0; }
  .collapsed .nav-badge { position: absolute; top: 2px; right: 2px; min-width: 16px; padding: 0 4px; font-size: 10px; line-height: 16px; }
  .collapsed .theme-seg { flex-direction: column; }
  .collapsed .side-toggle svg { transform: rotate(180deg); }
  .collapsed .side-status { justify-content: center; padding-inline: 0; }
}

.main { flex: 1; min-width: 0; padding: 28px 32px 40px; }
.view { max-width: 1320px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.page-head p { margin: 4px 0 0; color: var(--text-2); }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.page-foot { margin: 16px 0 0; font-size: 12px; color: var(--text-3); }

/* ───────── controls ───────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px;
  border-radius: 7px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.danger { color: var(--danger); border-color: var(--border-strong); }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn.block { width: 100%; height: 42px; }
.btn.small { height: 28px; padding: 0 10px; font-size: 12px; }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); }
.link { background: none; border: 0; padding: 0; color: var(--accent-text); cursor: pointer; font-size: inherit; }
.link:hover { text-decoration: underline; }
.pill { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 9px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; }

.input {
  width: 100%; height: 38px; padding: 0 12px; border-radius: 7px;
  border: 1px solid var(--border-strong); background: var(--bg); color: var(--text); outline: none;
}
[data-theme="light"] .input { background: #fff; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder { color: var(--text-3); }
select.input { cursor: pointer; padding-right: 8px; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-weight: 500; font-size: 13px; }
.field small, .toggle-row small { color: var(--text-3); font-size: 12px; }
#geo-status.ok { color: var(--accent-text); }
#geo-status.warn { color: var(--warn); }
.label-row { display: flex; justify-content: space-between; align-items: baseline; }
.label-row output { color: var(--text-2); font-variant-numeric: tabular-nums; }

.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); }
.seg button {
  flex: 1; height: 30px; padding: 0 14px; border: 0; border-radius: 6px; background: none;
  color: var(--text-2); font-weight: 500; cursor: pointer;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .18); }
[data-theme="dark"] .seg button.on { background: var(--border-strong); }
.seg.small button { height: 28px; }

.range { width: 100%; accent-color: var(--accent); }

.switch {
  position: relative; width: 40px; height: 22px; flex: none; border-radius: 11px; border: 0; cursor: pointer;
  background: var(--border-strong); transition: background .15s;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: transform .15s;
}
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }
.switch:disabled { opacity: .4; cursor: default; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.toggle-row > div { display: flex; flex-direction: column; gap: 2px; }

/* ───────── Nova busca ───────── */
.nova-grid { display: grid; grid-template-columns: minmax(320px, 440px) 1fr; gap: 20px; align-items: start; }
.form { display: flex; flex-direction: column; gap: 18px; padding: 22px; }
.more summary { cursor: pointer; color: var(--text-2); font-weight: 500; font-size: 13px; }
.more summary:hover { color: var(--text); }
.more-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.form-error { padding: 10px 12px; border-radius: 7px; background: var(--danger-soft); color: var(--danger); font-size: 13px; }
.map-card { position: sticky; top: 28px; overflow: hidden; }
.map { height: 520px; background: var(--surface-2); }
.map-card.tall { position: static; }
.map-card.tall .map { height: calc(100vh - 330px); min-height: 420px; }
.map-hint { margin: 0; padding: 10px 14px; border-top: 1px solid var(--border); color: var(--text-3); font-size: 12px; }
.leaflet-tile-pane { filter: var(--map-filter); }
.leaflet-container { font: inherit; background: var(--surface-2); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.leaflet-popup-content { margin: 12px 14px; font-size: 13px; line-height: 1.5; }
.leaflet-popup-content a { color: var(--accent-text); }
.leaflet-container a.leaflet-popup-close-button { color: var(--text-3); }
.leaflet-bar a { background: var(--surface); color: var(--text); border-color: var(--border); }
.leaflet-bar a:hover { background: var(--surface-2); }
.leaflet-control-attribution { background: var(--surface) !important; color: var(--text-3); }
.leaflet-control-attribution a { color: var(--text-2); }
.dot-pin { border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .4); }

/* ───────── tables ───────── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 12px; font-weight: 500; color: var(--text-3); white-space: nowrap;
  padding: 11px 14px; border-bottom: 1px solid var(--border);
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--neutral-soft); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .empty { padding: 48px 16px; text-align: center; color: var(--text-3); }
.table .empty .btn { margin-top: 12px; }
.table a { color: var(--text); text-decoration: none; }
.table a:hover { color: var(--accent-text); text-decoration: underline; }
.none { color: var(--text-3); }

/* status pills (Buscas) */
.st { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 11px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.st.ok { background: var(--accent-soft); color: var(--accent-text); }
.st.working { background: var(--info-soft); color: var(--info); }
.st.pending { background: var(--neutral-soft); color: var(--text-2); }
.st.failed { background: var(--danger-soft); color: var(--danger); }
.st.working::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.job-name { font-weight: 500; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.tag { font-size: 11px; padding: 1px 7px; border-radius: 5px; border: 1px solid var(--border-strong); color: var(--text-2); white-space: nowrap; }
.tag.green { border-color: transparent; background: var(--accent-soft); color: var(--accent-text); }
.row-actions { display: flex; justify-content: flex-end; gap: 6px; white-space: nowrap; }
.row-actions .btn { height: 30px; padding: 0 10px; font-size: 13px; }
.row-actions .icon-btn { width: 30px; height: 30px; }
.row-actions .icon-btn:hover { color: var(--danger); }
.row-actions svg { width: 16px; height: 16px; }

/* ───────── Leads ───────── */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.kpi span { color: var(--text-2); font-size: 12px; font-weight: 500; }
.kpi b { font-size: 24px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--text-3); font-size: 12px; }

.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; }
.tabs a {
  padding: 8px 0 10px; color: var(--text-2); text-decoration: none; font-weight: 500; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--accent-text); border-bottom-color: var(--accent); }
.tabs a span { color: var(--text-3); font-weight: 400; margin-left: 2px; }
.tabs a.on span { color: inherit; }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar .search { max-width: 360px; flex: 1 1 220px; }
.toolbar .btn[aria-expanded="true"] { border-color: var(--accent); color: var(--accent-text); }
.toolbar .btn svg { width: 16px; height: 16px; }
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; padding: 16px; margin-bottom: 12px; }
.checks { display: flex; gap: 14px; flex-wrap: wrap; min-height: 38px; align-items: center; }
.checks label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--text-2); }
.checks input { accent-color: var(--accent); width: 15px; height: 15px; }

.sheet th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.sheet th button:hover, .sheet th.sorted button { color: var(--text); }
.sheet th .arrow { font-size: 9px; color: var(--accent-text); }
.sheet th.num button { justify-content: flex-end; width: 100%; }
.sheet td { font-size: 13px; }
.sheet tbody tr { cursor: pointer; }
.sheet .c-sel { width: 36px; padding-right: 0; cursor: default; }
.sheet .c-sel input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; vertical-align: middle; }
.sheet tr.selected td { background: var(--accent-soft); }
.sheet .c-title { min-width: 170px; max-width: 260px; }
.lead-open {
  all: unset; display: block; cursor: pointer; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
}
.lead-open:hover { color: var(--accent-text); text-decoration: underline; }
.lead-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.c-title small { display: block; color: var(--text-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet .c-phone, .sheet .c-nw { white-space: nowrap; }
.sheet .c-email { white-space: nowrap; }
.sheet .c-email a { display: block; }
.sheet th, .sheet td { padding-inline: 12px; }
.sheet .c-note { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-prev { color: var(--text-2); }
.note-add { color: var(--text-3); font-size: 12px; opacity: 0; transition: opacity .1s; }
.sheet tr:hover .note-add { opacity: 1; }
@media (max-width: 1399px) { .sheet .c-note, .sheet th[data-key="note"] { display: none; } }
.sheet svg { width: 14px; height: 14px; }
.wa {
  display: inline-grid; place-items: center; width: 22px; height: 22px; margin-left: 6px; vertical-align: middle;
  border-radius: 6px; background: var(--accent-soft); color: var(--accent-text) !important;
}
.wa:hover { background: var(--accent); color: var(--on-accent) !important; }
.site-link, .social-link { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.sheet .c-link { max-width: 240px; overflow: hidden; }
.social-link { font-weight: 500; }
.social-link.ig { color: #e1306c !important; }
[data-theme="dark"] .social-link.ig { color: #f472b6 !important; }
.site-link svg, .social-link svg { flex: none; }
.site-tag { font-size: 12px; padding: 1px 7px; border-radius: 5px; white-space: nowrap; }
.site-tag.none { background: var(--danger-soft); color: var(--danger); }
.stars { color: #f5b301; }

.status-sel {
  height: 28px; padding: 0 6px; border-radius: 6px; border: 1px solid transparent; cursor: pointer;
  font-size: 12px; font-weight: 600; outline: none;
}
.status-sel option { background: var(--surface); color: var(--text); font-weight: 400; }
.st-novo { background: var(--neutral-soft); color: var(--text-2); }
.st-contatado { background: var(--info-soft); color: var(--info); }
.st-respondeu { background: var(--warn-soft); color: var(--warn); }
.st-fechado { background: var(--accent-soft); color: var(--accent-text); }
.st-descartado { background: var(--danger-soft); color: var(--danger); }
.note {
  width: 100%; min-width: 180px; height: 30px; padding: 0 8px; border-radius: 6px;
  border: 1px solid transparent; background: transparent; outline: none;
}
.note:hover { border-color: var(--border); }
.note:focus { border-color: var(--accent); background: var(--bg); }
.note::placeholder { color: var(--text-3); }

.pager { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--border); color: var(--text-2); font-size: 13px; }
.pager .btn { height: 32px; }

/* ───────── IA ───────── */
:root, [data-theme="dark"] { --ai: #a78bfa; --ai-soft: rgba(167, 139, 250, .14); }
[data-theme="light"] { --ai: #7c3aed; --ai-soft: rgba(124, 58, 237, .09); }
.ia-grid { display: grid; grid-template-columns: minmax(340px, 620px) minmax(280px, 1fr); gap: 20px; align-items: start; }
.ia-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 28px; }
.ia-box { padding: 18px 20px; }
.ia-box h3 { margin: 0 0 12px; font-size: 14px; font-weight: 600; }
.ia-box p { margin: 10px 0 0; font-size: 13px; }
.ia-box .actions { margin-top: 12px; }
.ia-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ia-stats div { display: flex; flex-direction: column; padding: 10px; border-radius: 7px; background: var(--surface-2); }
.ia-stats b { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ia-stats span { font-size: 12px; color: var(--text-3); }
.ia-how { margin: 0; padding-left: 18px; color: var(--text-2); display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.ia-how a { color: var(--accent-text); }
.prov-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.prov {
  display: flex; flex-direction: column; gap: 4px; padding: 12px; text-align: left; cursor: pointer;
  border-radius: 8px; border: 1px solid var(--border-strong); background: var(--bg); color: var(--text);
}
[data-theme="light"] .prov { background: #fff; }
.prov:hover { border-color: var(--text-3); }
.prov.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.prov-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.prov small { color: var(--text-3); font-size: 12px; line-height: 1.4; }
.key-row { display: flex; gap: 8px; }
.key-row .btn { height: 38px; }
#ia-key-status.ok { color: var(--accent-text); }
#ia-key-status.warn { color: var(--warn); }
.field small a { color: var(--accent-text); }
.sep { border: 0; border-top: 1px solid var(--border); margin: 2px 0; width: 100%; }
textarea.input { height: auto; padding: 9px 12px; resize: vertical; line-height: 1.45; }
.btn.ai { color: var(--ai); border-color: var(--ai); }
.btn.ai:hover { background: var(--ai-soft); }
.tag.ai { border-color: transparent; background: var(--ai-soft); color: var(--ai); }
.name-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ai-chip { display: inline-grid; place-items: center; flex: none; width: 18px; height: 18px; border-radius: 5px; background: var(--ai-soft); color: var(--ai); }
.sheet .ai-chip svg, .ai-chip svg { width: 12px; height: 12px; }
.ai-chip.fila, .ai-chip.rodando { background: var(--neutral-soft); color: var(--text-3); animation: pulse 1.2s infinite; }
.ai-chip.erro { background: var(--danger-soft); color: var(--danger); }
.ai-tag { margin-left: 5px; padding: 0 4px; border-radius: 4px; font-size: 10px; font-weight: 700; background: var(--ai-soft); color: var(--ai); vertical-align: 1px; }
.ai-line { display: flex; align-items: center; margin-top: 3px; white-space: nowrap; }
.ai-sec h3 { display: flex; align-items: center; gap: 6px; color: var(--ai); }
.ai-sec h3 svg { width: 14px; height: 14px; }
.ai-sec h4 { margin: 14px 0 6px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.ai-sec dl { margin-bottom: 10px; }
.ai-wait { color: var(--ai); animation: pulse 1.6s infinite; }
.ai-text { color: var(--text); line-height: 1.5; margin-top: 12px !important; }
.ai-sec .small:first-of-type { margin-top: 0; }
.ai-sec > .small { margin: 0 0 6px; }
.ai-list { margin: 0; padding-left: 18px; color: var(--text-2); display: flex; flex-direction: column; gap: 4px; }
.msg-area { font-size: 13px; }
.ai-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.ai-src { margin-top: 12px; font-size: 12px; }
.ai-src summary { cursor: pointer; color: var(--text-2); }
.ai-src a { display: block; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.small { font-size: 12px; }
.d-sec .small { margin-top: 12px; }

/* ───────── bases de conhecimento ───────── */
.bases-grid { display: grid; grid-template-columns: minmax(260px, 380px) minmax(0, 1fr); gap: 20px; align-items: start; }
.bases-list { display: flex; flex-direction: column; gap: 8px; }
.base-item {
  display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 12px 14px; text-align: left;
  color: var(--text); font: inherit; cursor: pointer;
}
.base-item:hover { border-color: var(--text-3); }
.base-item.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.base-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.base-top b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.base-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); }
.base-item small { color: var(--text-3); font-size: 12px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.base-none { padding: 20px; text-align: center; }
.base-none p { margin: 0 0 12px; color: var(--text-2); }
.base-editor { position: sticky; top: 28px; }
.base-content { min-height: 320px; font-size: 13px; line-height: 1.5; resize: vertical; }
.base-foot { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.base-pick { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px; }
.base-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 8px; border-radius: 7px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface); font-size: 13px; user-select: none;
}
.base-chip input { margin: 0; accent-color: var(--ai); }
.base-chip small { color: var(--text-3); font-size: 11px; }
.base-chip.on { border-color: var(--ai); background: var(--ai-soft); }
.enrich-dlg { width: min(560px, calc(100vw - 32px)); }
.enrich-dlg .label { display: block; margin-top: 4px; }
.enrich-dlg .field { margin: 12px 0 4px; }
.enrich-dlg .actions { margin-top: 16px; }
.enrich-dlg .actions .d-foot-gap { flex: 1; }

/* ───────── estratégia + mensagens (ficha) ───────── */
.strat-next, .strat-hl { padding: 10px 12px; border-radius: 7px; margin-bottom: 8px; font-size: 13px; line-height: 1.5; }
.strat-next { background: var(--accent-soft); color: var(--text); }
.strat-hl { background: var(--ai-soft); }
.strat-next b, .strat-hl b { display: block; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; margin-bottom: 2px; }
.strat-next b { color: var(--accent-text); }
.strat-hl b { color: var(--ai); }
.strat-hl p { margin: 0 !important; color: var(--text) !important; }
.strat-sec { border: 1px solid var(--border); border-radius: 7px; margin-bottom: 6px; font-size: 13px; }
.strat-sec summary { cursor: pointer; padding: 8px 12px; font-weight: 600; color: var(--text-2); }
.strat-sec[open] summary { border-bottom: 1px solid var(--border); }
.strat-sec > div { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.strat-sec p { margin: 0 !important; color: var(--text); line-height: 1.5; }
.strat-sec .ai-list { gap: 6px; line-height: 1.45; }
.strat-sec .strat-lbl { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
.strat-obj b { display: block; color: var(--text); margin-bottom: 2px; }
.ai-upgrade { margin: 12px 0 0 !important; padding: 10px 12px; border-radius: 7px; background: var(--ai-soft); font-size: 13px; }
.msg-tabs { margin-bottom: 8px; }
.msg-pane .field { margin-bottom: 8px; }
.msg-pane .label { font-size: 12px; }

/* ───────── dialog + toast ───────── */
.dialog {
  width: min(480px, calc(100vw - 32px)); padding: 24px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); box-shadow: var(--shadow);
}
.dialog::backdrop { background: rgba(0, 0, 0, .55); }
.dialog h2 { margin: 0 0 6px; font-size: 20px; }
.dialog p { color: var(--text-2); margin: 0 0 12px; }
.dialog a { color: var(--accent-text); }
.about-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.about-head img { border-radius: 11px; }
.about-head h2 { margin: 0; }
.about-head .muted { font-size: 12px; }
.about-sub { margin: 18px 0 8px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.credits { list-style: none; margin: 0 0 16px; padding: 0; border: 1px solid var(--border); border-radius: 8px; }
.credits li { display: grid; grid-template-columns: 112px 1fr; column-gap: 12px; padding: 9px 12px; border-top: 1px solid var(--border); }
.credits li:first-child { border-top: 0; }
.credits span { grid-row: span 2; color: var(--text-3); font-size: 12px; padding-top: 1px; }
.credits b { font-weight: 600; }
.credits small { color: var(--text-2); font-size: 12px; }
.about-note { font-size: 12px; padding: 10px 12px; border-radius: 7px; background: var(--neutral-soft); }

/* lead card: slides in from the right */
.drawer {
  position: fixed; inset: 0 0 0 auto; margin: 0; width: min(460px, 100vw); height: 100%; max-width: none; max-height: none;
  padding: 0; border: 0; border-left: 1px solid var(--border); background: var(--surface); color: var(--text); box-shadow: var(--shadow);
}
.drawer[open] { animation: slide-in .18s ease-out; }
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } }
.drawer::backdrop { background: rgba(0, 0, 0, .45); }
.drawer-body { display: flex; flex-direction: column; height: 100%; }
.d-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 20px 14px; border-bottom: 1px solid var(--border); }
.d-head h2 { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.35; }
.d-head p { margin: 4px 0 0; color: var(--text-2); font-size: 13px; }
.d-head .icon-btn { flex: none; width: 32px; height: 32px; }
.d-scroll { flex: 1; overflow-y: auto; padding: 6px 20px 20px; }
.d-status { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; }
.d-sec { padding: 14px 0; border-top: 1px solid var(--border); }
.d-sec h3 { margin: 0 0 10px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.d-sec p { margin: 0 0 4px; }
.d-sec dl { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.d-row { display: grid; grid-template-columns: 84px 1fr; gap: 10px; align-items: baseline; }
.d-row dt { color: var(--text-3); font-size: 12px; }
.d-row dd { margin: 0; overflow-wrap: anywhere; }
.drawer a:not(.btn) { color: var(--text); text-decoration: none; }
.drawer a:not(.btn):hover { color: var(--accent-text); }
.drawer .social-link.ig { color: #e1306c !important; }
[data-theme="dark"] .drawer .social-link.ig { color: #f472b6 !important; }
.wa-btn { margin-left: 8px; color: var(--accent-text) !important; border-color: var(--accent); vertical-align: middle; }
.note-area { height: auto; padding: 8px 12px; resize: vertical; line-height: 1.45; }
.d-foot-gap { flex: 1; }
.d-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--border); }
.dialog form { display: flex; justify-content: flex-end; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 2000;
  max-width: calc(100vw - 32px); padding: 11px 16px; border-radius: 8px;
  background: var(--text); color: var(--bg); font-weight: 500; box-shadow: var(--shadow);
}

/* ───────── small screens ───────── */
@media (max-width: 1000px) {
  .nova-grid { grid-template-columns: 1fr; }
  .map-card { position: static; }
  .map { height: 300px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .ia-grid, .bases-grid, .team-grid { grid-template-columns: 1fr; }
  .ia-side, .base-editor { position: static; }
}
@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .side {
    position: sticky; top: 0; z-index: 1000; width: auto; height: auto;
    flex-direction: row; align-items: center; gap: 8px; padding: 10px 16px;
    border-right: 0; border-bottom: 1px solid var(--border);
  }
  .brand { padding: 0; font-size: 17px; }
  .nav { flex-direction: row; flex: 1; justify-content: center; }
  .nav a { padding: 7px 8px; font-size: 13px; gap: 6px; }
  .nav a svg, .nav-count { display: none; }
  .side-foot { margin: 0; padding: 0; border: 0; }
  .side-foot .lbl, #about-btn, .side-toggle, .side-status { display: none; }
  .theme-seg { margin: 0; }
  .theme-seg button { width: 30px; padding: 0; }
  .main { padding: 20px 16px 32px; }
  .page-head h1 { font-size: 20px; }
  .more-grid, .prov-grid { grid-template-columns: 1fr; }
  .ia-stats { grid-template-columns: repeat(2, 1fr); }
  .map-card.tall .map { height: 60vh; }
}
@media (max-width: 460px) {
  .brand { display: none; }
  .nav { justify-content: flex-start; }
}

/* ───────── login (/entrar) ───────── */
.auth-page { display: flex; min-height: 100%; align-items: center; justify-content: center; padding: 24px 16px; box-sizing: border-box; }
.auth-box { width: 100%; max-width: 400px; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 20px; font-size: 22px; font-weight: 700; }
.auth-brand img { border-radius: 10px; }
.auth-brand b { color: var(--accent); }
.auth-card { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.auth-card h1 { margin: 0; font-size: 20px; font-weight: 600; }
.auth-card p { margin: 0; font-size: 13px; line-height: 1.5; }
.auth-alt { align-self: center; font-size: 13px; }
.auth-ok { padding: 10px 12px; border-radius: 7px; background: var(--accent-soft); color: var(--text); font-size: 13px; line-height: 1.5; }

/* ───────── usuários: papéis, equipe, conta, histórico ───────── */
.vendor-only { display: none !important; }
.role-vendedor .vendor-only { display: block !important; }
.role-vendedor .admin-only { display: none !important; }
.owner-tag { display: block; margin-top: 3px; font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 110px; }
.owner-bulk { width: auto; height: 36px; }
.owner-pick { width: auto; min-width: 160px; }
.d-status + .d-status { padding-top: 0; }
.team-grid { grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); }
.team-list-card { padding: 4px 0; }
.team-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px 140px 190px; gap: 14px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.team-row:last-child { border-bottom: 0; }
.team-row.off { opacity: .6; }
.team-who, .team-st { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.team-who b { font-weight: 600; }
.team-who small, .team-st small { color: var(--text-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.team-st .tag { align-self: flex-start; }
.team-acts { display: flex; gap: 12px; justify-content: flex-end; font-size: 13px; white-space: nowrap; }
.danger-link { color: var(--danger) !important; }
.team-empty { padding: 18px; margin: 0; }
.team-h { margin: 0; font-size: 14px; font-weight: 600; }
.invite-box .key-row { margin-top: 12px; }
.acc-sec { display: flex; flex-direction: column; gap: 10px; padding: 14px 0; border-top: 1px solid var(--border); }
.acc-sec[hidden] { display: none; }
.acc-foot { margin-top: 14px; }
.hist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.hist li { display: flex; justify-content: space-between; gap: 10px; color: var(--text-2); }
.hist li b { color: var(--text); font-weight: 600; }
.hist small { color: var(--text-3); white-space: nowrap; }
@media (max-width: 1000px) {
  .team-grid { grid-template-columns: 1fr; }
}
@media (max-width: 460px) {
  /* six menu items for admins: the theme follows the phone's setting */
  .side .theme-seg { display: none; }
  .nav { overflow-x: auto; scrollbar-width: none; }
}
@media (max-width: 760px) {
  .team-row { grid-template-columns: 1fr auto; }
  .team-row .team-st { grid-column: 1; }
  .team-acts { grid-column: 1 / -1; }
  .side-foot { flex-direction: row; align-items: center; gap: 4px; }
  #me-btn { display: flex; padding: 6px; }
  #me-btn .lbl { display: none; }
}

/* ───────── WhatsApp (Evolution) ───────── */
.wa-list { display: flex; flex-direction: column; gap: 10px; }
.wa-item { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.wa-item.off { opacity: .6; }
.wa-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wa-top b { font-weight: 600; font-size: 15px; }
.wa-item small { color: var(--text-3); font-size: 12px; }
.wa-item small b { color: var(--text); }
.wa-item .actions { margin-top: 6px; }
.tag.danger { border-color: transparent; background: var(--danger-soft); color: var(--danger); }
.wa-users { flex-wrap: wrap; gap: 6px 14px; }
.wa-send { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); display: flex; flex-direction: column; gap: 8px; }
.wa-send:empty { display: none; }
.wa-sec { display: flex; flex-direction: column; gap: 8px; }
.wa-sec h3 { display: flex; align-items: center; gap: 6px; }
.wa-sec h3 svg { width: 14px; height: 14px; }
.wa-send-row { display: flex; gap: 8px; flex-wrap: wrap; }
.wa-send-row select { flex: 1 1 180px; width: auto; min-width: 0; }
.wa-sent { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.wa-sent li { display: flex; justify-content: space-between; gap: 8px; color: var(--text-2); }
.wa-sent li.enviada span { color: var(--accent-text); }
.wa-sent li.erro span { color: var(--danger); }
.wa-sent small { color: var(--text-3); white-space: nowrap; }
.tag.test { margin-left: 6px; border-color: transparent; background: var(--warn-soft, rgba(245, 158, 11, .15)); color: var(--warn, #d97706); font-size: 10px; font-weight: 700; vertical-align: 2px; }

/* ───────── Conversas ───────── */
.view-chat { max-width: none; }
.chat-shell { display: grid; grid-template-columns: 320px minmax(0, 1fr) 300px; gap: 12px; height: calc(100vh - 68px); min-height: 480px; }
.chat-list, .chat-main, .chat-side { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.chat-list { padding: 14px 10px 6px; gap: 10px; }
.chat-list-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 6px; }
.chat-list-head h1 { margin: 0; font-size: 20px; font-weight: 600; }
.chat-list .seg { align-self: flex-start; }
.chat-items { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; margin: 0 -4px; padding: 0 4px; }
.chat-item { display: flex; flex-direction: column; gap: 3px; padding: 10px; border: 0; border-radius: 8px; background: none; color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.chat-item:hover { background: var(--neutral-soft); }
.chat-item.on { background: var(--accent-soft); }
.chat-item-top { display: flex; align-items: baseline; gap: 6px; }
.chat-item-top b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item-top small { margin-left: auto; color: var(--text-3); font-size: 11px; white-space: nowrap; }
.chat-item-sub { display: flex; align-items: center; gap: 4px; color: var(--text-3); font-size: 13px; min-width: 0; }
.chat-item-sub > span:not(.tick) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.chat-item.unread .chat-item-sub > span:not(.tick) { color: var(--text); font-weight: 500; }
.chat-dot { font-style: normal; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.chat-none { padding: 12px 8px; }
.chat-empty { margin: auto; text-align: center; padding: 24px; color: var(--text-2); }
.chat-empty p { margin: 4px 0; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.chat-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-who b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-who small { color: var(--text-3); font-size: 12px; }
.chat-conn { width: auto; height: 32px; font-size: 13px; }
.chat-back { display: none; font-size: 22px; line-height: 1; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 14px 18px; display: flex; flex-direction: column; gap: 6px; background: var(--bg); }
.chat-day { text-align: center; margin: 8px 0; }
.chat-day span { font-size: 11px; color: var(--text-3); background: var(--surface); border: 1px solid var(--border); padding: 2px 10px; border-radius: 10px; }
.msg { max-width: min(560px, 78%); padding: 7px 10px 5px; border-radius: 10px; font-size: 14px; line-height: 1.45; box-shadow: 0 1px 1px rgba(0, 0, 0, .12); }
.msg.in { align-self: flex-start; background: var(--surface); border-top-left-radius: 3px; }
.msg.out { align-self: flex-end; background: #d9fdd3; color: #111b21; border-top-right-radius: 3px; }
[data-theme="dark"] .msg.out { background: #005c4b; color: #e9edef; }
.msg.failed { opacity: .75; outline: 1px solid var(--danger); }
.msg-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-text a { color: inherit; text-decoration: underline; }
.msg-media { font-weight: 500; margin-bottom: 2px; }
.msg-media small { font-weight: 400; opacity: .6; }
.msg-meta { display: flex; justify-content: flex-end; gap: 4px; font-size: 11px; opacity: .65; margin-top: 2px; }
.msg-err { font-size: 12px; color: var(--danger); margin-top: 2px; }
.tick { letter-spacing: -3px; padding-right: 3px; }
.tick.read { color: #34b7f1; opacity: 1; }
.tick.err { color: var(--danger); letter-spacing: 0; }
.chat-compose { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); }
.chat-compose textarea { flex: 1; resize: none; min-height: 40px; max-height: 180px; line-height: 1.4; }
.chat-compose .btn { height: 40px; }
.chat-optout { margin: 10px 12px; }
.chat-side { padding: 16px; gap: 10px; overflow-y: auto; }
.chat-side h3 { margin: 0; font-size: 16px; font-weight: 600; }
.chat-side p { margin: 0; }
.chat-side .d-status { padding: 4px 0; }
.chat-note { font-size: 13px; padding: 8px 10px; border-radius: 7px; background: var(--neutral-soft); white-space: pre-wrap; }
.wa-sent li.recebida span { color: var(--text); }
@media (max-width: 1250px) { .chat-shell { grid-template-columns: 300px minmax(0, 1fr); } .chat-side { display: none; } }
@media (max-width: 760px) {
  .chat-shell { grid-template-columns: 1fr; height: calc(100vh - 120px); }
  .chat-shell .chat-main { display: none; }
  .chat-shell.open .chat-list { display: none; }
  .chat-shell.open .chat-main { display: flex; }
  .chat-back { display: grid; }
  .msg { max-width: 88%; }
}
.chat-who .tag { align-self: flex-start; margin: 2px 0; }
.chat-list .seg button { white-space: nowrap; }
.wa-item .ok-text { color: var(--accent-text); }
.wa-item .err-text { color: var(--danger); }

/* ───────── mídia (1.8) ───────── */
.msg-img { display: block; max-width: 100%; max-height: 320px; border-radius: 7px; margin-bottom: 3px; }
.msg-img.sticker { max-height: 140px; background: none; }
.msg-audio { width: 260px; max-width: 100%; height: 40px; display: block; }
.msg-video { display: block; max-width: 100%; max-height: 340px; border-radius: 7px; background: #000; }
.msg-doc { display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 7px; background: rgba(0, 0, 0, .06); color: inherit !important; text-decoration: none !important; font-weight: 500; }
[data-theme="dark"] .msg-doc { background: rgba(255, 255, 255, .08); }
.msg-doc small { opacity: .6; font-weight: 400; }
.media-tools { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.media-tools .btn { height: 34px; padding: 0 10px; }
.chat-compose { flex-direction: column; align-items: stretch; }
.chat-compose-row { display: flex; align-items: flex-end; gap: 6px; }
.chat-compose-row .media-tools .btn { height: 40px; }
.chat-pending:empty { display: none; }
.media-pending { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.media-pending img, .media-pending video { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; background: #000; }
.media-pending video.round { border-radius: 50%; }
.media-pending audio { height: 36px; max-width: 240px; }
.media-pending .doc-ico { font-size: 28px; }
.media-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.media-info small { color: var(--text-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-pending.rec { color: var(--danger); }
.media-pending.rec b { color: var(--danger); }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: pulse 1s infinite; flex: none; }
.rec-time { font-variant-numeric: tabular-nums; color: var(--text); }
#card-pending:empty { display: none; }
.script-area { font-size: 15px; line-height: 1.6; }
@media (max-width: 760px) {
  .chat-compose-row { flex-wrap: wrap; }
  .chat-compose-row textarea { flex: 1 1 100%; order: -1; }
  .chat-compose-row .btn.primary { margin-left: auto; }
}
.media-pending audio { flex: 1 1 auto; min-width: 0; }
.media-pending .media-info { flex: 0 1 auto; }
.media-pending .icon-btn { flex: none; }
@media (max-width: 460px) { .media-pending .media-info { display: none; } }
.media-pending svg, .chat-main svg, .chat-side svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
