/* ---------- Tokens ---------- */
:root {
  --brand: #4f46e5;
  --brand-soft: color-mix(in srgb, var(--brand) 12%, transparent);
  --brand-text: color-mix(in srgb, var(--brand) 85%, #000);
  --bg: #f7f7f8;
  --surface: #ffffff;
  --surface-2: #f2f2f4;
  --surface-3: #e9e9ed;
  --text: #0e0e12;
  --text-2: #3c3c45;
  --muted: #6e6e7a;
  --border: #e6e6ea;
  --border-2: #d8d8de;
  --good: #15803d; --good-soft: #e4f4e9;
  --warn: #b45309; --warn-soft: #fcf0dd;
  --bad: #b91c1c; --bad-soft: #fbe5e5;
  --t1: #4f46e5; --t2: #0891b2; --t3: #c2410c; --t4: #7c3aed; --t5: #0d9488; --t6: #be185d;
  --shadow: 0 1px 2px rgb(0 0 0 / .04), 0 4px 16px rgb(0 0 0 / .04);
  --shadow-lg: 0 10px 40px rgb(0 0 0 / .14);
  --radius: 12px;
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand-text: color-mix(in srgb, var(--brand) 60%, #fff);
    --bg: #0c0c0f; --surface: #141419; --surface-2: #1b1b22; --surface-3: #24242d; --text: #ededf1; --text-2: #c9c9d2;
    --muted: #8f8f9c; --border: #25252e; --border-2: #33333e;
    --good: #4ade80; --good-soft: #13261a; --warn: #fbbf24; --warn-soft: #2b2311; --bad: #f87171; --bad-soft: #2e1616;
    --t1: #8b85ff; --t2: #22d3ee; --t3: #fb923c; --t4: #a78bfa; --t5: #2dd4bf; --t6: #f472b6;
    --shadow: 0 1px 2px rgb(0 0 0 / .3); --shadow-lg: 0 10px 40px rgb(0 0 0 / .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand-text: color-mix(in srgb, var(--brand) 60%, #fff);
  --bg: #0c0c0f; --surface: #141419; --surface-2: #1b1b22; --surface-3: #24242d; --text: #ededf1; --text-2: #c9c9d2;
  --muted: #8f8f9c; --border: #25252e; --border-2: #33333e;
  --good: #4ade80; --good-soft: #13261a; --warn: #fbbf24; --warn-soft: #2b2311; --bad: #f87171; --bad-soft: #2e1616;
  --t1: #8b85ff; --t2: #22d3ee; --t3: #fb923c; --t4: #a78bfa; --t5: #2dd4bf; --t6: #f472b6;
  --shadow: 0 1px 2px rgb(0 0 0 / .3); --shadow-lg: 0 10px 40px rgb(0 0 0 / .5);
  color-scheme: dark;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand-text); }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.i.lg { width: 20px; height: 20px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.stack { display: grid; gap: 12px; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.01em; }

/* ---------- Barra do protótipo ---------- */
.demobar { display: none !important;
  display: flex; align-items: center; gap: 10px; padding: 6px 16px; font-size: 12px;
  background: var(--text); color: var(--bg); position: sticky; top: 0; z-index: 30;
}
.demobar .url { font-family: var(--mono); background: color-mix(in srgb, var(--bg) 14%, transparent); padding: 2px 8px; border-radius: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.demobar button { background: none; border: 1px solid color-mix(in srgb, var(--bg) 30%, transparent); color: inherit; border-radius: 6px; padding: 2px 8px; font-size: 12px; white-space: nowrap; }
.demobar .lbl { font-weight: 600; white-space: nowrap; }

/* ---------- Botões e campos ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px;
  border-radius: 9px; border: 1px solid var(--border-2); background: var(--surface); font-weight: 500; white-space: nowrap;
  color: var(--text); text-decoration: none;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: color-mix(in srgb, var(--brand) 88%, #000); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { border-color: transparent; background: none; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 8px; border: 0; background: none; color: var(--text-2); position: relative; }
.icon-btn:hover { background: var(--surface-2); }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.input, select.input, textarea.input {
  height: 38px; width: 100%; padding: 0 12px; border-radius: 9px; border: 1px solid var(--border-2); background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; padding: 10px 12px; resize: vertical; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.input-group { display: flex; align-items: center; border: 1px solid var(--border-2); border-radius: 9px; background: var(--surface); overflow: hidden; }
.input-group input { border: 0; height: 38px; padding: 0 12px; flex: 1; min-width: 0; background: none; outline: none; }
.input-group .addon { padding: 0 12px; color: var(--muted); background: var(--surface-2); height: 38px; display: grid; place-items: center; font-size: 13px; border-left: 1px solid var(--border); white-space: nowrap; }
.input-group:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

.toggle { position: relative; width: 38px; height: 22px; flex: none; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle span { position: absolute; inset: 0; background: var(--surface-3); border-radius: 99px; transition: background .2s; cursor: pointer; }
.toggle span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 2px rgb(0 0 0 / .2); }
.toggle input:checked + span { background: var(--brand); }
.toggle input:checked + span::after { transform: translateX(16px); }
.toggle input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; padding: 1px 8px; border-radius: 99px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.brand { background: var(--brand-soft); color: var(--brand-text); }
.kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--border-2); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; color: var(--muted); background: var(--surface); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--good); flex: none; }
.dot.live { background: var(--brand); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.fade { animation: fadein .3s ease both; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card.flat { box-shadow: none; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head h3 { font-size: 14.5px; font-weight: 600; }
.card-head .spacer + * { margin-left: auto; }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; border: 1px dashed var(--border-2); border-radius: var(--radius); }
.empty .i { width: 28px; height: 28px; margin-bottom: 8px; color: var(--muted); }
.empty strong { display: block; color: var(--text); margin-bottom: 4px; }

/* ---------- Telas de entrada ---------- */
.center-screen { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.landing { max-width: 860px; width: 100%; }
.landing h1 { font-size: 30px; line-height: 1.2; margin-bottom: 8px; }
.landing > p { color: var(--muted); max-width: 620px; margin: 0 0 28px; font-size: 15px; }
.tenant-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.tenant-card { text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: 14px; padding: 18px; box-shadow: var(--shadow); display: grid; gap: 12px; transition: border-color .15s, transform .15s; }
.tenant-card:hover { border-color: var(--border-2); transform: translateY(-2px); }
.tenant-card .addr { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.tenant-card.new { border-style: dashed; place-content: center; text-align: center; color: var(--muted); box-shadow: none; }
.avatar { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; flex: none; }
.avatar.sm { width: 28px; height: 28px; border-radius: 8px; font-size: 11px; }
.avatar.round { border-radius: 50%; background: var(--surface-3); color: var(--text-2); }
.note { margin-top: 24px; display: flex; gap: 10px; padding: 14px 16px; border-radius: 12px; background: var(--brand-soft); color: var(--text-2); font-size: 13.5px; }
.note .i { color: var(--brand-text); margin-top: 2px; }

.auth { width: 100%; max-width: 400px; }
.auth .card { padding: 28px; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 22px; text-align: center; }
.auth-brand .avatar { width: 48px; height: 48px; border-radius: 14px; font-size: 16px; }
.auth-brand h2 { font-size: 19px; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 4px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.sso-btn { gap: 10px; }
.otp { display: flex; gap: 8px; justify-content: center; }
.otp input { width: 44px; height: 50px; text-align: center; font-size: 20px; font-weight: 600; border-radius: 10px; border: 1px solid var(--border-2); background: var(--surface); }
.otp input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.auth-foot { text-align: center; font-size: 12.5px; color: var(--muted); margin-top: 16px; }

/* Onboarding */
.wizard { width: 100%; max-width: 620px; }
.steps-bar { display: flex; gap: 8px; margin-bottom: 18px; }
.steps-bar div { flex: 1; }
.steps-bar i { display: block; height: 4px; border-radius: 99px; background: var(--surface-3); margin-bottom: 6px; }
.steps-bar .on i { background: var(--brand); }
.steps-bar span { font-size: 12px; color: var(--muted); }
.steps-bar .on span { color: var(--text); font-weight: 500; }
.wizard h2 { font-size: 22px; margin-bottom: 4px; }
.wizard .lead { color: var(--muted); margin: 0 0 20px; }
.wizard-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 22px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.swatches { display: flex; gap: 8px; }
.swatch { width: 28px; height: 28px; border-radius: 8px; border: 2px solid transparent; }
.swatch.on { border-color: var(--text); box-shadow: inset 0 0 0 2px var(--surface); }

.dropzone { border: 1.5px dashed var(--border-2); border-radius: 14px; padding: 30px 20px; text-align: center; background: var(--surface-2); transition: border-color .15s, background .15s; }
.dropzone.over { border-color: var(--brand); background: var(--brand-soft); }
.dropzone .i { width: 28px; height: 28px; color: var(--muted); }
.dropzone strong { display: block; margin: 8px 0 2px; }
.file-list { display: grid; gap: 6px; margin-top: 14px; max-height: 260px; overflow: auto; }
.file-row { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 6px 10px; border-radius: 8px; background: var(--surface-2); animation: fadein .25s both; }
.file-row .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .ok { color: var(--good); }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { border-right: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; padding: 14px 12px; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.org { display: flex; align-items: center; gap: 10px; padding: 6px 8px 14px; }
.org strong { display: block; font-size: 14px; line-height: 1.2; }
.org span { font-size: 11.5px; color: var(--muted); font-family: var(--mono); }
.nav-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 14px 10px 4px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--text-2); text-decoration: none; font-weight: 500; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--brand-soft); color: var(--brand-text); }
.nav .count { margin-left: auto; font-size: 11.5px; font-weight: 600; background: var(--surface-3); color: var(--text-2); border-radius: 99px; padding: 0 7px; }
.nav .count.warn { background: var(--warn-soft); color: var(--warn); }
.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); display: grid; gap: 8px; }
.analysis-mini { padding: 10px; border-radius: 10px; background: var(--surface-2); font-size: 12.5px; }
.analysis-mini .bar { margin-top: 6px; }
.isolation { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); padding: 4px 8px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 60px; display: flex; align-items: center; gap: 8px; padding: 0 24px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 10; }
.topbar h1 { font-size: 16px; font-weight: 600; }
.search-trigger { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); min-width: 220px; }
.search-trigger .kbd { margin-left: auto; }
.menu-btn { display: none; }
.content { padding: 24px; max-width: 1180px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.notif-dot { position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--bad); border: 2px solid var(--bg); }

/* Menu suspenso */
.menu { position: absolute; z-index: 40; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 220px; animation: fadein .15s both; }
.menu .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.menu .who strong { display: block; }
.menu button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; background: none; border-radius: 8px; text-align: left; }
.menu button:hover { background: var(--surface-2); }

/* ---------- Início ---------- */
.hero { display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: center; }
.ring-wrap { position: relative; width: 132px; height: 132px; }
.ring { width: 132px; height: 132px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; }
.ring .bg { stroke: var(--surface-3); }
.ring .fg { stroke: var(--brand); stroke-linecap: round; transition: stroke-dashoffset .6s ease, stroke .6s; }
.ring-text { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-text strong { font-size: 36px; line-height: 1; letter-spacing: -0.03em; }
.ring-text span { font-size: 11.5px; color: var(--muted); }
.hero h2 { font-size: 20px; margin-bottom: 4px; }
.hero p { margin: 0; color: var(--muted); }
.delta { color: var(--good); font-weight: 600; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 16px 0; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.kpi span { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.kpi strong { display: block; font-size: 24px; letter-spacing: -0.02em; margin-top: 2px; }
.grid-main { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.feed li { display: grid; grid-template-columns: 16px 1fr; gap: 12px; padding: 0 0 14px; position: relative; animation: fadein .35s both; }
.feed li::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: 0; width: 2px; background: var(--border); }
.feed li:last-child::before { display: none; }
.feed .mark { width: 16px; height: 16px; border-radius: 50%; background: var(--brand-soft); display: grid; place-items: center; margin-top: 2px; }
.feed .mark::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.feed .phase { font-size: 11.5px; font-weight: 600; color: var(--brand-text); }
.crit { margin-bottom: 12px; }
.crit-head { display: flex; justify-content: space-between; font-size: 13px; }
.bar { height: 6px; background: var(--surface-3); border-radius: 99px; overflow: hidden; margin-top: 5px; }
.bar > i { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .6s ease; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12.5px; border-radius: 99px; padding: 3px 10px; background: var(--surface-2); border: 1px solid var(--border); display: inline-flex; align-items: center; gap: 6px; }
.chip i { width: 7px; height: 7px; border-radius: 50%; }
button.chip { cursor: pointer; }
button.chip.on { background: var(--brand-soft); border-color: transparent; color: var(--brand-text); font-weight: 500; }
.c1 { background: var(--t1); } .c2 { background: var(--t2); } .c3 { background: var(--t3); } .c4 { background: var(--t4); } .c5 { background: var(--t5); } .c6 { background: var(--t6); }
.callout { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--border); background: linear-gradient(120deg, var(--brand-soft), transparent 70%); }
.callout .icon-box { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--brand); color: #fff; flex: none; }
.callout p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

/* ---------- Tabelas ---------- */
.table-wrap { overflow-x: auto; margin: 0 -20px -20px; }
table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); padding: 10px 20px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.t td { padding: 12px 20px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr.click { cursor: pointer; }
.t tbody tr.click:hover { background: var(--surface-2); }
.t .sub { display: block; font-size: 12px; color: var(--muted); font-family: var(--mono); }
.grade { font-weight: 600; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.grade .arrow { color: var(--muted); font-weight: 400; }
.g-low { color: var(--bad); } .g-mid { color: var(--warn); } .g-high { color: var(--good); }
.issue { font-size: 11.5px; padding: 1px 7px; border-radius: 6px; background: var(--warn-soft); color: var(--warn); margin: 0 4px 2px 0; display: inline-block; }
.issue.fixed { background: var(--good-soft); color: var(--good); text-decoration: line-through; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .input-group { flex: 1; min-width: 220px; }
.toolbar .input-group .i { margin-left: 12px; color: var(--muted); }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 7px; font-size: 13px; color: var(--muted); font-weight: 500; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ---------- Melhorias e revisão ---------- */
.diff { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.diff > div { border-radius: 10px; padding: 12px 14px; font-size: 13.5px; white-space: pre-line; border: 1px solid transparent; }
.diff .before { background: var(--surface-2); color: var(--text-2); }
.diff .after { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 20%, transparent); }
.diff small { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 4px; }
.confidence { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.confidence .bar { width: 48px; margin: 0; }
.review-card { border-left: 3px solid var(--warn); }
.review-card.done { border-left-color: var(--good); }
.options { display: grid; gap: 8px; margin-top: 14px; }
.option { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--surface); text-align: left; transition: border-color .15s, background .15s; }
.option:hover { border-color: var(--brand); background: var(--brand-soft); }
.option .kbd { flex: none; }
.resolved { margin-top: 12px; color: var(--good); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.src-list { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.src { font-family: var(--mono); font-size: 11.5px; background: var(--surface-2); padding: 1px 7px; border-radius: 6px; color: var(--text-2); }

/* ---------- MCP ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: none; padding: 10px 12px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.tabs button.on { color: var(--text); border-bottom-color: var(--brand); }
.code { position: relative; background: #0e0e12; color: #e6e6ee; border-radius: 10px; padding: 14px 96px 14px 16px; font-family: var(--mono); font-size: 12.5px; white-space: pre-wrap; word-break: break-all; }
:root[data-theme="dark"] .code { background: #08080b; border: 1px solid var(--border); }
.code .copy { position: absolute; top: 8px; right: 8px; background: rgb(255 255 255 / .08); color: #e6e6ee; border: 0; border-radius: 7px; height: 28px; padding: 0 10px; display: flex; gap: 6px; align-items: center; font-family: var(--font); font-size: 12px; }
.code .copy:hover { background: rgb(255 255 255 / .16); }
.endpoint { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-family: var(--mono); font-size: 13px; }
.endpoint span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.answer { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; animation: fadein .3s both; }
.answer .calls { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-bottom: 8px; display: grid; gap: 2px; }
.answer .calls b { color: var(--brand-text); font-weight: 500; }
.answer .q { font-weight: 600; margin-bottom: 4px; }
.answer .meta { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ask { display: flex; gap: 8px; }
.ask .input { flex: 1; }
.tool-row { display: grid; grid-template-columns: 180px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.tool-row:last-child { border-bottom: 0; }

/* ---------- Configurações ---------- */
.settings { display: grid; grid-template-columns: 200px 1fr; gap: 24px; align-items: start; }
.subnav { display: grid; gap: 2px; position: sticky; top: 76px; }
.subnav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--text-2); text-decoration: none; font-weight: 500; }
.subnav a:hover { background: var(--surface-2); }
.subnav a.active { background: var(--surface); box-shadow: var(--shadow); border: 1px solid var(--border); color: var(--text); }
.setting { display: flex; gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--border); }
.setting:first-of-type { padding-top: 0; }
.setting:last-child { border-bottom: 0; padding-bottom: 0; }
.setting .txt { flex: 1; min-width: 0; }
.setting .txt strong { display: block; font-weight: 600; }
.setting .txt span { font-size: 13px; color: var(--muted); }
.provider { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; }
.provider .logo { width: 32px; height: 32px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.provider .txt { flex: 1; }
.provider .txt strong { display: block; }
.provider .txt span { font-size: 12.5px; color: var(--muted); }
.danger-zone { border-color: color-mix(in srgb, var(--bad) 35%, var(--border)); }
.login-preview { border: 1px solid var(--border); border-radius: 12px; padding: 18px; background: var(--bg); display: grid; justify-items: center; gap: 8px; text-align: center; }
input[type="range"] { accent-color: var(--brand); width: 100%; }

/* ---------- Painéis sobrepostos ---------- */
.backdrop { position: fixed; inset: 0; background: rgb(10 10 14 / .45); z-index: 50; animation: fadein .15s both; display: grid; place-items: center; padding: 16px; }
.modal { width: 100%; max-width: 460px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 22px; animation: fadein .2s both; max-height: 100vh; overflow: auto; }
.modal h3 { font-size: 17px; margin-bottom: 4px; }
.modal .lead { color: var(--muted); margin: 0 0 18px; font-size: 13.5px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.drawer-back { place-items: stretch end; padding: 0; }
.drawer { width: min(620px, 100vw); height: 100%; background: var(--surface); box-shadow: var(--shadow-lg); padding: 24px; overflow-y: auto; animation: slidein .25s ease both; }
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 18px; }
.drawer-head h3 { font-size: 18px; }
.meta-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.meta-grid div { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.meta-grid span { font-size: 12px; color: var(--muted); display: block; }
.meta-grid strong { font-size: 15px; }
.palette { align-items: start; padding-top: 12vh; }
.palette .box { width: 100%; max-width: 560px; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; animation: fadein .15s both; border: 1px solid var(--border); }
.palette input { width: 100%; border: 0; border-bottom: 1px solid var(--border); padding: 16px 18px; font-size: 15px; background: none; outline: none; }
.palette .results { max-height: 360px; overflow-y: auto; padding: 6px; }
.palette .group { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding: 8px 12px 4px; }
.palette .item { width: 100%; display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 8px; border: 0; background: none; text-align: left; }
.palette .item.on, .palette .item:hover { background: var(--surface-2); }
.palette .item small { margin-left: auto; color: var(--muted); font-family: var(--mono); font-size: 11.5px; }
.palette .foot { display: flex; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }

#toasts { position: fixed; bottom: 20px; right: 20px; display: grid; gap: 8px; z-index: 60; }
.toast { background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow-lg); display: flex; gap: 8px; align-items: center; font-size: 13.5px; animation: fadein .2s both; max-width: 360px; }
.toast .i { color: var(--good); }

/* ---------- Responsivo ---------- */
@media (max-width: 960px) {
  .grid-main { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .settings { grid-template-columns: 1fr; }
  .subnav { position: static; display: flex; overflow-x: auto; gap: 4px; scrollbar-width: none; }
  .subnav a { white-space: nowrap; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; z-index: 45; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); height: auto; }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open::after { content: ""; position: fixed; inset: 0; background: rgb(0 0 0 / .4); z-index: 44; }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 0 12px; }
  .search-trigger { min-width: 0; width: 34px; padding: 0; justify-content: center; border: 0; background: none; }
  .search-trigger .lbl, .search-trigger .kbd { display: none; }
  .content { padding: 16px; }
  .hero { grid-template-columns: 1fr; justify-items: start; }
  .diff, .grid-2 { grid-template-columns: 1fr; }
  .tool-row { grid-template-columns: 1fr; gap: 4px; }
  .meta-grid { grid-template-columns: 1fr 1fr; }
  .demobar .hide-sm { display: none; }
  .landing h1 { font-size: 24px; }
  .table-wrap { margin: 0 -20px -20px; }
}

/* ---------- Sistema real ---------- */
.secret-box { font-family: var(--mono); font-size: 14px; padding: 14px 16px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--border-2); word-break: break-all; display: flex; gap: 10px; align-items: center; }
.secret-box span { flex: 1; }
.warn-box { display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px; background: var(--warn-soft); color: var(--text-2); font-size: 13.5px; }
.warn-box .i { color: var(--warn); margin-top: 2px; }
.loading { display: grid; place-items: center; min-height: 60vh; color: var(--muted); }
.spinner { width: 22px; height: 22px; border: 2.5px solid var(--surface-3); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-text { color: var(--bad); font-size: 13px; }
.chunk { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; white-space: pre-line; }
.chunk.improved { border-color: color-mix(in srgb, var(--good) 30%, var(--border)); background: var(--good-soft); }
.result { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
