:root {
  --bg: #09090b;
  --surface: #121215;
  --surface-2: #18181c;
  --surface-3: #1f1f24;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .13);
  --text: #f5f5f4;
  --muted: #8b8b94;
  --dim: #5c5c65;
  --accent: #ff4d2e;
  --accent-soft: rgba(255, 77, 46, .13);
  --series-1: #3987e5;
  --series-2: #f04a2a;
  --good: #3ddc97;
  --warn: #f5b83d;
  --info: #9085e9;
  --bad: #e66767;
  --radius: 14px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --sans: 'Inter Tight', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
code { font: 500 .88em var(--mono); color: #ffb3a3; }
a { color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
[hidden] { display: none !important; }

h1, h2 { margin: 0; font-weight: 500; letter-spacing: -.02em; }
h2 { font-size: 15px; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; color: #ff7a55; }

kbd {
  display: inline-block;
  padding: 1px 5px;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  font: 500 10.5px var(--mono);
  color: var(--muted);
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.rec {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(255, 77, 46, .7);
}

/* ───────── Buttons & inputs ───────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color .2s, border-color .2s, color .2s, transform .2s var(--ease);
}
.btn:active { transform: scale(.97); }
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--accent); color: #fff; font-weight: 600; }
.btn-primary:hover { background: #ff6445; }
.btn-ghost { background: var(--surface-2); border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--line-2); background: var(--surface-3); }
.btn-danger { background: transparent; border-color: rgba(230, 103, 103, .35); color: var(--bad); }
.btn-danger:hover { background: rgba(230, 103, 103, .1); }
.btn[disabled] { opacity: .6; cursor: progress; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
  transition: color .2s, border-color .2s, background-color .2s;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-2); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn.spin svg { animation: spin .8s linear infinite; }

.link-btn { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--text); }

.spinner {
  display: none;
  width: 14px; height: 14px;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.is-loading .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

input[type="search"], input[type="number"], input[type="text"], input[type="password"], select, textarea {
  height: 36px;
  padding: 0 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  transition: border-color .2s, background-color .2s;
}
input:focus, select:focus, textarea:focus { border-color: rgba(255, 77, 46, .6); background: var(--surface-3); }
select { padding-right: 30px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b8b94' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 14px; }
select option { background: var(--surface-2); }
input[type="range"] { width: 100%; accent-color: var(--accent); }
input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }

.seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.seg button {
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  transition: background-color .2s, color .2s;
}
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset; }
.seg-sm { padding: 2px; margin-left: 6px; vertical-align: middle; }
.seg-sm button { height: 20px; padding: 0 7px; font-size: 11px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  transition: background-color .2s, color .2s, border-color .2s;
}
.chip:hover { color: var(--text); border-color: var(--line-2); }
.chip[aria-pressed="true"] { color: var(--text); border-color: rgba(255, 77, 46, .55); background: var(--accent-soft); }
.chip .n { font: 500 11px var(--mono); color: var(--dim); }
.chip[aria-pressed="true"] .n { color: #ffb3a3; }

/* ───────── Auth pages ───────── */

body.auth {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 16px;
  background:
    radial-gradient(60vmax 60vmax at 10% -20%, rgba(255, 77, 46, .18), transparent 60%),
    radial-gradient(50vmax 50vmax at 110% 120%, rgba(80, 90, 255, .1), transparent 60%),
    var(--bg);
}
.auth-card {
  width: min(400px, 100%);
  padding: 32px 28px;
  background: rgba(18, 18, 21, .8);
  border: 1px solid var(--line);
  border-radius: 20px;
  backdrop-filter: blur(20px);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .8);
}
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; font: 500 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.auth-card h1 { font-size: 32px; letter-spacing: -.03em; margin-bottom: 8px; }
.auth-card .muted { margin: 0 0 22px; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 12.5px; color: var(--muted); }
.pw { position: relative; }
.pw input { width: 100%; height: 44px; padding-right: 48px; font-family: var(--mono); }
.pw .icon-btn { position: absolute; right: 4px; top: 4px; border: 0; background: none; }
.auth-error { min-height: 20px; margin: 10px 0; color: var(--bad); font-size: 13px; }
.auth-card .btn { width: 100%; height: 44px; }
.setup-list { margin: 0 0 20px; padding-left: 18px; display: grid; gap: 6px; }

/* ───────── App shell ───────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px clamp(16px, 3vw, 32px);
  background: rgba(9, 9, 11, .82);
  backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; white-space: nowrap; }
.brand-sub { color: var(--muted); font-weight: 400; }

.tabs { display: flex; gap: 2px; margin-left: 12px; }
.tabs button {
  position: relative;
  height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  transition: color .2s, background-color .2s;
}
.tabs button:hover { color: var(--text); background: var(--surface-2); }
.tabs button[aria-selected="true"] { color: var(--text); }
.tabs button[aria-selected="true"]::after {
  content: '';
  position: absolute;
  left: 12px; right: 12px; bottom: -13px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}
.tab-badge, .count-badge {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font: 600 10.5px var(--mono);
}

.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

main {
  width: min(1400px, 100%);
  margin: 0 auto;
  padding: clamp(16px, 3vw, 28px) clamp(16px, 3vw, 32px) 80px;
}

.view { animation: viewIn .5s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  min-width: 0;
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head p { margin: 2px 0 0; font-size: 12.5px; }

.grid { display: grid; gap: 14px; margin-top: 14px; }
.grid-funnel { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ───────── KPIs ───────── */

.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.kpi { position: relative; overflow: hidden; }
.kpi-label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.kpi-value { margin-top: 8px; font-size: clamp(24px, 2.4vw, 32px); font-weight: 500; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi-value small { font-size: .5em; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.kpi-foot { margin-top: 6px; font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.delta { font: 500 11.5px var(--mono); color: var(--text); }
.delta.up::before { content: '▲ '; color: var(--good); font-size: 9px; }
.delta.down::before { content: '▼ '; color: var(--bad); font-size: 9px; }
.kpi.hl { border-color: rgba(255, 77, 46, .35); background: linear-gradient(160deg, rgba(255, 77, 46, .1), var(--surface) 60%); }
.info-i { display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--line-2); font: 600 9px var(--mono); color: var(--dim); cursor: help; }

/* ───────── Funnel ───────── */

.funnel { display: grid; gap: 4px; }
.f-row {
  display: grid;
  grid-template-columns: minmax(0, 150px) minmax(0, 1fr) 48px 64px;
  align-items: center;
  gap: 12px;
  padding: 5px 6px;
  border-radius: 8px;
  transition: background-color .2s;
}
.f-row:hover { background: var(--surface-2); }
.f-label { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.f-label .q { font: 500 10.5px var(--mono); color: var(--dim); margin-right: 6px; }
.f-track { position: relative; height: 18px; }
.f-bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  min-width: 2px;
  border-radius: 0 4px 4px 0;
  background: var(--accent);
  transform-origin: left;
  animation: grow .8s var(--ease) backwards;
}
.f-row.is-end .f-bar { background: var(--accent); }
.f-row:not(.is-end):not(.is-start) .f-bar { background: rgba(255, 77, 46, .72); }
.f-row.is-start .f-bar { background: rgba(255, 77, 46, .45); }
@keyframes grow { from { transform: scaleX(0); } }
.f-n { text-align: right; font: 500 12.5px var(--mono); font-variant-numeric: tabular-nums; }
.f-drop { text-align: right; font: 500 11.5px var(--mono); color: var(--muted); }
.f-row.worst { background: rgba(245, 184, 61, .07); }
.f-row.worst .f-drop { color: var(--warn); }
.f-note { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; align-items: flex-start; }
.f-note svg { flex: none; width: 15px; height: 15px; color: var(--warn); margin-top: 2px; }
.f-note b { color: var(--text); font-weight: 500; }

/* ───────── Charts ───────── */

.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 10px; height: 3px; border-radius: 2px; }
.sw-1 { background: var(--series-1); }
.sw-2 { background: var(--series-2); }

.chart { position: relative; height: 260px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis-text { fill: var(--dim); font: 500 10.5px var(--mono); }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { opacity: .12; }
.chart .cross { stroke: var(--line-2); stroke-width: 1; }
.chart .dot { stroke: var(--surface); stroke-width: 2; }
.chart-empty { display: grid; place-items: center; height: 100%; color: var(--dim); font-size: 13px; }

.bars { display: grid; gap: 8px; }
.bar-row {
  width: 100%;
  display: grid;
  gap: 5px;
  padding: 6px 8px;
  margin: 0 -8px;
  border: 0;
  border-radius: 8px;
  background: none;
  text-align: left;
  transition: background-color .2s;
}
.bar-row:hover { background: var(--surface-2); }
.bar-row[aria-pressed="true"] { background: var(--accent-soft); }
.bar-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.bar-top span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-top .n { font: 500 12px var(--mono); color: var(--muted); white-space: nowrap; }
.bar-track { display: block; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 0 3px 3px 0; background: var(--accent); transform-origin: left; animation: grow .8s var(--ease) backwards; }

.mini-table { display: grid; }
.mt-row { display: grid; grid-template-columns: minmax(0, 1fr) 52px 58px 58px; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.mt-row:last-child { border-bottom: 0; }
.mt-row.head { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; padding-top: 0; }
.mt-row > span:not(:first-child) { text-align: right; font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.mt-row.head > span { font-family: var(--sans); font-size: 11px; }
.mt-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty-mini { color: var(--dim); font-size: 13px; padding: 12px 0; }

/* ───────── Filters ───────── */

.filters { display: grid; gap: 12px; }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; }
.search { position: relative; flex: 1 1 280px; }
.search svg { position: absolute; left: 11px; top: 50%; width: 15px; height: 15px; margin-top: -7.5px; color: var(--dim); pointer-events: none; }
.search input { width: 100%; padding-left: 34px; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; }

.filter-panel { display: grid; gap: 14px; padding-top: 14px; border-top: 1px solid var(--line); animation: viewIn .35s var(--ease); }
.fgroup { display: grid; gap: 7px; align-content: start; }
.flabel { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.flabel b { color: var(--text); font: 500 11.5px var(--mono); margin-left: auto; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; align-items: end; }
.fgroup.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); height: 36px; cursor: pointer; }
.range-pair { display: flex; align-items: center; gap: 6px; color: var(--dim); }
.range-pair input { width: 100%; min-width: 0; }
.filter-panel .link-btn { justify-self: start; }

/* ───────── Table ───────── */

.table-card { margin-top: 14px; padding: 0; overflow: hidden; }
.table-meta { display: flex; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); font-size: 13px; }
.table-meta b { font-weight: 600; }
.table-wrap { overflow-x: auto; }
table.leads { width: 100%; border-collapse: collapse; min-width: 900px; }
.leads th {
  position: sticky; top: 0;
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--dim);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.leads td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 13px; }
.leads tbody tr { cursor: pointer; transition: background-color .15s; }
.leads tbody tr:hover { background: var(--surface-2); }
.leads tbody tr.active { background: var(--accent-soft); }
.leads tbody tr:last-child td { border-bottom: 0; }

.who { display: flex; align-items: center; gap: 11px; min-width: 200px; }
.avatar {
  flex: none;
  display: grid; place-items: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  font-size: 12px; font-weight: 600;
  color: var(--muted);
}
.who-name { font-weight: 500; display: flex; align-items: center; gap: 6px; }
.who-sub { font-size: 12px; color: var(--muted); }
.new-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.dup { font: 500 10px var(--mono); padding: 1px 5px; border-radius: 4px; background: rgba(245, 184, 61, .12); color: var(--warn); }

.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag { padding: 2px 7px; border-radius: 5px; background: var(--surface-3); font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.tag.key { background: var(--accent-soft); color: #ffb3a3; }
.lvl { font-size: 12.5px; white-space: nowrap; }
.lvl i { display: inline-flex; gap: 2px; margin-right: 6px; vertical-align: middle; }
.lvl i b { width: 4px; height: 10px; border-radius: 1px; background: var(--surface-3); }
.lvl i b.on { background: var(--accent); }

.score { display: flex; align-items: center; gap: 8px; font: 500 12.5px var(--mono); font-variant-numeric: tabular-nums; }
.score-track { width: 44px; height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.score-fill { display: block; height: 100%; background: var(--accent); border-radius: 0 2px 2px 0; }

.stars { display: inline-flex; gap: 1px; color: var(--dim); font-size: 13px; letter-spacing: 1px; white-space: nowrap; }
.stars .on { color: var(--warn); }

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-novo { color: #ff8b73; }
.st-analise { color: var(--warn); }
.st-entrevista { color: var(--info); }
.st-aprovado { color: var(--good); }
.st-reprovado { color: var(--dim); }

.port-link { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; color: var(--muted); border: 1px solid var(--line); transition: color .2s, border-color .2s; }
.port-link:hover { color: var(--text); border-color: var(--line-2); }
.port-link svg { width: 14px; height: 14px; }
.date { color: var(--muted); white-space: nowrap; font-size: 12.5px; }

.empty { padding: 60px 20px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--text); font-weight: 500; font-size: 15px; margin-bottom: 4px; }

/* ───────── Drawer ───────── */

.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .5); backdrop-filter: blur(2px); animation: fade .25s; }
@keyframes fade { from { opacity: 0; } }
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  z-index: 41;
  width: min(560px, 100%);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--line-2);
  box-shadow: -30px 0 80px -20px rgba(0, 0, 0, .7);
  transform: translateX(105%);
  transition: transform .45s var(--ease);
}
.drawer.open { transform: none; }
.d-head { padding: 20px 22px 16px; border-bottom: 1px solid var(--line); }
.d-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.d-nav { display: flex; gap: 6px; align-items: center; font: 500 11.5px var(--mono); color: var(--dim); }
.d-name { font-size: 24px; font-weight: 500; letter-spacing: -.02em; line-height: 1.15; }
.d-meta { margin-top: 4px; color: var(--muted); font-size: 13px; display: flex; gap: 10px; flex-wrap: wrap; }
.d-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.d-actions .btn { height: 34px; }
.btn-wa { background: #1f9d55; color: #fff; }
.btn-wa:hover { background: #22b05f; }

.d-body { flex: 1; overflow-y: auto; padding: 18px 22px 30px; display: grid; gap: 22px; align-content: start; }
.d-section h3 { margin: 0 0 8px; font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.d-status { display: flex; flex-wrap: wrap; gap: 6px; }
.d-status button { background: var(--surface-2); }
.d-status button[aria-pressed="true"] { border-color: currentColor; background: var(--surface-3); }
.rate { display: inline-flex; gap: 2px; }
.rate button { width: 30px; height: 30px; border: 0; background: none; font-size: 20px; line-height: 1; color: var(--dim); transition: color .15s, transform .15s var(--ease); padding: 0; }
.rate button.on { color: var(--warn); }
.rate button:hover { transform: scale(1.15); }
.d-notes textarea { width: 100%; height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.save-state { font-size: 11.5px; color: var(--dim); margin-left: 6px; text-transform: none; letter-spacing: 0; }
.answer { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); white-space: pre-wrap; word-break: break-word; font-size: 14px; line-height: 1.55; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.score-break { display: grid; gap: 6px; font-size: 12.5px; }
.score-break div { display: flex; justify-content: space-between; color: var(--muted); }
.score-break b { color: var(--text); font: 500 12px var(--mono); }
.big-score { display: flex; align-items: baseline; gap: 6px; font-size: 30px; font-weight: 500; letter-spacing: -.03em; }
.big-score small { font-size: 13px; color: var(--muted); letter-spacing: 0; }
.d-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; }

/* ───────── Settings ───────── */

.settings textarea {
  display: block;
  width: 100%;
  height: 360px;
  padding: 14px 16px;
  resize: vertical;
  font: 12.5px/1.6 var(--mono);
  tab-size: 2;
  color: #e6e6e6;
}
.settings-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-top: 14px; flex-wrap: wrap; }
.settings-foot p { margin: 0; max-width: 70ch; }
.settings-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }

/* ───────── Tooltip & toast ───────── */

.tip {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  min-width: 140px;
  padding: 9px 11px;
  border-radius: 10px;
  background: #222228;
  border: 1px solid var(--line-2);
  box-shadow: 0 12px 30px -8px rgba(0, 0, 0, .6);
  font-size: 12.5px;
}
.tip-title { color: var(--muted); font-size: 11.5px; margin-bottom: 5px; }
.tip-row { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.tip-row span { display: inline-flex; align-items: center; gap: 6px; }
.tip-row b { font: 500 12px var(--mono); }

.toast {
  position: fixed;
  left: 50%; bottom: 24px;
  z-index: 70;
  padding: 10px 16px;
  border-radius: 10px;
  background: #222228;
  border: 1px solid var(--line-2);
  font-size: 13px;
  box-shadow: 0 12px 30px -8px rgba(0, 0, 0, .6);
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .4s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 6px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ───────── Responsive ───────── */

@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .topbar { flex-wrap: wrap; row-gap: 10px; }
  .tabs { order: 3; width: 100%; margin-left: 0; overflow-x: auto; }
  .tabs button[aria-selected="true"]::after { bottom: -11px; }
  .grid-funnel { grid-template-columns: minmax(0, 1fr); }
  .brand-sub { display: none; }
}

@media (max-width: 640px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 16px; }
  .seg button { padding: 0 8px; }
  .f-row { grid-template-columns: minmax(0, 110px) minmax(0, 1fr) 40px 52px; gap: 8px; }
  .kbd-help { display: none; }
  table.leads { min-width: 0; }
  .leads .c-age, .leads .c-types, .leads .c-port, .leads .c-rating, .leads .c-date, .leads .c-level { display: none; }
  .who { min-width: 0; }
  .kv { grid-template-columns: 110px 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
