/* Macro Pulse — simulador (/simulador). Depende de cedula.css. */

.page { padding-top: 36px; padding-bottom: 24px; }

.sim-header { max-width: 760px; margin-bottom: 26px; }
.sim-header .mp-serial { margin: 0 0 12px; }
.sim-header > p:last-child { margin: 14px 0 0; color: var(--ink-2); font-size: 1.06rem; max-width: 62ch; }

/* Abas: régua de cédulas */
.sim-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--rule);
  overflow-x: auto;
  scrollbar-width: none;
}
.sim-tabs::-webkit-scrollbar { display: none; }
.sim-tab {
  flex: none;
  min-height: 46px;
  padding: 0 16px;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: transparent;
  color: var(--ink-2);
  font-weight: 650;
  font-size: 0.95rem;
  cursor: pointer;
  white-space: nowrap;
}
.sim-tab:hover { color: var(--ink); }
.sim-tab.is-active { color: var(--ink); border-bottom-color: var(--ink); }

.sim-panel { animation: mp-settle 500ms var(--ease) both; }

.panel-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
@media (min-width: 980px) {
  .panel-grid { grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.6fr); }
  .panel-grid.wide { grid-template-columns: minmax(340px, 1fr) minmax(0, 1.2fr); }
}
.right-stack { display: grid; gap: 16px; min-width: 0; }

.card {
  min-width: 0;
  padding: 20px;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
@media (min-width: 700px) { .card { padding: 24px; } }

.card-title { margin: 0 0 14px; font-size: 1.05rem; font-weight: 700; font-variation-settings: "wdth" 94; color: var(--ink); }
.sub-title { margin: 0 0 8px; font-size: 0.82rem; font-weight: 700; color: var(--ink-2); }

/* Formulário */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-group label { font-size: 0.86rem; font-weight: 600; color: var(--ink-2); }
.card input[type="number"], .card input[type="text"], .card select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--ground);
  color: var(--ink);
  font-size: 1rem;
  font-feature-settings: "tnum" 1;
}
.card select {
  appearance: none;
  padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.card input:hover, .card select:hover { border-color: var(--ink-3); }
.card input:focus-visible, .card select:focus-visible { border-color: var(--ink); }
.card input[readonly] { cursor: default; }

.toggle-row { display: flex; align-items: center; gap: 10px; margin: 4px 0 6px; font-size: 0.9rem; color: var(--ink-2); }
.toggle-row input { width: 18px; height: 18px; accent-color: var(--ink); }

.divider { height: 1px; margin: 18px 0; background: var(--rule-2); }

.info-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  border: 1px dashed var(--rule);
  border-radius: var(--radius);
  font-size: 0.84rem;
  color: var(--ink-2);
}

/* Resultados */
.results-stack { display: grid; }
.result-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dotted var(--rule);
}
.result-label { color: var(--ink-2); font-size: 0.92rem; }
.result-value { font-weight: 700; font-feature-settings: "tnum" 1; text-align: right; white-space: nowrap; }
.result-value.big { font-size: 1.3rem; font-weight: 800; font-variation-settings: "wdth" 114; letter-spacing: -0.02em; }

.result-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.result-card-sm { padding: 12px; background: var(--sheet-2); border: 1px solid var(--rule-2); border-radius: var(--radius); min-width: 0; }
.result-card-sm .lbl { margin: 0; font-size: 0.78rem; font-weight: 600; color: var(--ink-2); }
.result-card-sm .val { margin: 4px 0 0; font-size: clamp(1rem, 0.7rem + 1.2vw, 1.2rem); font-weight: 800; font-variation-settings: "wdth" 104; letter-spacing: -0.02em; white-space: nowrap; }
@media (max-width: 380px) { .result-pair { grid-template-columns: minmax(0, 1fr); } }

.pos { color: var(--up); }
.neg { color: var(--down); }
.warn { color: var(--c-commod); }
.liq { color: var(--c-bolsa); }

/* Destaque FIRE: numeral de denominação */
.fire-hero { margin-bottom: 12px; padding: 18px; background: color-mix(in oklab, var(--c-bolsa) 9%, var(--sheet)); border: 1px solid color-mix(in oklab, var(--c-bolsa) 30%, var(--rule)); border-radius: var(--radius); }
.fire-hero .lbl { margin: 0; font-size: 0.82rem; font-weight: 700; color: var(--c-bolsa); }
.fire-hero .val { margin: 6px 0 4px; font-size: clamp(1.8rem, 1.3rem + 1.6vw, 2.6rem); font-weight: 800; font-variation-settings: "wdth" 120; letter-spacing: -0.03em; line-height: 1; overflow-wrap: anywhere; }
.fire-hero .sub { margin: 0; font-size: 0.86rem; color: var(--ink-2); }

/* Gráficos */
.chart-wrap { position: relative; height: 280px; }
.chart-wrap.tall { height: 380px; }
@media (max-width: 600px) { .chart-wrap { height: 240px; } .chart-wrap.tall { height: 280px; } }

/* Tabelas */
.table-scroll { overflow-x: auto; border: 1px solid var(--rule-2); border-radius: var(--radius); max-height: 420px; overflow-y: auto; }
.card table { width: 100%; border-collapse: collapse; font-size: 0.9rem; font-feature-settings: "tnum" 1; }
.card th {
  position: sticky; top: 0;
  padding: 10px 12px;
  background: var(--sheet-2);
  border-bottom: 1px solid var(--rule);
  font-size: 0.78rem; font-weight: 700; color: var(--ink-2);
  text-align: right; white-space: nowrap;
}
.card td { padding: 9px 12px; border-bottom: 1px solid var(--rule-2); text-align: right; white-space: nowrap; }
.card td:first-child, .card th:first-child { text-align: left; }
.card tbody tr:last-child td { border-bottom: 0; }
.card tbody tr:hover td { background: var(--sheet-2); }
.badge-dot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 1px; vertical-align: 1px; }

.fin-compare { border: 1px solid var(--rule-2); }
.fin-compare th.sac { color: var(--c-bolsa); }
.fin-compare th.price { color: var(--c-cambio); }
.fin-compare .span2 { text-align: left !important; white-space: normal !important; color: var(--ink-2); background: var(--sheet-2); }
.fin-compare .span2 span { font-weight: 800; color: var(--up); }

.inner-tabs { display: inline-flex; gap: 2px; padding: 3px; margin-bottom: 12px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--sheet); }
.inner-tab { min-height: 34px; padding: 0 14px; border: 0; border-radius: 1px; background: transparent; color: var(--ink-2); font-weight: 650; cursor: pointer; }
.inner-tab.is-active { background: var(--ink); color: var(--sheet); }

/* Câmbio */
.fx-converter { display: grid; gap: 6px; }
.fx-amount-row { display: grid; grid-template-columns: minmax(0, 1fr) 112px; gap: 8px; }
.fx-rule { flex: 1; height: 1px; background: var(--rule); }
.fx-swap-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--sheet);
  color: var(--ink);
  cursor: pointer;
}
.fx-swap-btn:hover { background: var(--sheet-2); border-color: var(--ink-3); }
.card input.fx-out { background: color-mix(in oklab, var(--up) 7%, var(--sheet)); border-color: color-mix(in oklab, var(--up) 30%, var(--rule)); color: var(--ink); font-weight: 700; }

.fx-result-hero { padding: 18px; background: color-mix(in oklab, var(--c-cambio) 9%, var(--sheet)); border: 1px solid color-mix(in oklab, var(--c-cambio) 30%, var(--rule)); border-radius: var(--radius); }
.fx-result-hero .lbl { margin: 0; font-size: 0.82rem; font-weight: 700; color: var(--c-cambio); }
.fx-result-hero .val { margin: 6px 0 4px; font-size: clamp(1.8rem, 1.2rem + 1.8vw, 2.6rem); font-weight: 800; font-variation-settings: "wdth" 118; letter-spacing: -0.03em; line-height: 1; overflow-wrap: anywhere; }
.fx-result-hero .rate-line { margin: 0; font-size: 0.86rem; color: var(--ink-2); }

.fx-source { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 0.82rem; color: var(--ink-3); }
.fx-source .dot { width: 7px; height: 7px; border-radius: 1px; background: var(--up); flex: none; }

.fx-loading { display: flex; align-items: center; gap: 10px; color: var(--ink-2); padding: 12px 0; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--rule); border-top-color: var(--ink); border-radius: 50%; animation: sim-spin 700ms linear infinite; }
@keyframes sim-spin { to { transform: rotate(360deg); } }

.fx-rates-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.fx-rate-card {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 140ms var(--ease), background-color 140ms var(--ease);
}
.fx-rate-card:hover { border-color: var(--ink-3); }
.fx-rate-card.selected { background: color-mix(in oklab, var(--c-cambio) 9%, var(--sheet)); border-color: var(--c-cambio); }
.ccy-flag { display: none; }
.ccy-info { display: flex; flex-direction: column; min-width: 0; }
.ccy-code { font-weight: 800; font-variation-settings: "wdth" 110; }
.ccy-name { font-size: 0.8rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ccy-val { text-align: right; }
.ccy-rate { font-weight: 700; font-feature-settings: "tnum" 1; white-space: nowrap; }
.ccy-change { font-size: 0.76rem; color: var(--ink-3); }
