/* NewSeed Inteligência Comercial
   Mundo: off-white quente + tinta quente, serifa editorial nos títulos, laranja NewSeed como ação,
   painel petróleo para o "seu dia", WhatsApp com a cara do WhatsApp. */
:root {
  --bg: #fbf9f6;
  --surface: #ffffff;
  --surface-2: #f5f2ed;
  --ink: #1e1a17;
  --ink-2: #57514c;
  --ink-3: #736c66;
  --line: #ece7e0;
  --line-2: #ddd6cc;
  --accent: #c2531f;
  --accent-hover: #a84517;
  --accent-ink: #ffffff;
  --accent-soft: #fcefe5;
  --brand-orange: #f9a75b;
  --brand-green: #8cc982;
  --petrol: radial-gradient(70% 380% at 50% 0%, #35788d 0%, #185f77 38%, #0d4a5e 66%, #082832 100%);
  --on-petrol: #f6f1ea;
  --on-petrol-2: rgba(246, 241, 234, .78);
  --wa: #168a4c; --wa-hover: #117a42; --wa-ink: #ffffff;
  --wa-soft: #e3f6ea; --wa-icon: #1a9e50;
  --chat-bar: #f0f2f5; --chat-bg: #efeae2; --bubble: #d9fdd3; --bubble-ink: #111b21; --bubble-meta: #667781; --tick: #53bdeb;
  --ok-bg: #e4f2e2; --ok-ink: #2c6a26;
  --warn-bg: #fbefd9; --warn-ink: #85520a;
  --bad-bg: #fbe7e2; --bad-ink: #a3301f;
  --t0-bg: #e3ecf7; --t0-ink: #1a4a8a;
  --t1-bg: #e2f0e4; --t1-ink: #1f6431;
  --t2-bg: #fbe6d8; --t2-ink: #9a400e;
  --t3-bg: #f2e4ef; --t3-ink: #5a1a4a;
  --t4-bg: #dfedef; --t4-ink: #0d5568;
  --shadow-sm: 0 1px 2px rgba(30, 26, 23, .05);
  --shadow: 0 1px 2px rgba(30, 26, 23, .06), 0 12px 32px -12px rgba(30, 26, 23, .16);
  --r-card: 18px;
  --r-ctl: 12px;
  --font: "Inter Tight", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --gutter: 24px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171412;
    --surface: #1f1b18;
    --surface-2: #27221e;
    --ink: #f3eee8;
    --ink-2: #c4bcb3;
    --ink-3: #9d958c;
    --line: #322c27;
    --line-2: #423a33;
    --accent: #f39a5a;
    --accent-hover: #f7b383;
    --accent-ink: #1e120a;
    --accent-soft: #3a2619;
    --wa: #2cc66c; --wa-hover: #49d483; --wa-ink: #04170b;
    --wa-soft: #173322; --wa-icon: #3fd27c;
    --chat-bar: #202c33; --chat-bg: #0b141a; --bubble: #005c4b; --bubble-ink: #e9edef; --bubble-meta: #a6b8bf; --tick: #53bdeb;
    --ok-bg: #1d3320; --ok-ink: #9fd897;
    --warn-bg: #3a2b10; --warn-ink: #f1c375;
    --bad-bg: #3d1d17; --bad-ink: #ffa08f;
    --t0-bg: #1c2a3d; --t0-ink: #a9c6ee;
    --t1-bg: #1c3222; --t1-ink: #a5d8ad;
    --t2-bg: #3a2416; --t2-ink: #f4b88c;
    --t3-bg: #36202f; --t3-ink: #e3b2d5;
    --t4-bg: #19323a; --t4-ink: #9fd3df;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 14px 36px -12px rgba(0,0,0,.65);
    color-scheme: dark;
  }
  .brand-logo { content: url("logo-newseed-branco.png"); }
  .gate-logo { content: url("logo-newseed-branco.png"); }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums;
}
::selection { background: var(--accent-soft); color: var(--ink); }
* { scrollbar-color: var(--line-2) transparent; scrollbar-width: thin; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-underline-offset: 3px; }
code { font: 12px/1 ui-monospace, "Cascadia Mono", Consolas, monospace; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 2px 5px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { width: 18px; height: 18px; flex: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid transparent; background: none;
  font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s, transform .1s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn[aria-disabled="true"], .btn:disabled { opacity: .45; pointer-events: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-pill { background: var(--surface); border-color: var(--line-2); color: var(--ink); box-shadow: var(--shadow-sm); }
.btn-pill:hover { border-color: var(--ink-3); }
.btn-pill[aria-expanded="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-outline { border-color: var(--line-2); color: var(--ink); background: var(--surface); }
.btn-outline:hover { border-color: var(--ink-3); background: var(--surface-2); }
.btn-light { background: var(--on-petrol); color: #0d4a5e; }
.btn-light:hover { background: #fff; }
.btn-wa { background: var(--wa); color: var(--wa-ink); }
.btn-wa:hover { background: var(--wa-hover); }
.btn-sm { height: 32px; padding: 0 13px; font-size: 13px; }
.btn-lg { height: 50px; padding: 0 22px; font-size: 15px; }
.btn-lg .ic { width: 20px; height: 20px; }
.btn-block { width: 100%; }
.icon-btn { width: 34px; height: 34px; display: inline-grid; place-items: center; border: 0; background: none; border-radius: 999px; color: var(--ink-2); }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.link-btn { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; padding: 4px 2px; color: var(--accent); font-weight: 600; font-size: 13px; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.danger-link { color: var(--ink-3); font-weight: 500; }

/* ---------- fields ---------- */
.field { display: grid; gap: 6px; }
.field > span, .label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field em { font-style: normal; font-weight: 400; color: var(--ink-3); }
input, select, textarea {
  width: 100%; border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--r-ctl);
  padding: 8px 12px; min-height: 38px; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; line-height: 1.45; }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.hint { margin: 0; font-size: 12.5px; color: var(--ink-3); max-width: 60ch; }

.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button {
  display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; border-radius: 999px;
  padding: 6px 14px; font-weight: 600; font-size: 13px; color: var(--ink-2); white-space: nowrap; transition: background-color .15s, color .15s, box-shadow .15s;
}
.seg button .ic { width: 15px; height: 15px; }
.seg button:hover { color: var(--ink); }
.seg button[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(30,26,23,.1), 0 0 0 1px var(--line); }
.seg button[aria-checked="true"] .ic-wa { color: var(--wa-icon); }
.seg-sm button { padding: 6px 12px; }

/* ---------- login ---------- */
.gate { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; background: var(--petrol); }
.gate-card { width: min(400px, 100%); background: var(--surface); border-radius: 24px; box-shadow: var(--shadow); padding: 32px 28px; display: grid; gap: 18px; }
.gate-logo { width: 116px; height: auto; }
.gate-title { margin: 0; font: 400 34px/1.05 var(--serif); letter-spacing: -.02em; }
.gate-sub { margin: 6px 0 0; color: var(--ink-2); }
.gate-error { margin: 0; color: var(--bad-ink); font-size: 13px; }
.gate-error:empty { display: none; }

/* ---------- shell ---------- */
.app { height: 100dvh; display: flex; flex-direction: column; }
.top { flex: none; z-index: 5; }
.top-row { display: flex; align-items: center; gap: 16px; padding: 14px var(--gutter) 12px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand-logo { height: 38px; width: auto; display: block; }
.brand-name { font: 400 23px/1 var(--serif); letter-spacing: -.01em; padding-left: 12px; border-left: 1px solid var(--line-2); white-space: nowrap; }
.brand-meta { margin-left: auto; color: var(--ink-3); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pulse {
  margin: 0 var(--gutter); border-radius: 22px; color: var(--on-petrol); overflow: hidden; position: relative;
  background: radial-gradient(40% 90% at 85% 0%, rgba(249, 167, 91, .38), transparent 70%), var(--petrol);
  padding: 18px 22px; display: grid; grid-template-columns: 1fr auto auto; gap: 24px; align-items: center;
}
.pulse-title { margin: 0; font: 400 32px/1.05 var(--serif); letter-spacing: -.02em; }
.pulse-title i { color: var(--brand-orange); }
.pulse-line { margin: 6px 0 0; color: var(--on-petrol-2); font-size: 14.5px; max-width: 70ch; }
.pulse-line b { color: var(--on-petrol); font-weight: 600; }
.pulse-meter { display: grid; gap: 7px; justify-items: end; }
.pulse-meter-bar { width: 200px; height: 6px; border-radius: 3px; background: rgba(246, 241, 234, .2); overflow: hidden; }
.pulse-meter-bar i { display: block; height: 100%; width: 100%; background: var(--brand-orange); transform: scaleX(0); transform-origin: left; transition: transform .4s cubic-bezier(.2,.8,.2,1); border-radius: 3px; }
.pulse-meter.over .pulse-meter-bar i { background: var(--brand-green); }
.pulse-meter-label { font-size: 12.5px; color: var(--on-petrol-2); }

.settings { margin: 0 var(--gutter) 14px; background: var(--surface); border-radius: var(--r-card); padding: 20px 22px; max-height: 70dvh; overflow: auto; box-shadow: var(--shadow); }
.settings-title { margin: 0 0 2px; font: 400 22px/1.1 var(--serif); letter-spacing: -.01em; }
.settings-title i { color: var(--accent); }
.settings-grid { display: grid; grid-template-columns: minmax(240px, 340px) 1fr; gap: 28px; }
.settings-col { display: grid; gap: 14px; align-content: start; }
.variants-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; align-items: baseline; }
.vars { font-size: 12px; color: var(--ink-3); display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.variants { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: v; }
.variant { display: grid; grid-template-columns: 24px 1fr auto; gap: 8px; align-items: start; counter-increment: v; }
.variant::before { content: counter(v); font: 400 18px/1 var(--serif); color: var(--ink-3); padding-top: 10px; text-align: right; }
.variant textarea { min-height: 64px; font-size: 13px; background: var(--bg); }
.variant.off textarea { opacity: .5; }
.variant-tools { display: grid; gap: 2px; padding-top: 2px; }
.switch { position: relative; width: 36px; height: 22px; border-radius: 11px; border: 0; background: var(--line-2); padding: 0; transition: background-color .15s; margin-top: 8px; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .18s cubic-bezier(.2,.8,.2,1); }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(14px); }
.variants-actions { display: flex; gap: 4px; flex-wrap: wrap; margin-left: 24px; }
.settings-foot { display: flex; align-items: center; gap: 8px; justify-content: flex-end; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.save-state { margin-right: auto; font-size: 12.5px; color: var(--ink-3); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px var(--gutter) 14px; align-items: center; }
.filters-more { display: contents; }
.filters-toggle { display: none; }
.filters-n:not(:empty) { margin-left: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-size: 11px; display: inline-grid; place-items: center; }
.search { position: relative; flex: 1 1 200px; max-width: 290px; }
.search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); width: 17px; height: 17px; }
.search input { padding-left: 36px; border-radius: 999px; }
.select { flex: 0 1 170px; min-width: 128px; }
.select select, .select input { font-size: 13px; border-radius: 999px; }

.local-banner { background: var(--warn-bg); color: var(--warn-ink); font-size: 12.5px; padding: 7px 14px; margin: 0 var(--gutter) 12px; border-radius: 12px; flex: none; }

/* ---------- work area ---------- */
.work { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 16px; padding: 0 var(--gutter) var(--gutter); }
.list { overflow: auto; min-height: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-sm); }
.list-card { padding-bottom: 16px; }
.list-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px 10px; }
.count { font-size: 13px; color: var(--ink-2); }
.count b { font: 400 22px/1 var(--serif); color: var(--ink); letter-spacing: -.01em; margin-right: 2px; }
.keys { font-size: 12px; color: var(--ink-3); }
kbd { font: 600 11px/1 var(--font); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; padding: 2px 5px; background: var(--surface); color: var(--ink-2); }

.rows-head, .row {
  display: grid; grid-template-columns: minmax(220px, 1.7fr) minmax(150px, 1.3fr) minmax(110px, .9fr) 132px 96px;
  gap: 14px; align-items: center; padding: 0 20px;
}
.rows-head { font-size: 11.5px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; padding-top: 6px; padding-bottom: 8px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.rows { list-style: none; margin: 0; padding: 0; }
.row { min-height: 64px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background-color .12s; }
.row:hover { background: var(--surface-2); }
.row[aria-selected="true"] { background: var(--accent-soft); }
.row.done .r-name-text { color: var(--ink-2); }
.r-lead { display: flex; align-items: center; gap: 12px; min-width: 0; }
.r-name { min-width: 0; }
.r-name-text { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-name small { display: flex; align-items: center; gap: 6px; font-weight: 400; color: var(--ink-3); font-size: 12.5px; overflow: hidden; white-space: nowrap; margin-top: 1px; }
.r-name small span { overflow: hidden; text-overflow: ellipsis; }
.r-ativ { min-width: 0; }
.r-bairro { color: var(--ink-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-tel { font-size: 13px; white-space: nowrap; color: var(--ink-2); }
.r-tel .nozap { color: var(--ink-3); font-size: 11.5px; display: block; }
.r-act { display: flex; gap: 6px; justify-content: flex-end; }
.r-act a { width: 38px; height: 38px; border-radius: 999px; display: inline-grid; place-items: center; transition: background-color .15s, color .15s, transform .1s; }
.r-act a:active { transform: scale(.94); }
.r-act .wa { background: var(--wa-soft); color: var(--wa-icon); }
.r-act .wa .ic { width: 19px; height: 19px; }
.r-act .wa:hover { background: var(--wa); color: var(--wa-ink); }
.r-act .call { background: var(--surface-2); color: var(--ink-2); }
.r-act .call:hover { background: var(--ink); color: var(--bg); }
.r-act [aria-disabled="true"] { opacity: .4; }
.r-meta { display: none; }

.avatar { flex: none; width: 38px; height: 38px; border-radius: 999px; display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; letter-spacing: .02em; background: var(--tb); color: var(--ti); }
.avatar-lg { width: 54px; height: 54px; font-size: 18px; }
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.chip-tag { display: inline-block; max-width: 100%; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--tb); color: var(--ti); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.t0 { --tb: var(--t0-bg); --ti: var(--t0-ink); }
.t1 { --tb: var(--t1-bg); --ti: var(--t1-ink); }
.t2 { --tb: var(--t2-bg); --ti: var(--t2-ink); }
.t3 { --tb: var(--t3-bg); --ti: var(--t3-ink); }
.t4 { --tb: var(--t4-bg); --ti: var(--t4-ink); }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; flex: none; }
.badge .ic { width: 13px; height: 13px; }
.b-ok { background: var(--ok-bg); color: var(--ok-ink); }
.b-wa { background: var(--wa-soft); color: var(--wa-icon); }
.b-warn { background: var(--warn-bg); color: var(--warn-ink); }
.b-bad { background: var(--bad-bg); color: var(--bad-ink); }

.more { margin: 16px auto 0; display: flex; }
.empty { padding: 56px 24px; text-align: center; color: var(--ink-2); max-width: 48ch; margin: 0 auto; }
.empty strong { display: block; color: var(--ink); font: 400 26px/1.15 var(--serif); margin-bottom: 8px; letter-spacing: -.01em; }
.skeleton { padding: 0 20px; display: grid; }
.skeleton i { height: 64px; background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s ease-in-out infinite; border-bottom: 1px solid var(--line); }
@keyframes sk { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ---------- detail ---------- */
.detail { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: auto; min-height: 0; box-shadow: var(--shadow-sm); }
.detail-inner { padding: 14px 22px 26px; display: grid; gap: 16px; align-content: start; }
.detail-empty { color: var(--ink-3); padding: 48px 8px; text-align: center; }
.d-top { display: flex; align-items: center; justify-content: space-between; margin: 0 -10px -6px; }
.d-close { visibility: hidden; }
.d-nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.d-pos { font-size: 12px; color: var(--ink-3); min-width: 92px; text-align: center; }
.d-head { display: flex; gap: 14px; align-items: flex-start; }
.d-head-text { min-width: 0; display: grid; gap: 6px; justify-items: start; }
.d-name { margin: 0; font: 400 28px/1.05 var(--serif); letter-spacing: -.02em; text-wrap: balance; }
.d-fant { margin: -2px 0 0; color: var(--ink-2); }
.d-fant:empty { display: none; }
.d-facts { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; padding: 14px 16px; background: var(--bg); border-radius: 14px; }
.d-facts div { min-width: 0; }
.d-facts .wide { grid-column: 1 / -1; }
.d-facts dt { font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.d-facts dd { margin: 2px 0 0; font-size: 13.5px; overflow-wrap: anywhere; }
.d-state:empty { display: none; }
.d-state { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; color: var(--ink-2); margin-top: -6px; }

/* prévia no WhatsApp */
.chat { border-radius: 16px; overflow: hidden; border: 1px solid var(--line); }
.chat-bar { display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 12px; background: var(--chat-bar); }
.chat-who { display: grid; min-width: 0; line-height: 1.2; }
.chat-who b { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-who small { color: var(--bubble-meta); font-size: 12px; }
.chat-tools { margin-left: auto; display: flex; gap: 2px; }
.chat-tool { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; color: var(--ink-2); padding: 6px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.chat-tool .ic { width: 16px; height: 16px; }
.chat-tool:hover { background: rgba(0,0,0,.06); color: var(--ink); }
.chat-body { background: var(--chat-bg); padding: 16px 14px 12px 40px; display: grid; justify-items: end; gap: 4px; }
.bubble {
  background: var(--bubble); color: var(--bubble-ink); border-radius: 10px 2px 10px 10px; position: relative;
  padding: 9px 12px; font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere;
  box-shadow: 0 1px .5px rgba(11, 20, 26, .13); outline: none; transition: box-shadow .15s;
}
.bubble::after { content: ""; position: absolute; top: 0; right: -8px; width: 0; height: 0; border-top: 10px solid var(--bubble); border-right: 8px solid transparent; }
.bubble:focus { box-shadow: 0 0 0 2px var(--accent); }
.bubble mark { background: none; color: inherit; font-weight: 700; }
.bubble-meta { font-size: 11.5px; color: var(--bubble-meta); display: inline-flex; align-items: center; gap: 4px; }
.bubble-meta .ic { width: 16px; height: 16px; color: var(--tick); }
.bubble.edited + .bubble-meta::before { content: "editada · "; }

.d-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.d-result { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 16px; }
.d-result .label { font: 400 20px/1 var(--serif); color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 6px 13px; font-size: 13px; font-weight: 600; color: var(--ink-2); transition: background-color .15s, border-color .15s, color .15s; }
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip[aria-pressed="true"][data-r="interessado"] { background: var(--ok-bg); border-color: transparent; color: var(--ok-ink); }
.chip[aria-pressed="true"][data-r="nao_atende"] { background: var(--warn-bg); border-color: transparent; color: var(--warn-ink); }
.chip[aria-pressed="true"][data-r="sem_interesse"], .chip[aria-pressed="true"][data-r="numero_errado"] { background: var(--bad-bg); border-color: transparent; color: var(--bad-ink); }
.d-result .link-btn { justify-self: start; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: var(--bg); border-radius: 999px; padding: 8px 8px 8px 16px;
  display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow); z-index: 50; font-size: 13.5px; max-width: calc(100vw - 24px);
  animation: toast-in .22s cubic-bezier(.2,.8,.2,1);
}
.toast > .ic { color: var(--brand-green); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }
.toast-btn { border: 0; background: rgba(255,255,255,.12); color: inherit; font-weight: 700; padding: 6px 12px; border-radius: 999px; }
.toast-btn:hover { background: rgba(255,255,255,.22); }
@media (prefers-color-scheme: dark) { .toast-btn { background: rgba(0,0,0,.08); } }

/* ---------- responsive ---------- */
@media (max-width: 1279px) {
  .rows-head, .row { grid-template-columns: minmax(200px, 1.6fr) minmax(130px, 1.2fr) 124px 92px; }
  .rows-head span:nth-child(3), .r-bairro { display: none; }
  .work { grid-template-columns: minmax(0, 1fr) 400px; }
  .brand-meta { display: none; }
}
@media (max-width: 1023px) {
  .work { grid-template-columns: 1fr; }
  .detail {
    position: fixed; inset: 0; z-index: 30; border: 0; border-radius: 0; transform: translateY(100%);
    transition: transform .26s cubic-bezier(.2,.8,.2,1); visibility: hidden;
  }
  .app.show-detail .detail { transform: none; visibility: visible; }
  .d-close { visibility: visible; }
  .detail-inner { padding: 10px 16px calc(24px + env(safe-area-inset-bottom)); max-width: 640px; margin: 0 auto; }
  .keys { display: none; }
  .pulse { grid-template-columns: 1fr auto; }
  .pulse-meter { grid-column: 1 / -1; justify-items: start; grid-row: 2; }
  .pulse-meter-bar { width: 100%; }
}
@media (max-width: 760px) {
  :root { --gutter: 12px; }
  .top-row { padding: 10px 12px 10px; gap: 10px; }
  .brand-logo { height: 32px; }
  .brand-name { font-size: 19px; padding-left: 10px; }
  #btn-settings { margin-left: auto; padding: 0 12px; }
  #btn-settings span { display: none; }
  .pulse { padding: 14px 16px; gap: 10px 12px; border-radius: 18px; }
  .pulse-title { font-size: 24px; }
  .pulse-line { font-size: 13px; margin-top: 4px; }
  #pulse-go { height: 34px; padding: 0 12px; font-size: 13px; }
  .filters { padding: 12px; display: grid; grid-template-columns: 1fr auto; }
  .search { max-width: none; }
  .filters-toggle { display: inline-flex; height: 38px; }
  .filters-toggle[aria-expanded="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
  .filters .seg { width: 100%; }
  .filters .seg button { flex: 1; justify-content: center; padding: 7px 4px; }
  #f-zap { grid-column: 1 / -1; }
  .filters-more { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; grid-column: 1 / -1; }
  .filters-more[data-open="false"] { display: none; }
  #f-status { grid-column: 1 / -1; }
  .select { min-width: 0; }
  .filters-more .select:last-child { grid-column: 1 / -1; }
  .work { padding: 0 0 0; }
  .list { border-radius: 18px 18px 0 0; border-bottom: 0; }
  .rows-head { display: none; }
  .row { grid-template-columns: 1fr auto; padding: 10px 12px; min-height: 70px; }
  .r-ativ, .r-bairro, .r-tel { display: none; }
  .r-meta { display: block; font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .r-name small { display: none; }
  .r-act a { width: 44px; height: 44px; }
  .settings { margin: 0 12px 12px; padding: 16px; max-height: 75dvh; }
  .settings-grid { grid-template-columns: 1fr; }
  .d-actions { grid-template-columns: 1fr; }
  .list-head { padding: 12px 12px 8px; }
  .local-banner { margin: 0 12px 10px; }
  .d-name { font-size: 25px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
