:root {
  color-scheme: dark;
  --bg: #0b1510;
  --felt: #10271b;
  --felt-2: #163424;
  --line: #24442f;
  --text: #eef5f0;
  --muted: #92a89a;
  --gold: #f2c14e;
  --gold-ink: #231a02;
  --green: #3ddc84;
  --red: #ff6b6b;
  --radius: 16px;
  --shadow: 0 10px 30px rgb(0 0 0 / 0.35);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(1200px 600px at 50% -200px, #1c4a31 0%, transparent 70%),
    var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
h1, h2 { margin: 0; }
h1 { font-size: 1.8rem; letter-spacing: -0.02em; }
h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; margin-bottom: 12px; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.pos { color: var(--green); }
.neg { color: var(--red); }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  background: rgb(11 21 16 / 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand .suit { color: var(--gold); }
.topbar nav { display: flex; gap: 4px; flex-shrink: 0; }
.topbar nav a { padding: 8px 12px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 0.9rem; }
.topbar nav a.active { background: var(--felt-2); color: var(--text); }

main {
  max-width: 880px; margin: 0 auto;
  padding: 16px 16px calc(env(safe-area-inset-bottom) + 32px);
  display: flex; flex-direction: column; gap: 16px;
}
main[data-view='fechar'] { padding-bottom: 190px; }

/* ---------- Summary ---------- */
.summary {
  position: sticky; top: calc(env(safe-area-inset-top) + 57px); z-index: 10;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line);
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
}
.stat { background: var(--felt); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat span { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.stat strong { font-size: 1.05rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat.main { grid-column: 1 / -1; background: linear-gradient(135deg, #1b4630, #10271b); flex-direction: row; justify-content: space-between; align-items: center; padding: 12px 16px; }
.stat.main strong { font-size: 1.9rem; color: var(--gold); }
.summary.three { grid-template-columns: repeat(3, 1fr); }
@media (min-width: 720px) {
  .summary { grid-template-columns: 1.6fr repeat(4, 1fr); }
  .summary.three { grid-template-columns: 1.6fr repeat(3, 1fr); }
  .stat.main { grid-column: auto; flex-direction: column; align-items: flex-start; }
}
@media (max-width: 420px) {
  .stat { padding: 8px 10px; }
  .stat strong { font-size: 0.95rem; }
  .hide-xs, .close-result small:first-child { display: none; }
  .topbar nav a { padding: 8px 10px; }
}
.session-meta { margin: -6px 4px 0; color: var(--muted); font-size: 0.85rem; }

/* ---------- Cards / forms ---------- */
.card { background: var(--felt); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.hero { text-align: center; padding: 24px 8px 8px; }
.hero.small { padding: 8px 8px 0; }
.hero p { margin: 8px 0 0; }
.hero .btn { margin-top: 20px; }
.hero-suits { font-size: 1.6rem; letter-spacing: 0.4em; color: var(--gold); margin-bottom: 8px; }
.label { margin: 16px 0 8px; font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

.field {
  width: 100%; min-height: 48px; padding: 10px 14px;
  font: inherit; font-size: 16px; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  outline: none;
}
.field:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgb(242 193 78 / 0.2); }
.field:disabled { opacity: 0.55; }
.inline-form { display: flex; gap: 8px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form h2 { margin: 12px 0 0; }
.form h2:first-child { margin-top: 0; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 0.92rem; }
.form label.switch { flex-direction: row; align-items: center; gap: 12px; font-weight: 500; }
.switch input { width: 22px; height: 22px; accent-color: var(--gold); flex-shrink: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .grid2 { grid-template-columns: 1fr; } }
.notice { margin: 0; padding: 10px 12px; border-radius: 10px; background: rgb(242 193 78 / 0.12); color: var(--gold); font-size: 0.9rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px;
  font: inherit; font-weight: 700; color: var(--text);
  background: var(--felt-2); border: 1px solid var(--line); border-radius: 12px;
  cursor: pointer; white-space: nowrap; user-select: none;
  transition: transform 0.08s ease, filter 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--gold); color: var(--gold-ink); border-color: transparent; }
.btn.danger { background: rgb(255 107 107 / 0.14); color: var(--red); border-color: rgb(255 107 107 / 0.35); }
.btn.ghost { background: transparent; }
.btn.big { min-height: 58px; font-size: 1.08rem; border-radius: 14px; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 0.85rem; }
.btn.block { width: 100%; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--felt-2); color: var(--text); font-size: 1rem; cursor: pointer; }
.link { background: none; border: 0; color: var(--muted); font: inherit; text-decoration: underline; cursor: pointer; }
.row { display: flex; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row > * { flex: 1; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px dashed var(--line); background: transparent; color: var(--text); font: inherit; font-size: 0.92rem; cursor: pointer; }
.chip.on { border-style: solid; background: var(--felt-2); border-color: var(--gold); }
.inline-form + .chips { margin-top: 12px; }

/* ---------- Players ---------- */
.players { display: grid; gap: 10px; }
@media (min-width: 720px) { .players { grid-template-columns: 1fr 1fr; } }
.player {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px;
  padding: 10px 10px 10px 12px;
  background: var(--felt); border: 1px solid var(--line); border-radius: var(--radius);
}
.player-info { display: flex; align-items: center; gap: 12px; min-width: 0; background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; padding: 4px 0; }
.avatar {
  display: grid; place-items: center; flex-shrink: 0;
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #d4912a); color: var(--gold-ink);
  font-weight: 800; font-size: 1.15rem;
}
.avatar.sm { width: 36px; height: 36px; font-size: 0.95rem; }
.pname { display: flex; flex-direction: column; min-width: 0; }
.pname strong { font-size: 1.08rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pname small { color: var(--muted); font-variant-numeric: tabular-nums; }
.buycount { display: flex; flex-direction: column; align-items: center; min-width: 52px; line-height: 1; }
.buycount strong { font-size: 1.7rem; font-variant-numeric: tabular-nums; }
.buycount small { color: var(--muted); font-size: 0.7rem; text-transform: uppercase; margin-top: 2px; }
.pips { display: flex; gap: 2px; height: 8px; margin-bottom: 4px; }
.pips i { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: inset 0 0 0 2px #b8862b; }
.pips b { font-size: 0.6rem; color: var(--gold); line-height: 8px; }
.btn-buy {
  min-height: 56px; min-width: 88px; padding: 0 14px;
  border: 0; border-radius: 14px; cursor: pointer;
  background: var(--gold); color: var(--gold-ink);
  font: inherit; font-weight: 800; font-size: 1.05rem;
  transition: transform 0.08s ease;
}
.btn-buy:active { transform: scale(0.95); }

/* ---------- Log ---------- */
.log, .transfers, .entries { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.log li { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--line); font-size: 0.92rem; }
.log li:first-child { border-top: 0; }
.log li span:nth-child(2) { flex: 1; }
.log time { color: var(--muted); font-variant-numeric: tabular-nums; }
.log li.voided span { text-decoration: line-through; color: var(--muted); }
.log li.void { color: var(--red); }

/* ---------- Fechamento ---------- */
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--muted); }
.steps strong { color: var(--text); }
.close-list { display: flex; flex-direction: column; gap: 10px; }
.close-row {
  display: grid; grid-template-columns: 1fr 120px; gap: 10px 12px; align-items: center;
  padding: 12px; background: var(--felt); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color 0.2s;
}
.close-row > * { min-width: 0; }
.close-row.done { border-color: rgb(61 220 132 / 0.6); }
.close-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.close-name > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.close-name small { color: var(--muted); font-size: 0.8rem; }
.count { display: flex; flex-direction: column; gap: 4px; font-size: 0.72rem; color: var(--muted); text-transform: uppercase; }
.count .field { text-align: right; font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.close-result { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-variant-numeric: tabular-nums; }
.close-result small { color: var(--muted); }
.close-result small:not(:first-child) { font-weight: 700; }
.close-result .pos, .close-result .neg { color: inherit; }
.close-result [data-net].pos { color: var(--green); }
.close-result [data-net].neg { color: var(--red); }
.confirm { white-space: nowrap; display: flex; align-items: center; justify-content: flex-end; gap: 8px; font-weight: 600; cursor: pointer; }
.confirm input { width: 24px; height: 24px; accent-color: var(--green); }
@media (min-width: 720px) {
  .close-row { grid-template-columns: 1.4fr 130px 1fr auto; }
}
.close-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  padding: 12px 16px calc(env(safe-area-inset-bottom) + 12px);
  background: rgb(11 21 16 / 0.95); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.close-bar > * { max-width: 848px; margin-left: auto; margin-right: auto; }
.progress { height: 8px; border-radius: 99px; background: var(--felt-2); overflow: hidden; }
.progress div { height: 100%; width: 0; background: var(--gold); transition: width 0.25s, background 0.25s; }
.progress div.ok { background: var(--green); }
.progress div.over { background: var(--red); }
.status { margin: 10px auto; font-size: 0.92rem; min-height: 2.4em; }

/* ---------- Resultado / histórico ---------- */
.table-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
.results { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 0.92rem; }
.results th { text-align: right; color: var(--muted); font-weight: 600; font-size: 0.72rem; text-transform: uppercase; padding: 6px 8px; }
.results td { text-align: right; padding: 10px 8px; border-top: 1px solid var(--line); white-space: nowrap; }
.results tr > :first-child { text-align: left; padding-left: 0; white-space: normal; }
.transfers li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.transfers li:first-child { border-top: 0; }
.history { display: flex; flex-direction: column; gap: 10px; }
.history-item { display: flex; justify-content: space-between; gap: 12px; padding: 14px 16px; background: var(--felt); border: 1px solid var(--line); border-radius: var(--radius); }
.history-item > span { display: flex; flex-direction: column; gap: 2px; }
.history-item small { color: var(--muted); }
.history-item .right { text-align: right; }
.danger-zone { border-color: rgb(255 107 107 / 0.3); }

/* ---------- Modal ---------- */
dialog {
  width: min(520px, calc(100% - 24px)); max-height: calc(100dvh - 24px);
  padding: 0; border: 1px solid var(--line); border-radius: 20px;
  background: var(--felt); color: var(--text); box-shadow: var(--shadow);
}
dialog::backdrop { background: rgb(0 0 0 / 0.6); backdrop-filter: blur(3px); }
.modal { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.modal > header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.modal > header h2 { margin: 0; color: var(--text); text-transform: none; letter-spacing: 0; font-size: 1.25rem; }
.modal footer { display: flex; gap: 10px; }
.modal footer > * { flex: 1; }
.modal .hint { margin: 0; color: var(--muted); }
.modal .hint strong { color: var(--text); }
.ask { display: flex; flex-direction: column; gap: 14px; }
.error { margin: 0; color: var(--red); font-weight: 600; }
.buy-amount { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 16px; border-radius: 14px; background: var(--bg); }
.buy-amount strong { font-size: 1.8rem; color: var(--gold); }
.buy-amount span { color: var(--muted); font-weight: 600; }
.sigwrap { position: relative; }
.sig { display: block; width: 100%; height: 190px; border-radius: 14px; background: #fff; touch-action: none; cursor: crosshair; }
.sig-ph { position: absolute; inset: 0; display: grid; place-items: center; color: #9aa3ad; font-size: 1.1rem; font-style: italic; pointer-events: none; }
.sigwrap .link { position: absolute; right: 10px; bottom: 8px; color: #56606b; }
.entries { max-height: 55dvh; overflow-y: auto; }
.entries li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.entries li:first-child { border-top: 0; }
.entries li > div { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.entries small { color: var(--muted); }
.entries img { height: 44px; width: auto; border-radius: 6px; background: #fff; }
.entries li.voided strong, .entries li.voided img { opacity: 0.45; text-decoration: line-through; }

/* ---------- Toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 20px); z-index: 100;
  display: flex; align-items: center; gap: 14px;
  max-width: calc(100% - 32px); padding: 12px 16px;
  background: #f4f7f5; color: #0b1510; border-radius: 14px; box-shadow: var(--shadow);
  font-weight: 600;
  transform: translate(-50%, 150%); opacity: 0; pointer-events: none;
  transition: transform 0.25s ease, opacity 0.25s;
}
#toast.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
#toast.error { background: var(--red); color: #fff; }
#toast button { background: none; border: 0; color: #b8862b; font: inherit; font-weight: 800; cursor: pointer; padding: 4px; }
main[data-view='fechar'] ~ #toast { bottom: 200px; }

/* ---------- Sincronização ---------- */
.brand { display: flex; align-items: center; gap: 6px; min-width: 0; }
#brand-name { overflow: hidden; text-overflow: ellipsis; }
.sync { flex-shrink: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); opacity: 0.5; }
.sync.online { background: var(--green); opacity: 1; box-shadow: 0 0 0 3px rgb(61 220 132 / 0.2); }
.sync.connecting { background: var(--gold); opacity: 1; animation: pulse 1s infinite alternate; }
.sync.offline { background: #f59e0b; opacity: 1; }
.sync.error { background: var(--red); opacity: 1; }
@keyframes pulse { to { opacity: 0.3; } }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
textarea.field { resize: vertical; line-height: 1.4; }
.setup { margin: 4px 0 14px; }
.setup summary { cursor: pointer; font-weight: 600; margin-bottom: 8px; }
.setup textarea { font-size: 13px; }
.notice.info { background: var(--bg); color: var(--muted); }
.notice.info strong { color: var(--text); }
.buy-amount span { display: flex; flex-direction: column; align-items: flex-end; }
.buy-amount small { font-size: 0.8rem; font-weight: 500; }
.card > p:first-of-type:not(.muted) { margin-top: 0; }

/* ---------- Caixa / Pix / histórico ---------- */
.caixa h3 { margin: 14px 0 2px; font-size: 0.95rem; }
.caixa h3:first-of-type { margin-top: 0; }
.caixa .row { margin-top: 14px; }
.transfers li > span { display: flex; flex-direction: column; min-width: 0; }
.pix { color: var(--muted); font-size: 0.82rem; word-break: break-all; }
.pix.missing { color: #f59e0b; }
.btn.whatsapp { background: #25d366; color: #062b14; }
details.card > summary { list-style: none; cursor: pointer; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary h2 { margin: 0; }
details.card > summary h2::after { content: ' ▾'; }
details.card[open] > summary h2 { margin-bottom: 12px; }
.pix-list { display: flex; flex-direction: column; gap: 8px; }
.form label.pix-row { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 10px; font-weight: 600; }
.pix-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pix-btn { align-self: flex-start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.history-row { display: flex; gap: 8px; align-items: stretch; }
.history-row .history-item { flex: 1; min-width: 0; }
.icon-btn.trash { width: 48px; height: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--felt); font-size: 1.1rem; }

/* ---------- Histórico mensal / ranking ---------- */
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--felt); border: 1px solid var(--line); border-radius: 14px; }
.tabs a { flex: 1; text-align: center; padding: 10px; border-radius: 10px; font-weight: 700; color: var(--muted); }
.tabs a.active { background: var(--felt-2); color: var(--text); }
.month { display: flex; flex-direction: column; gap: 10px; }
.month-head { display: flex; justify-content: space-between; gap: 12px; padding: 4px 4px 0; }
.month-head > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.month-head strong { font-size: 1.05rem; }
.month-head small { color: var(--muted); font-size: 0.8rem; }
.month-head .right { text-align: right; align-items: flex-end; }
.month-head .right strong { font-size: 0.92rem; color: var(--gold); }
.link-like { text-decoration: underline; }
.periods { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; scrollbar-width: none; }
.periods .chip { display: inline-flex; align-items: center; white-space: nowrap; flex-shrink: 0; }
.ranking .pos-cell { width: 36px; font-size: 1.05rem; text-align: left; padding-left: 0; }
.ranking tr > :nth-child(2) { text-align: left; white-space: normal; }
.ranking tr > :first-child { padding-right: 4px; }
.ranking .sub { display: block; color: var(--muted); font-size: 0.75rem; font-weight: 400; }
.ranking td.pos, .ranking td.neg { font-size: 0.85rem; }
.ranking td, .ranking th { padding-left: 4px; padding-right: 4px; }
.ranking tr > :last-child { padding-right: 0; }
@media (max-width: 420px) {
  .ranking { font-size: 0.85rem; }
  .ranking td.pos, .ranking td.neg { font-size: 0.8rem; }
}

/* ---------- Aprovação de buys ---------- */
.pending-card { border-color: rgb(245 158 11 / 0.6); background: linear-gradient(180deg, rgb(245 158 11 / 0.1), var(--felt)); }
.pending-card h2 { color: #f59e0b; margin-bottom: 4px; }
.pending-card > p { margin: 0 0 8px; }
.approvals li { flex-wrap: wrap; }
.approve-actions { display: flex; gap: 8px; width: 100%; }
.approve-actions .btn { flex: 1; min-height: 44px; }
.approvals img { height: 52px; }
.wait { color: #f59e0b; font-style: normal; font-weight: 600; }
.approvals li > .approve-actions { flex: 1 1 100%; }
.approvals li > div:first-child { flex: 1 1 auto; }
#toast { width: max-content; }
.approvals .approve-actions { flex-direction: row; }

/* ---------- Vários buys por pedido ---------- */
.qty { display: flex; align-items: center; justify-content: center; gap: 24px; padding: 6px 0; }
.qty output { font-size: 3rem; font-weight: 800; min-width: 64px; text-align: center; font-variant-numeric: tabular-nums; }
.qty-btn { width: 64px; height: 64px; border-radius: 50%; border: 1px solid var(--line); background: var(--felt-2); color: var(--text); font-size: 2rem; font-weight: 700; cursor: pointer; }
.qty-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.qty-btn:active:not(:disabled) { transform: scale(0.94); }
.sig-count { line-height: 1.45; }
.sig-steps { display: flex; gap: 6px; }
.sig-steps i { flex: 1; height: 6px; border-radius: 99px; background: var(--felt-2); }
.sig-steps i.done { background: var(--green); }
.sig-steps i.now { background: var(--gold); }
.sig-grid { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 100%; }
.sig-grid img { height: 48px; width: auto; border-radius: 6px; background: #fff; }
.approvals .sig-grid { flex-direction: row; }
.modal footer > * { min-width: 0; white-space: normal; text-align: center; line-height: 1.2; }
.approvals li > div:first-child { flex: 1 1 100%; }
.approvals li > .sig-grid { flex: 1 1 100%; flex-direction: row; flex-wrap: wrap; }
.approvals .sig-grid img, .approvals .sig-grid em { height: 56px; width: auto; max-width: calc(33% - 4px); object-fit: contain; }
@media (max-width: 420px) {
  .topbar { gap: 6px; }
  .topbar nav a { padding: 8px 8px; font-size: 0.85rem; }
  .brand { font-size: 0.98rem; }
}

/* ---------- Saída individual ---------- */
.out-card h2 { margin-bottom: 4px; }
.link-row { display: flex; justify-content: space-between; gap: 12px; width: 100%; background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; padding: 0; }
.link-row > span { display: flex; flex-direction: column; min-width: 0; }
.link-row .right { text-align: right; align-items: flex-end; flex-shrink: 0; }
.out-card li { padding: 10px 0; }
.out-box { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 12px; background: var(--bg); }
.big-count .field { font-size: 1.8rem; min-height: 64px; text-align: center; }
.buy-amount > span small { display: block; font-size: 0.85rem; font-weight: 600; }
.confirm.left { justify-content: flex-start; }
.close-row.is-out { opacity: 0.85; border-style: dashed; }
.close-row.is-out .field { background: var(--felt-2); }
.out-net { margin: 0; font-size: 1.05rem; }
.results .sub { display: block; color: var(--muted); font-size: 0.75rem; font-weight: 400; }

/* ---------- Conexão / versão ---------- */
.netbar, .updatebar {
  position: sticky; top: calc(env(safe-area-inset-top) + 57px); z-index: 19;
  display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; font-size: 0.9rem; font-weight: 600; text-align: center;
}
.netbar.warn { background: #f59e0b; color: #241500; }
.netbar.error { background: var(--red); color: #fff; }
.netbar.info { background: var(--felt-2); color: var(--muted); font-weight: 500; }
.netbar button, .updatebar button { border: 0; border-radius: 999px; padding: 6px 14px; font: inherit; font-weight: 800; cursor: pointer; background: rgb(0 0 0 / 0.2); color: inherit; }
.updatebar { background: var(--gold); color: var(--gold-ink); }
.updatebar button { background: var(--gold-ink); color: var(--gold); }
.netbar + .updatebar { top: calc(env(safe-area-inset-top) + 100px); }

/* ---------- Acertos / lixeira ---------- */
.owed { display: flex; flex-direction: column; gap: 6px; border-color: rgb(245 158 11 / 0.6); }
.owed h2 { margin: 0; color: #f59e0b; }
.owed ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 2px; }
.owed small { font-size: 0.8rem; }
.owed-tag { color: #f59e0b !important; font-weight: 600; }
.settle-status { margin: 0 0 4px; color: #f59e0b; font-weight: 700; }
.settle-status.done { color: var(--green); }
.caixa .transfers li .right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.settle { border: 1px dashed var(--line); background: transparent; color: var(--muted); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 0.8rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
.settle.on { border-style: solid; border-color: rgb(61 220 132 / 0.6); background: rgb(61 220 132 / 0.12); color: var(--green); }
.is-settled > span:first-child strong { text-decoration: line-through; opacity: 0.6; }
.trash-card > summary { list-style: none; cursor: pointer; }
.trash-card > summary::-webkit-details-marker { display: none; }
.trash-card > summary h2 { margin: 0; }
.trash-card[open] > summary h2 { margin-bottom: 8px; }
.trash-card .transfers li { align-items: center; }
.trash-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.trash-card .transfers li { flex-wrap: wrap; }
.trash-card .trash-actions { width: 100%; justify-content: flex-start; }
.form.merge { margin-bottom: 12px; }

/* ---------- Correção de fichas ---------- */
.correct-list li { justify-content: space-between; }
.correct-list .field { width: 110px; flex: 0 0 110px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.correct-list small.changed { font-weight: 700; }
.corrections { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.corrections h3 { margin: 0 0 6px; font-size: 0.9rem; }
.corrections ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.corrections li { display: flex; flex-direction: column; gap: 2px; font-size: 0.88rem; }
.card > .btn.small.ghost[data-action="correct-chips"] { margin-top: 10px; }
.edit-out { align-self: flex-end; font-size: 0.8rem; text-transform: none; padding: 2px 0; color: var(--gold); }
