/* ==========================================================================
   Inferência — sistema visual
   ========================================================================== */
:root {
  --primary: #1F4E79; --primary-600: #183f62; --primary-50: #eaf1f8; --primary-100: #d3e2f0;
  --accent: #E07A1F; --accent-50: #fdf1e6;
  --ok: #1e8a5a; --ok-50: #e7f5ee; --warn: #b7791f; --warn-50: #fdf6e3; --err: #c0392b; --err-50: #fbeceb; --info: #2f6fb0; --info-50: #e9f1fa;
  --bg: #f4f6fa; --surface: #ffffff; --surface-2: #f8fafc; --line: #e3e8ef; --line-2: #eef2f6;
  --text: #17212e; --text-2: #4a5768; --muted: #7a8696;
  --radius: 10px; --radius-sm: 7px; --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
  --shadow-lg: 0 12px 32px -8px rgba(16,24,40,.18);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sidebar: 248px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary-50: #16263a; --primary-100: #1d3350; --accent-50: #3a2614;
    --ok-50: #11291f; --warn-50: #2e2511; --err-50: #33181a; --info-50: #142538;
    --bg: #0f141b; --surface: #161d27; --surface-2: #1b2430; --line: #2a3442; --line-2: #222b37;
    --text: #e6ebf2; --text-2: #b4bfcc; --muted: #8592a3;
    --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 12px 32px -8px rgba(0,0,0,.6);
  }
}
:root[data-theme="dark"] {
  --primary-50: #16263a; --primary-100: #1d3350; --accent-50: #3a2614;
  --ok-50: #11291f; --warn-50: #2e2511; --err-50: #33181a; --info-50: #142538;
  --bg: #0f141b; --surface: #161d27; --surface-2: #1b2430; --line: #2a3442; --line-2: #222b37;
  --text: #e6ebf2; --text-2: #b4bfcc; --muted: #8592a3;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14.5px; line-height: 1.55; color: var(--text); background: var(--bg); font-feature-settings: 'cv11', 'ss01'; }
a { color: var(--primary); text-decoration: none; }
:root[data-theme="dark"] a, :root:not([data-theme="light"]) a { }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; font-weight: 700; } h2 { font-size: 1.25rem; font-weight: 650; } h3 { font-size: 1.05rem; font-weight: 650; } h4 { font-size: .95rem; font-weight: 650; }
p { margin: 0 0 .8em; }
code, .mono { font-family: var(--mono); font-size: .88em; }
.num { font-variant-numeric: tabular-nums; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
small, .small { font-size: .85em; }
.muted { color: var(--muted); } .text-2 { color: var(--text-2); }
.ok { color: var(--ok); } .err { color: var(--err); } .warn { color: var(--warn); }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- layout app ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; font-weight: 750; font-size: 1.05rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--primary); display: grid; place-items: center; color: #fff; flex: none; }
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: .72rem; letter-spacing: .02em; }
.nav { padding: 6px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav-title { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 14px 10px 6px; font-weight: 600; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text-2); font-weight: 500; }
.nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.nav a.active { background: var(--primary-50); color: var(--primary); }
:root[data-theme="dark"] .nav a.active { color: #9cc3ea; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .nav a.active { color: #9cc3ea; } }
.nav svg { width: 18px; height: 18px; flex: none; }
.sidebar-foot { margin-top: auto; padding: 14px; border-top: 1px solid var(--line); font-size: .82rem; }
.plan-pill { background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 58px; display: flex; align-items: center; gap: 12px; padding: 0 28px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar .spacer { flex: 1; }
.menu-btn { display: none; background: none; border: 0; padding: 6px; color: var(--text); cursor: pointer; }
.content { padding: 26px 28px 60px; max-width: 1320px; width: 100%; }
.content.wide { max-width: none; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--text-2); }
.crumbs { font-size: .82rem; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }
.impersonate { background: var(--warn-50); color: var(--warn); padding: 8px 28px; font-size: .85rem; display: flex; gap: 10px; align-items: center; border-bottom: 1px solid var(--line); }

@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: 270px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .app.nav-open .sidebar { transform: none; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .content { padding: 20px 16px 60px; }
}

/* ---------- componentes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-body { padding: 20px; }
.card-head { padding: 14px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.card + .card { margin-top: 16px; }
.grid > .card + .card, .grid > .card { margin-top: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.mt { margin-top: 16px; } .mt2 { margin-top: 28px; } .mb { margin-bottom: 16px; } .mb0 { margin-bottom: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 16px; border-radius: 8px; border: 1px solid transparent; font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; line-height: 1.2; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s; text-decoration: none !important; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-600); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { filter: brightness(.95); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); border-color: #cfd6df; }
.btn-danger { background: var(--surface); color: var(--err); border-color: #efc9c4; }
.btn-danger:hover { background: var(--err-50); }
.btn-link { background: none; border: 0; color: var(--primary); padding: 4px 6px; }
.btn-sm { padding: 6px 11px; font-size: .82rem; }
.btn-lg { padding: 12px 22px; font-size: 1rem; }
.btn[disabled], .btn.loading { opacity: .6; pointer-events: none; }
.btn.loading::after { content: ''; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { background: none; border: 1px solid transparent; border-radius: 7px; padding: 6px; cursor: pointer; color: var(--text-2); display: inline-flex; }
.icon-btn:hover { background: var(--surface-2); border-color: var(--line); color: var(--text); }
.icon-btn svg { width: 17px; height: 17px; }

label { font-weight: 600; font-size: .86rem; display: block; margin-bottom: 5px; color: var(--text); }
.field { margin-bottom: 14px; }
.field .hint { font-size: .8rem; color: var(--muted); margin-top: 4px; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=url], input[type=search], input[type=tel], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid #cfd6df; border-radius: var(--radius-sm); padding: 9px 11px; transition: border-color .12s, box-shadow .12s;
}
:root[data-theme="dark"] input, :root[data-theme="dark"] select, :root[data-theme="dark"] textarea { border-color: var(--line); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) input, :root:not([data-theme="light"]) select, :root:not([data-theme="light"]) textarea { border-color: var(--line); } }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }
textarea { min-height: 90px; resize: vertical; }
input[type=color] { width: 44px; height: 36px; padding: 2px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); cursor: pointer; }
.input-group { display: flex; } .input-group > * { border-radius: 0; } .input-group > :first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); } .input-group > :last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-group .addon { background: var(--surface-2); border: 1px solid #cfd6df; padding: 9px 11px; color: var(--muted); white-space: nowrap; }
.check { display: flex; align-items: flex-start; gap: 9px; font-weight: 500; cursor: pointer; margin-bottom: 8px; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--primary); flex: none; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 36px; height: 20px; background: #cfd6df; border-radius: 20px; position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ''; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--primary); outline-offset: 2px; }

.alert { padding: 12px 14px; border-radius: 9px; border: 1px solid; margin-bottom: 14px; font-size: .92rem; display: flex; gap: 10px; align-items: flex-start; }
.alert-success { background: var(--ok-50); border-color: #b9e1cc; color: var(--ok); }
.alert-error { background: var(--err-50); border-color: #f0c5c0; color: var(--err); }
.alert-info { background: var(--info-50); border-color: #c6dbf1; color: var(--info); }
.alert-warn { background: var(--warn-50); border-color: #ecd9a8; color: var(--warn); }
.alert ul { margin: 4px 0 0; padding-left: 18px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .alert { border-color: var(--line); } }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: .74rem; font-weight: 650; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); white-space: nowrap; }
.badge-ok { background: var(--ok-50); color: var(--ok); border-color: transparent; }
.badge-warn { background: var(--warn-50); color: var(--warn); border-color: transparent; }
.badge-err { background: var(--err-50); color: var(--err); border-color: transparent; }
.badge-info { background: var(--info-50); color: var(--info); border-color: transparent; }
.badge-primary { background: var(--primary-50); color: var(--primary); border-color: transparent; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: currentColor; }

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-weight: 600; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .r { text-align: right; } .table .c { text-align: center; }
.table.compact td, .table.compact th { padding: 6px 10px; }

.stat { padding: 16px 18px; }
.stat .label { font-size: .78rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 1.65rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.stat .sub { font-size: .82rem; color: var(--text-2); }

.progress { height: 8px; background: var(--line-2); border-radius: 9px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--primary); border-radius: 9px; transition: width .3s; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs button, .tabs a { background: none; border: 0; padding: 11px 14px; font: inherit; font-weight: 600; color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 7px; align-items: center; text-decoration: none; }
.tabs button:hover, .tabs a:hover { color: var(--text); }
.tabs .active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; } .tab-panel.active { display: block; }

.empty { text-align: center; padding: 50px 20px; color: var(--text-2); }
.empty svg { width: 46px; height: 46px; color: var(--muted); margin-bottom: 10px; }

.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); min-width: 210px; padding: 6px; display: none; z-index: 50; }
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a, .dropdown-menu button { display: flex; width: 100%; text-align: left; gap: 9px; align-items: center; padding: 8px 10px; border-radius: 7px; color: var(--text); background: none; border: 0; font: inherit; cursor: pointer; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-2); text-decoration: none; }
.dropdown-menu .sep { height: 1px; background: var(--line); margin: 5px 0; }

.modal-bg { position: fixed; inset: 0; background: rgba(12,18,28,.5); display: none; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 100; overflow-y: auto; }
.modal-bg.open { display: flex; }
.modal { background: var(--surface); border-radius: 14px; width: 100%; max-width: 640px; box-shadow: var(--shadow-lg); }
.modal.lg { max-width: 960px; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { margin: 0; }
.modal-body { padding: 20px; max-height: 70vh; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }

.toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: #17212e; color: #fff; padding: 11px 16px; border-radius: 9px; box-shadow: var(--shadow-lg); font-size: .9rem; max-width: 380px; animation: tin .2s; }
.toast.error { background: var(--err); } .toast.success { background: var(--ok); }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: .9rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 500; }

.callout { border-left: 3px solid var(--primary); background: var(--primary-50); padding: 12px 14px; border-radius: 0 8px 8px 0; font-size: .92rem; }
.callout.accent { border-color: var(--accent); background: var(--accent-50); }
.formula { font-family: var(--mono); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: .86rem; overflow-x: auto; white-space: nowrap; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: .84rem; cursor: pointer; font-weight: 500; color: var(--text-2); }
.chip.active, .chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }

.md h1, .md h2, .md h3 { margin-top: 1.1em; } .md h1:first-child, .md h2:first-child, .md h3:first-child { margin-top: 0; }
.md ul, .md ol { padding-left: 22px; } .md li { margin: 3px 0; }
.md p { margin: 0 0 .7em; }
.md table { border-collapse: collapse; margin: 10px 0; } .md td, .md th { border: 1px solid var(--line); padding: 5px 9px; }

/* ---------- gráficos ---------- */
.chart { width: 100%; overflow: visible; }
.chart text { fill: var(--text-2); font-family: var(--font); font-size: 12px; }
.chart .lbl { fill: var(--text); font-weight: 500; }
.chart .val { fill: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }
.chart .grid line { stroke: var(--line-2); }
.chart .axis line, .chart .axis path { stroke: var(--line); }
.chart .ci { stroke: var(--text); stroke-width: 1.4; opacity: .55; }
.chart-tip { position: fixed; pointer-events: none; background: #17212e; color: #fff; font-size: .8rem; padding: 7px 10px; border-radius: 7px; z-index: 300; max-width: 280px; box-shadow: var(--shadow-lg); display: none; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .82rem; color: var(--text-2); margin-top: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 6px; vertical-align: -1px; }

/* ---------- público (landing, auth) ---------- */
.pub-nav { background: var(--surface); border-bottom: 1px solid var(--line); }
.pub-nav .inner { max-width: 1160px; margin: 0 auto; padding: 0 20px; height: 64px; display: flex; align-items: center; gap: 22px; }
.pub-nav nav { display: flex; gap: 20px; margin-left: 12px; }
.pub-nav nav a { color: var(--text-2); font-weight: 500; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.hero { padding: 70px 0 50px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 50px; align-items: center; }
.hero h1 { font-size: 2.6rem; line-height: 1.1; letter-spacing: -.03em; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p.lead { font-size: 1.12rem; color: var(--text-2); max-width: 560px; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; padding-top: 40px; } .hero h1 { font-size: 2rem; } .pub-nav nav { display: none; } }
.feature { padding: 22px; }
.feature .ic { width: 38px; height: 38px; border-radius: 9px; background: var(--primary-50); color: var(--primary); display: grid; place-items: center; margin-bottom: 12px; }
.feature .ic svg { width: 20px; height: 20px; }
.section { padding: 56px 0; }
.section-title { text-align: center; max-width: 680px; margin: 0 auto 34px; }
.section-title p { color: var(--text-2); }
.price-card { padding: 24px; display: flex; flex-direction: column; position: relative; }
.price-card.hl { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), var(--shadow-lg); }
.price-card .price { font-size: 2rem; font-weight: 750; letter-spacing: -.02em; }
.price-card ul { list-style: none; padding: 0; margin: 16px 0 22px; font-size: .9rem; }
.price-card li { padding: 5px 0 5px 22px; position: relative; color: var(--text-2); }
.price-card li::before { content: '✓'; position: absolute; left: 0; color: var(--ok); font-weight: 700; }
.price-card li.no { opacity: .5; } .price-card li.no::before { content: '–'; color: var(--muted); }
.price-card .btn { margin-top: auto; }
.ribbon { position: absolute; top: -11px; right: 18px; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; }
.auth-wrap { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 40px 16px; }
.auth-card { width: 100%; max-width: 430px; }
.auth-card .card-body { padding: 30px; }
.footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: .85rem; background: var(--surface); }

/* ---------- construtor ---------- */
.builder { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
@media (max-width: 1150px) { .builder { grid-template-columns: 1fr; } }
.side-sticky { position: sticky; top: 76px; }
.qcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; transition: box-shadow .15s, border-color .15s; }
.qcard.open { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary-100), var(--shadow); }
.qcard.dragging { opacity: .5; }
.qcard.drop-before { box-shadow: 0 -3px 0 var(--accent); }
.qhead { display: flex; align-items: center; gap: 10px; padding: 11px 12px; cursor: pointer; }
.qhead .grip { cursor: grab; color: var(--muted); display: flex; }
.qhead .qnum { font-family: var(--mono); font-size: .78rem; color: var(--muted); min-width: 26px; }
.qhead .qtext { flex: 1 1 45%; min-width: 120px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qhead .qmeta { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; flex: 0 1 auto; max-width: 48%; }
@media (max-width: 700px) { .qhead .qmeta { display: none; } }
.chip svg, .badge svg, .alert svg, .hint svg { width: 14px; height: 14px; flex: none; }
.qbody { padding: 4px 16px 16px; border-top: 1px solid var(--line-2); display: none; }
.qcard.open .qbody { display: block; }
.qcard.section { background: var(--surface-2); }
.opt-row { display: grid; grid-template-columns: 22px 70px 1fr auto auto; gap: 6px; align-items: center; margin-bottom: 6px; }
.opt-row input { padding: 6px 9px; }
.opt-thumb { width: 34px; height: 34px; border-radius: 6px; object-fit: cover; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; display: grid; place-items: center; color: var(--muted); font-size: .7rem; overflow: hidden; }
.opt-thumb img { width: 100%; height: 100%; object-fit: cover; }
.add-bar { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px; border: 1px dashed #c4ccd7; border-radius: var(--radius); background: var(--surface); }
.savebar { display: flex; align-items: center; gap: 10px; }
.save-state { font-size: .82rem; color: var(--muted); }
.cand-card { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.cand-photo { width: 64px; height: 64px; border-radius: 10px; background: var(--surface-2); border: 1px dashed #c4ccd7; display: grid; place-items: center; cursor: pointer; overflow: hidden; color: var(--muted); font-size: .72rem; text-align: center; }
.cand-photo img { width: 100%; height: 100%; object-fit: cover; }
.imgpick { display: flex; align-items: center; gap: 12px; }
.imgpick .prev { width: 120px; height: 68px; border-radius: 8px; border: 1px dashed #c4ccd7; background: var(--surface-2) center/cover no-repeat; display: grid; place-items: center; color: var(--muted); font-size: .75rem; }

/* ---------- resultados ---------- */
.res-q { padding: 20px; }
.res-q + .res-q { border-top: 1px solid var(--line); }
.res-q h3 { font-size: 1rem; margin-bottom: 2px; }
.res-meta { font-size: .8rem; color: var(--muted); margin-bottom: 12px; display: flex; gap: 12px; flex-wrap: wrap; }
.infer-box { background: var(--primary-50); border: 1px solid var(--primary-100); border-radius: 10px; padding: 14px 16px; }
.infer-box h4 { color: var(--primary); display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
:root[data-theme="dark"] .infer-box h4 { color: #9cc3ea; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .infer-box h4 { color: #9cc3ea; } }
.verdict { padding: 10px 12px; border-radius: 8px; font-weight: 550; font-size: .92rem; }
.verdict.sig { background: var(--ok-50); color: var(--ok); }
.verdict.ns { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); }
.tie { color: var(--warn); font-weight: 650; }
.xt td.hi { background: rgba(30,138,90,.13); } .xt td.lo { background: rgba(192,57,43,.11); }
.cand-row { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.cand-row img, .cand-row .ph { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-weight: 700; color: var(--muted); }

/* ---------- impressão ---------- */
@media print {
  .no-print, .sidebar, .topbar, .toasts { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  .content { padding: 0; max-width: none; }
  .app { display: block; }
  a { color: #000; }
}
