/* Layout: fixed rail on the left, spec-sheet content on the right.
   Dark-only identity taken from the references: near-black ground,
   glowing squircle "devices" (blue / pink-purple / ember), lime as the live signal,
   Urbanist for text, Doto (dot-matrix) for numbers. */
:root {
  --bg: #0b0b0c;
  --surface: #121214;
  --surface-2: #19191c;
  --surface-3: #222226;
  --line: rgba(255, 255, 255, .075);
  --line-2: rgba(255, 255, 255, .14);
  --text: #f1f1f3;
  --muted: #8b8b94;
  --dim: #56565e;

  --lime: #c6f432;
  --lime-ink: #1a2200;
  --blue: #182780;
  --blue-glow: #7f8cff;
  --pink: #f567b5;
  --purple: #622585;
  --ember: #ff4a1c;
  --ok: #3ddc97;
  --warn: #ffb547;
  --bad: #ff5a3c;

  --f-text: "Urbanist", "Segoe UI", system-ui, sans-serif;
  --f-dot: "Doto", "Courier New", monospace;

  --r-xl: 34px;
  --r-lg: 24px;
  --r-md: 16px;
  --r-sm: 11px;
  --side-w: 236px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-text);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
body::after { /* film grain */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 999; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img { max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
::selection { background: var(--lime); color: var(--lime-ink); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 10px; border: 3px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

.dot { font-family: var(--f-dot); font-weight: 700; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100%; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 28px;
  padding: 28px 18px 22px; border-right: 1px solid var(--line); background: linear-gradient(180deg, #0e0e10, #0b0b0c);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; text-decoration: none; }
.brand-mark { display: grid; grid-template-columns: repeat(3, 5px); gap: 3px; }
.brand-mark i { width: 5px; height: 5px; border-radius: 50%; background: var(--text); opacity: .9; }
.brand-mark i:nth-child(2n) { opacity: .35; }
.brand-mark i:nth-child(5) { background: var(--lime); opacity: 1; }
.brand b { font-weight: 600; font-size: 18px; letter-spacing: -.01em; }
.brand small { display: block; color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 11px; color: var(--dim); letter-spacing: .1em; padding: 0 10px 8px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; text-decoration: none;
  color: var(--muted); font-weight: 500; transition: background .2s, color .2s;
}
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav a .n { margin-left: auto; font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; }
.nav a:hover { background: var(--surface); color: var(--text); }
.nav a.active { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.nav a.active .n { color: var(--lime); }
.nav a .badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--lime); color: var(--lime-ink); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.nav a .badge + .n { margin-left: 6px; }

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.conn-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; color: var(--text); width: fit-content;
}
.conn-pill .led { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px var(--lime); }
.conn-pill.off .led { background: var(--dim); box-shadow: none; }

.main { min-width: 0; padding: 30px 40px 60px; }

/* ---------- Page header (spec-sheet) ---------- */
.ph { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 16px 24px; margin-bottom: 28px; }
.ph-idx { grid-column: 1 / -1; display: flex; justify-content: space-between; font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; }
.ph h1 { margin: 0; font-weight: 500; font-size: clamp(36px, 4.6vw, 60px); line-height: 1.05; letter-spacing: -.01em; text-wrap: balance; }
.ph p { margin: 6px 0 0; font-size: clamp(17px, 1.6vw, 22px); font-weight: 300; color: var(--muted); }
.ph-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.eyebrow { font-size: 13px; color: var(--muted); letter-spacing: .02em; display: flex; gap: 10px; align-items: center; margin: 34px 0 14px; }
.eyebrow::before, .eyebrow::after { content: "///"; color: var(--dim); }
.eyebrow:first-child { margin-top: 0; }

/* ---------- Buttons & controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 999px;
  border: 0; cursor: pointer; background: var(--surface-2); color: var(--text); font-weight: 500; font-size: 14px; white-space: nowrap;
  box-shadow: inset 0 0 0 1px var(--line); transition: background .2s, transform .1s, box-shadow .2s; text-decoration: none;
}
.btn svg { width: 17px; height: 17px; }
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--text); color: #0b0b0c; box-shadow: none; }
.btn.primary:hover { background: #fff; }
.btn.lime { background: var(--lime); color: var(--lime-ink); box-shadow: 0 0 24px -6px rgba(198,244,50,.6); }
.btn.lime:hover { background: #d4ff4a; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--surface); }
.btn.danger { color: var(--bad); }
.btn.sm { height: 34px; padding: 0 13px; font-size: 13px; }
.btn.icon { width: 42px; padding: 0; }
.btn.sm.icon { width: 34px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.glass { background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); backdrop-filter: blur(12px); }
.btn.glass:hover { background: rgba(255,255,255,.14); }

.icon-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
  background: var(--surface-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); transition: .2s; text-decoration: none; flex: none;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { color: var(--text); background: var(--surface-3); }
.icon-btn.on { background: var(--lime); color: var(--lime-ink); box-shadow: none; }
.icon-btn.wa:hover { color: var(--lime); }

.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > span { font-size: 12px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; height: 46px; padding: 0 16px; border-radius: 14px; border: 0; outline: 0;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .2s, background .2s;
}
.textarea { height: auto; min-height: 110px; padding: 13px 16px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { box-shadow: inset 0 0 0 1px var(--line-2), 0 0 0 4px rgba(198,244,50,.08); background: var(--surface-2); }
.input::placeholder, .textarea::placeholder { color: var(--dim); }
.select { appearance: none; padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%238b8b94' stroke-width='1.6'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 15px center; }
.input-icon { position: relative; }
.input-icon svg { position: absolute; left: 15px; top: 50%; translate: 0 -50%; width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.input-icon .input { padding-left: 42px; }

.seg { display: inline-flex; padding: 4px; gap: 2px; border-radius: 999px; background: rgba(255,255,255,.05); box-shadow: inset 0 0 0 1px var(--line); flex-wrap: wrap; }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 7px 14px; border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 500; transition: .2s; }
.seg button:hover { color: var(--text); }
.seg button.on { background: rgba(255,255,255,.12); color: var(--text); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.seg.full { display: flex; }
.seg.full button { flex: 1; }

.switch { position: relative; width: 50px; height: 28px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: rgba(255,255,255,.12); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); transition: .25s; }
.switch span::after { content: ""; position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: #e9e9ee; transition: .25s; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.switch input:checked + span { background: rgba(198,244,50,.25); }
.switch input:checked + span::after { left: 26px; background: var(--lime); }

.chk { display: inline-grid; place-items: center; width: 22px; height: 22px; flex: none; cursor: pointer; position: relative; }
.chk input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chk i { width: 18px; height: 18px; border-radius: 6px; box-shadow: inset 0 0 0 1.5px var(--dim); transition: .15s; display: grid; place-items: center; }
.chk input:checked + i { background: var(--lime); box-shadow: none; }
.chk input:checked + i::after { content: ""; width: 9px; height: 5px; border-left: 2px solid var(--lime-ink); border-bottom: 2px solid var(--lime-ink); rotate: -45deg; translate: 0 -1px; }
.chk input:focus-visible + i { outline: 2px solid var(--lime); outline-offset: 2px; }

.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; cursor: pointer; font-size: 14px; }
.toggle-row small { display: block; color: var(--dim); font-size: 12px; }

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

/* ---------- Pills, chips, tags ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 500;
  background: rgba(255,255,255,.06); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); white-space: nowrap; }
.pill svg { width: 13px; height: 13px; }
.pill.lime { color: var(--lime); background: rgba(198,244,50,.08); box-shadow: inset 0 0 0 1px rgba(198,244,50,.2); }
.pill.pink { color: var(--pink); background: rgba(245,103,181,.08); box-shadow: inset 0 0 0 1px rgba(245,103,181,.2); }
.pill.blue { color: var(--blue-glow); background: rgba(127,140,255,.08); box-shadow: inset 0 0 0 1px rgba(127,140,255,.2); }
.pill.bad { color: var(--bad); background: rgba(255,90,60,.08); box-shadow: inset 0 0 0 1px rgba(255,90,60,.2); }
.pill.warn { color: var(--warn); background: rgba(255,181,71,.08); box-shadow: inset 0 0 0 1px rgba(255,181,71,.2); }
.pill .sw { width: 8px; height: 8px; border-radius: 50%; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 0; cursor: pointer; padding: 7px 13px; border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 13px; box-shadow: inset 0 0 0 1px var(--line); transition: .2s; }
.chip:hover { color: var(--text); background: var(--surface-2); }
.chip.on { color: var(--lime-ink); background: var(--lime); box-shadow: none; }

.color-chip { display: inline-flex; align-items: center; gap: 10px; padding: 5px 5px 5px 14px; border-radius: 999px; background: var(--surface-2); font-size: 12px; font-family: var(--f-text); color: var(--muted); }
.color-chip i { width: 22px; height: 22px; border-radius: 50%; }

.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 11px; border-radius: 999px; background: var(--surface-2); font-size: 12px; color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.tag i { width: 7px; height: 7px; border-radius: 50%; }
.tag button { border: 0; background: transparent; color: var(--dim); cursor: pointer; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; padding: 0; }
.tag button:hover { color: var(--text); background: var(--surface-3); }
.tag.plain { padding-right: 11px; }

/* ---------- Glow "device" cards ---------- */
.gcard { position: relative; border-radius: var(--r-xl); padding: 22px 24px; overflow: hidden; isolation: isolate; min-width: 0; }
.gcard h3 { margin: 0; font-weight: 500; font-size: 16px; letter-spacing: -.005em; }
.gcard.blue {
  background: radial-gradient(130% 100% at 50% 0%, #1d2a8f 0%, #0d1356 38%, #060828 75%, #04051a 100%);
  box-shadow: inset 0 0 0 1px rgba(160,170,255,.22), inset 0 0 50px rgba(120,130,255,.35), 0 40px 80px -40px rgba(40,60,220,.6);
}
.gcard.pink {
  background: linear-gradient(180deg, #f567b5 0%, #b3438f 16%, #5a1f63 42%, #2d0e30 70%, #1f0a1d 100%);
  box-shadow: inset 0 0 0 1px rgba(255,170,220,.3), inset 0 0 60px rgba(245,103,181,.35), 0 40px 80px -40px rgba(245,103,181,.45);
}
.gcard.ember {
  background: radial-gradient(140% 110% at 50% 115%, #ff5a26 0%, #e2380f 32%, #5a1306 64%, #1a0703 100%);
  box-shadow: inset 0 0 0 1px rgba(255,150,110,.25), inset 0 0 50px rgba(255,90,40,.3), 0 40px 80px -40px rgba(255,74,28,.5);
}
.gcard.black {
  background: linear-gradient(180deg, #232327 0%, #121214 45%, #0b0b0c 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), inset 0 1px 0 rgba(255,255,255,.08), 0 30px 60px -30px rgba(0,0,0,.8);
}
.gcard.violet {
  background: radial-gradient(130% 110% at 50% 0%, #4b3ba8 0%, #241a5e 40%, #0e0a26 100%);
  box-shadow: inset 0 0 0 1px rgba(190,170,255,.22), inset 0 0 50px rgba(150,130,255,.3);
}

.panel { background: var(--surface); border-radius: var(--r-lg); box-shadow: inset 0 0 0 1px var(--line); padding: 22px; min-width: 0; }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-h h3 { margin: 0; font-size: 16px; font-weight: 500; }
.panel-h .muted { font-size: 13px; }

/* spec rows (label under value) */
.spec { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; }
.spec > div { padding: 12px 0; border-top: 1px solid var(--line); min-width: 0; }
.spec b { display: block; font-weight: 500; font-size: 16px; overflow-wrap: anywhere; }
.spec small { display: block; color: var(--dim); font-size: 11px; margin-top: 2px; }
.spec .wide { grid-column: 1 / -1; }

/* ---------- Dashboard ---------- */
.dash { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; }
.dash .hero { grid-column: span 5; grid-row: span 2; min-height: 380px; display: flex; flex-direction: column; }
.dash .streak { grid-column: span 4; min-height: 180px; display: flex; flex-direction: column; }
.dash .toggle-card { grid-column: span 3; display: flex; flex-direction: column; justify-content: space-between; min-height: 180px; }
.dash .rate { grid-column: span 7; min-height: 182px; display: flex; flex-direction: column; }
.dash .funnel { grid-column: span 7; }
.dash .follow { grid-column: span 5; }
.dash .chart { grid-column: span 7; }
.dash .recent { grid-column: span 5; }

.hero-num { font-size: clamp(72px, 9vw, 116px); line-height: .9; margin-top: 18px; }
.hero-sub { font-size: 20px; color: rgba(255,255,255,.75); margin-top: 6px; }
.hero-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; position: relative; z-index: 1; flex-wrap: wrap; }
.hero-foot b { font-size: 22px; font-weight: 500; display: block; }
.hero-foot small { color: rgba(255,255,255,.6); font-size: 12px; }
.orbit { position: absolute; left: 0; right: 0; bottom: -40px; height: 70%; z-index: -1; opacity: .9; }
.hero .title-row { display: flex; justify-content: space-between; align-items: center; }
.hero .title-row h3 { font-style: italic; font-weight: 400; font-size: 22px; }

.big-stat { display: flex; align-items: baseline; gap: 10px; margin-top: auto; }
.big-stat .dot { font-size: 54px; line-height: 1; }
.big-stat span { color: var(--muted); font-size: 14px; }
.dotbar { display: flex; align-items: center; gap: 5px; margin-top: 14px; overflow: hidden; }
.dotbar i { width: 4px; height: 4px; border-radius: 50%; background: rgba(255,255,255,.22); flex: none; }
.dotbar i.on { background: #fff; }
.dotbar i.mark { width: 4px; height: 18px; border-radius: 2px; background: var(--lime); box-shadow: 0 0 10px var(--lime); }

.toggle-card .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.toggle-card p { margin: 0; color: rgba(255,255,255,.7); font-size: 13px; }
.toggle-card .dot { font-size: 40px; line-height: 1; }

.arcs { width: 100%; height: 80px; margin-top: auto; display: block; }

.funnel-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 44px; align-items: center; gap: 14px; padding: 7px 0; }
.funnel-row .lbl { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.funnel-row .lbl i { width: 7px; height: 7px; border-radius: 50%; }
.funnel-row .track { height: 10px; border-radius: 6px; background: repeating-linear-gradient(90deg, rgba(255,255,255,.08) 0 3px, transparent 3px 7px); position: relative; overflow: hidden; }
.funnel-row .fill { position: absolute; inset: 0 auto 0 0; border-radius: 6px; }
.funnel-row b { text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }

.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); min-width: 0; }
.li:first-child { border-top: 0; }
.li .grow { flex: 1; min-width: 0; }
.li .t { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.li .t:hover { color: var(--lime); }
.li .s { font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: none; color: #fff; }
.empty { text-align: center; padding: 28px 12px; color: var(--muted); font-size: 14px; }
.empty .dot { display: block; font-size: 30px; color: var(--dim); margin-bottom: 6px; }

.bars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; align-items: end; height: 170px; padding-top: 10px; }
.bars .col { display: flex; flex-direction: column-reverse; align-items: center; gap: 4px; height: 100%; position: relative; }
.bars .col i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.85); flex: none; }
.bars .col i.ghost { background: rgba(255,255,255,.08); }
.bars .col.today i:not(.ghost) { background: var(--lime); box-shadow: 0 0 8px rgba(198,244,50,.5); }
.bars-axis { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; margin-top: 8px; font-size: 10px; color: var(--dim); text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- Search ---------- */
.search-layout { display: grid; grid-template-columns: minmax(340px, 440px) minmax(0, 1fr); gap: 20px; align-items: start; }
.search-left { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.search-form { display: flex; flex-direction: column; gap: 14px; }
.row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.radius-val { font-family: var(--f-dot); font-weight: 700; font-size: 18px; color: var(--text); }
.filters { display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; }
.filters .toggle-row { padding: 7px 0; font-size: 13px; }
.filters .switch { width: 40px; height: 22px; }
.filters .switch span::after { width: 14px; height: 14px; top: 4px; left: 4px; }
.filters .switch input:checked + span::after { left: 22px; }
details.adv summary { cursor: pointer; color: var(--muted); font-size: 13px; list-style: none; display: flex; align-items: center; gap: 8px; }
details.adv summary::-webkit-details-marker { display: none; }
details.adv summary::before { content: "+"; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-size: 13px; }
details.adv[open] summary::before { content: "−"; }
details.adv > div { padding-top: 10px; }

.results-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.results-head .count { font-size: 14px; color: var(--muted); flex: 1; min-width: 140px; }
.results-head .count b { color: var(--text); font-weight: 600; }
.bulkbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 10px 10px 16px; border-radius: 18px; background: rgba(198,244,50,.07); box-shadow: inset 0 0 0 1px rgba(198,244,50,.2); }
.bulkbar span { flex: 1; font-size: 13px; color: var(--lime); min-width: 100px; }

.results { display: flex; flex-direction: column; gap: 8px; }
.res {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 14px; border-radius: 20px;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); transition: background .2s, box-shadow .2s;
}
.res:hover { background: var(--surface-2); }
.res.is-active { box-shadow: inset 0 0 0 1px rgba(198,244,50,.45), 0 0 0 4px rgba(198,244,50,.06); background: var(--surface-2); }
.res .chk { margin-top: 2px; }
.res-main { min-width: 0; cursor: pointer; }
.res-top { display: flex; align-items: center; gap: 10px; }
.res-top h4 { margin: 0; font-size: 15px; font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-meta { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }
.res-actions { display: flex; flex-direction: column; gap: 6px; }
.stars { color: var(--warn); }

.score { --c: var(--lime); font-family: var(--f-dot); font-weight: 900; font-size: 15px; width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--v) * 1%), rgba(255,255,255,.08) 0); position: relative; }
.score::before { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--surface); }
.res:hover .score::before, .res.is-active .score::before { background: var(--surface-2); }
.score span { position: relative; }
.score.mid { --c: var(--pink); }
.score.low { --c: var(--dim); }

.map-wrap { position: sticky; top: 20px; height: calc(100vh - 40px); min-height: 520px; border-radius: var(--r-xl); overflow: hidden;
  background: #0d0e14; box-shadow: inset 0 0 0 1px var(--line), 0 40px 80px -40px rgba(24,39,128,.7); }
.map-slot, .map-host { position: absolute; inset: 0; }
.map-host .gm-style { font-family: var(--f-text) !important; }
.map-top { position: absolute; left: 16px; right: 16px; top: 16px; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; z-index: 5; pointer-events: none; flex-wrap: wrap; }
.map-top > * { pointer-events: auto; }
.map-legend { display: flex; gap: 12px; padding: 8px 14px; border-radius: 999px; background: rgba(10,10,14,.7); backdrop-filter: blur(12px); box-shadow: inset 0 0 0 1px var(--line); font-size: 12px; color: var(--muted); }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.map-legend i { width: 8px; height: 8px; border-radius: 50%; }

.scan {
  position: absolute; left: 50%; bottom: 20px; translate: -50% 0; width: min(560px, calc(100% - 32px)); z-index: 5;
  border-radius: 30px; padding: 16px 18px; color: #fff;
  background: radial-gradient(130% 120% at 50% 0%, rgba(40,52,170,.92) 0%, rgba(14,18,80,.93) 45%, rgba(6,7,30,.95) 100%);
  box-shadow: inset 0 0 0 1px rgba(160,170,255,.25), inset 0 0 40px rgba(120,130,255,.3), 0 30px 60px -20px rgba(0,0,0,.8);
  backdrop-filter: blur(14px);
}
.scan-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 10px; font-size: 12px; }
.scan-top .v { font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; }
.scan-top .r { text-align: right; }
.scan-top .c { text-align: center; color: rgba(255,255,255,.85); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.scan-top small { color: rgba(255,255,255,.55); }
.scan-line { position: relative; height: 20px; margin: 10px 0 12px; }
.scan-line::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px dashed rgba(255,255,255,.25); }
.scan-line .prog { position: absolute; left: 0; top: 50%; height: 2px; translate: 0 -50%; background: var(--lime); box-shadow: 0 0 10px var(--lime); transition: width .3s; }
.scan-line .prog::after { content: ""; position: absolute; right: -4px; top: 50%; translate: 0 -50%; width: 8px; height: 8px; border-radius: 50%; background: var(--lime); }
.scan-actions { display: flex; gap: 8px; align-items: center; }
.scan-actions .btn { height: 40px; }
.scan-actions .grow { flex: 1; }
.dots3 { display: grid; grid-template-columns: repeat(3, 3px); gap: 3px; }
.dots3 i { width: 3px; height: 3px; border-radius: 50%; background: #fff; opacity: .5; }
.scanning .dots3 i { animation: blink 1.2s infinite; }
.dots3 i:nth-child(3n+2) { animation-delay: .2s; } .dots3 i:nth-child(3n) { animation-delay: .4s; }
@keyframes blink { 50% { opacity: 1; } }

.demo-map { position: absolute; inset: 0; cursor: crosshair; background-color: #0c0d13;
  background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1.2px); background-size: 18px 18px; }
.demo-map svg { width: 100%; height: 100%; display: block; }
.demo-map .mk { cursor: pointer; transition: r .2s; }
.demo-banner { position: absolute; left: 16px; bottom: 16px; z-index: 4; font-size: 12px; color: var(--muted); }

/* ---------- CRM ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.toolbar .input-icon { flex: 1; min-width: 200px; max-width: 380px; }
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 14px; align-items: start; }
.kcol { background: var(--surface); border-radius: var(--r-lg); box-shadow: inset 0 0 0 1px var(--line); padding: 12px; min-height: 240px; display: flex; flex-direction: column; gap: 8px; transition: box-shadow .2s, background .2s; }
.kcol.over { box-shadow: inset 0 0 0 1px rgba(198,244,50,.5); background: #141611; }
.kcol-h { display: flex; align-items: center; gap: 8px; padding: 4px 6px 8px; }
.kcol-h i { width: 8px; height: 8px; border-radius: 50%; }
.kcol-h b { font-weight: 500; font-size: 14px; }
.kcol-h .n { margin-left: auto; font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }
.kcol-h .v { font-size: 11px; color: var(--muted); padding: 0 6px 6px; }
.kcard { background: var(--surface-2); border-radius: 16px; padding: 12px 13px; cursor: grab; box-shadow: inset 0 0 0 1px var(--line); transition: transform .15s, box-shadow .2s; }
.kcard:hover { box-shadow: inset 0 0 0 1px var(--line-2); }
.kcard:active { cursor: grabbing; }
.kcard.dragging { opacity: .4; }
.kcard h5 { margin: 0; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kcard .m { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kcard .f { display: flex; gap: 6px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.kcard .f .val { margin-left: auto; font-size: 12px; color: var(--text); font-variant-numeric: tabular-nums; }
.kcard .tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px; }
.kcard .tags i { height: 4px; width: 22px; border-radius: 2px; }

.table-wrap { overflow-x: auto; border-radius: var(--r-lg); box-shadow: inset 0 0 0 1px var(--line); background: var(--surface); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 860px; }
.tbl th { text-align: left; font-weight: 500; font-size: 12px; color: var(--dim); padding: 14px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { cursor: pointer; transition: background .15s; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl .nm { font-weight: 600; }
.tbl .sub { font-size: 12px; color: var(--dim); }

/* ---------- Drawer ---------- */
.drawer-scrim, .modal-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.55); backdrop-filter: blur(4px); z-index: 50; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(540px, 100%); z-index: 60; background: #0f0f11; box-shadow: -1px 0 0 var(--line), -40px 0 80px rgba(0,0,0,.6);
  translate: 105% 0; transition: translate .35s cubic-bezier(.2,.8,.2,1); overflow-y: auto; overscroll-behavior: contain; }
.drawer.open { translate: 0 0; }
.drawer-head { margin: 14px; padding: 20px 22px 22px; }
.drawer-head .top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.drawer-head h2 { margin: 26px 0 2px; font-weight: 500; font-size: 30px; line-height: 1.1; letter-spacing: -.01em; overflow-wrap: anywhere; }
.drawer-head p { margin: 0; color: rgba(255,255,255,.65); font-size: 14px; }
.drawer-head .acts { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.drawer-body { padding: 4px 26px 40px; display: flex; flex-direction: column; gap: 22px; }
.drawer-body .eyebrow { margin: 6px 0 -8px; }
.timeline { display: flex; flex-direction: column; }
.tl { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 12px; padding-bottom: 14px; position: relative; }
.tl::before { content: ""; position: absolute; left: 8px; top: 16px; bottom: 0; border-left: 1px dashed var(--line-2); }
.tl:last-child::before { display: none; }
.tl i { width: 9px; height: 9px; border-radius: 50%; margin: 5px 0 0 4px; background: var(--dim); }
.tl.msg_out i { background: var(--blue-glow); } .tl.msg_in i { background: var(--lime); } .tl.stage i { background: var(--pink); } .tl.note i { background: var(--warn); }
.tl p { margin: 0; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.tl small { color: var(--dim); font-size: 12px; }

/* ---------- Modal ---------- */
.modal-scrim { display: grid; place-items: center; padding: 20px; z-index: 70; }
.modal { width: min(620px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; border-radius: var(--r-xl); background: #111113; box-shadow: inset 0 0 0 1px var(--line), 0 50px 100px -20px rgba(0,0,0,.9); padding: 26px; animation: pop .25s cubic-bezier(.2,.8,.2,1); }
.modal.wide { width: min(860px, 100%); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.modal-h h2 { margin: 0; font-weight: 500; font-size: 26px; letter-spacing: -.01em; }
.modal-h p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.modal-f { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.photo { height: 190px; border-radius: 22px; background: var(--surface-2) center / cover no-repeat; margin-bottom: 16px; }
.hours { font-size: 13px; color: var(--muted); display: grid; gap: 3px; margin-top: 4px; }

.preview-bubble { background: linear-gradient(180deg, #1e2a90, #121a5e); border-radius: 20px 20px 6px 20px; padding: 14px 16px; white-space: pre-wrap; font-size: 14px; line-height: 1.5; box-shadow: inset 0 0 0 1px rgba(160,170,255,.2); overflow-wrap: anywhere; }
.vars { display: flex; gap: 6px; flex-wrap: wrap; }
.vars button { border: 0; cursor: pointer; padding: 4px 9px; border-radius: 8px; background: var(--surface-2); color: var(--blue-glow); font-size: 12px; font-family: var(--f-text); box-shadow: inset 0 0 0 1px var(--line); }
.vars button:hover { background: var(--surface-3); }

.queue-card { padding: 22px; border-radius: 28px; }
.queue-prog { display: flex; gap: 4px; margin: 14px 0 4px; flex-wrap: wrap; }
.queue-prog i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.18); }
.queue-prog i.sent { background: var(--lime); } .queue-prog i.skip { background: var(--bad); } .queue-prog i.cur { background: #fff; box-shadow: 0 0 8px #fff; }

/* ---------- Conversations ---------- */
.chat { display: grid; grid-template-columns: minmax(250px, 320px) minmax(0, 1fr); height: calc(100vh - 210px); min-height: 520px; border-radius: var(--r-xl); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); background: var(--surface); }
.chat-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.chat-list .input-icon { margin: 14px; }
.chat-items { overflow-y: auto; flex: 1; }
.citem { display: flex; gap: 12px; align-items: center; padding: 12px 16px; cursor: pointer; border-left: 2px solid transparent; transition: background .15s; }
.citem:hover { background: var(--surface-2); }
.citem.on { background: var(--surface-2); border-left-color: var(--lime); }
.citem .grow { flex: 1; min-width: 0; }
.citem b { display: block; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.citem small { display: block; color: var(--dim); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.citem .when { font-size: 11px; color: var(--dim); align-self: flex-start; white-space: nowrap; }
.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: radial-gradient(120% 60% at 50% 0%, rgba(24,39,128,.25), transparent 70%), #0e0e10; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.chat-head .grow { flex: 1; min-width: 120px; }
.chat-head b { display: block; font-weight: 600; }
.chat-head small { color: var(--muted); font-size: 12px; }
.thread { flex: 1; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: min(78%, 520px); padding: 11px 14px; border-radius: 18px; font-size: 14px; white-space: pre-wrap; line-height: 1.5; overflow-wrap: anywhere; }
.bubble small { display: block; font-size: 11px; margin-top: 4px; opacity: .6; }
.bubble.out { align-self: flex-end; background: linear-gradient(180deg, #24309c, #151d68); border-bottom-right-radius: 6px; box-shadow: inset 0 0 0 1px rgba(160,170,255,.2); }
.bubble.in { align-self: flex-start; background: var(--surface-3); border-bottom-left-radius: 6px; }
.day-sep { align-self: center; font-size: 11px; color: var(--dim); padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.04); }
.composer { padding: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.composer .row { display: flex; gap: 8px; align-items: flex-end; }
.composer .textarea { min-height: 52px; max-height: 180px; border-radius: 18px; }
.composer-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.composer-tools .select { height: 34px; width: auto; min-width: 180px; font-size: 13px; border-radius: 999px; }

/* ---------- Templates ---------- */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.tpl { display: flex; flex-direction: column; gap: 12px; min-height: 230px; }
.tpl p { margin: 0; font-size: 14px; color: rgba(255,255,255,.72); white-space: pre-wrap; line-height: 1.5; flex: 1; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.tpl .f { display: flex; gap: 8px; align-items: center; }
.tpl .f .grow { flex: 1; font-size: 12px; color: var(--dim); }

/* ---------- Settings ---------- */
.settings { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.settings .panel { display: flex; flex-direction: column; gap: 14px; }
.settings .panel.span { grid-column: 1 / -1; }
.help { font-size: 13px; color: var(--muted); line-height: 1.55; }
.help ol { margin: 6px 0 0; padding-left: 18px; }
.help code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: 12px; color: var(--text); }
.help a { color: var(--lime); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 16px; background: #1b1b1f; box-shadow: inset 0 0 0 1px var(--line-2), 0 20px 40px rgba(0,0,0,.5); font-size: 14px; max-width: 380px; animation: pop .25s; }
.toast i { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); flex: none; }
.toast.error i { background: var(--bad); } .toast.info i { background: var(--blue-glow); }

/* Campos de chave: mascarados sem ser type=password (evita o preenchimento de senhas pelo navegador) */
.input.secret { -webkit-text-security: disc; font-family: var(--f-text); letter-spacing: .04em; }
.input.secret:focus { -webkit-text-security: none; }

/* Créditos de busca do mês */
.credits { display: flex; flex-direction: column; gap: 7px; padding: 12px 14px; border-radius: 16px; background: rgba(198,244,50,.05); box-shadow: inset 0 0 0 1px rgba(198,244,50,.16); }
.credits-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13px; color: var(--muted); }
.credits-h b { color: var(--text); font-weight: 600; font-size: 16px; }
.credits-h b span { color: var(--dim); font-weight: 400; font-size: 13px; }
.credits-track { height: 6px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; }
.credits-track i { display: block; height: 100%; border-radius: 3px; background: var(--lime); box-shadow: 0 0 10px rgba(198,244,50,.5); transition: width .4s; }
.credits small { font-size: 12px; color: var(--dim); }
.credits .link { border: 0; background: none; padding: 0; cursor: pointer; font-size: 12px; color: var(--lime); text-decoration: underline; }
.credits.low { background: rgba(255,90,60,.06); box-shadow: inset 0 0 0 1px rgba(255,90,60,.22); }
.credits.low .credits-track i { background: var(--bad); box-shadow: none; }
.seg button .lock { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: var(--pink); color: #2a0a20; margin-left: 4px; vertical-align: 1px; }
.seg button[data-locked] { color: var(--dim); }

/* Indicador da janela do WhatsApp Web (aberta = lime) */
.led-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); margin-left: 2px; }
.led-dot.on { background: var(--lime); box-shadow: 0 0 8px var(--lime); }
.btn.lime .led-dot { background: var(--lime-ink); opacity: .35; }

/* ---------- Sugestões de local ---------- */
.ac { position: relative; }
.ac-list { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; padding: 6px; border-radius: 18px; background: #18181b;
  box-shadow: inset 0 0 0 1px var(--line-2), 0 24px 50px -12px rgba(0,0,0,.8); display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow-y: auto; }
.ac-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 12px; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.ac-item svg { position: static; translate: none; width: 16px; height: 16px; color: var(--muted); flex: none; }
.ac-item span { min-width: 0; }
.ac-item b { display: block; font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-item small { display: block; font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-item:hover, .ac-item.on { background: var(--surface-3); }
.ac-item.on svg { color: var(--lime); }

/* ---------- Conta, sincronização e planos ---------- */
.boot { position: fixed; inset: 0; z-index: 200; display: grid; place-content: center; justify-items: center; gap: 16px; background: var(--bg); color: var(--muted); font-size: 14px; }
.boot .brand-mark { grid-template-columns: repeat(3, 8px); gap: 5px; }
.boot .brand-mark i { width: 8px; height: 8px; animation: blink 1.2s infinite; }
.boot .brand-mark i:nth-child(3n+2) { animation-delay: .2s; } .boot .brand-mark i:nth-child(3n) { animation-delay: .4s; }
.conn-pill.err .led { background: var(--bad); box-shadow: 0 0 10px var(--bad); }
.acct { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 16px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); min-width: 0; }
.acct .avatar { width: 32px; height: 32px; border-radius: 10px; font-size: 12px; }
.acct .grow { flex: 1; min-width: 0; text-decoration: none; }
.acct b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct small { display: block; font-size: 11px; color: var(--muted); }
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.plan { display: flex; flex-direction: column; gap: 12px; padding: 22px; }
.plan-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 26px; }
.plan-price { display: flex; align-items: baseline; gap: 6px; }
.plan-price .dot { font-size: 46px; line-height: 1; }
.plan-price small { color: rgba(255,255,255,.65); }
.plan p { margin: 0; font-size: 13px; color: rgba(255,255,255,.7); }
.plan ul { list-style: none; margin: 4px 0 8px; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; flex: 1; }
.plan li { display: flex; gap: 8px; align-items: flex-start; }
.plan li svg { width: 15px; height: 15px; color: var(--lime); flex: none; margin-top: 2px; }
.plan.pink li svg { color: #fff; }
@media (max-width: 760px) { .plans { grid-template-columns: 1fr; } }

/* ---------- Responsivo ----------
   > 1200px  menu lateral completo
   901-1200  tablet: menu vira trilho de ícones
   <= 900    celular e tablet em pé: menu inferior, folhas que sobem de baixo e telas empilhadas */
.nav a .lbl-s { display: none; }
.chat-back { display: none; }
.kcard { -webkit-touch-callout: none; }
.kghost { position: fixed; z-index: 300; pointer-events: none; transform: rotate(-3deg) scale(1.04); box-shadow: inset 0 0 0 1px rgba(198,244,50,.6), 0 24px 50px -10px rgba(0,0,0,.8); opacity: .95; }

@media (max-width: 1200px) and (min-width: 901px) {
  :root { --side-w: 80px; }
  .side { padding: 22px 12px; align-items: center; }
  .side .brand { padding: 0; }
  .side .brand > span:last-child, .nav-label, .nav a .lbl, .nav a .n, .side-foot .conn-pill { display: none; }
  .nav { width: 100%; }
  .nav a { justify-content: center; padding: 12px; position: relative; }
  .nav a svg { width: 20px; height: 20px; }
  .nav a .badge { position: absolute; top: 4px; right: 6px; margin: 0; height: 16px; min-width: 16px; font-size: 10px; }
  .acct { flex-direction: column; padding: 6px; }
  .acct .grow { display: none; }
  .main { padding: 26px 28px 50px; }
}
@media (max-width: 1100px) {
  .search-layout { grid-template-columns: 1fr; }
  .search-left { display: contents; }
  .search-form { order: 1; }
  .map-wrap { order: 2; position: relative; top: 0; height: 56vh; min-height: 360px; }
  #resultsArea { order: 3; }
  .settings { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 40; flex-direction: row; padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px)); border-right: 0; border-top: 1px solid var(--line); background: rgba(11,11,12,.94); backdrop-filter: blur(16px); }
  .side .brand, .side .nav-label, .side-foot { display: none; }
  .nav { flex-direction: row; justify-content: space-around; width: 100%; gap: 2px; }
  .nav a { flex-direction: column; gap: 4px; padding: 7px 2px; font-size: 10.5px; flex: 1 1 0; min-width: 0; text-align: center; position: relative; border-radius: 12px; }
  .nav a svg { width: 21px; height: 21px; }
  .nav a .lbl, .nav a .n { display: none; }
  .nav a .lbl-s { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .nav a.active { background: transparent; box-shadow: none; color: var(--lime); }
  .nav a .badge { position: absolute; top: 2px; left: 50%; margin: 0 0 0 6px; height: 16px; min-width: 16px; font-size: 10px; }
  .main { padding: 18px 16px calc(96px + env(safe-area-inset-bottom, 0px)); }

  .ph { grid-template-columns: 1fr; margin-bottom: 20px; gap: 12px; }
  .ph h1 { font-size: 34px; }
  .ph p { font-size: 16px; }
  .ph-actions { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding: 2px 16px; scrollbar-width: none; }
  .ph-actions::-webkit-scrollbar { display: none; }
  .ph-actions .btn, .ph-actions .conn-pill { height: 38px; padding: 0 14px; font-size: 13px; flex: none; }

  /* Avisos acima do menu inferior */
  .toasts { left: 12px; right: 12px; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); align-items: stretch; }
  .toast { max-width: none; }

  /* Modais viram folhas que sobem de baixo */
  .modal-scrim { place-items: end center; padding: 0; }
  .modal, .modal.wide { width: 100%; max-height: 92dvh; border-radius: 28px 28px 0 0; padding: 22px 18px calc(22px + env(safe-area-inset-bottom, 0px)); animation: sheet .32s cubic-bezier(.2,.8,.2,1); }
  .modal::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--surface-3); margin: -8px auto 14px; }
  .modal-h h2 { font-size: 22px; }
  .modal-f { position: sticky; bottom: calc(-22px - env(safe-area-inset-bottom, 0px)); margin: 18px -18px calc(-22px - env(safe-area-inset-bottom, 0px)); padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(180deg, rgba(17,17,19,0), #111113 30%); }
  .modal-f .btn { flex: 1 1 auto; }

  /* Gaveta do lead em tela cheia */
  .drawer-head { margin: 10px; padding: 18px; }
  .drawer-head h2 { font-size: 26px; margin-top: 18px; }
  .drawer-body { padding: 4px 18px calc(40px + env(safe-area-inset-bottom, 0px)); }
  .drawer .seg { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .drawer .seg button { flex: none; }

  /* Busca */
  .map-wrap { height: 48vh; min-height: 320px; border-radius: 26px; }
  .map-legend { display: none; }
  .scan { bottom: 12px; padding: 12px 14px; border-radius: 22px; }
  .scan-top .v { font-size: 15px; }
  .scan-line { margin: 6px 0 8px; }

  /* CRM: colunas deslizam com encaixe */
  .toolbar .input-icon { flex: 1 1 100%; max-width: none; }
  .toolbar .select { flex: 1; }
  .toolbar .seg { margin-left: 0; }
  .kanban { grid-auto-columns: min(84vw, 320px); scroll-snap-type: x mandatory; margin-inline: -16px; padding-inline: 16px; scroll-padding-inline: 16px; scrollbar-width: none; }
  .kanban::-webkit-scrollbar { display: none; }
  .kcol { scroll-snap-align: start; }
  .kcard { user-select: none; -webkit-user-select: none; }

  /* Conversas: lista ou conversa, uma de cada vez */
  .chat { grid-template-columns: 1fr; height: calc(100dvh - 250px - env(safe-area-inset-bottom, 0px)); min-height: 460px; border-radius: 26px; }
  .chat-list { border-right: 0; min-height: 0; }
  .chat-main { display: none; }
  .chat.thread .chat-list { display: none; }
  .chat.thread .chat-main { display: flex; }
  .chat-back { display: grid; }
  .chat-head { padding: 10px 12px; gap: 8px; flex-wrap: nowrap; }
  .chat-head .grow { min-width: 0; }
  .chat-head b, .chat-head small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .chat-head .avatar { width: 34px; height: 34px; }
  .chat-head .btn { height: 34px; padding: 0 10px; }
  .chat-head .btn span { display: none; }
  .thread { padding: 14px; }
  .bubble { max-width: 88%; }
  .composer { padding: 10px; }
  .composer-tools { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .composer-tools .vars { flex-wrap: nowrap; }
  .composer-tools .vars button { flex: none; }

  .spec.spec3 { grid-template-columns: 1fr 1fr; }
  .tpl-grid { grid-template-columns: 1fr; }
}
@keyframes sheet { from { transform: translateY(40px); opacity: 0; } }
@media (max-width: 520px) {
  .filters, .row2, .spec, .spec.spec3 { grid-template-columns: 1fr; }
  .res { grid-template-columns: auto minmax(0, 1fr); padding: 12px; }
  .res-actions { grid-column: 1 / -1; flex-direction: row; justify-content: flex-end; }
  .results-head .count { flex-basis: 100%; order: 3; }
  .bulkbar span { flex-basis: 100%; }
  .panel { padding: 18px; border-radius: 22px; }
  .search-form { padding: 16px; }
  .search-form .chips { flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding-inline: 16px; scrollbar-width: none; }
  .search-form .chips::-webkit-scrollbar { display: none; }
  .search-form .chip { flex: none; }
}
/* Telas de toque: alvos maiores e sem o zoom automático do iOS nos campos */
@media (pointer: coarse) {
  .input, .select, .textarea { font-size: 16px; }
  .icon-btn { width: 40px; height: 40px; }
  .btn.sm { height: 38px; }
  .chk { width: 28px; height: 28px; }
  .seg button { padding: 9px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
