/* ESI · Mercado B3 — plugin independente */
@font-face { font-family: "EMB Inter"; src: url(fonts/inter-400.woff) format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "EMB Inter"; src: url(fonts/inter-500.woff) format("woff"); font-weight: 500; font-display: swap; }
@font-face { font-family: "EMB Inter"; src: url(fonts/inter-600.woff) format("woff"); font-weight: 600; font-display: swap; }
@font-face { font-family: "EMB Inter"; src: url(fonts/inter-700.woff) format("woff"); font-weight: 700; font-display: swap; }
@font-face { font-family: "EMB Inter"; src: url(fonts/inter-800.woff) format("woff"); font-weight: 800; font-display: swap; }
.emb-root, body.emb-full {
  --emb-font: "EMB Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --esi-navy-900: #0a2540; --esi-navy-800: #0b3b60; --esi-blue: #0e5a8a; --esi-blue-dark: #0b4a73; --esi-cyan: #12a4d9;
  --esi-tint: #e8f6fb; --esi-tint-2: #f3fafd; --esi-border: #bfe6f4; --esi-text: #0f1f2e; --esi-muted: #5b6b7b; --esi-line: #e3eaf0;
}
.emb-root { font-family: var(--emb-font); color: var(--esi-text); line-height: 1.5; -webkit-font-smoothing: antialiased; }
.emb-root *, .emb-root *::before, .emb-root *::after { box-sizing: border-box; }
.emb-root h1, .emb-root h2 { font-family: var(--emb-font); color: var(--esi-navy-900); letter-spacing: -.02em; line-height: 1.15; margin: 0 0 10px; font-weight: 800; }
.emb-root p { margin: 0 0 10px; }
.emb-root button { font-family: var(--emb-font); }
.emb-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--esi-blue); margin-bottom: 10px; }
.emb-dot { width: 8px; height: 8px; border-radius: 50%; background: #16a34a; box-shadow: 0 0 0 3px rgba(22, 163, 74, .18); }
.emb-lead { font-size: 1.08rem; color: var(--esi-muted); }
.emb-ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; flex: none; }
.emb-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--esi-blue); background: var(--esi-blue); color: #fff !important; border-radius: 10px; padding: 11px 18px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none !important; }
.emb-btn:hover { background: var(--esi-blue-dark); }
.emb-btn.ghost { background: #fff; color: var(--esi-blue) !important; }
.emb-head { max-width: 1200px; margin: 0 auto; padding: 40px 24px 24px; }

/* modo tela cheia: cabeçalho e rodapé próprios */
body.emb-full { margin: 0; background: #fff; font-family: var(--emb-font); color: var(--esi-text); }
.emb-topbar { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.5) blur(12px); -webkit-backdrop-filter: saturate(1.5) blur(12px); border-bottom: 1px solid var(--esi-line); font-family: var(--emb-font); }
.admin-bar .emb-topbar { top: 32px; }
.emb-wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.emb-topbar .emb-wrap { height: 60px; }
.emb-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--esi-navy-900); min-width: 0; }
.emb-brand img { width: 36px; height: auto; flex: none; }
.emb-brand span { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.emb-brand b { font-weight: 800; font-size: 1.1rem; color: var(--esi-navy-800); }
.emb-brand small { font-size: .74rem; color: var(--esi-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.emb-home { font-size: .9rem; font-weight: 600; color: var(--esi-blue); text-decoration: none; padding: 8px 12px; border-radius: 8px; white-space: nowrap; }
.emb-home:hover { background: var(--esi-tint); }
.emb-main { background: linear-gradient(180deg, var(--esi-tint-2), #fff 320px); padding-bottom: 40px; }
.emb-foot { border-top: 1px solid var(--esi-line); color: var(--esi-muted); font-size: .82rem; font-family: var(--emb-font); }
.emb-foot .emb-wrap { padding-top: 18px; padding-bottom: 18px; }

/* login (quando exigido) */
.emb-login { max-width: 420px; margin: 48px auto; background: #fff; border: 1px solid var(--esi-line); border-radius: 18px; padding: 28px; box-shadow: 0 20px 50px rgba(10, 37, 64, .08); }
.emb-login p { color: var(--esi-muted); }
.emb-login form p { margin: 0 0 12px; color: inherit; }
.emb-login label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 4px; }
.emb-login input[type=text], .emb-login input[type=password] { width: 100%; padding: 11px 12px; border: 1px solid #cbd5e1; border-radius: 10px; font: inherit; font-size: 16px; }
.emb-login .login-remember label { display: inline-flex; gap: 6px; font-weight: 500; }
.emb-login input[type=submit] { width: 100%; border: 0; background: var(--esi-blue); color: #fff; border-radius: 10px; padding: 12px; font: inherit; font-weight: 700; cursor: pointer; }
.emb-login-links { text-align: center; font-size: .88rem; }
.emb-root { --up: #15803d; --down: #b91c1c; }
.emb-head { display: grid; grid-template-columns: 1.1fr .9fr; gap: 32px; align-items: end; }
.emb-head > * { min-width: 0; }
.emb-head h1 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
.emb-head .emb-lead { margin: 0; }
.emb-search { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid #cdd8e1; border-radius: 14px; padding: 6px 6px 6px 14px; box-shadow: 0 10px 30px rgba(10, 37, 64, .06); }
.emb-search:focus-within { border-color: var(--esi-blue); outline: 2px solid var(--esi-border); }
.emb-search .emb-ic { color: var(--esi-muted); }
.emb-search input { flex: 1; min-width: 0; border: 0; outline: 0; font: inherit; font-size: 16px; padding: 10px 4px; background: transparent; color: var(--esi-text); }
.emb-search .emb-btn { padding: 11px 18px; box-shadow: none; }
.emb-body { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.emb-ibov { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: linear-gradient(135deg, var(--esi-navy-900), var(--esi-navy-800)); color: #fff; border-radius: 14px; padding: 12px 18px; margin-bottom: 16px; }
.emb-ibov .lbl { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: #b8cfe0; font-weight: 700; }
.emb-ibov b { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.emb-ibov small { color: #b8cfe0; margin-left: auto; }
.emb-ibov .emb-chg.up { color: #6ee7b7; } .emb-ibov .emb-chg.down { color: #fda4af; }
.emb-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.emb-tabs, .emb-subs, .emb-ranges { display: flex; gap: 6px; flex-wrap: wrap; }
.emb-tabs button, .emb-subs button, .emb-ranges button { border: 1px solid #d5e0e8; background: #fff; border-radius: 999px; padding: 8px 14px; font: inherit; font-size: .9rem; font-weight: 600; color: #334155; cursor: pointer; }
.emb-tabs button.on, .emb-ranges button.on { background: var(--esi-navy-800); border-color: var(--esi-navy-800); color: #fff; }
.emb-subs button { padding: 6px 12px; font-size: .84rem; }
.emb-subs button.on { background: var(--esi-tint); border-color: var(--esi-border); color: var(--esi-navy-800); }
.emb-info { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; color: var(--esi-muted); font-size: .88rem; min-height: 1.4em; margin-bottom: 8px; }
.emb-upd { margin-left: auto; }
.emb-link { border: 0; background: none; color: var(--esi-blue); font: inherit; cursor: pointer; text-decoration: underline; padding: 0; }
.emb-list { background: #fff; border: 1px solid var(--esi-line); border-radius: 18px; overflow: hidden; }
.emb-row { display: grid; grid-template-columns: 1fr 130px 130px 110px; gap: 10px; align-items: center; width: 100%; padding: 12px 18px; border: 0; border-bottom: 1px solid #eef3f7; background: #fff; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.emb-row:last-child { border-bottom: 0; }
.emb-row:hover { background: var(--esi-tint-2); }
.emb-row.head { cursor: default; background: #f7fafc; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--esi-muted); font-weight: 700; padding-top: 10px; padding-bottom: 10px; }
.emb-row.head span:not(:first-child) { text-align: right; }
.emb-row .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.emb-asset { display: flex; align-items: center; gap: 12px; min-width: 0; }
.emb-asset > span:last-child { min-width: 0; }
.emb-asset b { display: block; color: var(--esi-navy-900); }
.emb-asset small { display: block; color: var(--esi-muted); font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.emb-logo { position: relative; display: inline-grid; place-items: center; border-radius: 10px; background: var(--esi-tint); overflow: hidden; flex: none; }
.emb-logo b { font-size: .62rem; color: var(--esi-navy-800); letter-spacing: .02em; }
.emb-logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.emb-chg { font-style: normal; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.emb-chg.up { color: var(--up); } .emb-chg.down { color: var(--down); } .emb-chg.flat { color: var(--esi-muted); }
.emb-more { text-align: center; margin: 16px 0 6px; }
.emb-loading { color: var(--esi-muted); text-align: center; padding: 30px 10px; margin: 0; }
.emb-loading.err { color: var(--down); }
.emb-empty { text-align: center; padding: 36px 18px; color: var(--esi-muted); }
.emb-empty b { display: block; color: var(--esi-navy-900); margin-bottom: 4px; font-size: 1.05rem; }
.emb-empty.err b { color: var(--down); }
.emb-disc { max-width: 1200px; margin: 14px auto 0; padding: 0 24px; color: var(--esi-muted); font-size: .8rem; }

/* Painel do ativo */
body.emb-open { overflow: hidden; }
.emb-panel { position: fixed; inset: 0; z-index: 9999; background: rgba(10, 37, 64, .5); display: flex; align-items: center; justify-content: center; padding: 16px; }
.emb-sheet { position: relative; background: #fff; border-radius: 22px; width: 100%; max-width: 820px; max-height: 94vh; overflow: auto; padding: 24px; box-shadow: 0 30px 80px rgba(0, 0, 0, .25); }
.emb-x { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: #f1f5f9; font-size: 1.4rem; cursor: pointer; line-height: 1; }
.emb-top { display: flex; align-items: center; gap: 14px; padding-right: 40px; }
.emb-top h2 { margin: 0; font-size: 1.5rem; }
.emb-top p { margin: 0; color: var(--esi-muted); }
.emb-top small { color: var(--esi-muted); }
.emb-price { margin: 16px 0 12px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.emb-price b { font-size: 2.2rem; letter-spacing: -.02em; color: var(--esi-navy-900); font-variant-numeric: tabular-nums; }
.emb-price small { flex-basis: 100%; color: var(--esi-muted); font-size: .82rem; }
.emb-ranges { align-items: center; margin-bottom: 8px; }
.emb-ranges button { padding: 6px 12px; font-size: .85rem; }
.emb-perf { margin-left: auto; font-size: .88rem; color: var(--esi-muted); }
.emb-chart { position: relative; min-height: 210px; }
.emb-chart svg { display: block; touch-action: pan-y; }
.emb-chart .grid { stroke: #e8eef3; stroke-width: 1; }
.emb-chart .tick { fill: #6b7c8c; font-size: 11px; font-family: var(--emb-font); }
.emb-chart .xh { stroke: #94a3b8; stroke-dasharray: 3 3; }
.emb-tip { position: absolute; top: 6px; background: #fff; border: 1px solid var(--esi-line); border-radius: 10px; padding: 8px 12px; box-shadow: 0 10px 24px rgba(10, 37, 64, .12); pointer-events: none; font-size: .85rem; white-space: nowrap; }
.emb-tip small, .emb-tip b, .emb-tip em { display: block; }
.emb-tip small { color: var(--esi-muted); }
.emb-tip b { font-size: 1.05rem; color: var(--esi-navy-900); }
.emb-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.emb-stats div { background: #f7fafc; border: 1px solid #eef3f7; border-radius: 12px; padding: 10px 12px; }
.emb-stats small { display: block; color: var(--esi-muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; }
.emb-stats b { font-variant-numeric: tabular-nums; color: var(--esi-navy-900); }
.emb-sheet .emb-disc { padding: 0; margin-top: 14px; }


@media (max-width: 900px) {
  .emb-head { grid-template-columns: 1fr; }
  .emb-stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .emb-body { padding: 0 12px; }
  .emb-head { padding-top: 28px !important; gap: 18px; }
  .emb-search .emb-btn { padding: 10px 12px; }
  .emb-row { grid-template-columns: 1fr auto auto; padding: 12px; gap: 12px; }
  .emb-row .hide-sm { display: none; }
  .emb-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .emb-tabs::-webkit-scrollbar { display: none; }
  .emb-tabs button { white-space: nowrap; }
  .emb-panel { align-items: flex-end; padding: 0; }
  .emb-sheet { border-radius: 22px 22px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); max-height: 92vh; }
  .emb-price b { font-size: 1.8rem; }
  .emb-ibov small { margin-left: 0; flex-basis: 100%; }
}
.emb-panel[hidden], .emb-root [hidden] { display: none !important; }
.emb-soft { margin: 12px 0; background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; border-radius: 12px; padding: 10px 12px; font-size: .88rem; }
/* celular */
.emb-row:focus-visible, .emb-tabs button:focus-visible, .emb-subs button:focus-visible, .emb-ranges button:focus-visible { outline: 2px solid var(--esi-cyan); outline-offset: 2px; }
@media (max-width: 640px) {
  .emb-head { padding: 14px 12px 10px !important; gap: 10px; }
  .emb-head .emb-eyebrow { display: none; }
  .emb-head h1 { font-size: 1.35rem; margin-bottom: 0; letter-spacing: -.02em; }
  .emb-head .emb-lead { display: none; }
  .emb-search { position: sticky; top: 52px; z-index: 20; border-radius: 12px; padding: 4px 4px 4px 12px; box-shadow: 0 6px 18px rgba(10, 37, 64, .08); }
  .emb-search input { padding: 9px 2px; }
  .emb-search .emb-btn { padding: 9px 12px; font-size: .9rem; border-radius: 10px; }
  .emb-ibov { padding: 10px 14px; gap: 6px 10px; border-radius: 12px; margin-bottom: 10px; }
  .emb-ibov b { font-size: 1.05rem; }
  .emb-ibov small { font-size: .74rem; }
  .emb-bar { display: block; margin: 0 -12px 6px; }
  .emb-tabs, .emb-subs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 2px 12px; scroll-padding: 12px; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 24px), transparent); }
  .emb-tabs::-webkit-scrollbar, .emb-subs::-webkit-scrollbar { display: none; }
  .emb-tabs button, .emb-subs button { white-space: nowrap; flex: none; }
  .emb-tabs button { padding: 7px 12px; font-size: .84rem; }
  .emb-subs { margin-top: 8px; }
  .emb-subs button { padding: 5px 11px; font-size: .8rem; }
  .emb-info { font-size: .78rem; margin-bottom: 6px; }
  .emb-list { border-radius: 14px; }
  .emb-row { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 11px 12px; }
  .emb-row.head { display: none; }
  .emb-row .num:nth-child(2) { display: none; }
  .emb-row .num:nth-child(3) { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
  .emb-row .num:nth-child(3)::before { content: attr(data-price); font-weight: 700; color: var(--esi-navy-900); font-size: .95rem; }
  .emb-row .num:nth-child(3) .emb-chg { font-size: .8rem; }
  .emb-asset { gap: 10px; }
  .emb-asset .emb-logo { width: 34px !important; height: 34px !important; border-radius: 9px; }
  .emb-asset b { font-size: .95rem; }
  .emb-asset small { font-size: .76rem; }
  .emb-more { margin: 12px 0 0; }
  .emb-more .emb-btn { width: 100%; }
  .emb-disc { padding: 0 12px; font-size: .74rem; }
  /* painel do ativo em tela cheia */
  .emb-sheet { height: 100%; max-height: 100%; border-radius: 0; padding: 0 14px calc(18px + env(safe-area-inset-bottom)); }
  .emb-panel { align-items: stretch; }
  .emb-x { position: sticky; top: 10px; float: right; margin-top: 10px; z-index: 3; box-shadow: 0 2px 8px rgba(10, 37, 64, .12); background: #fff; }
  .emb-top { padding-top: 14px; }
  .emb-top h2 { font-size: 1.25rem; }
  .emb-top p { font-size: .85rem; line-height: 1.3; }
  .emb-price { margin: 12px 0 10px; }
  .emb-price b { font-size: 1.7rem; }
  .emb-price em { font-size: .88rem; }
  .emb-ranges { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
  .emb-ranges button { padding: 7px 0; text-align: center; }
  .emb-perf { grid-column: 1 / -1; margin: 4px 0 0; font-size: .82rem; }
  .emb-stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .emb-stats div { padding: 9px 10px; }
  .emb-stats b { font-size: .88rem; }
  .emb-stats small { font-size: .66rem; }
}
.emb-asset .emb-logo b, .emb-top .emb-logo b { font-size: .58rem !important; display: inline !important; color: var(--esi-navy-800); }

/* limite de histórico do plano */
.emb-ranges button[disabled]{opacity:.4;cursor:not-allowed}
.emb-note{margin:.4rem 0 0;font-size:.82rem;color:#475569;text-align:center}

/* fora do modo tela cheia (dentro do tema), o bloco ocupa a largura do conteúdo */
body:not(.emb-full) .emb-head, body:not(.emb-full) .emb-body, body:not(.emb-full) .emb-disc { padding-left: 0; padding-right: 0; }
body:not(.emb-full) .emb-search { top: 0 !important; }
@media (max-width: 640px) {
  .emb-wrap { padding: 0 12px; }
  .emb-topbar .emb-wrap { height: 52px; }
  .emb-brand small { display: none; }
  .emb-brand img { width: 30px; }
  .emb-home { padding: 6px 8px; font-size: .84rem; }
  .admin-bar .emb-topbar { top: 46px; }
}
.emb-root > .emb-disc { margin: 14px auto 0; }
.emb-sheet .emb-disc { margin: 14px 0 0; padding: 0; }
.emb-root a { color: var(--esi-blue); }
@media (max-width: 480px) { .emb-login { margin: 24px 12px; padding: 22px; } }
