/* BankBet – tema "tabellone": scuro predefinito, chiaro alternativo. */
:root {
  --bg: #0D1411;
  --surface: #151F1A;
  --surface-2: #1C2822;
  --surface-3: #111A16;
  --border: #26352D;
  --border-2: #2E4036;
  --text: #E9F0EA;
  --text-2: #C9D6CD;
  --muted: #94A79C;
  --faint: #5E7166;
  --grid: #22302A;
  --accent: #F2B544;
  --accent-text: #1A1405;
  --pos: #5FD38D;
  --pos-bg: #1E3A2A;
  --neg: #FF8A7A;
  --warn: #F2B544;
  --ev: #8FB8FF;
  --pending: #8FB8FF;
  --heat-neg2: #E0614F;
  --heat-neg1: #6E352D;
  --heat-0: #1C2822;
  --heat-pos1: #2A6143;
  --heat-pos2: #5FD38D;
  --heat-ink-strong: #0D1411;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9;
  --radius: 16px;
  --shadow: none;
  --nav-h: 72px;
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-num: "Barlow Condensed", "Roboto Condensed", "Arial Narrow", system-ui, sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #F2F4EF;
  --surface: #FFFFFF;
  --surface-2: #EAEEE7;
  --surface-3: #F8FAF6;
  --border: #D7DED4;
  --border-2: #C6D0C2;
  --text: #0F1A14;
  --text-2: #2C3B32;
  --muted: #56675C;
  --faint: #8A998F;
  --grid: #E3E8E0;
  --accent: #B26B00;
  --accent-text: #FFFFFF;
  --pos: #1B7A43;
  --pos-bg: #DDF1E4;
  --neg: #C2412D;
  --warn: #B26B00;
  --ev: #2F62C9;
  --pending: #2F62C9;
  --heat-neg2: #D2533F;
  --heat-neg1: #F2C3BA;
  --heat-0: #EAEEE7;
  --heat-pos1: #A9DDBC;
  --heat-pos2: #2E9A5B;
  --heat-ink-strong: #FFFFFF;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6;
  --shadow: 0 1px 2px rgba(15, 26, 20, .05), 0 4px 14px rgba(15, 26, 20, .05);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root[data-theme="auto"] {
    --bg: #F2F4EF; --surface: #FFFFFF; --surface-2: #EAEEE7; --surface-3: #F8FAF6; --border: #D7DED4; --border-2: #C6D0C2;
    --text: #0F1A14; --text-2: #2C3B32; --muted: #56675C; --faint: #8A998F; --grid: #E3E8E0;
    --accent: #B26B00; --accent-text: #FFFFFF; --pos: #1B7A43; --pos-bg: #DDF1E4; --neg: #C2412D; --warn: #B26B00;
    --ev: #2F62C9; --pending: #2F62C9;
    --heat-neg2: #D2533F; --heat-neg1: #F2C3BA; --heat-0: #EAEEE7; --heat-pos1: #A9DDBC; --heat-pos2: #2E9A5B; --heat-ink-strong: #FFFFFF;
    --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6;
    --shadow: 0 1px 2px rgba(15, 26, 20, .05), 0 4px 14px rgba(15, 26, 20, .05);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 var(--font);
  -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px);
}
h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 600; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: .95rem; }
a { color: var(--accent); }
small, .muted { color: var(--muted); }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.num { font-variant-numeric: tabular-nums; }
.big-num { font-family: var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.label-caps { font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand svg { flex: none; }
.brand span { font-family: var(--font-num); font-weight: 700; font-size: 1.45rem; letter-spacing: .03em; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.balance { font-family: var(--font-num); font-weight: 600; font-size: 1.25rem; font-variant-numeric: tabular-nums; text-align: right; line-height: 1.05; }
.balance small { display: block; font-family: var(--font); font-weight: 400; font-size: .72rem; }
body.on-home .balance { display: none; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); cursor: pointer;
}
.icon-btn.spin svg { animation: spin 1s linear infinite; }
.icon-btn.err { color: var(--neg); border-color: var(--neg); }
.icon-btn.ok { color: var(--pos); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Navigation ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface-3); border-top: 1px solid var(--border);
}
.tabs a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--muted); text-decoration: none; font-size: .7rem; font-weight: 500;
}
.tabs svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabs a.active { color: var(--accent); font-weight: 600; }

main { max-width: 1180px; margin: 0 auto; padding: 14px 16px; outline: none; }

@media (min-width: 900px) {
  body { padding-bottom: 24px; padding-left: 220px; }
  .topbar { margin-left: -220px; padding-left: 22px; }
  .tabs {
    top: 65px; bottom: 0; right: auto; width: 220px; height: auto;
    display: flex; flex-direction: column; gap: 2px; padding: 18px 14px;
    border-top: 0; border-right: 1px solid var(--border);
  }
  .tabs a { flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 10px; font-size: .92rem; }
  .tabs a.active { background: var(--surface-2); color: var(--text); }
  .tabs a.active svg { color: var(--accent); }
  main { padding: 26px 32px; }
}

/* ---------- Building blocks ---------- */
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); min-width: 0;
}
.card > h2, .card > h3, .card > .spread { margin-bottom: 12px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.card-head a { font-size: .85rem; text-decoration: none; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 600px) { .kpis { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .kpis { grid-template-columns: repeat(6, 1fr); } .kpis:not(.two) .kpi .value { font-size: 1.55rem; } }
.kpis.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); min-width: 0; }
.kpi .label { font-size: .72rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.kpi .value { font-family: var(--font-num); font-size: 1.9rem; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .sub { font-size: .78rem; color: var(--muted); }

canvas.chart { width: 100%; height: 220px; display: block; }
.chart-wrap { position: relative; touch-action: pan-y; }
.chart-tip {
  position: absolute; top: 4px; pointer-events: none; z-index: 2;
  background: var(--bg); border: 1px solid var(--border-2); border-radius: 10px; padding: 7px 10px;
  font-size: .78rem; white-space: nowrap; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); transform: translateX(-50%);
}
.chart-tip b { display: block; font-family: var(--font-num); font-size: 1.15rem; font-weight: 600; }
.chart-tip .d { color: var(--muted); }
.chart-tip .e { color: var(--ev); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .78rem; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 16px; height: 3px; border-radius: 2px; background: var(--accent); }
.legend i.ev { height: 0; background: none; border-top: 2px dashed var(--ev); }
.legend i.dd { width: 12px; height: 10px; border-radius: 2px; background: color-mix(in srgb, var(--neg) 22%, transparent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--border-2);
  background: var(--surface-2); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover { filter: brightness(1.08); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.danger { color: var(--neg); }
.btn.small { min-height: 34px; padding: 4px 10px; font-size: .85rem; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--accent); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--bg); }
.seg button { border: 0; border-radius: 9px; background: transparent; color: var(--muted); min-height: 34px; padding: 0 12px; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }
.seg button.on { background: var(--border); color: var(--text); }
:root[data-theme="light"] .seg { background: var(--surface-2); }
:root[data-theme="light"] .seg button.on { background: var(--surface); box-shadow: var(--shadow); }

label.field { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; color: var(--muted); font-weight: 500; min-width: 0; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px; min-height: 44px; width: 100%;
}
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.form-grid .full { grid-column: 1 / -1; }
@media (min-width: 640px) { .form-grid.three { grid-template-columns: repeat(3, 1fr); } }
.hint { font-size: .8rem; color: var(--muted); }
.suggest {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--border-2); font-size: .85rem;
}

.chip { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .74rem; font-weight: 600; white-space: nowrap; border: 1px solid currentColor; }
.chip.won, .chip.half_won { color: var(--pos); }
.chip.lost, .chip.half_lost { color: var(--neg); }
.chip.pending { color: var(--pending); }
.chip.void, .chip.cashout { color: var(--muted); }
.chip.strat { color: var(--text-2); border-color: var(--border-2); }
.pill { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: .82rem; font-weight: 500; }
.pill.pos { background: var(--pos-bg); color: var(--pos); font-weight: 600; }
.pill.neg { background: color-mix(in srgb, var(--neg) 16%, transparent); color: var(--neg); font-weight: 600; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 6px; background: var(--surface-2); font-size: .74rem; color: var(--muted); }

.alert { padding: 10px 14px; border-radius: 10px; border: 1px solid var(--warn); color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, transparent); font-weight: 500; }
.alert.danger { border-color: var(--neg); color: var(--neg); background: color-mix(in srgb, var(--neg) 10%, transparent); }

/* ---------- Schedine ---------- */
.bet-list { display: flex; flex-direction: column; gap: 10px; }
.bet {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  cursor: pointer; box-shadow: var(--shadow);
}
.bet:hover { border-color: var(--border-2); }
.bet:focus-visible { outline: 2px solid var(--accent); }
.bet .t-head {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 8px 14px; background: var(--surface-3); border-bottom: 1px dashed var(--border-2);
  font-size: .76rem; color: var(--muted);
}
.bet .t-head > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.bet .t-head .chips { display: flex; gap: 6px; flex: none; }
.bet .t-body { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px 2px; }
.bet .title { font-weight: 600; font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bet .pick { font-size: .84rem; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bet .odds { font-family: var(--font-num); font-size: 2rem; font-weight: 700; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; flex: none; }
.bet .t-foot { display: flex; justify-content: space-between; gap: 8px; padding: 4px 14px 12px; font-size: .82rem; color: var(--muted); }
.bet .t-foot b { font-family: var(--font-num); font-size: 1.05rem; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.bet .t-foot b.pos { color: var(--pos); }
.bet .t-foot b.neg { color: var(--neg); }
.bet .quick { display: flex; gap: 6px; padding: 0 14px 14px; }
.bet .quick .btn { flex: 1; min-height: 44px; font-size: .85rem; }
.bet .quick .ok { color: var(--pos); }
.bet .quick .ko { color: var(--neg); }
.bet .quick .vd { color: var(--text-2); }
.bet.settled .odds { color: var(--text-2); }
.date-head { font-size: .74rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin: 10px 2px 0; }

.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.filters .search { grid-column: 1 / -1; }
@media (min-width: 720px) { .filters { grid-template-columns: 2fr 1fr 1fr 1fr; } .filters .search { grid-column: auto; } }

/* ---------- Home ---------- */
.home-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.home-head .when { font-size: .85rem; color: var(--muted); }
.home-head .actions { display: none; gap: 8px; }
@media (min-width: 900px) { .home-head .actions { display: flex; } }
.home-row { display: flex; gap: 16px; flex-wrap: wrap; }
.home-main { flex: 2 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.home-side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.hero { padding: 18px 18px 16px; }
@media (min-width: 900px) { .hero { padding: 22px 24px 18px; } }
.hero-top { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.hero-value { font-family: var(--font-num); font-weight: 700; font-size: 3.6rem; line-height: 1; margin-top: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hero-value .cur { font-size: .5em; color: var(--muted); }
@media (min-width: 900px) { .hero-value { font-size: 4.2rem; } }
.hero-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.hero-tools { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
@media (max-width: 640px) { .hero-tools { align-items: stretch; width: 100%; } .hero-tools .seg { display: grid; grid-template-columns: repeat(5, 1fr); } .hero-tools .legend { display: none; } }
.hero .chart-wrap { margin-top: 14px; }
.hero canvas.chart { height: 230px; }
@media (max-width: 640px) { .hero canvas.chart { height: 140px; } }
.hero-foot { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.hero-foot .v { font-family: var(--font-num); font-size: 1.6rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hero-foot .v small { font-family: var(--font); font-size: .75rem; font-weight: 400; }

.meter { display: flex; flex-direction: column; gap: 6px; }
.meter + .meter { margin-top: 12px; }
.meter .top { display: flex; justify-content: space-between; font-size: .85rem; }
.meter .top .big-num { font-size: 1.05rem; }
.meter .bar { height: 8px; border-radius: 99px; background: var(--bg); overflow: hidden; }
:root[data-theme="light"] .meter .bar { background: var(--surface-2); }
.meter .bar > div { height: 100%; border-radius: 99px; background: var(--accent); }
.meter.over .bar > div { background: var(--neg); }

.cal-nav { display: flex; align-items: center; gap: 4px; }
.cal-nav button { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; font: inherit; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.cal .dow { text-align: center; font-size: .7rem; font-weight: 600; color: var(--muted); padding-bottom: 2px; }
.cal .day {
  height: 38px; border-radius: 8px; display: grid; place-items: center; font-size: .78rem; font-weight: 600;
  background: var(--heat-0); color: var(--text-2); border: 1px solid transparent;
}
.cal .day.out { background: transparent; color: var(--faint); }
.cal .day.future { background: transparent; border: 1px dashed var(--border-2); color: var(--faint); }
.cal .day.p1 { background: var(--heat-pos1); color: var(--text); }
.cal .day.p2 { background: var(--heat-pos2); color: var(--heat-ink-strong); }
.cal .day.n1 { background: var(--heat-neg1); color: var(--text); }
.cal .day.n2 { background: var(--heat-neg2); color: var(--heat-ink-strong); }
.cal .day.today { border: 2px solid var(--accent); }
.cal-legend { display: flex; align-items: center; justify-content: flex-end; gap: 5px; margin-top: 10px; font-size: .72rem; color: var(--muted); }
.cal-legend i { width: 13px; height: 13px; border-radius: 4px; display: inline-block; }

.mcard + .mcard { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.mpath { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 6px; margin: 10px 0; }
.mpath span {
  height: 38px; border-radius: 8px; display: grid; place-items: center;
  font-family: var(--font-num); font-size: 1.1rem; font-weight: 700; color: var(--text);
}
.mpath .W { background: var(--heat-pos1); }
.mpath .L { background: var(--heat-neg1); }
.mpath .cur { border: 2px solid var(--accent); color: var(--accent); }
.mpath .next { border: 1px dashed var(--border-2); color: var(--faint); font-weight: 500; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 6px; text-align: right; border-bottom: 1px solid var(--grid); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { font-size: .72rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
tr:last-child td { border-bottom: 0; }
td.cur { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 6px; font-weight: 700; }

/* ---------- FAB / dialog / toast ---------- */
.fab {
  position: fixed; right: 18px; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px); z-index: 25;
  width: 60px; height: 60px; border-radius: 18px; border: 0; background: var(--accent); color: var(--accent-text);
  display: grid; place-items: center; cursor: pointer; box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
}
@media (min-width: 900px) { .fab { bottom: 24px; right: 28px; } body.on-home .fab { display: none; } }

dialog {
  width: min(640px, 100vw); max-height: 100dvh; margin: auto; padding: 0;
  border: 1px solid var(--border); border-radius: 18px; background: var(--surface); color: var(--text);
}
dialog::backdrop { background: rgba(3, 8, 5, .65); }
@media (max-width: 640px) {
  dialog { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 18px 18px 0 0; max-height: 94dvh; }
}
dialog form { display: flex; flex-direction: column; max-height: inherit; }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.dlg-body { padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.dlg-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); flex-wrap: wrap; }
.dlg-foot .left { margin-right: auto; }

#toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 90px); transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 500;
  opacity: 0; pointer-events: none; transition: .2s; z-index: 50; max-width: calc(100vw - 32px);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.empty { text-align: center; color: var(--muted); padding: 28px 16px; }
.progress { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); }
.hist { display: flex; gap: 3px; flex-wrap: wrap; }
.hist span { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; font-size: .72rem; font-weight: 700; color: var(--text); }
.hist .W { background: var(--heat-pos1); } .hist .L { background: var(--heat-neg1); } .hist .V { background: var(--surface-2); color: var(--muted); }
.sub-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.sub-tabs button { flex: none; }
details summary { cursor: pointer; font-weight: 600; }

/* ---------- Toast con azione, swipe, obiettivi ---------- */
#toast { display: flex; align-items: center; gap: 14px; }
#toast.act { pointer-events: auto; }
#toast button { border: 0; background: transparent; color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; padding: 6px 4px; min-height: 36px; }
:root[data-theme="light"] #toast button { color: #FFD27A; }
.bet[data-swipe] { touch-action: pan-y; }
.bet[data-dir="won"] { border-color: var(--pos); }
.bet[data-dir="lost"] { border-color: var(--neg); }
.bet.armed[data-dir="won"] { background: color-mix(in srgb, var(--pos) 16%, var(--surface)); }
.bet.armed[data-dir="lost"] { background: color-mix(in srgb, var(--neg) 16%, var(--surface)); }
.swipe-hint { margin: -6px 0 10px; }
@media (hover: hover) and (pointer: fine) { .swipe-hint { display: none; } }
.meter.goal .bar > div { background: var(--pos); }
.meter + .meter, .meter + .meter.goal { margin-top: 12px; }
.alert a { color: inherit; font-weight: 700; margin-left: 6px; }
.legs { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.leg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px; border: 1px dashed var(--border-2); border-radius: 12px; }
.leg [data-leg="event"] { grid-column: 1 / -1; }
.leg [data-leg-del] { justify-self: end; }
@media (min-width: 640px) { .leg { grid-template-columns: 1.3fr 1fr .8fr 1.2fr auto; align-items: center; } }
#toast button { color: #7A4E00; }
:root[data-theme="light"] #toast button { color: #FFD27A; }
@media (prefers-color-scheme: light) { :root[data-theme="auto"] #toast button { color: #FFD27A; } }
