/* simulador.html only (external simulator page). Uses the tokens of style.css; mobile first, widened from 760 px. */
.page-simulador { display: flex; flex-direction: column; gap: 22px; padding-top: 28px; padding-bottom: 40px; }
.page-simulador h1 { font-size: clamp(24px, 4.6vw, 36px); max-width: 30ch; }
.page-simulador .intro .lede { font-size: 16px; }

/* status: one line, the last update */
.cx-status { margin-top: 14px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--r); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; font-size: 14.5px; color: var(--ink-2); max-width: 80ch; }
.cx-credit a, .lede a { display: inline-block; min-height: 24px; }

/* the number: the same box as index.html, not sticky here */
.page-simulador .cx-controls { position: static; margin-inline: 0; padding: 0; background: none; }
.cx-controls .numrow { align-items: center; }
.cx-hint { flex: 1 1 200px; align-self: center; }
.cx-lote { margin-top: 8px; font-size: 14.5px; color: var(--ink-2); max-width: 80ch; }
.cx-lote:empty { display: none; }
.cx-lote b { color: var(--ink); font-weight: 650; }

.cx-sec h2 { margin-bottom: 6px; }
.cx-read { font-size: 15px; color: var(--ink-2); max-width: 80ch; }
.cx-ahead { font-size: 14.5px; color: var(--ink); background: var(--accent-tint); border-left: 3px solid var(--accent); border-radius: 6px; padding: 8px 12px; margin-top: 8px; max-width: 80ch; }
.cx-ahead:empty { display: none; }

/* participation by lote: one bar per lote */
.cx-lotes { margin-top: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 4px 0; }
.cx-lrow { display: grid; grid-template-columns: 92px minmax(0, 1fr); grid-template-areas: "n v" "bar bar"; gap: 4px 10px; padding: 7px 14px; align-items: center; border-top: 1px solid var(--line); }
.cx-lrow:first-child { border-top: 0; }
.cx-lrow.mine { background: var(--accent-tint); box-shadow: inset 4px 0 0 var(--accent); }
.cx-ln { grid-area: n; font-size: 14px; line-height: 1.25; }
.cx-ln b { font-weight: 650; }
.cx-lr { display: block; font-size: 12.5px; color: var(--ink-3); }
.cx-lv .cx-lr { display: inline; margin-left: 6px; }
.cx-tag { font-size: 11.5px; font-weight: 700; color: var(--accent-ink); background: var(--accent); border-radius: 4px; padding: 0 5px; vertical-align: 1px; }
.cx-bar { grid-area: bar; display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--track); box-shadow: inset 0 0 0 1px var(--line-2); }
.cx-bar i { display: block; height: 100%; }
.cx-bar .p { background: var(--accent); }
.cx-bar .r { background: color-mix(in srgb, var(--accent) 35%, var(--surface)); }
.cx-lv { grid-area: v; font-size: 14px; color: var(--ink-2); text-align: right; }
.cx-lv b { font-size: 16px; font-weight: 750; color: var(--ink); }
.cx-key { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--ink-3); margin-top: 8px; }
.cx-key span { display: inline-flex; align-items: center; gap: 6px; }
.cx-key i { display: inline-block; width: 14px; height: 10px; border-radius: 2px; }
.cx-k-pref { background: var(--accent); }
.cx-k-reg { background: color-mix(in srgb, var(--accent) 35%, var(--surface)); }
.cx-k-none { background: var(--track); box-shadow: inset 0 0 0 1px var(--line-2); }
@media (min-width: 760px) {
  .cx-lrow { grid-template-columns: 130px minmax(0, 1fr) 250px; grid-template-areas: "n bar v"; padding: 6px 18px; }
  .cx-lv { text-align: left; }
}

/* the list */
.cx-list { margin-top: 4px; }
.cx-spec { padding: 0; }
.cx-sbtn { all: unset; box-sizing: border-box; display: flex; gap: 10px; align-items: flex-start; width: 100%; min-height: 44px; padding: 12px 14px 4px 12px; cursor: pointer; }
.cx-sbtn:focus-visible { outline: 2.5px solid var(--accent); outline-offset: -3px; border-radius: 6px; }
@media (hover: hover) { .cx-sbtn:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); } }
.cx-sbtn .car { margin-top: 1px; }
.cx-sname { min-width: 0; }
.cx-sname b { display: block; font-weight: 650; font-size: 16.5px; line-height: 1.25; }
.cx-sub { display: block; font-size: 13.5px; color: var(--ink-3); margin-top: 1px; }
.cx-sline { padding: 2px 14px 2px 44px; font-size: 14px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 2px 12px; }
.cx-sline.mod { display: block; padding-bottom: 12px; color: var(--ink-2); }
.cx-sline b { color: var(--ink); }
.cx-you { display: inline; font-size: 14px; color: var(--ink); }
p.cx-you { display: block; margin-top: 4px; }
.cx-you i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 50%; border: 2px solid var(--ink-2); }
.cx-you.in i { background: var(--accent); border-color: var(--accent); }
.cx-you.in b { color: var(--accent-strong); }
.cx-pct { font-size: 17px; font-weight: 750; color: var(--ink); }
.cx-any { font-size: 12.5px; color: var(--ink-3); }
.cx-na { color: var(--ink-3); }
/* the model's word: a button only for its tooltip (tap or hover); 44 px tall without taking more line height */
.cx-sig { font: inherit; font-weight: 600; font-size: 13.5px; background: none; border: 0; padding: 0 4px; min-height: 44px; margin-block: -12px; cursor: help; }
.cx-sig:focus-visible { outline: 2.5px solid var(--accent); outline-offset: -6px; }

.cx-sublist { background: var(--bg); border-top: 1px solid var(--line); padding: 2px 0 6px; }
.cx-place { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 12px 14px 12px 16px; border-top: 1px dashed var(--line); border-left: 2px solid var(--band); margin-left: 0; }
.cx-sublist > .cx-place:first-child { border-top: 0; }
.cx-pname b { display: block; font-weight: 600; font-size: 15.5px; line-height: 1.3; }
.cx-site { display: block; font-size: 14px; color: var(--ink-2); }
.cx-col { font-size: 14px; color: var(--ink-2); min-width: 0; }
.cx-col p { margin: 0; }
.cx-col b { color: var(--ink); }
.cx-lab { display: block; font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 1px; }
.cx-col.sim .cx-lab { color: var(--accent-strong); }
.cx-occ { font-weight: 700; color: var(--ink); }
.cx-hbtn .btn { padding-inline: 0; }
.cx-hist { grid-column: 1 / -1; background: var(--surface); border: 1px dashed var(--line-2); border-radius: 10px; padding: 8px 12px; max-width: 560px; }
.cx-hist .tscroll { --tbg: var(--surface); margin: 6px 0 0; }
.cx-hist table { font-size: 13.5px; width: auto; min-width: 260px; }
.cx-hist td, .cx-hist th { padding: 4px 12px 4px 0; }
.cx-spark { display: block; width: 100%; height: 60px; }
.cx-spark polyline { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.cx-hnote { font-size: 13.5px; color: var(--ink-3); margin-top: 4px; }
@media (min-width: 760px) {
  .cx-place { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr); grid-template-areas: "name sim mod" "hb hb hb" "hist hist hist"; gap: 4px 20px; margin: 0 8px 0 30px; padding: 12px 18px 12px 14px; }
  .cx-pname { grid-area: name; } .cx-col.sim { grid-area: sim; } .cx-col.mod { grid-area: mod; }
  .cx-hbtn { grid-area: hb; } .cx-hist { grid-area: hist; }
  .cx-unm .cx-place { grid-template-columns: minmax(0, 1fr) minmax(0, 2.15fr); grid-template-areas: "name sim"; margin-left: 0; }
}

.cx-unm { margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 0 4px; }
.cx-unm h3 { padding: 0 14px; }
.cx-unm > .cx-hnote { padding: 0 14px 8px; }

.cx-howto { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--ink-3); border-radius: var(--r); padding: 16px 18px; }
.cx-howto ul { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 8px; max-width: 85ch; }
.cx-howto li { color: var(--ink-2); font-size: 15px; }
.cx-howto li b { color: var(--ink); }
.cx-credit { margin-top: 12px; font-size: 14px; color: var(--ink-3); }
.cx-credit { line-height: 2.4; }
/* simulator «dentro» but the model «pouco provável» */
.cx-flag { grid-column: 1 / -1; margin: 0; font-size: 13.5px; color: var(--ink); background: var(--surface-2); border-left: 3px solid var(--ink-3); border-radius: 6px; padding: 5px 10px; max-width: 70ch; }

.cx-listhelp { margin-top: 0; }
@media (max-width: 759px) {
  .page-simulador { gap: 28px; padding-top: 20px; }
  .page-simulador h1 { font-size: 23px; }
  .page-simulador .cx-status { font-size: 16px; }
  .page-simulador .numfield { flex: 1 1 100%; min-width: 0; }
  .page-simulador .numfield .lab { font-size: 15px; }
  .page-simulador .numbox { height: 60px; }
  .page-simulador .numbox input { width: 0; min-width: 0; flex: 1 1 0; font-size: 30px; }
  .page-simulador .step { width: 56px; font-size: 26px; }
  .cx-lote, .cx-hint { font-size: 16px; }
  .cx-read, .cx-howto li { font-size: 16px; }
  .cx-fold:not(.cx-howto) { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 16px; }
  .cx-fold:not(.cx-howto)[open] { padding-bottom: 14px; }
  .cx-howto { padding: 6px 16px; }
  .cx-howto[open] { padding-bottom: 16px; }
  /* list rows: name, the simulator line and «dentro / fora»; the counts and the model only once the row is open */
  .cx-spec:not(.open) .cx-sub, .cx-spec:not(.open) .cx-sline.mod { display: none; }
  .cx-spec:not(.open) .cx-sline { padding-bottom: 16px; }
  .cx-sbtn { padding-top: 16px; }
  .cx-sline, .cx-you { font-size: 15px; }
  .cx-sub { font-size: 15px; }
}
@media (max-width: 759px) { .page-simulador .filters { grid-template-columns: 1fr; } }
