/* Painel do emuapi — identidade visual: serif nos títulos, laranja #d97757, cartões. Sem CDN, sem fontes externas. */

:root {
  color-scheme: light;
  --bg: #f4f3ee;
  --card: #ffffff;
  --card-2: #faf9f5;
  --fg: #1f1e1d;
  --fg-2: #4a4945;
  --muted: #6f6e68;
  --line: #e4e2d9;
  --line-2: #d6d3c8;
  --accent: #d97757;
  --accent-rgb: 217, 119, 87;
  --accent-2: #b9562f;
  --accent-soft: #fbeee7;
  --on-accent: #ffffff;
  --ok: #3f7a52;
  --ok-soft: #e7f1e9;
  --warn: #8a5f0a;
  --warn-soft: #f8efd6;
  --bad: #b5352c;
  --bad-soft: #f9e6e3;
  --info: #3a6190;
  --info-soft: #e6eef8;
  --code-bg: #f1efe7;
  --focus: #b9562f;
  --shadow: 0 1px 2px rgba(31, 30, 29, 0.04), 0 6px 20px -12px rgba(31, 30, 29, 0.12);
  --backdrop: rgba(31, 30, 29, 0.42);
  --serif: "Tiempos Headline", "Iowan Old Style", "Charter", "Palatino", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue", system-ui, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, "JetBrains Mono", monospace;
  --radius: 14px;
  --gutter: 28px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #1f1e1d;
    --card: #272624;
    --card-2: #2d2c29;
    --fg: #f0eee6;
    --fg-2: #cfcdc4;
    --muted: #a3a29a;
    --line: #3a3936;
    --line-2: #4a4945;
    --accent: #d97757;
    --accent-rgb: 217, 119, 87;
    --accent-2: #eb9272;
    --accent-soft: #3b2b24;
    --on-accent: #1f1e1d;
    --ok: #8fc79f;
    --ok-soft: #26352a;
    --warn: #e2b95c;
    --warn-soft: #3a3120;
    --bad: #ef8a80;
    --bad-soft: #3f2623;
    --info: #93b6e0;
    --info-soft: #232f3d;
    --code-bg: #1a1918;
    --focus: #eb9272;
    --shadow: none;
    --backdrop: rgba(0, 0, 0, 0.6);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1f1e1d;
  --card: #272624;
  --card-2: #2d2c29;
  --fg: #f0eee6;
  --fg-2: #cfcdc4;
  --muted: #a3a29a;
  --line: #3a3936;
  --line-2: #4a4945;
  --accent: #d97757;
  --accent-2: #eb9272;
  --accent-soft: #3b2b24;
  --on-accent: #1f1e1d;
  --ok: #8fc79f;
  --ok-soft: #26352a;
  --warn: #e2b95c;
  --warn-soft: #3a3120;
  --bad: #ef8a80;
  --bad-soft: #3f2623;
  --info: #93b6e0;
  --info-soft: #232f3d;
  --code-bg: #1a1918;
  --focus: #eb9272;
  --shadow: none;
  --backdrop: rgba(0, 0, 0, 0.6);
}

/* ─────────────── Base ─────────────── */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 14px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
[hidden] { display: none !important; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.005em; }
code, .code, kbd {
  font-family: var(--mono);
  font-size: 12.5px;
  background: var(--code-bg);
  padding: 1px 6px;
  border-radius: 6px;
  color: var(--fg);
  overflow-wrap: anywhere;
}
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.page-title:focus, .page-title:focus-visible { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.boot { color: var(--muted); text-align: center; margin: 80px 16px; font-size: 15px; }
.icon { width: 14px; height: 14px; flex: none; }
.skip {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--accent); color: var(--on-accent); padding: 8px 12px; border-radius: 8px;
}
.skip:focus { top: 12px; }

/* ─────────────── Topo ─────────────── */

.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.top-in {
  max-width: 1320px; margin: 0 auto; padding: 12px var(--gutter) 6px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--fg); min-width: 0; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 26px; height: 26px; flex: none; }
.brand-name { font: 500 22px/1 var(--serif); letter-spacing: -0.01em; }
.brand-sub { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 28ch; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.flags { display: inline-flex; gap: 6px; }
.flags:empty { display: none; }
.conn { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.conn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
.conn.ok .dot { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.conn.bad .dot { background: var(--bad); }
.conn.accent .dot { background: var(--accent); }

.tabs { max-width: 1320px; margin: 0 auto; padding: 0 var(--gutter); }
.tabs-in {
  display: flex; gap: 2px; overflow-x: auto; scrollbar-width: thin;
  padding: 4px 2px 8px; margin: 0 -2px;
  -webkit-overflow-scrolling: touch;
}
.tab {
  flex: none; border-radius: 8px; padding: 7px 11px; color: var(--muted);
  font: 500 13px/1 var(--sans); white-space: nowrap;
}
.tab:hover { color: var(--fg); background: var(--card-2); text-decoration: none; }
.tab[aria-current="page"] { color: var(--accent-2); background: var(--accent-soft); }
.shell-banner { max-width: 1320px; margin: 0 auto; padding: 0 var(--gutter) 10px; }

/* ─────────────── Conteúdo ─────────────── */

.main { max-width: 1320px; margin: 0 auto; padding: 18px var(--gutter) 64px; }
.page-head { display: flex; align-items: baseline; gap: 12px; margin: 4px 0 14px; }
.page-title { margin: 0; font-size: 28px; line-height: 1.2; }
.page { display: block; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.spacer { flex: 1 1 auto; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(460px, 100%), 1fr)); gap: 18px; align-items: start; }
.grid-2 > * { min-width: 0; }
.offline { max-width: 560px; margin: 60px auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.offline h1 { margin: 0; font-size: 28px; }

/* Cartões */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 22px; margin-bottom: 18px; box-shadow: var(--shadow); min-width: 0;
}
.stack > .card, .grid-2 > .card, .grid-2 > .stack > .card { margin-bottom: 0; }
.card-h { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.card-title { min-width: 0; flex: 1 1 260px; }
.card-h h2 { margin: 0; font-size: 19px; line-height: 1.3; }
.card-h h3 { margin: 0; font-size: 16px; line-height: 1.3; }
.card-sub { color: var(--muted); margin: 3px 0 0; max-width: 80ch; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.subcard { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: var(--card-2); min-width: 0; }
.subcard + .subcard { margin-top: 12px; }
h3.section { font-size: 15px; margin: 18px 0 8px; }
h3.section:first-child { margin-top: 0; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 10px; }
.kpi { background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.kpi-l { color: var(--muted); font-size: 12px; letter-spacing: 0.02em; }
.kpi-v { font: 500 26px/1.15 var(--serif); margin-top: 3px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi-s { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* Tabelas */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; border-radius: 4px; }
.table-wrap:focus-visible { outline-offset: 0; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
tbody tr:last-child td { border-bottom: 0; }
td .name { font-weight: 600; overflow-wrap: anywhere; }
td .sub, .sub { color: var(--muted); font-size: 12.5px; }
table.accounts { min-width: 980px; }
table.dense td, table.dense th { padding: 6px 8px; }
.empty { color: var(--muted); padding: 14px 0; }

/* Etiquetas */
.tag {
  display: inline-flex; align-items: center; gap: 6px; vertical-align: middle;
  padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap;
  background: var(--code-bg); color: var(--fg-2); border: 1px solid transparent; line-height: 1.6;
}
.tag.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.9; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.accent { background: var(--accent-soft); color: var(--accent-2); }
.tag.info { background: var(--info-soft); color: var(--info); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }

/* Botões */
.btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: 500 13px/1 var(--sans); cursor: pointer; min-height: 34px;
  border-radius: 8px; padding: 8px 12px; border: 1px solid var(--line-2);
  background: var(--card); color: var(--fg); white-space: nowrap;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.btn:hover { background: var(--card-2); border-color: var(--muted); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn[aria-busy="true"] { cursor: progress; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.btn.danger-solid { background: var(--bad); border-color: var(--bad); color: var(--card); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--card-2); }
.btn.sm { padding: 5px 9px; font-size: 12px; min-height: 28px; }
.btn.icon-btn { padding: 0; width: 30px; min-height: 30px; }
.btn.icon-btn.sm { width: 28px; min-height: 28px; }
.btns { display: flex; gap: 6px; flex-wrap: wrap; }

/* Copiar */
.copy {
  appearance: none; display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-width: 0;
  font-family: var(--mono); font-size: 12.5px; background: var(--code-bg);
  border: 1px solid transparent; border-radius: 7px; padding: 3px 4px 3px 8px; color: var(--fg);
  cursor: pointer; line-height: 1.5; text-align: left;
}
.copy:hover { border-color: var(--line-2); }
.copy-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.copy-i { flex: none; width: 22px; height: 22px; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.copy:hover .copy-i { background: var(--card); color: var(--fg); }
.copy.done .copy-i { color: var(--ok); }

/* Chave/linhas de valor */
.lines { display: grid; grid-template-columns: minmax(120px, max-content) minmax(0, 1fr); gap: 8px 14px; align-items: center; }
.lines > .l { color: var(--muted); font-size: 13px; }
.lines > .v { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.kv { display: grid; grid-template-columns: minmax(110px, max-content) minmax(0, 1fr); gap: 4px 14px; margin: 0; }
.kv dt { color: var(--muted); font-size: 12.5px; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* Avisos */
.callout {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px; border-radius: 10px; margin: 8px 0;
  background: var(--info-soft); color: var(--fg); border: 1px solid color-mix(in srgb, var(--info) 25%, transparent);
}
.callout > .icon { margin-top: 3px; color: var(--info); }
.callout-body { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.callout-body > strong { display: block; margin-bottom: 2px; }
.callout-body .btn { margin-top: 4px; }
.callout.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.callout.ok > .icon { color: var(--ok); }
.callout.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.callout.warn > .icon { color: var(--warn); }
.callout.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.callout.bad > .icon { color: var(--bad); }
.banners:empty { display: none; }
.banners { margin-bottom: 14px; }
.issues { margin: 6px 0 0; padding-left: 18px; }
.issues li { margin: 2px 0; }
.issues li.bad { color: var(--bad); }
.issues li.warn { color: var(--warn); }

/* Formulários */
.form { display: flex; flex-direction: column; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 12px 16px; align-items: start; }
.form-grid > .wide { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field-label { font-size: 12.5px; font-weight: 600; color: var(--fg-2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.field-hint { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.field-error { font-size: 12px; color: var(--bad); }
.field.has-error .input { border-color: var(--bad); }
.field .warn-line { font-size: 12px; color: var(--warn); }
.input {
  appearance: none; width: 100%; min-width: 0; min-height: 38px;
  border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--card); color: var(--fg); padding: 8px 12px; font: 13.5px/1.35 var(--sans);
  transition: border-color .12s ease, box-shadow .12s ease, background .12s ease;
}
.input:hover:not(:disabled) { border-color: color-mix(in srgb, var(--accent) 45%, var(--line-2)); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.input::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
select.input {
  padding-right: 28px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
textarea.input { font-family: var(--mono); font-size: 12.5px; resize: vertical; min-height: 64px; }
.input:disabled { opacity: 0.6; }
.input.mono { font-family: var(--mono); font-size: 12.5px; }
input[type="checkbox"] { accent-color: var(--accent); }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; position: relative; min-height: 32px; -webkit-tap-highlight-color: transparent; }
.switch-input { position: absolute; opacity: 0; width: 42px; height: 24px; margin: 0; cursor: pointer; }
.switch-track { width: 42px; height: 24px; border-radius: 999px; background: var(--line-2); position: relative; flex: none; transition: background .18s ease, box-shadow .18s ease; box-shadow: inset 0 1px 2px rgba(0,0,0,.08); }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s cubic-bezier(.2,.8,.2,1), width .15s ease; }
.switch:active .switch-track::after { width: 22px; }
.switch-input:checked + .switch-track { background: var(--accent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-2) 40%, transparent); }
.switch-input:checked + .switch-track::after { transform: translateX(18px); }
.switch:active .switch-input:checked + .switch-track::after { transform: translateX(14px); }
.switch-input:focus-visible + .switch-track { outline: 2px solid var(--focus); outline-offset: 2px; }
.switch-input:disabled + .switch-track { opacity: 0.5; }
.switch.inherited .switch-track { opacity: 0.55; }
.switch-label { font-size: 13px; }

fieldset.group { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 14px; margin: 12px 0 0; min-width: 0; }
fieldset.group > legend { padding: 0 6px; font: 500 14px/1.2 var(--serif); color: var(--fg-2); }

/* Barras de cota */
.bar { height: 7px; background: var(--line); border-radius: 999px; overflow: hidden; min-width: 60px; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: var(--ok); }
.bar.warn > i { background: var(--warn); }
.bar.bad > i { background: var(--bad); }
.quota-row { display: grid; grid-template-columns: 62px minmax(60px, 1fr) auto; gap: 6px; align-items: center; font-size: 12px; }
.quota-row + .quota-row { margin-top: 5px; }
.quota-row .muted { white-space: nowrap; }

/* Feed ao vivo */
.feed { list-style: none; margin: 0; padding: 0; }
.feed > li { border-bottom: 1px solid var(--line); padding: 8px 0; display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; gap: 4px 10px; align-items: start; }
.feed > li:last-child { border-bottom: 0; }
.feed .when { color: var(--muted); font-size: 12px; padding-top: 2px; }
.feed .what { min-width: 0; overflow-wrap: anywhere; }
.feed .dur { font-size: 12.5px; text-align: right; white-space: nowrap; }
.feed .att { display: inline-flex; gap: 3px; flex-wrap: wrap; margin-top: 3px; }
.att-dot { font: 600 10.5px/1 var(--mono); border-radius: 5px; padding: 3px 5px; background: var(--code-bg); color: var(--fg-2); }
.att-dot.ok { background: var(--ok-soft); color: var(--ok); }
.att-dot.error { background: var(--bad-soft); color: var(--bad); }
.att-dot.skipped, .att-dot.aborted, .att-dot.hedge-lost { color: var(--muted); }
.att-dot.running { background: var(--accent-soft); color: var(--accent-2); }
.att-dot.partial, .att-dot.overloaded { background: var(--warn-soft); color: var(--warn); }

/* Árvore de tentativas */
.tree { list-style: none; margin: 4px 0 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); }
.test-tree > .tree, .plan-tree > .tree { padding-left: 0; border-left: 0; }
.attempt { padding: 6px 0; }
.attempt-h { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.attempt-n { color: var(--muted); font-size: 12px; }
.attempt-meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.attempt-err { font-size: 12.5px; margin-top: 3px; overflow-wrap: anywhere; }
.error-hint p { margin: 4px 0; font-size: 13px; }
.error-hint strong { color: var(--fg-2); }
.stage-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.stage-card { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--bg-2); }
.stage-body { margin-top: 4px; display: flex; flex-direction: column; gap: 6px; }
.candidate { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 13px; }
.candidate summary { cursor: pointer; display: flex; align-items: center; gap: 6px; }
.candidate-answer pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; margin: 4px 0; }
.tree-group { padding: 6px 0; }
.tree-label { display: flex; align-items: center; gap: 4px; }
.test-result { margin-top: 8px; max-width: 720px; }
.test-text { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }

/* Legenda da página (gaveta lateral) */
.legend-btn[aria-expanded="true"] { color: var(--accent-2); background: var(--accent-soft); border-color: transparent; }
:root { --drawer-w: min(480px, 42vw); }
/* Painel não modal: a página encolhe pra caber ao lado e continua interativa. */
body.drawer-open .main, body.drawer-open .top-in, body.drawer-open .tabs, body.drawer-open .shell-banner { max-width: calc(1320px + var(--drawer-w)); padding-right: calc(var(--gutter) + var(--drawer-w)); }
body.drawer-open .toasts { right: calc(var(--drawer-w) + 16px); }
.drawer-root { position: fixed; top: 0; right: 0; bottom: 0; z-index: 30; width: var(--drawer-w); pointer-events: none; }
.drawer {
  pointer-events: auto;
  width: 100%; height: 100%; max-height: 100dvh;
  background: var(--card); color: var(--fg); border-left: 1px solid var(--line);
  box-shadow: -12px 0 40px -30px rgba(0, 0, 0, 0.35);
  display: flex; flex-direction: column; min-height: 0; outline: none;
  animation: drawer-in 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-h {
  display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line); flex: none;
  background: color-mix(in srgb, var(--card) 92%, var(--accent-soft));
}
.drawer-title { flex: 1; min-width: 0; }
.drawer-kicker { margin: 0; font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-2); font-weight: 600; }
.drawer-h h2 { margin: 2px 0 0; font-size: 22px; line-height: 1.25; overflow-wrap: anywhere; }
.drawer-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 20px 32px; scroll-padding-top: 12px; }
.drawer-intro { margin: 0 0 12px; font-size: 13.5px; }
.drawer-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.drawer-nav a {
  font-size: 12px; padding: 4px 10px; border-radius: 999px; color: var(--fg-2);
  background: var(--card-2); border: 1px solid var(--line); white-space: nowrap;
}
.drawer-nav a:hover { text-decoration: none; color: var(--accent-2); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.legend-group { scroll-margin-top: 8px; }
.legend-group h3 {
  font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em;
  margin: 22px 0 8px; font-family: var(--sans); font-weight: 600;
  position: sticky; top: -14px; background: var(--card); padding: 14px 0 6px; z-index: 1;
}
.legend-item { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card-2); }
.legend-item + .legend-item { margin-top: 8px; }
.legend-item-h { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.legend-term { font-weight: 600; font-size: 14.5px; }
.legend-alias { font-size: 11.5px; color: var(--muted); }
.legend-body { margin: 4px 0 0; color: var(--fg-2); font-size: 13.5px; }
.legend-ex {
  margin: 8px 0 0; padding: 8px 10px 8px 12px; font-size: 13px; color: var(--fg-2);
  border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0;
  background: color-mix(in srgb, var(--accent-soft) 60%, var(--card));
}
.legend-ex-l { display: block; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-2); font-weight: 600; margin-bottom: 2px; }
@media (max-width: 760px) {
  /* Sem espaço pra dividir: a gaveta cobre a página, mas sem bloquear nada. */
  :root { --drawer-w: 100%; }
  body.drawer-open .main, body.drawer-open .top-in, body.drawer-open .tabs, body.drawer-open .shell-banner { max-width: 1320px; padding-right: var(--gutter); }
  body.drawer-open .toasts { right: 8px; }
  .drawer { border-left: 0; box-shadow: none; }
  .drawer-h { padding: 14px 16px 12px; }
  .drawer-body { padding: 12px 16px 28px; }
}

/* Detalhes e JSON */
details.more { margin-top: 8px; }
details.more > summary { cursor: pointer; color: var(--muted); font-size: 12.5px; width: fit-content; }
pre.json, pre.log {
  margin: 8px 0 0; padding: 10px 12px; background: var(--code-bg); border-radius: 8px;
  font: 11.5px/1.5 var(--mono); overflow: auto; max-height: 320px; color: var(--fg-2); white-space: pre;
}

/* Carregando */
.loading { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 18px 0; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; z-index: 60; background: var(--backdrop); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal.wide { width: min(820px, 100%); }
.modal { background: var(--card); color: var(--fg); border-radius: var(--radius); border: 1px solid var(--line); padding: 20px 22px; width: min(460px, 100%); max-height: 100%; overflow-y: auto; box-shadow: 0 20px 60px -20px rgba(0,0,0,.45); }
.modal h2 { margin: 0 0 8px; font-size: 20px; position: sticky; top: -20px; background: var(--card); padding-top: 20px; z-index: 1; }
.modal .modal-actions { position: sticky; bottom: -20px; background: var(--card); padding-bottom: 20px; margin-top: 12px; }
.modal-msg { margin: 0 0 16px; color: var(--fg-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

/* Toasts */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 70; display: flex; flex-direction: column; gap: 8px; width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; gap: 8px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--info); border-radius: 10px; padding: 8px 8px 8px 12px; box-shadow: 0 10px 30px -12px rgba(0,0,0,.35); }
.toast > .icon { margin-top: 3px; color: var(--info); }
.toast.ok { border-left-color: var(--ok); }
.toast.ok > .icon { color: var(--ok); }
.toast.warn { border-left-color: var(--warn); }
.toast.warn > .icon { color: var(--warn); }
.toast.bad { border-left-color: var(--bad); }
.toast.bad > .icon { color: var(--bad); }
.toast-msg { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 13px; padding-top: 2px; }

/* Rotas e editores */
.list-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--card-2); min-width: 0; }
.list-item + .list-item { margin-top: 10px; }
.list-item.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.list-item.disabled { opacity: 0.72; }
.list-item-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.list-item-h .name { font-weight: 600; font-size: 14.5px; overflow-wrap: anywhere; }
.list-item-meta { color: var(--muted); font-size: 12.5px; margin-top: 4px; overflow-wrap: anywhere; }
.target-row { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--card); }
.target-row + .target-row { margin-top: 8px; }
.target-row-h { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.target-row-h .idx { font: 600 12px/1 var(--mono); color: var(--muted); }
.target-grid { display: grid; grid-template-columns: minmax(0, 3fr) repeat(3, minmax(90px, 1fr)); gap: 8px 10px; align-items: start; }
.target-grid > .span-all { grid-column: 1 / -1; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 3px; background: var(--card-2); border: 1px solid var(--line); border-radius: 11px; max-width: 100%; }
.seg button {
  appearance: none; border: 0; border-radius: 8px; background: transparent; color: var(--muted);
  font: 500 13px/1 var(--sans); padding: 8px 13px; cursor: pointer; min-height: 32px; flex: 1 1 auto; white-space: nowrap;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease, transform .1s ease;
}
.seg button:hover { color: var(--fg); }
.seg button:active { transform: scale(.97); }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--accent-2); box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 0 0 1px var(--line); font-weight: 600; }
.seg button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.seg button:disabled { opacity: .5; cursor: default; }
.card-actions .seg { flex: none; }
.choice { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.choice-hint { font-size: 12.5px; color: var(--muted); animation: fade-in .15s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(-2px); } to { opacity: 1; transform: none; } }
.chip-pick[role="radio"] .chip-text { font-weight: 500; }
/* Lista de interruptores (substitui caixas de seleção) */
.switch-list { display: grid; grid-template-columns: 1fr; gap: 6px; }
.switch-list.two-col { grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); max-height: 320px; overflow-y: auto; padding-right: 4px; overscroll-behavior: contain; }
.switch-row { border: 1px solid var(--line); border-radius: 10px; background: var(--card); padding: 6px 10px; transition: border-color .15s ease, background .15s ease; min-width: 0; }
.switch-row.on { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent-soft) 55%, var(--card)); }
.switch-row .switch { width: 100%; align-items: flex-start; padding-top: 2px; }
.switch-row .switch-track { margin-top: 1px; }
.switch-row-l { display: flex; flex-direction: column; min-width: 0; }
.switch-row-t { font-size: 13.5px; overflow-wrap: anywhere; }
.switch-row-n { font-size: 11.5px; color: var(--muted); overflow-wrap: anywhere; }
.filter-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.filter-row .input { width: auto; flex: 1 1 200px; }
.dirty { color: var(--warn); font-size: 12.5px; }
.editor-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.candidates td code { font-size: 12px; }
.plan-summary { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.rule-summary { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.rule-summary .tag { white-space: normal; overflow-wrap: anywhere; }

/* Provedores */
.opt-field.explicit .field-label::after { content: "definido"; font-size: 10.5px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--accent-2); background: var(--accent-soft); border-radius: 999px; padding: 0 6px; }
.opt-field .opt-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.opt-field .opt-foot code { font-size: 11.5px; }
.catalog-list { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.catalog-list table { min-width: 560px; }
.catalog-list td:first-child, .catalog-list th:first-child { padding-left: 10px; }
.catalog-list thead th { position: sticky; top: 0; background: var(--card); z-index: 1; }
.account-form + .account-form { margin-top: 12px; }

/* ─────────────── Escolha de IA (ai-picker) ─────────────── */
.ai-picker { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--card); display: flex; flex-direction: column; gap: 10px; }
.ai-picker.has-error { border-color: var(--bad); }
.ai-picker-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ai-picker-h strong { font-size: 14px; }
.ai-picker > .field { margin: 0; }
.ai-model-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 1fr); gap: 10px; align-items: start; }
.ai-model-row > .field { margin: 0; min-width: 0; }
.ai-cost-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 14px 18px; align-items: start; }
.ai-cost-row > .field { margin: 0; }
.ai-summary { margin: 0; font-size: 12.5px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 8px; overflow-wrap: anywhere; }

.chip-group { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-pick { appearance: none; display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 5px 11px 5px 6px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--card-2); color: var(--fg-2); font: 500 13px/1.2 var(--sans); cursor: pointer; transition: background .12s ease, border-color .12s ease, color .12s ease; }
.chip-pick:hover { border-color: var(--accent); }
.chip-pick:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.chip-pick.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-2); }
.chip-pick.t-off { opacity: .6; }
.chip-mark { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--line); color: var(--fg-2); font: 600 11px/1 var(--mono); flex: 0 0 auto; }
.chip-pick.on .chip-mark { background: var(--accent); color: var(--on-accent); }
.chip-text { overflow-wrap: anywhere; }
.chip-note { font-size: 11px; color: var(--muted); }
.chip-pick.on .chip-note { color: var(--accent-2); }
.chip-ord { display: inline-flex; align-items: center; justify-content: center; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font: 600 10.5px/1 var(--mono); }

.opt-form { display: flex; flex-direction: column; gap: 18px; padding-top: 10px; }
.opt-group { display: flex; flex-direction: column; gap: 14px; }
.option-group { display: flex; flex-direction: column; gap: 14px; }
/* A régua ocupa mais altura que um campo comum: um respiro a mais evita o texto colado no trilho. */
.field > .sl { margin-top: 2px; }
.field > .sl + .field-hint { margin-top: 2px; }
.opt-group > h5 { margin: 0 0 6px; font: 600 11.5px/1 var(--sans); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.adv-count { font-size: 12px; color: var(--muted); }
.adv-count.on { color: var(--accent-2); font-weight: 600; }

@media (max-width: 560px) {
  .ai-model-row { grid-template-columns: minmax(0, 1fr); }
}

/* ─────────────── Arrastar (níveis e quantidades) e escolha de dois lados ─────────────── */
.sl { display: flex; flex-direction: column; gap: 5px; --sl-pos: 0; --sl-thumb: 24px; }
.sl-h { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-height: 19px; }
.sl.in-field .sl-h { display: none; }
.lbl-row { display: inline-flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.lbl-row .sl-value { font-weight: 600; }
.sl-name { font-size: 13px; color: var(--muted); }
.sl-value { font-size: 14.5px; color: var(--accent-2); font-weight: 600; letter-spacing: -0.01em; }
.sl-ends { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; color: var(--muted); padding: 0 2px; }
.sl-body { position: relative; height: 34px; touch-action: none; }

.sl-track { position: absolute; inset: 9px 0; border-radius: 999px; background: var(--line); overflow: hidden; }
/* Laranja que nasce transparente: o trilho continua visível por baixo, em vez de virar uma faixa branca. */
.sl-fill {
  position: absolute; inset: 0 auto 0 0;
  width: calc(var(--sl-thumb) / 2 + var(--sl-pos) * (100% - var(--sl-thumb)));
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0) 0%, rgba(var(--accent-rgb), 0.35) 38%, rgba(var(--accent-rgb), 0.92) 100%);
  transition: width var(--sl-ease-ms, 0ms) cubic-bezier(.22, 1.15, .36, 1);
}
/* Poeira luminosa: dissolve o fim do preenchimento em pontinhos, mais densos perto do polegar. */
.sl-spark {
  position: absolute; inset: 0;
  background-image: radial-gradient(circle at center, rgba(255, 255, 255, 0.85) 0.8px, transparent 1.1px);
  background-size: 5px 5px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,.25) 45%, #000 100%);
  mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,.25) 45%, #000 100%);
  opacity: .5; transition: opacity .25s ease;
  animation: sl-drift 2.6s linear infinite;
}
.sl:hover .sl-spark, .sl:focus-within .sl-spark, .sl.dragging .sl-spark, .sl.snapping .sl-spark { opacity: 1; }
.sl.at-min .sl-spark { opacity: 0; }
@keyframes sl-drift { from { background-position: 0 0; } to { background-position: 10px 0; } }

.sl-dots { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 10px; }
.sl-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--fg); opacity: .18; }

.sl-thumb {
  position: absolute; top: 50%; width: var(--sl-thumb); height: var(--sl-thumb);
  left: calc(var(--sl-thumb) / 2 + var(--sl-pos) * (100% - var(--sl-thumb)));
  transform: translate(-50%, -50%);
  border-radius: 50%; background: var(--card); border: 1px solid var(--line-2);
  box-shadow: 0 1px 4px rgba(0,0,0,.18), 0 0 0 0 rgba(var(--accent-rgb), .28);
  transition: left var(--sl-ease-ms, 0ms) cubic-bezier(.22, 1.15, .36, 1), box-shadow .18s ease, transform .18s ease;
  pointer-events: none;
}
.sl-body:hover .sl-thumb { transform: translate(-50%, -50%) scale(1.06); }
.sl.dragging .sl-thumb { transform: translate(-50%, -50%) scale(1.12); box-shadow: 0 2px 8px rgba(0,0,0,.22), 0 0 0 7px rgba(var(--accent-rgb), .16); }
.sl.snapping { --sl-ease-ms: 280ms; }
.sl-input:focus-visible ~ .sl-thumb { box-shadow: 0 1px 4px rgba(0,0,0,.18), 0 0 0 3px var(--focus); }

/* O <input> real segue existindo para teclado e leitor de tela; o arrasto é tratado pelo corpo. */
.sl-input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; appearance: none; -webkit-appearance: none; background: transparent; pointer-events: none; }
.sl-body { cursor: grab; }
.sl.dragging .sl-body { cursor: grabbing; }
.sl-input:disabled ~ .sl-thumb { opacity: .5; }
.sl.sl-smooth .sl-dots { display: none; }

.weights-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; }
@media (max-width: 560px) { .weights-grid { grid-template-columns: minmax(0, 1fr); } }
.eo-wrap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.eo-wrap.unset .switch-track { background: var(--line); }
.eo-wrap.unset .switch-track::after { opacity: .7; }
.eo-hint { font-size: 12px; color: var(--muted); font-style: italic; }
.eo-reset { appearance: none; border: 0; background: none; padding: 0; font: 500 12px/1 var(--sans); color: var(--accent-2); cursor: pointer; text-decoration: underline; }
.eo-reset:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.eo { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; position: relative; min-height: 30px; flex-wrap: wrap; }
.eo-side { font-size: 13px; color: var(--muted); transition: color .12s ease; }
.eo-side.on { color: var(--fg); font-weight: 600; }
.eo .switch-input { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ─────────────── Responsivo ─────────────── */

@media (max-width: 900px) {
  :root { --gutter: 18px; }
  .target-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .target-grid > .t-main { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  :root { --gutter: 14px; }
  .top-in { padding-top: 10px; }
  .brand-sub { display: none; }
  .top-right { width: 100%; justify-content: flex-start; margin-left: 0; }
  .card { padding: 14px; }
  .page-title { font-size: 23px; }
  .kpi-v { font-size: 21px; }
  .lines, .kv { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .lines > .l { margin-top: 6px; }
  .feed > li { grid-template-columns: minmax(0, 1fr) auto; }
  .feed .when { grid-column: 1 / -1; padding-top: 0; }
  .editor-actions .btn { flex: 1 1 auto; }
}

@media (max-width: 420px) {
  .brand-name { font-size: 19px; }
  .btn { padding: 7px 10px; }
  .target-grid { grid-template-columns: minmax(0, 1fr); }
  .quota-row { grid-template-columns: 54px minmax(40px, 1fr) auto; }
  .toasts { right: 8px; left: 8px; width: auto; }
}

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

/* ── Termos do dicionário: ícone de conceito + "o que é isto?" que abre no lugar ── */
.term { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.term-ic { flex: none; width: 15px; height: 15px; color: var(--accent-2); }
.field-label.has-term { gap: 7px; }
.field-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.field-head > .field-label { flex: 0 1 auto; min-width: 0; }
.term-help-btn {
  appearance: none; flex: none; width: 20px; height: 20px; border-radius: 50%;
  border: 1px solid var(--line-2); background: var(--card-2); color: var(--muted);
  font: 600 11.5px/1 var(--sans); cursor: pointer; display: inline-grid; place-items: center; position: relative;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
/* área de toque confortável sem inflar o desenho */
.term-help-btn::after { content: ''; position: absolute; inset: -9px; }
.term-help-btn:hover { border-color: var(--accent); color: var(--accent-2); }
.term-help-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.term-help-btn[aria-expanded="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-2); }
.term-help {
  border-left: 2px solid var(--accent); background: var(--accent-soft); border-radius: 0 8px 8px 0;
  padding: 8px 12px; margin: 2px 0 4px; font-size: 12.5px; color: var(--fg-2); animation: fade-in .16s ease;
}
.term-help p { margin: 0; }
.term-help p + p { margin-top: 6px; }
.term-help-ex { color: var(--muted); }
.term-help-ex .legend-ex-l { margin-right: 6px; }
.chip-ic { flex: none; width: 14px; height: 14px; margin-left: 4px; opacity: .85; }
.seg .chip-ic { margin: 0 5px 0 0; vertical-align: -2px; }
.card-title h2 .term-ic, .card-title h3 .term-ic { width: 17px; height: 17px; }
.tag .icon { width: 12px; height: 12px; margin-right: 4px; vertical-align: -1.5px; }
/* linha "esta estratégia não usa isto": o controle continua lá, só recua */
.ai-cost-row .field.idle { opacity: .55; }
.ai-cost-row .field.idle:focus-within, .ai-cost-row .field.idle:hover { opacity: 1; }
.idle-note { font-size: 12px; color: var(--muted); font-style: italic; }
.share-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--line); margin: 6px 0 4px; }
.share-bar > span { min-width: 2px; transition: flex-grow .28s cubic-bezier(.22,1.15,.36,1); }
.share-bar > span:nth-child(4n+1) { background: rgba(var(--accent-rgb), .95); }
.share-bar > span:nth-child(4n+2) { background: rgba(var(--accent-rgb), .6); }
.share-bar > span:nth-child(4n+3) { background: rgba(var(--accent-rgb), .35); }
.share-bar > span:nth-child(4n+4) { background: rgba(var(--accent-rgb), .78); }
.share-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--fg-2); margin: 0; padding: 0; list-style: none; }
.share-legend b { font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .share-bar > span { transition: none; } }

/* ── Linha de sucessão ── */
.succession-list { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.succession-step { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card-2); }
.succession-step.off { opacity: .55; }
.succession-step + .succession-step { position: relative; }
.succession-n { flex: none; width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font: 600 12px/1 var(--sans); background: var(--accent-soft); color: var(--accent-2); }
.succession-t { flex: 1 1 220px; min-width: 0; font-size: 13.5px; overflow-wrap: anywhere; }
.succession-note { display: block; margin: 6px 0 0; }
.succession-note .icon { width: 13px; height: 13px; vertical-align: -2px; color: var(--accent-2); }

/* Guia "Conectar em outra ferramenta": passos numerados com valores copiáveis */
.howto { margin: 14px 0 0; padding-left: 22px; display: grid; gap: 10px; line-height: 1.6; }
.howto > li { padding-left: 4px; }
.howto > li::marker { color: var(--muted); font-weight: 600; }
.howto .copy { vertical-align: middle; margin-top: 2px; }
