:root { --bg:#fbfaf8; --fg:#1d1c1a; --muted:#6b6862; --line:#e4e1db; --accent:#2f5d50; --bad:#a33; --code:#f2f0ec; }
@media (prefers-color-scheme: dark) { :root { --bg:#161615; --fg:#ecebe8; --muted:#9a968f; --line:#2c2b29; --accent:#7fb8a6; --bad:#e88; --code:#1f1e1c; } }
* { box-sizing: border-box; }
body { margin:0; background:var(--bg); color:var(--fg); font:15px/1.5 system-ui, sans-serif; }
header { display:flex; gap:12px; align-items:center; padding:12px 16px; border-bottom:1px solid var(--line); }
h1 { font-size:18px; margin:0; flex:1; }
main { padding:16px; max-width:1200px; margin:auto; }
.pill { font-size:12px; padding:2px 8px; border:1px solid var(--line); border-radius:99px; color:var(--muted); }
button, .file { font:inherit; padding:6px 12px; border:1px solid var(--line); background:transparent; color:var(--fg); border-radius:6px; cursor:pointer; }
button.primary { background:var(--accent); border-color:var(--accent); color:var(--bg); }
input { font:inherit; padding:6px 8px; border:1px solid var(--line); border-radius:6px; background:var(--bg); color:var(--fg); width:min(420px,100%); }
.toolbar, .examples, .run { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-bottom:10px; }
.examples button { font-size:13px; padding:3px 8px; color:var(--muted); }
textarea { width:100%; min-height:150px; font:14px/1.45 ui-monospace, monospace; padding:10px; border:1px solid var(--line); border-radius:6px; background:var(--code); color:var(--fg); }
.hint, #meta { color:var(--muted); font-size:13px; }
#result { overflow:auto; max-height:65vh; border:1px solid var(--line); border-radius:6px; }
#result:empty { display:none; }
table { border-collapse:collapse; width:100%; font-size:13px; }
th, td { padding:5px 10px; border-bottom:1px solid var(--line); text-align:left; white-space:nowrap; }
th { position:sticky; top:0; background:var(--code); }
td.num { text-align:right; font-variant-numeric:tabular-nums; }
td.neg { color:var(--bad); }
td.null { color:var(--muted); font-style:italic; }
#msg { color:var(--muted); }
#msg.err { color:var(--bad); }
code.big { display:block; font-size:18px; padding:12px; background:var(--code); border-radius:6px; margin:12px 0; word-break:break-all; }
form.stack { display:flex; flex-direction:column; gap:8px; max-width:420px; margin:8px 0 16px; }
h3 { font-size:15px; margin:20px 0 4px; }
.scroll { overflow:auto; border:1px solid var(--line); border-radius:6px; margin-bottom:12px; }
#prov-table input { width:110px; padding:3px 6px; text-align:right; }
#prov-table input.nota { width:min(360px, 60vw); text-align:left; }
#prov-table select, #map-table select { font:inherit; padding:3px 6px; border:1px solid var(--line); border-radius:6px; background:var(--bg); color:var(--fg); }
td.ok { color:var(--accent); font-weight:600; }
td.bad { color:var(--bad); font-weight:600; }
input[type=month] { width:auto; }
details summary { cursor:pointer; margin:8px 0; }
.sync { display:flex; flex-wrap:wrap; gap:6px 12px; align-items:center; font-size:13px; margin-bottom:12px; }
.sync .banco { color:var(--muted); }
.sync .banco.velho { color:var(--fg); }
.sync .bad { color:var(--bad); border-color:var(--bad); }
.sync .pill.ok { color:var(--accent); border-color:var(--accent); }
button.seta { padding:0 4px; border:0; color:var(--muted); line-height:1; }
tr.det > td, #map-table tr.det > td, #ganhos-table tr.det > td { padding:0 0 8px 28px; background:var(--code); }
table.sub { width:auto; min-width:60%; }
table.sub th { position:static; background:transparent; color:var(--muted); font-weight:500; }
#prov-table tfoot th, #prov-table tfoot td { font-weight:600; border-top:2px solid var(--line); position:static; background:transparent; }
#ganhos-table th { position:static; background:transparent; font-weight:600; }
#ganhos-table td.num { font-weight:600; padding-right:24px; }
#regras-table input { width:min(280px, 60vw); padding:3px 6px; }
#regras-table select { font:inherit; padding:3px 6px; border:1px solid var(--line); border-radius:6px; background:var(--bg); color:var(--fg); }
