/* ==========================================================================
   Foxbit Times & Trades — tema Oxus
   Tokens do design system Oxus (petróleo, teal, dourado, papel/areia),
   adaptados para um painel denso de mercado: legibilidade em primeiro lugar.
   ========================================================================== */
:root {
  /* marca */
  --ink-950: #0E2429;
  --ink-900: #10272B;
  --ink-850: #132E32;
  --ink-800: #16383C;
  --slate-700: #244351;
  --teal-700: #005555;
  --teal-600: #006868;
  --teal-500: #1A5E5E;
  --gold-300: #FCC485;
  --paper-50: #F6F7F0;
  --sand-200: #DBD4CA;
  --sand-300: #D4C6B9;
  --sand-400: #D5BD9C;
  --mint-300: #A8C7BE;
  --mint-400: #8DBB9A;
  --sage-400: #9CAB89;
  --error: #8E342D;

  /* papéis no painel */
  --bg: var(--ink-950);
  --panel: var(--ink-900);
  --panel2: var(--ink-850);
  --raised: var(--ink-800);
  --border: rgba(255, 255, 255, .09);
  --border-strong: rgba(255, 255, 255, .16);
  --text: #EEF1EA;
  --text-high: rgba(255, 255, 255, .86);
  --muted: #93A8A4;
  --label: var(--mint-300);
  --accent: var(--gold-300);          /* acento e foco (uso restrito) */
  --warn: #E9B872;                    /* atenção */
  --info: var(--mint-300);
  --buy: #5CC3A0;                     /* compra / positivo */
  --buy-bg: rgba(92, 195, 160, .12);
  --sell: #E8806E;                    /* venda / negativo */
  --sell-bg: rgba(232, 128, 110, .12);

  --font-sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;
  --mono: var(--font-sans);           /* números: Hanken com dígitos tabulares */

  --r-sm: 6px; --r-md: 7px; --r-base: 8px; --r-lg: 10px; --r-xl: 12px;
  --sh-glass: inset 0 1px #ffffff1a, 0 16px 40px #02101438;
  --sh-panel: inset 0 1px rgba(255, 255, 255, .035), 0 10px 30px rgba(2, 16, 20, .22);
  --sh-overlay: 0 38px 120px #00000061, 0 8px 30px #0000002e;
  --glass-bg: linear-gradient(145deg, #ffffff1a, #ffffff08), #2443515c;
  --glass-bg-hover: linear-gradient(145deg, #ffffff26, #ffffff0d), #2443517a;
  --ease: cubic-bezier(.23, 1, .32, 1);
  --ease-roll: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 13px/1.45 var(--font-sans);
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(252, 196, 133, .28); }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 12px; }
.serif-accent { font-family: var(--font-serif); font-style: italic; font-weight: 400; color: var(--gold-300); letter-spacing: -.01em; }
code { background: var(--panel2); padding: 1px 5px; border-radius: 4px; }
a { color: var(--mint-300); }
:focus-visible { outline: 2px solid var(--gold-300); outline-offset: 2px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .22); background-clip: padding-box; border: 2px solid transparent; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- barra superior ---------------- */
.topbar {
  display: flex; align-items: center; gap: 22px; padding: 0 20px; height: 56px;
  position: sticky; top: 0; z-index: 10;
  background: rgba(14, 36, 41, .86); border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: blur(18px) saturate(125%); backdrop-filter: blur(18px) saturate(125%);
}
.brand { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.brand .mark {
  width: 26px; height: 26px; border-radius: 6px; background: var(--teal-700); display: grid; place-items: center;
  font: italic 400 17px/1 var(--font-serif); color: #fff; box-shadow: inset 0 1px #ffffff26;
}
.brand .word { font-weight: 600; font-size: 12px; letter-spacing: .22em; color: var(--paper-50); }
.brand .sep { width: 1px; height: 18px; background: var(--border-strong); }
.brand .product { font: italic 400 19px/1 var(--font-serif); color: var(--gold-300); letter-spacing: -.01em; }
.tabs { display: flex; gap: 4px; }
.tab {
  background: none; border: 1px solid transparent; color: var(--muted); padding: 7px 14px; border-radius: var(--r-base);
  cursor: pointer; font: 600 11px/1 var(--font-sans); letter-spacing: .09em; text-transform: uppercase;
  transition: color .18s var(--ease), background .18s var(--ease);
}
.tab:hover { color: var(--text); background: rgba(255, 255, 255, .04); border-color: transparent; }
.tab.active { color: #fff; background: var(--glass-bg); border-color: #ffffff21; box-shadow: var(--sh-glass); }
.health { color: var(--muted); font-size: 13px; cursor: help; }
.health.ok { color: var(--buy); } .health.warn { color: var(--warn); } .health.err { color: var(--sell); }
.userbox { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.icon-btn {
  display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: var(--r-base);
  background: var(--glass-bg); border: 1px solid #ffffff21; color: var(--text); box-shadow: var(--sh-glass);
  text-transform: none; letter-spacing: 0;
}
.icon-btn:hover { background: var(--glass-bg-hover); border-color: #ffffff30; }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 16px; height: 16px; }

/* ---------------- estrutura ---------------- */
.page { padding: 16px 20px 44px; display: flex; flex-direction: column; gap: 14px; }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; justify-content: space-between; }
.markets { display: flex; gap: 6px; flex-wrap: wrap; }
.ticker { display: flex; gap: 22px; flex-wrap: wrap; }
.ticker b { font-size: 19px; font-weight: 500; letter-spacing: -.02em; color: #fff; }
.ticker b.pos { color: var(--buy); } .ticker b.neg { color: var(--sell); }
.ticker .lbl { color: var(--label); font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; display: block; margin-bottom: 2px; }
.ticker .bn .lbl { color: var(--sand-400); }

/* ---------------- botões ---------------- */
button, .btn {
  background: rgba(255, 255, 255, .04); color: var(--text); border: 1px solid var(--border-strong);
  padding: 7px 13px; border-radius: var(--r-base); cursor: pointer; text-decoration: none; display: inline-block;
  font: 600 11px/1.2 var(--font-sans); letter-spacing: .06em; text-transform: uppercase;
  transition: background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease), transform .14s var(--ease);
}
button:hover, .btn:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .26); }
button:active, .btn:active { transform: scale(.985); }
button.active { background: var(--teal-700); color: #fff; border-color: var(--teal-600); box-shadow: inset 0 1px #ffffff1f; }
button.active:hover { background: var(--teal-600); }
button.ghost, .btn.ghost { background: transparent; }
button.primary, .btn.primary { background: var(--teal-700); border-color: var(--teal-700); color: #fff; box-shadow: 0 10px 24px rgba(0, 0, 0, .18), inset 0 1px #ffffff1f; }
button.primary:hover, .btn.primary:hover { background: var(--teal-600); border-color: var(--teal-600); }
.sm { padding: 5px 10px; font-size: 10.5px; }
button.xs { padding: 2px 7px; font-size: 10px; line-height: 14px; letter-spacing: .04em; }
button:disabled { opacity: .45; cursor: default; transform: none; }

/* ---------------- filtros e campos ---------------- */
.controls {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; background: var(--panel);
  border: 1px solid var(--border); border-radius: var(--r-lg); padding: 12px 14px; box-shadow: var(--sh-panel);
}
.controls label { display: flex; flex-direction: column; gap: 5px; color: var(--label); font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.controls label.chk { flex-direction: row; align-items: center; gap: 7px; font-size: 11px; padding-bottom: 8px; color: var(--muted); letter-spacing: .04em; }
.controls .quick, .controls .exports { display: flex; gap: 4px; padding-bottom: 1px; }
input, select {
  background: rgba(255, 255, 255, .04); color: var(--text); border: 1px solid var(--border-strong);
  border-radius: var(--r-base); padding: 7px 9px; font: 400 13px/1.2 var(--font-sans); min-width: 110px;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
  text-transform: none; letter-spacing: 0;
}
input:hover, select:hover { border-color: rgba(255, 255, 255, .26); }
input:focus, select:focus { outline: none; border-color: var(--mint-300); box-shadow: 0 0 0 3px rgba(0, 85, 85, .45); background: rgba(255, 255, 255, .06); }
select option { background: var(--ink-900); color: var(--text); }
input::placeholder { color: rgba(255, 255, 255, .35); }
input[type=checkbox] { min-width: 0; accent-color: var(--teal-600); width: 14px; height: 14px; }
input[type=date], input[type=datetime-local] { color-scheme: dark; }

/* ---------------- cartões ---------------- */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 12px 14px; min-width: 0; box-shadow: var(--sh-panel); }
.card-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.card-head h3 { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--label); }
.chart-box { position: relative; height: 240px; }
.chart-box.short { height: 170px; }
.chart-box.tallc { height: 380px; }
.info { color: var(--muted); cursor: help; font-size: 12px; }
.hint { margin: 2px 0 6px; font-size: 12px; }

/* ---------------- Times & Trades: grade ---------------- */
.grid-tt { display: grid; grid-template-columns: minmax(480px, 1fr) minmax(320px, 360px) minmax(320px, 360px); gap: 14px; align-items: start; }
.center, .right, .book-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.grid-tt .book-col { display: flex; grid-column: auto; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 1500px) {
  .grid-tt { grid-template-columns: 1fr 1fr; }
  .grid-tt .center { grid-column: 1 / -1; }
}
@media (max-width: 900px) { .grid-tt, .two { grid-template-columns: 1fr; } }

.head-controls { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.head-controls label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.head-controls select { min-width: 0; padding: 4px 7px; font-size: 12px; }
.lw-wrap { position: relative; height: 560px; }
.lw-box { position: absolute; inset: 0; }
.overlay { position: absolute; top: 0; left: 0; pointer-events: none; z-index: 3; }
.legend {
  position: absolute; top: 8px; left: 10px; z-index: 4; font-size: 11.5px; line-height: 1.5;
  background: rgba(14, 36, 41, .86); border: 1px solid #ffffff21; border-radius: var(--r-base); padding: 6px 9px;
  pointer-events: none; white-space: nowrap; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.legend b { color: #fff; font-weight: 600; }
.heat-wrap { position: relative; height: 460px; border-radius: var(--r-base); overflow: hidden; }
.heat-wrap canvas { width: 100%; height: 100%; display: block; cursor: crosshair; user-select: none; }
.xhair { position: absolute; pointer-events: none; z-index: 2; }
.xhair.x { top: 0; width: 1px; background: rgba(246, 247, 240, .3); }
.xhair.y { left: 0; height: 1px; background: rgba(246, 247, 240, .3); }
.hist-ctl { display: flex; gap: 10px; align-items: flex-end; padding: 0 0 0 12px; border-left: 2px solid var(--teal-600); }
.hist-ctl input[type=datetime-local] { min-width: 0; }

/* tape */
.tape-card .table-wrap.tall { max-height: calc(100vh - 180px); }
table.tape { font-size: 12px; }
table.tape td, table.tape th { padding: 3px 6px; }
.tape-hl { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: -2px 0 8px; font-size: 11px; color: var(--muted); }
.tape-hl label { display: flex; align-items: center; gap: 5px; }
.tape-hl input[type=number] { width: 96px; min-width: 0; padding: 4px 7px; font-size: 12px; }
.tape-hl select { min-width: 0; padding: 2px 5px; font-size: 11px; }

/* DOM */
.book-col .card { overflow: hidden; }
table.ladder { font-size: 12px; table-layout: fixed; }
table.ladder td, table.ladder th { padding: 2px 5px; overflow: hidden; text-overflow: ellipsis; position: relative; }
table.ladder th:nth-child(1), table.ladder th:nth-child(5) { width: 17%; }
table.ladder th:nth-child(3) { width: 22%; }
table.ladder td.px { text-align: center; font-weight: 600; }
table.ladder tr.ask td.px { color: var(--sell); }
table.ladder tr.bid td.px { color: var(--buy); }
table.ladder td .lb { position: absolute; top: 2px; bottom: 2px; opacity: .26; border-radius: 3px; }
table.ladder td.bq .lb { right: 0; background: var(--buy); }
table.ladder td.aq .lb { left: 0; background: var(--sell); }
table.ladder td.aq { text-align: left; }
table.ladder td span.v { position: relative; }
table.ladder tr.wall td.bq, table.ladder tr.wall td.aq { font-weight: 700; color: #fff; }
table.ladder tr.spread td { text-align: center; color: var(--muted); background: var(--panel2); font-size: 11px; letter-spacing: .02em; }
table.ladder tr.mine td.px::after { content: " \2605"; color: var(--gold-300); }
table.ladder td.cum { color: var(--muted); font-size: 11px; }
.imb { display: flex; flex-direction: column; gap: 5px; font-size: 11px; }
.imb-bottom { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--border); }
.imb > .muted { color: var(--label); font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 2px; }
.imb-row { display: grid; grid-template-columns: 64px 1fr 64px 42px; white-space: nowrap; gap: 6px; align-items: center; }
.imb-bar { display: flex; height: 7px; border-radius: 999px; overflow: hidden; background: var(--panel2); }
.imb-bar .b { background: var(--buy); }
.imb-bar .a { background: var(--sell); }

/* ---------------- indicadores ---------------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.kpi { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 10px 13px; box-shadow: var(--sh-panel); }
.kpi .lbl { color: var(--label); font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.kpi .val { font-size: 19px; font-weight: 500; letter-spacing: -.02em; color: #fff; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .sub { color: var(--muted); font-size: 11px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpis.big .kpi .val { font-size: 21px; }

/* ---------------- tabelas ---------------- */
.table-wrap { overflow: auto; max-height: 420px; }
.table-wrap.tall { max-height: calc(100vh - 230px); min-height: 300px; }
.table-wrap.xl { max-height: calc(100vh - 260px); }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th {
  position: sticky; top: 0; z-index: 1; background: var(--panel); color: var(--muted); font-weight: 600; text-align: right;
  padding: 7px 8px; border-bottom: 1px solid var(--border-strong); white-space: nowrap;
  font-size: 10px; letter-spacing: .09em; text-transform: uppercase;
}
td { padding: 4px 8px; text-align: right; white-space: nowrap; border-bottom: 1px solid rgba(255, 255, 255, .05); }
th:first-child, td:first-child { text-align: left; }
td.l, th.l { text-align: left; }
tr.buy td.s, .buy-t { color: var(--buy); }
tr.sell td.s, .sell-t { color: var(--sell); }
tr.buy.hl { background: rgba(92, 195, 160, .13); }
tr.sell.hl { background: rgba(232, 128, 110, .13); }
tr.buy.hl2 { background: rgba(92, 195, 160, .3); }
tr.sell.hl2 { background: rgba(232, 128, 110, .3); }
tr.hl td { font-weight: 600; }
tr.hl2 td { color: #fff !important; }
tr.new { animation: flash 1s var(--ease); }
@keyframes flash { from { background: rgba(252, 196, 133, .22); } to { background: transparent; } }
table.clickable tbody tr, table.hover tbody tr { transition: background .14s var(--ease); }
table.clickable tbody tr { cursor: pointer; }
table.clickable tbody tr:hover, table.hover tbody tr:hover { background: rgba(255, 255, 255, .035); }
tr.selected { outline: 1px solid var(--gold-300); outline-offset: -1px; }
.bar-cell { position: relative; }
.bar-cell .bg { position: absolute; top: 3px; bottom: 3px; right: 0; opacity: .25; border-radius: 3px; }
.pos { color: var(--buy); } .neg { color: var(--sell); }
table.mini { font-size: 11.5px; }
table.mini td, table.mini th { padding: 3px 5px; }

/* ---------------- estado / avisos ---------------- */
.sync { color: var(--muted); }
.sync b { color: var(--text); font-weight: 600; }
.actions { display: flex; gap: 8px; }
.notice { background: rgba(233, 184, 114, .07); border: 1px solid rgba(233, 184, 114, .45); border-radius: var(--r-lg); padding: 12px 14px; color: var(--text-high); }
.warn-t { color: var(--warn); }
.live { margin-left: auto; font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 7px; letter-spacing: .02em; }
.live .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sage-400); box-shadow: 0 0 8px #9cab896b; animation: pulse 2.4s infinite; }
.live.stale .dot { background: var(--warn); box-shadow: none; animation: none; }
.live.err .dot { background: var(--sell); box-shadow: none; animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(156, 171, 137, .5); } 70% { box-shadow: 0 0 0 7px rgba(156, 171, 137, 0); } 100% { box-shadow: 0 0 0 0 rgba(156, 171, 137, 0); } }
.sticky-controls { position: sticky; top: 64px; z-index: 6; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--r-base); overflow: hidden; margin-left: auto; background: rgba(255, 255, 255, .03); }
.seg button { border: 0; border-radius: 0; background: transparent; padding: 7px 13px; }
.seg button.active { background: var(--teal-700); color: #fff; box-shadow: none; }
.status-pills { display: flex; gap: 6px; margin-left: auto; align-self: center; }
.pill { font-size: 11px; color: var(--muted); border: 1px solid var(--border-strong); border-radius: 999px; padding: 3px 10px; display: inline-flex; align-items: center; gap: 6px; cursor: help; }
.pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--sage-400); box-shadow: 0 0 6px #9cab896b; }
.pill.bad { color: var(--sell); border-color: rgba(232, 128, 110, .5); }
.pill.bad i { background: var(--sell); box-shadow: none; }
.filter-on { color: var(--gold-300); font-weight: 600; }
select.filter-sel { border-color: var(--gold-300); box-shadow: 0 0 0 1px var(--gold-300); }

/* selos */
.badges { display: flex; gap: 5px; flex-wrap: wrap; }
.badge { font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; border-radius: var(--r-sm); padding: 2px 7px; border: 1px solid var(--border-strong); color: var(--muted); white-space: nowrap; }
.badge.ok { color: var(--buy); border-color: rgba(92, 195, 160, .45); }
.badge.sug { color: var(--info); border-color: rgba(168, 199, 190, .5); }
.badge.warn { color: var(--warn); border-color: rgba(233, 184, 114, .5); }
.badge.bad { color: var(--sell); border-color: rgba(232, 128, 110, .5); }
.dot-s { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot-s.ok { background: var(--buy); } .dot-s.sug { background: var(--info); } .dot-s.warn { background: var(--warn); } .dot-s.muted { background: #4E6663; } .dot-s.bad { background: var(--sell); }

/* ---------------- sub-abas (Controle de operações) ---------------- */
.subtabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); align-items: flex-end; flex-wrap: wrap; }
.subtabs > button {
  background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; color: var(--muted);
  padding: 10px 14px; font-size: 11px; letter-spacing: .09em;
}
.subtabs > button:hover { color: var(--text); background: none; }
.subtabs > button.active { color: #fff; border-bottom-color: var(--gold-300); background: none; box-shadow: none; }
.subtabs .cnt { font-size: 10px; background: var(--panel2); border-radius: 999px; padding: 1px 7px; margin-left: 5px; color: var(--muted); letter-spacing: 0; }
.subtabs .cnt:empty { display: none; }
.subtabs .cnt.bad { background: rgba(232, 128, 110, .18); color: var(--sell); }
.subtabs .alerts { margin-left: auto; padding-bottom: 7px; gap: 6px; display: flex; flex-wrap: wrap; }
.alerts:empty { display: none; }
.apill { font-size: 11px; font-weight: 600; letter-spacing: .02em; text-transform: none; border-radius: 999px; padding: 4px 11px; border: 1px solid; background: transparent; cursor: pointer; }
.apill.bad { color: var(--sell); border-color: rgba(232, 128, 110, .55); }
.apill.warn { color: var(--warn); border-color: rgba(233, 184, 114, .55); }
.apill.info { color: var(--info); border-color: rgba(168, 199, 190, .5); }
.apill.ok { color: var(--buy); border-color: rgba(92, 195, 160, .45); cursor: default; }
.otc-panel { display: flex; flex-direction: column; gap: 12px; }
.panel-bar { display: flex; align-items: center; gap: 10px; }
.panel-bar .seg { margin-left: auto; }
#otcMore { align-self: center; }

/* cards de operação */
.op-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 860px), 1fr)); gap: 14px; }
.op-card { background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--border-strong); border-radius: var(--r-lg); padding: 14px 16px; box-shadow: var(--sh-panel); }
.op-card.r-pos { border-left-color: var(--buy); }
.op-card.r-neg { border-left-color: var(--sell); }
.op-card.m-pendente { border-left-color: var(--warn); }
.op-card.m-reembolsado, .op-card.m-fora, .op-card.m-sem_hedge { opacity: .8; }
.op-card header { display: flex; align-items: center; gap: 10px; row-gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.op-title { font-size: 15px; letter-spacing: -.01em; }
.op-title b { font-weight: 500; }
.op-title .ord { color: var(--gold-300); font: italic 400 19px/1 var(--font-serif); margin-right: 2px; }
.op-title .pair { font-size: 10px; font-weight: 600; letter-spacing: .08em; background: var(--panel2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 2px 7px; margin-left: 4px; color: var(--muted); }
.op-res { margin-left: auto; font-size: 21px; font-weight: 500; letter-spacing: -.02em; }
.op-res small { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 5px; letter-spacing: 0; }
.op-stats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.stat { background: var(--panel2); border: 1px solid var(--border); border-radius: var(--r-base); padding: 6px 11px; display: flex; flex-direction: column; min-width: 96px; }
.stat span { color: var(--label); font-size: 9.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.stat b { font-size: 14px; font-weight: 500; letter-spacing: -.01em; margin-top: 2px; }
.op-body { display: grid; grid-template-columns: 1.1fr 1.2fr 1fr; gap: 12px; }
@media (max-width: 1100px) { .op-body { grid-template-columns: 1fr; } }
.op-body section { background: rgba(14, 36, 41, .55); border: 1px solid var(--border); border-radius: var(--r-base); padding: 10px 12px; }
.op-body h4 { margin: 0 0 8px; font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: var(--label); font-weight: 600; }
.op-body details summary { cursor: pointer; color: var(--muted); font-size: 11px; margin-top: 8px; }
.op-body pre { white-space: pre-wrap; font: 11.5px/1.5 var(--font-sans); background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 8px; margin: 6px 0 0; color: var(--text-high); }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px dashed rgba(255, 255, 255, .07); font-size: 12.5px; }
.kv span { color: var(--muted); }
.kv b { font-weight: 500; text-align: right; }
.kv b.extra { color: var(--warn); }
.kv.total { border-top: 1px solid var(--border-strong); border-bottom: 1px solid var(--border-strong); margin: 6px 0; padding: 6px 0; font-size: 13.5px; }
.kv.total b { font-weight: 600; }
.kv small { color: var(--muted); font-weight: 400; }
.mini-grid { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 12px; margin-top: 8px; }
.mini-grid span { color: var(--muted); }
.mini-grid b { font-weight: 500; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-grid small { color: var(--muted); }
.mono-s { font-size: 10.5px; letter-spacing: .02em; }
.op-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.empty { padding: 8px 0; font-size: 12px; }
#otcTable tbody tr.op-row { cursor: pointer; }
#otcTable tbody tr.op-row.open { background: rgba(255, 255, 255, .04); }
#otcTable td.res { font-weight: 600; }
#otcTable tr.exp > td { padding: 10px 4px 14px; background: var(--bg); white-space: normal; text-align: left; }

/* fluxo de USDT */
.flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 700px), 1fr)); gap: 14px; }
.flow:empty { display: none; }
.flow-card .card-head h3 { font-size: 12px; }
.flow-grid, .flow-card .flow-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 10px; }
@media (max-width: 1300px) { .flow-card .flow-grid { grid-template-columns: 1fr 1fr; } }
.flow-box { background: var(--panel2); border: 1px solid var(--border); border-radius: var(--r-base); padding: 12px 14px; border-top: 2px solid var(--border-strong); }
.flow-box.buy { border-top-color: var(--buy); }
.flow-box.out { border-top-color: var(--mint-300); }
.flow-box.sell { border-top-color: var(--sell); }
.flow-box.saldo { border-top-color: var(--gold-300); }
.flow-box .lbl { color: var(--label); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; }
.flow-box .val { font-size: 23px; font-weight: 500; letter-spacing: -.025em; margin: 6px 0 4px; color: #fff; }
.flow-box .val small { font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: .08em; }
.flow-box .sub { color: var(--muted); font-size: 11.5px; margin-top: 2px; }

/* custos extras */
.cost-form { margin: 8px 0 12px; background: var(--bg); box-shadow: none; }
.cost-form input[name=empresa] { min-width: 220px; }
.cost-form input[name=nome] { min-width: 180px; }

/* modais */
.modal { position: fixed; inset: 0; background: rgba(4, 18, 22, .66); z-index: 30; display: flex; align-items: center; justify-content: center; padding: 20px; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.modal-box { background: var(--panel); border: 1px solid var(--border-strong); border-radius: var(--r-xl); padding: 18px; width: min(1100px, 100%); max-height: 90vh; display: flex; flex-direction: column; box-shadow: var(--sh-overlay); }
.modal-box .table-wrap.tall { max-height: 60vh; }
.modal-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 12px; }
.modal-foot span { margin-right: auto; }
details.sub { margin-top: 10px; }
details.sub > summary { cursor: pointer; font-size: 12px; color: var(--muted); }
details.card > summary { list-style: none; cursor: pointer; margin-bottom: 0; }
details.card[open] > summary { margin-bottom: 10px; }

/* ---------------- auditoria ---------------- */
.audit-list { display: flex; flex-direction: column; gap: 8px; }
.audit-group h3 { margin: 14px 0 8px; font-size: 11px; color: var(--label); text-transform: uppercase; letter-spacing: .14em; font-weight: 600; }
.audit-item { background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--border-strong); border-radius: var(--r-lg); padding: 10px 14px; }
.audit-item.ok { border-left-color: var(--buy); }
.audit-item.warn { border-left-color: var(--warn); }
.audit-item.fail { border-left-color: var(--sell); }
.audit-item summary { cursor: pointer; display: flex; gap: 12px; align-items: baseline; list-style: none; flex-wrap: wrap; }
.audit-item summary::-webkit-details-marker { display: none; }
.audit-item .st { font-weight: 600; min-width: 70px; font-size: 10.5px; letter-spacing: .1em; }
.audit-item.ok .st { color: var(--buy); } .audit-item.warn .st { color: var(--warn); } .audit-item.fail .st { color: var(--sell); }
.audit-item .nm { font-weight: 500; }
.audit-item .sm { color: var(--muted); font-size: 12px; }
.audit-item .ds { color: var(--muted); font-size: 12px; margin: 8px 0; }

/* ==========================================================================
   Login
   ========================================================================== */
.login-body {
  min-height: 100svh; display: grid; place-items: center; padding: clamp(18px, 4vw, 48px);
  background: radial-gradient(74% 120% at 78% 65%, #245450, #17383D 43%, #0E2429 81%);
}
.login-shell { width: min(1180px, 100%); display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
@media (max-width: 900px) { .login-shell { grid-template-columns: 1fr; } }
.login-intro .brand { margin-bottom: clamp(28px, 5svh, 56px); }
.login-eyebrow { display: block; font-size: clamp(11px, .88vw, 13px); letter-spacing: .19em; text-transform: uppercase; color: var(--mint-300); margin-bottom: 22px; }
.login-title { margin: 0; font-weight: 500; font-size: clamp(40px, 4.6vw, 70px); line-height: 1.02; letter-spacing: -.055em; color: var(--paper-50); }
.login-title em { display: block; margin-top: .12em; font: italic 400 1.02em/1.02 var(--font-serif); letter-spacing: -.02em; color: var(--gold-300); }
.login-lead { margin: clamp(22px, 3svh, 32px) 0 0; max-width: 440px; font-size: clamp(15px, 1.2vw, 18px); line-height: 1.5; color: rgba(246, 247, 240, .72); }
.login-panel {
  background: var(--sand-200); color: var(--ink-950); border: 1px solid rgba(14, 36, 41, .1);
  border-radius: clamp(10px, 1vw, 15px); padding: clamp(28px, 4vw, 52px); box-shadow: 0 28px 80px #00000042;
  animation: panel-in 1.1s cubic-bezier(.2, 1, .3, 1) both;
}
@keyframes panel-in { from { opacity: 0; transform: translateY(24px) scale(.985); } to { opacity: 1; transform: none; } }
.login-panel h2 { margin: 0 0 6px; font-weight: 400; font-size: clamp(28px, 2.6vw, 40px); line-height: 1; letter-spacing: -.045em; }
.login-panel p.sub { margin: 0 0 26px; font-size: 14px; color: rgba(14, 36, 41, .62); }
.login-panel form { display: grid; gap: 18px; }
.login-panel label { display: grid; gap: 10px; font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: rgba(14, 36, 41, .66); }
.login-panel input {
  height: 60px; width: 100%; min-width: 0; border-radius: 8px; border: 1px solid rgba(14, 36, 41, .18);
  background: rgba(255, 255, 255, .42); padding: 0 18px; font: 400 .98rem var(--font-sans); color: var(--ink-950);
  box-shadow: inset 0 1px #ffffff70; letter-spacing: 0; text-transform: none;
}
.login-panel input::placeholder { color: rgba(14, 36, 41, .4); }
.login-panel input:hover { background: rgba(255, 255, 255, .54); border-color: rgba(14, 36, 41, .3); }
.login-panel input:focus { background: rgba(255, 255, 255, .72); border-color: var(--teal-700); box-shadow: 0 0 0 3px #0055551a; }
.login-panel input[aria-invalid=true] { border-color: #8e342d8f; box-shadow: 0 0 0 3px #8e342d14; }
.login-error { min-height: 18px; font-size: .8rem; color: var(--error); }
/* botão principal Oxus: texto que rola + seta em quadrado branco */
.cta {
  position: relative; isolation: isolate; display: grid; grid-template-columns: 1fr 46px; align-items: center; gap: 10px;
  width: 100%; min-height: 64px; padding: 9px 9px 9px 22px; border-radius: 8px; border: 1px solid var(--teal-700);
  background: transparent; color: #fff; overflow: hidden; text-align: left;
  font: 600 .86rem/1.3 var(--font-sans); letter-spacing: .045em; text-transform: uppercase;
  box-shadow: 0 18px 38px #0e24292e, inset 0 1px #ffffff1f;
}
.cta::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--teal-700); transition: inset .6s var(--ease-roll), background .6s var(--ease-roll); }
.cta:hover { background: transparent; border-color: var(--teal-700); }
.cta:hover::before { inset: .125em; background: var(--teal-600); }
.cta .roll { display: block; overflow: hidden; height: 1.3em; white-space: nowrap; }
.cta .roll span { display: inline-block; transition: transform .6s var(--ease-roll); text-shadow: 0 1.3em currentColor; }
.cta:hover .roll span { transform: translateY(-1.3em); }
.cta i { position: relative; display: flex; justify-content: flex-end; width: 46px; height: 46px; border-radius: 6px; background: #fff; color: var(--teal-700); overflow: hidden; }
.cta i > span { display: flex; width: 200%; height: 100%; flex-shrink: 0; transition: transform .6s var(--ease-roll); }
.cta i > span > span { display: grid; place-items: center; width: 50%; }
.cta:hover i > span { transform: translateX(50%); }
.cta:disabled { opacity: .7; }
.login-foot { margin-top: 22px; font-size: .67rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: rgba(14, 36, 41, .5); display: flex; justify-content: space-between; gap: 12px; }

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

/* ordem expandida no card da operação */
table.ord-table tr.ord-row { cursor: pointer; transition: background .14s var(--ease); }
table.ord-table tr.ord-row:hover, table.ord-table tr.ord-row.open { background: rgba(255, 255, 255, .04); }
table.ord-table .chev { display: inline-block; width: 12px; color: var(--mint-300); font-size: 10px; }
table.ord-table tr.ord-exp > td { padding: 0 0 8px; white-space: normal; text-align: left; border-bottom: 1px solid var(--border-strong); }
.ord-detail { container-type: inline-size; background: var(--panel2); border: 1px solid var(--border); border-radius: var(--r-base); padding: 10px 12px; margin-top: 2px; }
.ord-detail .ids { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.id-chip { display: inline-flex; align-items: baseline; gap: 6px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); padding: 3px 8px; cursor: copy; max-width: 100%; }
.id-chip span { color: var(--label); font-size: 9.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.id-chip b { font-weight: 500; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.id-chip:hover, .id-mini:hover { border-color: var(--mint-300); color: #fff; }
.id-chip.copied, .id-mini.copied { border-color: var(--gold-300); color: var(--gold-300); }
.id-mini { cursor: copy; border-bottom: 1px dashed rgba(255, 255, 255, .25); }
.ord-detail .mini-grid.cols2 { grid-template-columns: auto 1fr auto 1fr; gap: 4px 14px; margin: 0 0 8px; }
@container (max-width: 640px) { .ord-detail .mini-grid.cols2 { grid-template-columns: auto 1fr; } }
.ord-detail .mini-grid b { white-space: normal; overflow-wrap: anywhere; }
.ord-detail .shared { margin: 0 0 8px; font-size: 11.5px; }
.ord-detail .fills-wrap { max-height: 260px; overflow: auto; border-top: 1px solid var(--border); }
.ord-detail table.fills th { background: var(--panel2); }

/* saques vinculados (perna de saída) */
.wd-block { margin-top: 10px; padding-top: 8px; border-top: 1px dashed rgba(255, 255, 255, .08); }
.wd-block .sub-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--label); }
.wd-block .sub-head .muted { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 500; }
.wd-block .empty { font-size: 11.5px; padding: 4px 0; }
.op-actions .repair { border-color: var(--gold-300); color: var(--gold-300); }
.why-pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
#otcUnlinked td.why { white-space: normal; max-width: 420px; font-size: 12px; }
/* falta de ordem na operação */
.gap-block { margin-top: 8px; padding: 8px 10px; border: 1px solid rgba(233, 184, 114, .35); border-radius: var(--r-sm); background: rgba(233, 184, 114, .06); font-size: 12px; }
.gap-head { color: var(--warn); margin-bottom: 4px; }
.gap-sug { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 3px 0; }
.modal-box.small { max-width: 560px; }
.modal-box .check { display: flex; align-items: center; gap: 8px; margin: 10px 0; text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--text); }
.relink-result { min-height: 22px; margin: 6px 0 4px; font-size: 13px; }
.relink-result button { margin-top: 8px; }
/* operação com falta de cobertura */
.op-card.has-gap { border-left-color: var(--warn); box-shadow: var(--sh-panel), inset 3px 0 0 var(--warn); }
.badge.gap-badge { color: #1a1206; background: var(--warn); border-color: var(--warn); font-weight: 700; }
.apill.gap { border-color: var(--warn); color: var(--warn); }
.gap-foot { display: flex; align-items: center; gap: 10px; margin-top: 6px; padding-top: 6px; border-top: 1px dashed rgba(233, 184, 114, .3); }
.gap-foot .muted { font-size: 11px; }

/* ---------- operação em tela cheia ---------- */
.op-card { cursor: pointer; }
.op-card table, .op-card button, .op-card details { cursor: auto; }
.op-card header { position: relative; }
.op-card .op-expand { margin-left: 6px; }
body.no-scroll { overflow: hidden; }
.op-full { position: fixed; inset: 0; z-index: 25; background: var(--ink, #0E2429); overflow-y: auto; }
.op-full .opf-top { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 24px; background: rgba(14, 36, 41, .92); border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.op-full .opf-top .op-title { font-size: 18px; }
.op-full .opf-top .op-res { margin-left: auto; font-size: 22px; }
.opf-nav { display: flex; align-items: center; gap: 6px; }
.opf-body { padding: 18px 24px 40px; max-width: 1700px; margin: 0 auto; }
.opf-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; }
.opf-grid > section { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px 16px; min-width: 0; }
.opf-grid > section h4 { margin: 0 0 10px; }
.opf-stats { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; }
.opf-res { grid-column: span 4; }
.opf-link { grid-column: span 4; }
.opf-time { grid-column: span 4; }
.opf-ord, .opf-wd, .opf-sheet-s { grid-column: 1 / -1; }
.opf-grid.has-gap .opf-ord { border-color: var(--warn); }
@media (max-width: 1200px) { .opf-res, .opf-link, .opf-time { grid-column: 1 / -1; } }
.opf-orders .ord-exp > td { padding: 4px 0 12px; background: transparent; }
.opf-timeline { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.opf-timeline li { display: grid; grid-template-columns: 150px 80px 1fr; gap: 8px; padding: 5px 0 5px 10px; border-left: 2px solid var(--border-strong); }
.opf-timeline li.buy { border-left-color: var(--buy); }
.opf-timeline li.sell { border-left-color: var(--sell); }
.opf-timeline li.out { border-left-color: var(--gold-300); }
.opf-timeline .t { color: var(--muted); font-variant-numeric: tabular-nums; }
.opf-timeline .d { color: var(--label); font-size: 11.5px; }
.opf-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 6px 18px; font-size: 12.5px; }
.opf-sheet span { color: var(--muted); display: block; font-size: 11px; letter-spacing: .04em; }
.opf-sheet b { font-weight: 500; overflow-wrap: anywhere; }
.opf-sheet-s pre { white-space: pre-wrap; font-size: 12px; }

/* ---------- tela cheia: tipografia maior e proporcional à largura da tela ---------- */
.op-full { font-size: clamp(14.5px, 0.45vw + 9px, 17.5px); line-height: 1.45; }
.op-full .opf-top .op-title { font-size: 1.3em; }
.op-full .opf-top .op-title .ord { font-size: 1.35em; }
.op-full .opf-top .op-res { font-size: 1.75em; }
.op-full .op-res small { font-size: .5em; }
.op-full .op-title .pair, .op-full .badge { font-size: .72em; padding: .2em .6em; }
.op-full button.sm { font-size: .78em; padding: .45em .9em; }
.op-full button.xs { font-size: .7em; padding: .2em .6em; line-height: 1.4; }
.op-full .opf-grid > section h4 { font-size: .74em; letter-spacing: .12em; text-transform: uppercase; color: var(--label); font-weight: 600; margin-bottom: .8em; }
.op-full .opf-grid > section h4 .muted { text-transform: none; letter-spacing: 0; font-size: 1.2em; }
.op-full .stat { padding: .5em .9em; min-width: 8em; }
.op-full .stat span { font-size: .66em; }
.op-full .stat b { font-size: 1.2em; }
.op-full .kv { font-size: 1em; padding: .35em 0; }
.op-full .kv.total { font-size: 1.15em; }
.op-full .mini-grid { font-size: .92em; gap: .35em 1em; }
.op-full table, .op-full table.mini { font-size: .88em; }
.op-full table th { font-size: .78em; }
.op-full table td, .op-full table th { padding: .4em .6em; }
.op-full .ord-detail { padding: .8em 1em; }
.op-full .ord-detail .mini-grid { font-size: .95em; }
.op-full .id-chip span { font-size: .68em; }
.op-full .id-chip b { font-size: .9em; }
.op-full .gap-block, .op-full .wd-block { font-size: .95em; }
.op-full .opf-timeline { font-size: .92em; }
.op-full .opf-timeline li { grid-template-columns: 11.5em 6em 1fr; padding: .4em 0 .4em .8em; }
.op-full .opf-timeline .d { font-size: .9em; }
.op-full .opf-sheet { font-size: .95em; grid-template-columns: repeat(auto-fill, minmax(17em, 1fr)); gap: .5em 1.4em; }
.op-full .opf-sheet span { font-size: .72em; }
.op-full .opf-sheet-s pre { font-size: .9em; }
.op-full .muted.empty { font-size: .92em; }
/* tabelas largas rolam de lado em vez de espremer o texto */
.op-full .opf-ord, .op-full .opf-wd { overflow-x: auto; }
.op-full .opf-ord > table, .op-full .opf-wd > table { min-width: 760px; }
@media (max-width: 760px) {
  .op-full .opf-top { padding: 10px 12px; gap: 8px; }
  .op-full .opf-top .op-res { margin-left: 0; width: 100%; }
  .op-full .opf-body { padding: 12px 10px 30px; }
  .op-full .opf-grid { gap: 10px; }
  .op-full .opf-timeline li { grid-template-columns: 1fr; gap: 0; }
}
.op-full table th { position: static; }
.op-full .stat span { font-size: .74em; }
.op-full table th { font-size: .82em; }
.op-full .id-chip span { font-size: .74em; }
.op-full .opf-sheet span { font-size: .78em; }
/* distribuição: resultado | linha do tempo | vínculo; em telas menores a linha do tempo ganha espaço */
.op-full .opf-res { grid-column: span 4; }
.op-full .opf-time { grid-column: span 5; }
.op-full .opf-link { grid-column: span 3; }
@media (max-width: 1500px) {
  .op-full .opf-res { grid-column: span 5; }
  .op-full .opf-time { grid-column: span 7; }
  .op-full .opf-link { grid-column: 1 / -1; }
}
@media (max-width: 1000px) {
  .op-full .opf-res, .op-full .opf-time { grid-column: 1 / -1; }
}
.op-full .opf-timeline li { grid-template-columns: auto 5.5em 1fr; }
@media (max-width: 1500px) { .op-full .opf-link .mini-grid { grid-template-columns: auto 1fr auto 1fr; } }
@media (max-width: 760px) { .op-full .opf-link .mini-grid { grid-template-columns: auto 1fr; } }
.fx-note { font-size: 11px; text-align: right; margin: -2px 0 6px; }
.op-full .fx-note { font-size: .8em; }

/* ---------- tela cheia: planilha + cupom ---------- */
.sheet-full { display: grid; grid-template-columns: minmax(300px, 440px) 1fr; gap: 28px; align-items: start; }
.sheet-full.no-receipt { grid-template-columns: 1fr; }
@media (max-width: 1000px) { .sheet-full { grid-template-columns: 1fr; } }
.receipt-wrap { filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .45)) drop-shadow(0 2px 3px rgba(0, 0, 0, .3)); transform: rotate(-.6deg); padding: 6px 4px 10px; }
.receipt {
  --paper: #f5f0e3; --s: 12px;
  background: var(--paper);
  background-image:
    repeating-linear-gradient(0deg, rgba(120, 100, 60, .045) 0 1px, transparent 1px 3px),
    radial-gradient(120% 60% at 50% 0%, rgba(255, 255, 255, .55), transparent 60%),
    linear-gradient(180deg, rgba(0, 0, 0, 0) 70%, rgba(110, 90, 50, .08));
  color: #24221d; padding: calc(var(--s) + 16px) 22px calc(var(--s) + 18px);
  font-family: "Courier New", "Courier Prime", ui-monospace, Menlo, Consolas, monospace; font-size: .86em; line-height: 1.5;
  -webkit-mask: conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / var(--s) 51% repeat-x,
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / var(--s) 51% repeat-x;
  mask: conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / var(--s) 51% repeat-x,
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / var(--s) 51% repeat-x;
}
.receipt .rc-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; text-transform: uppercase; letter-spacing: .06em; font-size: .92em; }
.receipt .rc-head b { font-size: 1.12em; letter-spacing: .16em; }
.receipt .rc-cut { border-top: 1.5px dashed rgba(36, 34, 29, .45); margin: 12px 0; }
.receipt .rc-text { margin: 0; white-space: pre-wrap; tab-size: 4; font: inherit; color: inherit; background: none; border: 0; padding: 0; }
.receipt .rc-foot { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: .78em; letter-spacing: .08em; }
.receipt .rc-bars { display: flex; gap: 2px; height: 34px; align-items: stretch; max-width: 100%; overflow: hidden; }
.receipt .rc-bars i { display: block; background: #24221d; }
.sh-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19em), 1fr)); gap: 14px; }
.sh-group { background: var(--panel2); border: 1px solid var(--border); border-radius: var(--r-base); padding: .7em .9em; }
.sh-title { font-size: .72em; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-300); margin-bottom: .5em; }
.sh-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: .32em 0; border-bottom: 1px dashed rgba(255, 255, 255, .07); font-size: .95em; }
.sh-row:last-child { border-bottom: 0; }
.sh-row span { color: var(--muted); }
.sh-row b { font-weight: 500; text-align: right; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.sh-row b.muted { color: var(--muted); font-weight: 400; }
.sh-row.key b { color: #fff; font-weight: 600; font-size: 1.06em; }
.rt-dot { color: var(--buy); font-weight: 600; }

/* ---------- SuperDOM ---------- */
.sd-bar { display: flex; align-items: center; gap: 10px; margin: -2px 0 6px; font-size: 11.5px; }
.sd-bar .chk { display: flex; align-items: center; gap: 5px; color: var(--muted); text-transform: none; letter-spacing: 0; font-size: 11.5px; }
.sd-bar .sd-hint { margin-left: auto; font-size: 10.5px; }
.sd-wrap { height: clamp(420px, 62vh, 760px); overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--border); border-radius: var(--r-base); }
.sd-wrap thead th { position: sticky; top: 0; z-index: 2; background: var(--panel); }
table.superdom { table-layout: fixed; }
table.superdom th:nth-child(1), table.superdom th:nth-child(5) { width: 19%; }
table.superdom th:nth-child(2), table.superdom th:nth-child(4) { width: 21%; }
table.superdom th:nth-child(3) { width: 20%; }
table.superdom td { padding: 1px 5px; height: 19px; line-height: 17px; cursor: pointer; }
table.superdom tr:hover td { background: rgba(255, 255, 255, .04); }
table.superdom tr.gap td.px { color: var(--muted); }
table.superdom tr.gap td { background: rgba(252, 196, 133, .05); }
table.superdom tr.best-a td { border-bottom: 2px solid var(--sell); }
table.superdom tr.best-b td { border-top: 2px solid var(--buy); }
table.superdom tr.best-a td.px, table.superdom tr.best-b td.px { font-weight: 700; color: #fff; }
table.superdom tr.last td.px { box-shadow: inset 0 0 0 1.5px var(--gold-300); border-radius: 3px; }
table.superdom td.tv { color: var(--muted); font-size: 11px; }
table.superdom td.tv .lb.tb { right: 0; background: var(--buy); opacity: .16; }
table.superdom td.tv.tvs { text-align: left; }
table.superdom td.tv .lb.ts { left: 0; background: var(--sell); opacity: .16; }
/* ---------- calculadora de partial fill ---------- */
.pf-card label { display: flex; flex-direction: column; gap: 3px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--label); }
.pf-card input, .pf-card select { width: 100%; }
.pf-full { margin-bottom: 8px; }
.pf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.pf-new { display: flex; gap: 6px; align-items: center; }
.pf-out { margin-top: 10px; font-size: 12.5px; }
.pf-row { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px dashed rgba(255, 255, 255, .07); }
.pf-row span { color: var(--muted); }
.pf-row b { font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
.pf-main b { font-size: 1.2em; font-weight: 700; color: #fff; }
.pf-new-order { margin-top: 8px; padding: 8px 10px; border: 1px solid rgba(252, 196, 133, .35); border-radius: var(--r-sm); background: rgba(252, 196, 133, .05); }
.pf-title { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--gold-300); font-weight: 600; margin-bottom: 4px; }

/* ---------- calculadoras ---------- */
.calc-grid { display: grid; grid-template-columns: minmax(320px, 420px) 1fr; gap: 14px; align-items: start; }
.calc-q { grid-column: 1; }
.calc-b { grid-column: 2; }
.calc-s, .calc-p { grid-column: 1 / -1; }
@media (max-width: 1100px) { .calc-grid { grid-template-columns: 1fr; } .calc-q, .calc-b { grid-column: 1; } }
.calc-grid label { display: flex; flex-direction: column; gap: 3px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--label); }
.calc-grid label.chk { flex-direction: row; align-items: center; text-transform: none; letter-spacing: 0; font-size: 12px; color: var(--muted); }
.calc-grid input, .calc-grid select { width: 100%; }
.calc-grid .pf-new select { width: auto; }
.bater-table input, .bater-table select { min-width: 70px; padding: 4px 6px; }
.bater-table input.num { text-align: right; max-width: 120px; }
.bater-table td.bater { font-weight: 700; color: #fff; font-size: 1.05em; }
.sp-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 12px; align-items: end; }
.sp-form .sp-list { grid-column: span 2; }
.sp-go { display: flex; align-items: end; }
.sp-table { margin-top: 12px; }
.sp-table input { max-width: 140px; text-align: right; padding: 3px 6px; }
.sp-table tfoot td { border-top: 1px solid var(--border-strong); }
.sp-actions { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.pl-card { margin-bottom: 12px; background: var(--panel2); }
.pl-card.done { border-color: rgba(92, 195, 160, .5); }
.pl-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pl-head > b { font-size: 15px; }
.pl-prog { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-left: auto; }
.pl-prog .bar { width: 140px; height: 6px; background: rgba(255, 255, 255, .08); border-radius: 3px; overflow: hidden; }
.pl-prog .bar i { display: block; height: 100%; background: var(--buy); }
.pl-acts { display: flex; gap: 6px; }
.pl-sum { display: flex; gap: 22px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin: 8px 0; }
.pl-sum b { color: #fff; font-weight: 600; }
.pl-table tr.ok-row td { color: var(--buy); }
.pl-table tr.ok-row td .badge { color: var(--buy); }

/* ---------- Ferramentas numa tela só ---------- */
.tools-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; align-items: start; }
.tools-grid .tool { grid-column: span 4; min-width: 0; margin: 0; }
.tools-grid .tool-b, .tools-grid .tool-p { grid-column: 1 / -1; }
@media (max-width: 1450px) { .tools-grid .tool-q, .tools-grid .tool-pf { grid-column: span 6; } .tools-grid .tool-s { grid-column: 1 / -1; } }
@media (max-width: 900px) { .tools-grid .tool { grid-column: 1 / -1 !important; } }
.tools-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--label); white-space: normal; line-height: 1.25; min-width: 0; }
.tools-grid label.chk { flex-direction: row; align-items: center; text-transform: none; letter-spacing: 0; font-size: 12px; color: var(--muted); }
.tools-grid input, .tools-grid select { width: 100%; min-width: 0; font-size: 14px; padding: 7px 9px; box-sizing: border-box; }
.tools-grid .pf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.tools-grid .pf-grid + .pf-grid { margin-top: 10px; }
.tools-grid .pf-full { grid-column: 1 / -1; }
.tools-grid .pf-new { display: flex; gap: 6px; align-items: stretch; min-width: 0; }
.tools-grid .pf-new input { flex: 1 1 auto; }
.tools-grid .pf-new select { flex: 0 0 auto; width: auto; }
.tools-grid .pf-new button { flex: 0 0 auto; white-space: nowrap; }
.tools-grid .pf-out { font-size: 14px; margin-top: 12px; }
.tools-grid .pf-row { align-items: baseline; }
.tools-grid .pf-row b { white-space: nowrap; }
.tools-grid .pf-main b { font-size: 1.25em; }
/* bater: tabela com largura mínima e rolagem lateral (nada cortado) */
.tool-b .table-wrap { overflow-x: auto; }
.tool-b .bater-table { min-width: 1080px; font-size: 13px; }
.tool-b .bater-table th { white-space: nowrap; }
.tool-b .bater-table td { white-space: nowrap; padding: 4px 6px; }
.tool-b .bater-table input, .tool-b .bater-table select { max-width: none; font-size: 13.5px; padding: 6px 8px; }
.tool-b .bater-table td:nth-child(1) { min-width: 170px; }
.tool-b .bater-table td:nth-child(2) { min-width: 130px; }
.tool-b .bater-table td:nth-child(3) { min-width: 130px; }
.tool-b .bater-table td:nth-child(4) { min-width: 100px; }
.tool-b .bater-table td:nth-child(5), .tool-b .bater-table td:nth-child(6) { min-width: 80px; }
.tool-b .bater-table td.bater { font-size: 14.5px; }
/* dividir ordem */
.tool-s .sp-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; align-items: end; }
.tool-s .sp-form .sp-list { grid-column: 1 / -1; }
.tool-s .sp-go { grid-column: 1 / -1; }
.tool-s .sp-go button { width: 100%; padding: 9px; }
.tool-s #spPreview { overflow-x: auto; }
.tool-s .sp-table { font-size: 13px; }
.tool-s .sp-table input { max-width: 150px; font-size: 13px; padding: 4px 6px; }
@media (max-width: 1450px) { .tool-s .sp-form { grid-template-columns: repeat(4, minmax(0, 1fr)); } .tool-s .sp-form .sp-list { grid-column: span 2; } }
@media (max-width: 900px) { .tool-s .sp-form { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* planos */
.tool-p .pl-table { font-size: 13px; }
.tool-p .pl-head > b { font-size: 16px; }

/* ---------- bater em blocos (como a planilha) ---------- */
.bt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.bt-block { display: flex; flex-direction: column; gap: 8px; background: var(--panel2); border: 1px solid var(--border); border-top: 3px solid var(--border-strong); border-radius: var(--r-base); padding: 12px 14px; min-width: 0; }
.bt-block.bt-gowd { border-top-color: var(--gold-300); }
.bt-block.bt-stark { border-top-color: var(--mint-300, #A8C7BE); }
.bt-head { display: flex; align-items: center; justify-content: space-between; }
.bt-head b { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
.bt-gowd .bt-head b { color: var(--gold-300); }
.bt-stark .bt-head b { color: var(--mint-300, #A8C7BE); }
.bt-block label { flex-direction: row !important; align-items: center; justify-content: space-between; gap: 10px; }
.bt-block label input { width: 58%; text-align: right; font-variant-numeric: tabular-nums; }
.bt-block label input[data-k="label"] { text-align: left; }
.bt-hint:empty { display: none; }
.bt-hint { font-size: 11.5px; }
.bt-res { margin-top: 4px; padding-top: 10px; border-top: 1px dashed rgba(255, 255, 255, .12); display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 2px 10px; }
.bt-res > span { font-size: 11px; font-weight: 700; letter-spacing: .14em; color: var(--label); }
.bt-res > b { text-align: right; font-size: 21px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.bt-res > small { grid-column: 1 / -1; text-align: right; color: var(--muted); font-size: 11.5px; }
.bt-total { margin-top: 12px; text-align: right; font-size: 14px; color: var(--muted); }
.bt-total b { color: #fff; font-size: 17px; }
.tool-b .head-controls { display: flex; gap: 8px; margin-left: auto; }
.bt-block label { font-size: 11px; letter-spacing: .04em; }
.bt-block label input { width: 46%; }
.bt-res { grid-template-columns: 1fr; }
.bt-res > b { white-space: nowrap; font-size: clamp(18px, 1.5vw, 23px); }

/* cotação para o cliente */
.q-main { margin: 10px 0 6px; padding: 12px 14px; border: 1px solid rgba(252, 196, 133, .4); border-radius: var(--r-base); background: rgba(252, 196, 133, .06); display: grid; gap: 2px; }
.q-main > span { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-300); }
.q-main > b { font-size: clamp(26px, 2.4vw, 34px); font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.q-main > small { color: var(--muted); font-size: 12px; }
.q-check { margin-top: 10px; }
.tool-q .pf-new input { min-width: 0; }

/* cotação ao vivo: pisca quando muda */
.q-val { display: inline-flex; align-items: baseline; gap: 8px; border-radius: 6px; padding: 0 4px; margin-left: -4px; }
.q-val.up { animation: qUp 1.2s ease-out; }
.q-val.down { animation: qDown 1.2s ease-out; }
.q-arrow { font-style: normal; font-size: .5em; }
.q-val.up .q-arrow { color: var(--buy); }
.q-val.down .q-arrow { color: var(--sell); }
@keyframes qUp { from { background: rgba(92, 195, 160, .35); } to { background: transparent; } }
@keyframes qDown { from { background: rgba(232, 128, 110, .35); } to { background: transparent; } }

/* cotação a mercado na Foxbit */
.q-fox { margin-top: 12px; padding-top: 10px; border-top: 1px dashed rgba(255, 255, 255, .12); }
.q-fox .pf-title { margin-bottom: 4px; }
.q-main.q-main-fox { border-color: rgba(168, 199, 190, .45); background: rgba(168, 199, 190, .06); }
.q-main.q-main-fox > span { color: var(--mint-300, #A8C7BE); }
.q-main.q-main-fox > b { font-size: clamp(22px, 2vw, 28px); }
.q-warn { font-size: 12px; margin: 4px 0; }

/* gravação do book */
.rec-card { margin-bottom: 14px; }
.rec-card .card-head { gap: 10px; }
.rec-dot { color: var(--sell); font-weight: 700; animation: recBlink 1.4s infinite; }
@keyframes recBlink { 50% { opacity: .35; } }
.rec-live { display: flex; flex-wrap: wrap; gap: 18px; font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.rec-live:empty { display: none; }
.rec-live b { color: #fff; }
#recToggle.danger { border-color: var(--sell); color: var(--sell); background: rgba(232, 128, 110, .1); }
#recTable tr.rec-active td { background: rgba(232, 128, 110, .05); }
a.btn-link { display: inline-block; padding: 2px 7px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); color: var(--text); text-decoration: none; font-size: 10.5px; margin-right: 4px; }
a.btn-link:hover { border-color: var(--mint-300); }

.tools-grid label.chk-line { flex-direction: row !important; align-items: center; gap: 10px; text-transform: none; letter-spacing: 0; font-size: 12.5px; color: var(--text); }
.tools-grid label.chk-line > span { display: flex; align-items: center; gap: 6px; flex: 1 1 auto; }
.tools-grid label.chk-line > span input { width: auto; }
.tools-grid label.chk-line > input { width: 170px; flex: 0 0 170px; }

/* ordens manuais */
.man-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 12px; align-items: end; margin-bottom: 12px; }
.man-form label { display: flex; flex-direction: column; gap: 4px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--label); }
.man-form input, .man-form select { width: 100%; }
.man-form .man-note { grid-column: span 2; }
.man-actions { display: flex; gap: 8px; }
.man-import { margin-bottom: 12px; }
.man-import code { background: var(--panel2); padding: 1px 5px; border-radius: 4px; }
.man-import-row { display: grid; grid-template-columns: 160px 1fr auto; gap: 10px; align-items: end; margin: 8px 0; }
.man-import-row textarea { width: 100%; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
@media (max-width: 800px) { .man-import-row { grid-template-columns: 1fr; } .man-form .man-note { grid-column: auto; } }

/* tela de vincular: ordenação e filtros */
.pick-tools { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; padding: 10px 0 12px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.pick-tools label { display: flex; flex-direction: column; gap: 3px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--label); }
.pick-tools label.grow { flex: 1 1 180px; }
.pick-tools input:not([type=search]) { width: 110px; }
.pick-tools #otcManWdOpen { margin-left: auto; }
.pick-manwd { padding: 10px 12px; background: var(--panel2); border: 1px solid var(--border); border-radius: var(--r-sm); margin-bottom: 10px; }

/* bots de alerta */
.bots-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 4px 0 14px; flex-wrap: wrap; }
.bots-head h2 { margin: 0 0 4px; font-size: 18px; }
.bots-list { display: grid; gap: 14px; }
.bot-card.off { opacity: .75; }
.bot-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.bot-head h3 { display: inline; margin-right: 8px; }
.bot-head .chip { font-size: 10.5px; padding: 1px 7px; border: 1px solid var(--border-strong); border-radius: 999px; color: var(--label); }
.bot-switch { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 6px; border-radius: 999px; border: 1px solid var(--border-strong); background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; }
.bot-switch span { width: 30px; height: 16px; border-radius: 999px; background: rgba(255,255,255,.15); position: relative; transition: background .15s; }
.bot-switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: left .15s; }
.bot-switch.on { color: var(--buy); border-color: var(--buy); }
.bot-switch.on span { background: var(--buy); }
.bot-switch.on span::after { left: 16px; }
.bot-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.bot-stats > div { background: var(--panel2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.bot-stats b { font-size: 22px; font-weight: 500; }
.bot-stats small { color: var(--muted); font-size: 11px; }
.bot-rules, .bot-near { margin: 8px 0; font-size: 13px; }
.bot-rules ol { margin: 6px 0 6px 18px; padding: 0; }
.bot-open { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; margin: 10px 0 14px; }
.bot-idle { padding: 14px; border: 1px dashed var(--border-strong); border-radius: var(--r-sm); text-align: center; }
.bot-alert { border: 1px solid var(--buy); border-radius: var(--r-md, 10px); padding: 12px 14px; background: rgba(92,195,160,.07); display: flex; flex-direction: column; gap: 6px; animation: botIn .4s ease-out; }
.bot-alert.done.varrido { border-color: var(--buy); background: rgba(92,195,160,.12); }
.bot-alert.done.retirado { border-color: var(--sell); background: rgba(232,128,110,.14); }
.bot-alert.done.retirado .ba-out { animation: recBlink 1s infinite; font-weight: 700; }
.bot-alert.done.expirado { border-color: #FCC485; background: rgba(252,196,133,.08); }
@keyframes botIn { from { transform: scale(.97); box-shadow: 0 0 0 4px rgba(92,195,160,.35); } to { transform: none; box-shadow: none; } }
.ba-top { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.ba-timer { color: var(--muted); font-variant-numeric: tabular-nums; }
.ba-main { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.ba-px { font-size: 28px; font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; }
.ba-order { font-size: 14px; }
.ba-order .id-mini { font-size: 16px; font-weight: 700; color: var(--buy); }
.ba-meta { font-size: 12px; }
.bot-sub { display: flex; align-items: center; gap: 10px; margin: 6px 0; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--label); }
.bot-hist td, .bot-hist th { white-space: nowrap; }
.bot-toasts { position: fixed; top: 64px; right: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: 380px; }
.bot-toast { cursor: pointer; padding: 10px 14px; border-radius: var(--r-sm); background: var(--panel); border: 1px solid var(--buy); box-shadow: 0 8px 24px rgba(0,0,0,.45); display: flex; flex-direction: column; gap: 3px; font-size: 13px; animation: botIn .3s ease-out; }
.bot-toast b { font-size: 14px; }
.bot-toast.retirado { border-color: var(--sell); background: #3a1f1b; }
.bot-toast.expirado { border-color: #FCC485; }
@media (max-width: 900px) { .bot-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.bot-vol { display: inline-flex !important; flex-direction: row !important; align-items: center; gap: 6px; }
.bot-vol input { width: 110px; }
.bot-vol span { min-width: 34px; font-variant-numeric: tabular-nums; color: var(--muted); }
.bots-head .head-controls { flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.bot-popup { position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; }
.bot-popup-box { min-width: 340px; max-width: 92vw; padding: 22px 26px; border-radius: var(--r-xl); background: var(--panel); border: 2px solid var(--buy); box-shadow: 0 20px 60px rgba(0,0,0,.6); display: flex; flex-direction: column; gap: 8px; animation: botIn .25s ease-out; }
.bot-popup-box.retirado { border-color: var(--sell); background: #3a1f1b; }
.bot-popup-box.expirado { border-color: #FCC485; }
.bp-lbl { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--label); }
.bp-px { font-size: 46px; font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; line-height: 1.1; }
.bp-line { font-size: 15px; }
.bp-order { font-size: 18px; }
.bp-order .id-mini { font-size: 22px; font-weight: 700; color: var(--buy); }
.bp-out { font-size: 26px; font-weight: 700; }
.bot-popup-box.retirado .bp-out { color: var(--sell); animation: recBlink 1s infinite; }
.bot-popup-box.varrido .bp-out { color: var(--buy); }
.bot-popup-box.expirado .bp-out { color: #FCC485; }
.bp-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }

.id-dbl { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px; color: var(--muted); cursor: copy; border-bottom: 1px dashed var(--border-strong); user-select: all; }
.id-dbl:hover { color: var(--text); }
.id-dbl.copied { color: var(--buy); border-bottom-color: var(--buy); }
.id-dbl.copied::after { content: " copiado"; font-family: inherit; font-size: 10px; }

/* notícias */
.news-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 10px; }
.news-head h2 { margin: 0; font-size: 18px; }
.news-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.news-presets button.active { border-color: var(--mint-300, var(--buy)); color: var(--buy); }
.news-filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; margin-bottom: 12px; }
.news-filters label { display: flex; flex-direction: column; gap: 4px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--label); }
.news-filters label.grow { flex: 1 1 260px; }
.news-filters label.chk { flex-direction: row; align-items: center; text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--text); }
.news-body { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 12px; align-items: start; }
.news-facets { position: sticky; top: 60px; max-height: calc(100vh - 80px); overflow: auto; font-size: 12px; }
.nw-fsum { margin-bottom: 8px; }
.nw-fgroup { margin-bottom: 10px; }
.nw-fgroup .lbl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--label); margin-bottom: 4px; }
.nw-fclear { cursor: pointer; color: var(--buy); text-transform: none; letter-spacing: 0; margin-left: 6px; }
.nw-fchips { display: flex; flex-wrap: wrap; gap: 4px; }
.nw-fchip { cursor: pointer; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--text); }
.nw-fchip small { color: var(--muted); }
.nw-fchip.on { background: rgba(92,195,160,.15); border-color: var(--buy); color: var(--buy); }
.news-list { display: flex; flex-direction: column; max-width: 1040px; }
.nw-hour { position: sticky; top: 52px; z-index: 2; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--label); padding: 10px 0 6px; background: var(--bg, #0b1513); border-bottom: 1px solid var(--border); margin-bottom: 2px; }
.nw-item { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 14px; padding: 12px 12px 12px 14px; border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent; transition: background .15s; }
.nw-item:hover { background: rgba(255,255,255,.025); }
.nw-item.imp3 { border-left-color: rgba(92,195,160,.35); }
.nw-item.imp4 { border-left-color: #FCC485; }
.nw-item.imp5 { border-left-color: #F2A65A; background: rgba(252,196,133,.04); }
.nw-item.urg { border-left-color: var(--sell); background: rgba(232,128,110,.07); }
.nw-item.fresh { animation: nwFresh 2.5s ease-out; }
@keyframes nwFresh { from { background: rgba(92,195,160,.18); } to { background: transparent; } }
.nw-time { display: flex; flex-direction: column; font-variant-numeric: tabular-nums; padding-top: 1px; }
.nw-time b { font-size: 13px; font-weight: 600; color: var(--text); }
.nw-time small { color: var(--muted); font-size: 11px; }
.nw-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.nw-title { font-size: 15px; line-height: 1.4; color: #fff; font-weight: 500; cursor: pointer; max-width: 78ch; }
.nw-item.imp4 .nw-title, .nw-item.imp5 .nw-title, .nw-item.urg .nw-title { font-weight: 650; }
.nw-item.imp1 .nw-title, .nw-item.imp2 .nw-title, .nw-item.imp0 .nw-title { color: rgba(255,255,255,.72); font-weight: 400; }
.nw-lead { font-size: 13.5px; line-height: 1.5; color: var(--muted); margin-top: 3px; max-width: 86ch; cursor: pointer;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nw-item.open .nw-lead { -webkit-line-clamp: unset; display: block; }
.nw-urg { font-size: 10px; font-weight: 700; color: #fff; background: var(--sell); padding: 1px 6px; border-radius: 3px; letter-spacing: .08em; align-self: center; }
.nw-impact { font-size: 11px; padding: 0 7px; border-radius: 999px; border: 1px solid; white-space: nowrap; align-self: center; }
.nw-up { color: var(--sell); border-color: rgba(232,128,110,.6); }
.nw-down { color: var(--buy); border-color: rgba(92,195,160,.6); }
.nw-neu { color: var(--muted); border-color: var(--border-strong); }
.nw-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin-top: 6px; font-size: 11.5px; color: var(--muted); }
.nw-m { cursor: pointer; }
.nw-m:hover { color: var(--text); text-decoration: underline; }
.nw-m.src { color: var(--text); font-weight: 600; }
.nw-m.dim { opacity: .75; }
.nw-m.tk { color: #9ec3ff; font-family: ui-monospace, Menlo, Consolas, monospace; }
.nw-sep { opacity: .4; }
.nw-imp { letter-spacing: -1px; color: #FCC485; font-size: 9px; margin-right: 4px; }
.nw-imp i { font-style: normal; color: rgba(255,255,255,.12); }
.nw-origbtn { cursor: pointer; color: var(--muted); }
.nw-orig { font-size: 12.5px; color: var(--muted); margin-top: 6px; padding: 6px 10px; border-left: 2px solid var(--border-strong); max-width: 86ch; }
.nw-link { color: var(--muted); }
.nw-vsep { width: 1px; height: 20px; background: var(--border-strong); margin: 0 4px; align-self: center; }
/* compacto: uma linha por notícia */
.news-list.compact .nw-item { grid-template-columns: 46px minmax(0, 1fr); padding: 6px 10px; gap: 10px; }
.news-list.compact .nw-time small, .news-list.compact .nw-lead, .news-list.compact .nw-orig { display: none; }
.news-list.compact .nw-content { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.news-list.compact .nw-head { flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; }
.news-list.compact .nw-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13.5px; max-width: none; }
.news-list.compact .nw-item.open .nw-title { white-space: normal; }
.news-list.compact .nw-meta { margin-top: 0; flex: 0 0 auto; flex-wrap: nowrap; max-width: 40%; overflow: hidden; }
.news-more { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 12px 0; }
.news-newpill { position: sticky; top: 60px; z-index: 5; cursor: pointer; text-align: center; padding: 6px; border-radius: 999px; background: var(--buy); color: #0b1f1a; font-weight: 600; margin-bottom: 6px; }
.news-alerts { margin-top: 14px; }
.news-alerts summary { cursor: pointer; font-weight: 600; }
.news-alert-cfg { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin: 10px 0; }
.news-hook .kv-grid { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 6px 12px; font-size: 13px; margin-bottom: 10px; }
.nw-ex { white-space: pre-wrap; word-break: break-all; background: var(--panel2); padding: 10px; border-radius: var(--r-sm); font-size: 12px; cursor: copy; }
.nw-empty { padding: 30px; text-align: center; border: 1px dashed var(--border-strong); border-radius: var(--r-md); }
.bot-toast.news b { font-weight: 500; font-size: 13px; }
@media (max-width: 1000px) { .news-body { grid-template-columns: 1fr; } .news-facets { position: static; max-height: none; } }
.news-list.compact .nw-item:not(.open) .nw-m:not(.src):not(.tk), .news-list.compact .nw-item:not(.open) .nw-sep,
.news-list.compact .nw-item:not(.open) .nw-origbtn, .news-list.compact .nw-item:not(.open) .nw-link { display: none; }
.news-list.compact .nw-meta { white-space: nowrap; gap: 6px; max-width: 34%; }
.news-list.compact .nw-item.open .nw-content { flex-direction: column; align-items: stretch; gap: 4px; }
.news-list.compact .nw-item.open .nw-meta { flex-wrap: wrap; max-width: none; white-space: normal; }
.news-list.compact .nw-item.open .nw-lead { display: block; -webkit-line-clamp: unset; }

/* notícias: fatos agrupados, quem deu primeiro, feedback */
.nw-more-src { cursor: pointer; font-size: 11px; padding: 0 7px; border-radius: 999px; background: rgba(158,195,255,.12); color: #9ec3ff; white-space: nowrap; align-self: center; }
.nw-more-src:hover { background: rgba(158,195,255,.22); }
.nw-first { color: var(--muted); }
.nw-vers { margin-top: 8px; padding: 8px 10px; border-left: 2px solid rgba(158,195,255,.35); background: rgba(158,195,255,.04); border-radius: 0 6px 6px 0; max-width: 86ch; }
.nw-vers-h { font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }
.nw-ver { display: grid; grid-template-columns: 64px 74px 130px minmax(0, 1fr) 16px; gap: 8px; font-size: 12px; padding: 2px 0; align-items: baseline; }
.nw-ver.main b { color: #9ec3ff; }
.nw-ver-t { font-variant-numeric: tabular-nums; color: var(--muted); }
.nw-ver-lag { font-variant-numeric: tabular-nums; color: #FCC485; }
.nw-ver-x { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nw-flag { cursor: pointer; color: var(--muted); opacity: .55; }
.nw-item:hover .nw-flag { opacity: 1; }
.nw-flag:hover { color: #FCC485; }
.nw-flag.on { color: #FCC485; opacity: 1; }
.news-list.compact .nw-item:not(.open) .nw-flag, .news-list.compact .nw-item:not(.open) .nw-first { display: none; }
.nw-speed { width: 100%; font-size: 11.5px; border-collapse: collapse; }
.nw-speed td { padding: 2px 4px 2px 0; }
.nw-speed td:nth-child(2), .nw-speed td:nth-child(3) { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nw-speed small { color: var(--muted); }
.nw-fb { width: min(640px, 94vw); }
.nw-fb h3 { margin: 0 0 6px; }
.nw-fb-text { font-size: 13.5px; color: var(--muted); margin-bottom: 10px; }
.nw-fb-fields { display: flex; flex-direction: column; gap: 6px; }
.nw-fb-row { display: grid; grid-template-columns: 18px 130px 150px minmax(0, 1fr); gap: 8px; align-items: center; font-size: 13px; }
.nw-fb-cur { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nw-fb-in select, .nw-fb-in input { width: 100%; }
.nw-fb-c { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; font-size: 12px; }
.nw-fb-c textarea { width: 100%; }
.nw-fb-act { display: flex; gap: 8px; justify-content: flex-end; align-items: center; margin-top: 12px; }
.nw-fb-act #nwFbMsg { margin-right: auto; }
.nw-fbcfg { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.nw-fbcfg input { flex: 1 1 220px; }

.nw-usdt { font-size: 10.5px; font-weight: 700; padding: 0 6px; border-radius: 4px; color: #26A17B; border: 1px solid rgba(38,161,123,.6); align-self: center; letter-spacing: .04em; }
.nw-usdt-f { cursor: pointer; color: #26A17B; }

/* ===== notícias: cards de leitura ===== */
.nw-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.nw-stat { padding: 10px 14px; border-radius: var(--r-lg); background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.01)); border: 1px solid var(--border); display: flex; align-items: baseline; gap: 10px; }
.nw-stat[data-stat] { cursor: pointer; transition: border-color .15s, transform .15s; }
.nw-stat[data-stat]:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.nw-stat b { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; color: #fff; }
.nw-stat span { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--label); }
.nw-stat.urg b { color: var(--sell); } .nw-stat.dol b { color: #FCC485; } .nw-stat.usdt b { color: #26A17B; }
.news-list { gap: 10px; max-width: 1000px; }
.nw-hour { display: flex; align-items: center; gap: 10px; border: 0; padding: 8px 0 2px; margin: 0; }
.nw-hour::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border-strong), transparent); }
.nw-card { position: relative; padding: 14px 16px 12px 18px; border-radius: 12px; background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.012));
  border: 1px solid var(--border); box-shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 6px 18px rgba(0,0,0,.18); transition: border-color .15s, transform .15s, box-shadow .15s; overflow: hidden; }
.nw-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: transparent; }
.nw-card.imp3::before { background: rgba(92,195,160,.45); }
.nw-card.imp4::before { background: #FCC485; }
.nw-card.imp5::before { background: linear-gradient(180deg, #F2A65A, #E8806E); }
.nw-card.urg { border-color: rgba(232,128,110,.45); background: linear-gradient(180deg, rgba(232,128,110,.10), rgba(232,128,110,.03)); }
.nw-card.urg::before { background: var(--sell); }
.nw-card.has-url { cursor: pointer; }
.nw-card:hover { border-color: var(--border-strong); transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 10px 26px rgba(0,0,0,.28); }
.nw-card.fresh { animation: nwFreshCard 3s ease-out; }
@keyframes nwFreshCard { 0% { box-shadow: 0 0 0 2px rgba(92,195,160,.7); } 100% { box-shadow: 0 6px 18px rgba(0,0,0,.18); } }
.nw-card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.nw-av { --h: 160; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  font-size: 10.5px; font-weight: 700; color: hsl(var(--h) 70% 85%); background: hsl(var(--h) 45% 24%); border: 1px solid hsl(var(--h) 45% 34%); }
.nw-av.sm { width: 20px; height: 20px; font-size: 8.5px; }
.nw-src { font-weight: 650; color: #fff; cursor: pointer; }
.nw-src:hover { text-decoration: underline; }
.nw-fonte { color: var(--muted); padding: 0 6px; border-radius: 4px; background: rgba(255,255,255,.05); font-size: 11px; }
.nw-when { color: var(--muted); font-variant-numeric: tabular-nums; }
.nw-spacer { flex: 1 1 auto; }
.nw-go { color: var(--muted); opacity: 0; transition: opacity .15s, transform .15s; font-size: 14px; }
.nw-card:hover .nw-go { opacity: 1; transform: translate(1px, -1px); color: var(--buy); }
.nw-meter { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; }
.nw-meter i { width: 3px; border-radius: 1px; background: rgba(255,255,255,.12); }
.nw-meter i:nth-child(1) { height: 5px; } .nw-meter i:nth-child(2) { height: 7px; } .nw-meter i:nth-child(3) { height: 9px; }
.nw-meter i:nth-child(4) { height: 11px; } .nw-meter i:nth-child(5) { height: 12px; }
.nw-meter i.on { background: #5CC3A0; }
.nw-meter.m4 i.on { background: #FCC485; } .nw-meter.m5 i.on { background: #E8806E; }
.nw-card .nw-urg { border-radius: 999px; padding: 1px 8px; font-size: 10px; }
.nw-card .nw-impact { font-size: 11px; padding: 1px 8px; border: 0; }
.nw-card .nw-up { background: rgba(232,128,110,.14); color: #F0A090; }
.nw-card .nw-down { background: rgba(92,195,160,.14); color: #7FD6B6; }
.nw-card .nw-neu { background: rgba(255,255,255,.06); }
.nw-card .nw-usdt { border-radius: 999px; padding: 1px 8px; background: rgba(38,161,123,.14); border: 0; }
.nw-card .nw-title { display: block; margin: 9px 0 0; font-size: 16.5px; line-height: 1.38; letter-spacing: -.005em; color: #fff; font-weight: 600; max-width: 76ch; cursor: inherit; }
.nw-card.imp1 .nw-title, .nw-card.imp2 .nw-title, .nw-card.imp0 .nw-title { color: rgba(255,255,255,.78); font-weight: 500; font-size: 15.5px; }
.nw-card .nw-lead { margin: 6px 0 0; font-size: 14px; line-height: 1.55; color: rgba(255,255,255,.62); max-width: 80ch;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; cursor: inherit; }
.nw-card.open .nw-lead { -webkit-line-clamp: unset; display: block; }
.nw-more { display: inline-block; margin-top: 2px; font-size: 12px; color: var(--buy); cursor: pointer; }
.nw-card .nw-orig { margin-top: 8px; padding: 8px 12px; border-radius: 8px; background: rgba(255,255,255,.04); border: 0; font-size: 13px; color: rgba(255,255,255,.7); }
.nw-card .nw-orig .lbl { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--label); margin-bottom: 2px; }
.nw-card-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; font-size: 11.5px; }
.nw-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.nw-tag { padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.06); color: rgba(255,255,255,.75); cursor: pointer; transition: background .15s; }
.nw-tag:hover { background: rgba(255,255,255,.12); color: #fff; }
.nw-tag.soft { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.nw-tag.geo { background: rgba(158,195,255,.10); color: #b9d3ff; }
.nw-tag.tk { background: rgba(252,196,133,.10); color: #FCC485; font-family: ui-monospace, Menlo, Consolas, monospace; }
.nw-stack { display: inline-flex; align-items: center; gap: 0; padding: 1px 8px 1px 2px; border-radius: 999px; border: 1px solid rgba(158,195,255,.3);
  background: rgba(158,195,255,.08); color: #b9d3ff; font-size: 11.5px; cursor: pointer; }
.nw-stack .nw-av { margin-right: -6px; border-color: var(--panel); box-shadow: 0 0 0 1px var(--panel); }
.nw-stack span { margin-left: 10px; }
.nw-stack:hover { background: rgba(158,195,255,.16); }
.nw-card .nw-first { color: var(--muted); }
.nw-card .nw-first b { color: rgba(255,255,255,.85); font-weight: 600; }
.nw-act { color: var(--muted); cursor: pointer; padding: 2px 6px; border-radius: 6px; opacity: .7; }
.nw-act:hover { background: rgba(255,255,255,.07); color: #fff; opacity: 1; }
.nw-card .nw-flag.on { color: #FCC485; opacity: 1; }
.nw-card .nw-vers { margin-top: 10px; padding: 8px; border: 0; border-radius: 10px; background: rgba(0,0,0,.18); max-width: none; }
.nw-card .nw-vers-h { padding: 0 6px 6px; }
.nw-card .nw-ver { display: grid; grid-template-columns: 20px 130px 70px minmax(0, 1fr) 64px; gap: 8px; align-items: center; padding: 5px 6px; border-radius: 6px; color: inherit; text-decoration: none; }
.nw-card .nw-ver[href]:hover { background: rgba(255,255,255,.05); }
.nw-card .nw-ver b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nw-card .nw-ver-lag.first { color: var(--buy); font-weight: 700; }
.nw-card .nw-ver-t { text-align: right; }
/* compacto: uma linha por notícia */
.news-list.compact { gap: 4px; }
.news-list.compact .nw-card { display: flex; align-items: center; gap: 10px; padding: 7px 12px 7px 14px; border-radius: 8px; box-shadow: none; }
.news-list.compact .nw-card:hover { transform: none; }
.news-list.compact .nw-card-top { display: contents; }
.news-list.compact .nw-when { order: 0; min-width: 44px; }
.news-list.compact .nw-when [data-ago], .news-list.compact .nw-fonte, .news-list.compact .nw-spacer, .news-list.compact .nw-lead,
.news-list.compact .nw-more, .news-list.compact .nw-card-foot, .news-list.compact .nw-orig, .news-list.compact .nw-vers, .news-list.compact .nw-go { display: none; }
.news-list.compact .nw-av { order: 1; width: 20px; height: 20px; font-size: 8.5px; }
.news-list.compact .nw-title { order: 2; flex: 1 1 auto; min-width: 0; margin: 0; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: none; }
.news-list.compact .nw-urg, .news-list.compact .nw-usdt, .news-list.compact .nw-impact { order: 3; }
.news-list.compact .nw-meter { order: 4; }
.news-list.compact .nw-src { order: 5; min-width: 90px; text-align: right; color: var(--muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
@media (max-width: 900px) { .nw-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .nw-card .nw-ver { grid-template-columns: 20px 1fr 60px; } .nw-card .nw-ver-x, .nw-card .nw-ver-t { display: none; } }

.nw-av { position: relative; overflow: hidden; }
.nw-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; background: #fff; opacity: 0; transition: opacity .25s; }
.nw-av.has-logo img { opacity: 1; }
.nw-av.has-logo { color: transparent; border-color: rgba(255,255,255,.18); }

/* ===== Solicitações (RFQ) ===== */
.tab-n { margin-left: 6px; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--sell); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 16px; display: inline-block; text-align: center; animation: recBlink 1.6s infinite; }
.rq-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 12px; }
.rq-head h2 { margin: 0 0 2px; font-size: 18px; }
.rq-head .head-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.rq-head input[type=search] { width: 220px; }
.rq-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.rq-stat { padding: 10px 14px; border-radius: var(--r-lg); background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.01)); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.rq-stat b { font-size: 22px; font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; }
.rq-stat b small { font-size: 12px; color: var(--muted); font-weight: 500; }
.rq-stat span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--label); }
.rq-stat.warn b { color: #FCC485; } .rq-stat.info b { color: #9ec3ff; } .rq-stat.ok b { color: var(--buy); }
.rq-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: start; }
.rq-col { background: rgba(255,255,255,.02); border: 1px solid var(--border); border-radius: 12px; min-height: 120px; }
.rq-col header { display: flex; align-items: baseline; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); position: sticky; top: 52px; background: var(--panel); border-radius: 12px 12px 0 0; z-index: 2; }
.rq-col header small { color: var(--muted); font-size: 11px; margin-left: auto; }
.rq-n { font-size: 11px; padding: 0 7px; border-radius: 999px; background: rgba(255,255,255,.08); }
.rq-col-pedido header b { color: #FCC485; } .rq-col-negociacao header b { color: #9ec3ff; } .rq-col-fechado header b { color: var(--buy); } .rq-col-encerrado header b { color: var(--muted); }
.rq-cards { display: flex; flex-direction: column; gap: 8px; padding: 8px; max-height: calc(100vh - 260px); overflow: auto; }
.rq-empty { text-align: center; color: var(--muted); padding: 18px; }
.rq-card { position: relative; padding: 10px 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--border); cursor: pointer; transition: border-color .15s, transform .15s; overflow: hidden; }
.rq-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--border-strong); }
.rq-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.rq-card.st-new::before { background: #FCC485; } .rq-card.st-quote::before { background: #9ec3ff; } .rq-card.st-counter::before { background: #E8806E; }
.rq-card.st-closed::before, .rq-card.st-done::before { background: var(--buy); }
.rq-card.st-off { opacity: .62; }
.rq-card.st-new { background: linear-gradient(180deg, rgba(252,196,133,.08), var(--panel)); }
.rq-card.fresh { animation: nwFreshCard 2.5s ease-out; }
.rq-top { display: flex; align-items: center; gap: 8px; }
.rq-who { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.rq-who b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rq-who small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rq-st { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 1px 8px; border-radius: 999px; background: rgba(255,255,255,.07); white-space: nowrap; }
.st-new .rq-st { background: rgba(252,196,133,.16); color: #FCC485; } .st-quote .rq-st { background: rgba(158,195,255,.14); color: #b9d3ff; }
.st-counter .rq-st { background: rgba(232,128,110,.16); color: #F0A090; } .st-closed .rq-st, .st-done .rq-st { background: rgba(92,195,160,.16); color: #7FD6B6; }
.rq-mid { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: 8px; }
.rq-amt { font-size: 20px; font-weight: 650; color: #fff; display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.rq-liq { font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--border-strong); color: var(--muted); }
.rq-rate { display: flex; flex-direction: column; align-items: flex-end; }
.rq-rate b { font-size: 20px; font-variant-numeric: tabular-nums; color: #fff; }
.rq-rate small { font-size: 11px; }
.rq-rate small.up { color: #F0A090; } .rq-rate small.down { color: #7FD6B6; }
.rq-rate s { color: var(--muted); margin-left: 4px; }
.rq-cp { color: #F0A090; }
.rq-copy { cursor: copy; }
.rq-copy.copied { color: var(--buy) !important; }
.rq-brl { font-size: 12px; color: var(--muted); margin-top: 2px; text-align: right; font-variant-numeric: tabular-nums; }
.rq-msg { font-size: 12.5px; color: rgba(255,255,255,.7); margin-top: 6px; font-style: italic; }
.rq-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; font-size: 11px; color: var(--muted); }
.rq-foot b { color: rgba(255,255,255,.85); }
.rq-sp { flex: 1; }
.rq-id { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 10px; opacity: .6; }
.rq-timer { font-variant-numeric: tabular-nums; padding: 0 6px; border-radius: 4px; background: rgba(255,255,255,.06); color: #fff; }
.rq-timer.warn { background: rgba(252,196,133,.2); color: #FCC485; }
.rq-timer.late { background: rgba(232,128,110,.25); color: #F0A090; animation: recBlink 1.2s infinite; }
.rq-hist { margin-top: 8px; padding: 6px; border-radius: 8px; background: rgba(0,0,0,.2); font-size: 11.5px; }
.rq-ev { display: grid; grid-template-columns: 62px 92px 1fr; gap: 6px; padding: 2px 4px; align-items: baseline; }
.rq-ev b { text-transform: uppercase; font-size: 10px; letter-spacing: .05em; color: #b9d3ff; }
.rq-ev-a { color: rgba(255,255,255,.8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rq-ev-t { grid-column: 2 / 4; color: var(--muted); font-style: italic; }
.rq-ev-x { grid-column: 3; text-align: right; font-variant-numeric: tabular-nums; color: #fff; }
.rq-cfg { margin-bottom: 12px; }
.rq-cfg-row { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin-bottom: 10px; }
.rq-cfg-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 14px; }
.rq-cfg-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.rq-cfg-sel { display: flex; gap: 6px; } .rq-cfg-sel select { flex: 1; }
.rq-cfg-h { margin: 14px 0 6px; font-weight: 600; }
.rq-cfg-clients { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.rq-cfg-cl { display: flex; gap: 6px; align-items: center; }
.rq-cfg-cl input { width: 280px; }
.bot-toast.rfq { border-color: #FCC485; }
.bot-toast.rfq.fechado, .bot-toast.rfq.confirmado { border-color: var(--buy); }
.bot-toast.rfq.off { border-color: var(--border-strong); }
@media (max-width: 1200px) { .rq-board { grid-template-columns: repeat(2, minmax(0, 1fr)); } .rq-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .rq-board { grid-template-columns: 1fr; } .rq-cfg-grid { grid-template-columns: 1fr; } }

#rqMute.on { border-color: #FCC485; color: #FCC485; }

.rq-del { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; padding: 2px 5px; border-radius: 5px; opacity: 0; transition: opacity .15s; }
.rq-card:hover .rq-del { opacity: .7; }
.rq-del:hover { opacity: 1 !important; color: var(--sell); background: rgba(232,128,110,.12); }

.rq-bn { color: var(--muted); font-size: 11px; }
.rq-bn b { color: #FCC485; font-weight: 600; }
.rq-ev-x small { color: #FCC485; }
.rq-stats { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.rq-export { padding: 4px 10px; font-size: 12px; }
@media (max-width: 1200px) { .rq-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.rq-rate .rq-bn { white-space: nowrap; }
.rq-rate .rq-bn b { font-size: 11px; color: #FCC485; }

.rq-ref { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; padding: 1px 6px; border-radius: 4px; background: rgba(158,195,255,.16); color: #b9d3ff; }
.rq-ref-t { font-size: 14px; font-weight: 500; color: rgba(255,255,255,.75); }
.rq-link { font-size: 11.5px; color: #b9d3ff; margin-top: 4px; cursor: pointer; }
.rq-link a { cursor: pointer; text-decoration: underline; }
.rq-link b { color: #fff; }
.rq-stats { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)) !important; }

/* cards não encolhem quando a coluna enche (a coluna rola) */
.rq-card { flex-shrink: 0; }
.rq-cards { scrollbar-width: thin; }
/* fechados/encerrados: versão enxuta */
.rq-card.compact { padding: 7px 10px 7px 12px; }
.rq-card.compact .nw-av, .rq-card.compact .avatar { width: 22px; height: 22px; font-size: 9.5px; }
.rq-card.compact .rq-who b { font-size: 12.5px; }
.rq-card.compact .rq-who small { font-size: 10.5px; }
.rq-card.compact .rq-mid { margin-top: 4px; align-items: center; }
.rq-card.compact .rq-amt { font-size: 15px; }
.rq-card.compact .rq-rate { flex-direction: row; align-items: baseline; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.rq-card.compact .rq-rate b { font-size: 15px; }
.rq-card.compact .rq-rate small.up, .rq-card.compact .rq-rate small.down, .rq-card.compact .rq-cp { display: none; }
.rq-card.compact .rq-msg, .rq-card.compact .rq-brl, .rq-card.compact .rq-link { display: none; }
.rq-card.compact .rq-foot { margin-top: 4px; font-size: 10.5px; }
.rq-card.compact .rq-ref-t { font-size: 12px; }

.rq-was { font-size: 12px; font-weight: 500; color: var(--muted); }
.rq-brl b { color: rgba(255,255,255,.9); font-weight: 600; }
.rq-ev .rq-ev-v { color: #fff; font-style: normal; text-transform: none; font-size: 11.5px; letter-spacing: 0; }

.rq-amt-v { cursor: copy; border-radius: 4px; transition: color .15s, background .15s; }
.rq-amt-v:hover { background: rgba(255,255,255,.06); }
.rq-amt-v.copied { color: var(--buy); }

.ord-table .ord-of { display: block; font-size: 10.5px; color: var(--muted); font-weight: 400; }

.exec-last { display: block; font-size: 10.5px; }
#otcUnlinked .ord-of { display: block; font-size: 10.5px; color: var(--muted); }

/* tesouraria */
.tes-form { grid-template-columns: 160px 1fr 1.4fr auto; }
.tes-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-top: 12px; background: rgba(255,255,255,.015); }
.tes-card header { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.tes-card header b { font-size: 14px; }
.tes-b { background: rgba(158,195,255,.14); color: #b9d3ff; }
.tes-res { margin-left: auto; font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; }
.tes-note { margin-top: 4px; font-size: 12px; }
.tes-stats { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 0; font-size: 12.5px; color: var(--muted); align-items: center; }
.tes-stats b { color: var(--text); font-variant-numeric: tabular-nums; }
.tes-actions { display: flex; gap: 8px; margin-top: 10px; }
.tes-pick { margin-top: 10px; padding: 10px; border-radius: 10px; background: rgba(0,0,0,.18); }
.tes-pick-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.tes-pick-head button { margin-left: auto; }
.tes-pick table { max-height: 360px; }
.kpi-tes { cursor: pointer; }

/* Minhas ordens → Saques */
#meTabs { margin: 4px 0 12px; }
.wd-quick { display: flex; gap: 4px; }
.wd-op { display: block; white-space: nowrap; }
#wdTable tr.wd-failed td { opacity: .5; }

/* Minhas ordens → Depósitos */
.dp-quick { display: flex; gap: 4px; }
#dpTable tr.dp-row { cursor: pointer; }
#dpTable tr.dp-row.open td { background: rgba(255,255,255,.03); }
#dpTable tr.dp-item td { font-size: 12px; background: rgba(0,0,0,.15); }
#dpTable tr.dp-item td:first-child { padding-left: 28px; }
.dp-total { cursor: copy; }
.dp-total.copied { color: var(--buy); }

/* execução fora da Foxbit */
.ext-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 10px; margin-top: 8px; padding: 10px; border-radius: 10px; background: rgba(0,0,0,.18); }
.ext-form label { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--muted); }
.ext-form .ext-note { grid-column: 1 / 3; }
.ext-form .ext-actions { display: flex; gap: 6px; align-items: end; }
