/* Simulador de RAROC de câmbio — usa as variáveis de styles.css */
.sx-aviso { background: var(--surface); border: 1px solid var(--rule); border-left: 6px solid var(--heat-3); border-radius: 6px; padding: 14px 18px; font-family: var(--font-text); color: var(--muted); line-height: 1.6; margin: 0 0 20px; max-width: 900px; }
.sx-aviso strong { color: var(--ink); font-family: var(--font-ui); }

.sx-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.sx-tabs button { font: inherit; font-weight: 700; font-size: .95rem; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--rule); background: var(--surface); color: var(--muted); cursor: pointer; }
.sx-tabs button[aria-selected="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.sx-tabs button:hover { border-color: var(--link); }

.sx { display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); gap: 20px; align-items: start; }

.sx-form { background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 18px; position: sticky; top: 12px; }
.sx-form fieldset { border: 0; margin: 0 0 14px; padding: 0 0 14px; border-bottom: 1px solid var(--rule); }
.sx-form fieldset:last-of-type { border-bottom: 0; margin-bottom: 6px; }
.sx-form legend { font-weight: 800; font-size: .95rem; margin: 0 0 8px; padding: 0; }
.sx-form label { display: block; font-size: .85rem; color: var(--muted); margin: 0 0 10px; }
.sx-form input[type="text"], .sx-form input[type="number"], .sx-form select { display: block; width: 100%; margin-top: 4px; font: inherit; font-size: .98rem; color: var(--ink); background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; padding: 8px 10px; font-variant-numeric: tabular-nums; }
.sx-form input[readonly] { color: var(--muted); background: var(--surface); }
.sx-form .sx-check { display: flex; gap: 8px; align-items: center; color: var(--ink); }
.sx-hint { font-size: .78rem; color: var(--muted); margin: -4px 0 10px; line-height: 1.45; }
.sx-reset { font: inherit; font-size: .88rem; background: transparent; border: 0; color: var(--link); text-decoration: underline; cursor: pointer; padding: 4px 0; }

.sx-out { min-width: 0; }
.sx-erros { background: #fbeae6; border: 1px solid var(--heat-5); color: var(--ink); border-radius: 6px; padding: 10px 14px; margin: 0 0 14px; font-size: .92rem; }
.sx-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.sx-kpi { background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 14px 16px; min-width: 0; }
.sx-kpi.sx-bom { border-top: 4px solid var(--heat-1); }
.sx-kpi.sx-ruim { border-top: 4px solid var(--heat-5); }
.sx-k-label { color: var(--muted); font-size: .85rem; }
.sx-k-val { font-size: clamp(1.1rem, 1.6vw, 1.45rem); font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin-top: 2px; white-space: nowrap; }
.sx-k-note { color: var(--muted); font-size: .78rem; margin-top: 2px; }
.sx-be { font-family: var(--font-text); background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 12px 16px; margin: 0 0 12px; line-height: 1.55; }

.sx-card { background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 18px; margin-bottom: 12px; }
.sx-card h2 { font-size: 1.1rem; margin: 0 0 8px; letter-spacing: -0.01em; }
.sx-sub { color: var(--muted); font-size: .85rem; margin: 0 0 8px; }
.sx-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.sx-table th { text-align: left; font-weight: 400; padding: 7px 8px 7px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.sx-table td { text-align: right; padding: 7px 0 7px 8px; border-bottom: 1px solid var(--rule); font-variant-numeric: tabular-nums; white-space: nowrap; vertical-align: top; }
.sx-table .sx-nota { display: block; color: var(--muted); font-size: .78rem; margin-top: 1px; }
.sx-table tr.sx-sub th, .sx-table tr.sx-sub td { font-weight: 600; }
.sx-table tr.sx-tot th, .sx-table tr.sx-tot td { font-weight: 800; border-bottom: 2px solid var(--ink); }

.sx-chart svg { display: block; overflow: visible; }
.sx-chart text { font-family: var(--font-ui); font-size: 12px; fill: var(--muted); }
.sx-chart .grid { stroke: var(--rule); }
.sx-chart .sx-linha { fill: none; stroke: var(--link); stroke-width: 2.5; }
.sx-chart .sx-hurdle { stroke: var(--heat-4); stroke-width: 1.5; stroke-dasharray: 5 4; }
.sx-chart .sx-hurdle-t { fill: var(--heat-4); font-weight: 600; }
.sx-chart .sx-ponto { fill: var(--ink); stroke: var(--surface); stroke-width: 2; }

.sx-formula { font-family: var(--font-ui); font-weight: 600; background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 10px 14px; display: inline-block; }

[hidden] { display: none !important; }

@media (max-width: 960px) {
  .sx { grid-template-columns: 1fr; }
  .sx-form { position: static; }
  .sx-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.page-head p.sx-autor { margin: 16px 0 0; padding: 2px 0 2px 14px; border-left: 3px solid var(--heat-3); font-style: italic; font-size: 1rem; }
