/* Profit: the net result up top, then a month of days. The calendar is this page's one loud thing: each day's
 * cell takes a green or red wash by how much it made or lost, in four steps, with the signed amount written in
 * it so colour is never the only cue. Everything around it stays on hairlines. No orb and no glow here. */
.profit-workspace{max-width:1240px}
.profit-heading .primary-button{flex:none}

/* ── Overview ───────────────────────────────────────────────────────────── */
.profit-overview{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:end;gap:20px 44px;margin:0 0 30px}
.profit-hero{min-width:0}
.profit-hero-label{font-size:12px;line-height:1.3;color:var(--gx-muted)}
.profit-hero .gx-hero{margin:8px 0 10px}
.profit-hero-note{font-size:12.5px;color:var(--gx-muted)}
.profit-facts{--cols:5}
.profit-facts dd small,.calendar-totals dd small{display:block;margin:3px 0 0;font-size:12px;font-weight:400;letter-spacing:0;color:var(--gx-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.profit-overview-loading{grid-column:1/-1;display:grid;grid-template-columns:220px repeat(3,minmax(0,1fr));gap:20px}
.profit-overview-loading .gx-skel{height:64px}
.profit-overview:empty{display:none}

/* No bets yet: a quiet sketch of a month, the reason to upload, and the two ways to start. */
.profit-first{grid-column:1/-1;display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:22px 36px;padding:26px 28px;border-radius:var(--gx-r-card);background:var(--gx-surface);box-shadow:0 0 0 1px var(--gx-stroke)}
.profit-first-art{display:grid;grid-template-columns:repeat(7,20px);gap:4px}
.profit-first-art span{width:20px;height:20px;border-radius:5px;background:var(--gx-soft)}
.profit-first-art [data-tone=profit][data-wash="1"]{background:var(--wash-profit-1)}
.profit-first-art [data-tone=profit][data-wash="2"]{background:var(--wash-profit-2)}
.profit-first-art [data-tone=profit][data-wash="3"]{background:var(--wash-profit-3)}
.profit-first-art [data-tone=profit][data-wash="4"]{background:var(--wash-profit-4)}
.profit-first-art [data-tone=loss][data-wash="1"]{background:var(--wash-loss-1)}
.profit-first-art [data-tone=loss][data-wash="2"]{background:var(--wash-loss-2)}
.profit-first-art [data-tone=loss][data-wash="3"]{background:var(--wash-loss-3)}
.profit-first-copy{display:flex;flex-direction:column;gap:8px;min-width:0}
.profit-first-copy h2{font-size:19px;letter-spacing:-.45px}
.profit-first-copy p{max-width:62ch;font-size:13px;line-height:1.6;color:var(--gx-ink-2)}
.profit-first-copy .gx-note{color:var(--gx-muted)}
.profit-first-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:6px}

.profit-views{margin:0 0 22px}

/* ── Washes: four steps a side, mixed into the surface; dark mode mixes less so text keeps its contrast ── */
:root{--wash-profit-1:color-mix(in oklab,var(--gx-profit) 9%,var(--gx-surface));--wash-profit-2:color-mix(in oklab,var(--gx-profit) 17%,var(--gx-surface));
 --wash-profit-3:color-mix(in oklab,var(--gx-profit) 27%,var(--gx-surface));--wash-profit-4:color-mix(in oklab,var(--gx-profit) 39%,var(--gx-surface));
 --wash-loss-1:color-mix(in oklab,var(--gx-loss) 8%,var(--gx-surface));--wash-loss-2:color-mix(in oklab,var(--gx-loss) 15%,var(--gx-surface));
 --wash-loss-3:color-mix(in oklab,var(--gx-loss) 24%,var(--gx-surface));--wash-loss-4:color-mix(in oklab,var(--gx-loss) 35%,var(--gx-surface))}
@media (prefers-color-scheme:dark){:root:not([data-theme=light]){--wash-profit-1:color-mix(in oklab,var(--gx-profit) 9%,var(--gx-surface));--wash-profit-2:color-mix(in oklab,var(--gx-profit) 16%,var(--gx-surface));
 --wash-profit-3:color-mix(in oklab,var(--gx-profit) 24%,var(--gx-surface));--wash-profit-4:color-mix(in oklab,var(--gx-profit) 33%,var(--gx-surface));
 --wash-loss-1:color-mix(in oklab,var(--gx-loss) 9%,var(--gx-surface));--wash-loss-2:color-mix(in oklab,var(--gx-loss) 16%,var(--gx-surface));
 --wash-loss-3:color-mix(in oklab,var(--gx-loss) 24%,var(--gx-surface));--wash-loss-4:color-mix(in oklab,var(--gx-loss) 33%,var(--gx-surface))}}
:root[data-theme=dark]{--wash-profit-1:color-mix(in oklab,var(--gx-profit) 9%,var(--gx-surface));--wash-profit-2:color-mix(in oklab,var(--gx-profit) 16%,var(--gx-surface));
 --wash-profit-3:color-mix(in oklab,var(--gx-profit) 24%,var(--gx-surface));--wash-profit-4:color-mix(in oklab,var(--gx-profit) 33%,var(--gx-surface));
 --wash-loss-1:color-mix(in oklab,var(--gx-loss) 9%,var(--gx-surface));--wash-loss-2:color-mix(in oklab,var(--gx-loss) 16%,var(--gx-surface));
 --wash-loss-3:color-mix(in oklab,var(--gx-loss) 24%,var(--gx-surface));--wash-loss-4:color-mix(in oklab,var(--gx-loss) 33%,var(--gx-surface))}

/* ── Calendar ───────────────────────────────────────────────────────────── */
.calendar-view{display:flex;flex-direction:column}
.calendar-head{margin:0 0 18px}
.calendar-nav{display:flex;align-items:center;gap:4px}
.calendar-nav h2{min-width:156px;font-size:19px;letter-spacing:-.45px;text-align:center}
.calendar-nav #calendar-today{margin-left:8px}
.calendar-nav .gx-icon-btn:disabled{opacity:.35;cursor:not-allowed}
.calendar-totals{--cols:5;margin:0 0 20px}
.calendar-body{display:grid;grid-template-columns:minmax(0,1fr) 300px;align-items:start;gap:24px}
.calendar-weekdays,.calendar-week{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px}
.calendar-weekdays{margin:0 0 6px;padding:0 10px;font-size:11.5px;color:var(--gx-muted)}
.calendar-grid{display:flex;flex-direction:column;gap:6px;transition:opacity .2s ease}
.calendar-grid[aria-busy=true]{opacity:.55}
.calendar-cell{position:relative;min-width:0;border-radius:12px;background:var(--gx-surface);box-shadow:0 0 0 1px var(--gx-stroke);transition:box-shadow .15s ease}
.calendar-cell[data-outside]{display:flex;min-height:84px;padding:9px 10px;background:transparent;box-shadow:none}
.calendar-cell[data-outside] .calendar-date{color:var(--gx-faint);opacity:.6}
.calendar-day-button{position:relative;display:flex;flex-direction:column;align-items:flex-start;width:100%;min-height:84px;padding:9px 10px 8px;border-radius:inherit;text-align:left;transition:background .15s ease}
.calendar-day-button:hover{background:color-mix(in srgb,var(--gx-ink) 4%,transparent)}
.calendar-day-button:focus-visible{outline-offset:-2px}
.calendar-date{font-size:12px;font-weight:500;line-height:1.2;color:var(--gx-muted);font-variant-numeric:tabular-nums}
.calendar-net{margin-top:auto;font-size:14.5px;font-weight:600;letter-spacing:-.25px;line-height:1.25;white-space:nowrap;font-variant-numeric:tabular-nums}
.calendar-meta{margin-top:2px;font-size:11px;line-height:1.2;color:var(--gx-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.calendar-approx{margin-right:2px;font-weight:500;opacity:.75}
.calendar-flag{position:absolute;top:8px;right:9px;display:grid;place-items:center;width:16px;height:16px;border-radius:50%;background:color-mix(in oklab,var(--gx-warn) 18%,var(--gx-surface));color:var(--gx-warn);font-size:11px;font-weight:700;line-height:1}
.calendar-cell[data-tone=profit] .calendar-net{color:var(--gx-profit)}
.calendar-cell[data-tone=loss] .calendar-net{color:var(--gx-loss)}
.calendar-cell[data-tone=profit][data-wash="1"]{background:var(--wash-profit-1)}
.calendar-cell[data-tone=profit][data-wash="2"]{background:var(--wash-profit-2)}
.calendar-cell[data-tone=profit][data-wash="3"]{background:var(--wash-profit-3)}
.calendar-cell[data-tone=profit][data-wash="4"]{background:var(--wash-profit-4)}
.calendar-cell[data-tone=loss][data-wash="1"]{background:var(--wash-loss-1)}
.calendar-cell[data-tone=loss][data-wash="2"]{background:var(--wash-loss-2)}
.calendar-cell[data-tone=loss][data-wash="3"]{background:var(--wash-loss-3)}
.calendar-cell[data-tone=loss][data-wash="4"]{background:var(--wash-loss-4)}
.calendar-cell[data-today] .calendar-date{color:var(--gx-accent);font-weight:700}
.calendar-cell[data-future] .calendar-date{color:var(--gx-faint)}
.calendar-cell[aria-selected=true]{box-shadow:0 0 0 2px var(--gx-ink)}
.calendar-legend{margin-top:14px}
.calendar-legend [data-key=up]::before,.calendar-legend [data-key=down]::before{width:12px;height:12px;border-radius:3px}
.calendar-legend [data-key=up]::before{background:var(--wash-profit-3)}
.calendar-legend [data-key=down]::before{background:var(--wash-loss-3)}
.calendar-legend [data-key=estimate]::before{display:none}

/* The chosen day, beside the month on wide screens. */
.calendar-day{position:sticky;top:20px;display:flex;flex-direction:column;min-width:0;padding:18px 18px 16px;border-radius:var(--gx-r-card);background:var(--gx-surface);box-shadow:0 0 0 1px var(--gx-stroke)}
.calendar-day h3{font-size:15px;letter-spacing:-.25px}
.calendar-day-net{margin:10px 0 4px;font-size:28px;font-weight:600;letter-spacing:-.9px;line-height:1.1}
.calendar-day-source{margin:0}
.calendar-day-empty{margin:10px 0 0;font-size:13px;color:var(--gx-muted)}
.calendar-day-facts{--cols:2;margin:14px 0 2px}
.calendar-day-facts dd{font-size:16px}
.calendar-day-facts dd small{display:block;margin:2px 0 0}
.calendar-day h4{margin:18px 0 4px;font-size:12px;font-weight:500;color:var(--gx-muted)}
.calendar-day-list{list-style:none;margin:0;padding:0}
.calendar-day-list li{display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding:8px 0;border-top:1px solid var(--gx-hair);font-size:13px;font-variant-numeric:tabular-nums}
.calendar-day-list li>span:last-child{flex:none;font-weight:600}
.calendar-day-name{display:flex;flex-direction:column;gap:1px;min-width:0}
.calendar-day-name b{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.calendar-day-name small{font-size:11.5px;color:var(--gx-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.calendar-day .gx-note{margin-top:6px}
.calendar-day-link{align-self:flex-start;margin-top:12px;font-size:13px}

/* ── Studios and games ──────────────────────────────────────────────────── */
.stats-toolbar{margin:0 0 16px}
.stats-periods{border-bottom:0}
.stats-table-wrap{overflow:hidden}
.stats-table{table-layout:fixed}
.stats-table :is(th,td):first-child{padding-left:16px}
.stats-table :is(th,td):last-child{padding-right:16px}
.provider-table th:nth-child(1){width:34%}
.game-table th:nth-child(1){width:32%}
.game-table th:nth-child(7){width:14%}
.stats-row td{white-space:nowrap}
.stats-row td:first-child{white-space:normal}
.stats-row td small{display:block;margin-top:2px;font-size:11.5px;font-weight:400;color:var(--gx-muted)}
.stats-row td b{font-weight:600}
.stats-name{display:flex;flex-direction:column;align-items:flex-start;gap:2px;width:100%;min-width:0;text-align:left}
.stats-name b{font-size:13.5px;font-weight:600;overflow-wrap:anywhere}
.stats-name small{font-size:12px;color:var(--gx-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
.provider-table .stats-row{cursor:pointer}
.provider-table button.stats-name{border-radius:8px}
.provider-table .stats-row:hover button.stats-name b{text-decoration:underline;text-decoration-color:var(--gx-rule);text-underline-offset:3px}
.stats-when{color:var(--gx-muted)}
.games-tools{display:flex;align-items:flex-end;justify-content:space-between;gap:12px 24px;flex-wrap:wrap;margin:0 0 14px}
.games-search{flex:1;max-width:340px}
.game-sorts{border-bottom:0}
.game-studio{display:flex;align-items:center;flex-wrap:wrap;gap:2px 6px;margin:0 0 12px;font-size:13px;color:var(--gx-ink-2)}
.stats-none{margin:0;padding:44px 16px;font-size:13px;color:var(--gx-muted);text-align:center}
.games-more{display:flex;align-items:center;gap:14px;margin-top:14px}
.games-more .gx-note:empty{display:none}
:is(#providers-view,#games-view)[aria-busy=true] .stats-table-wrap{opacity:.55;transition:opacity .2s ease}

/* ── Bet archive ────────────────────────────────────────────────────────── */
.archive-columns{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(0,1fr);align-items:start;gap:28px 36px}
.archive-add h2,.archive-held h2{margin:0 0 12px;font-size:17px}
.archive-steps{margin:0 0 18px;padding-left:20px;font-size:13px;line-height:1.75;color:var(--gx-ink-2)}
.archive-drop{display:flex;flex-direction:column;align-items:center;gap:12px;padding:34px 20px 30px;border:1.5px dashed var(--gx-rule);border-radius:var(--gx-r-card);background:var(--gx-surface);text-align:center;transition:border-color .15s ease,background .15s ease}
.archive-drop[data-over]{border-color:var(--gx-accent);background:var(--gx-accent-soft)}
.archive-drop[aria-disabled=true]{opacity:.6;pointer-events:none}
.archive-drop>svg{width:26px;height:26px;color:var(--gx-muted)}
.archive-drop p{display:flex;flex-direction:column;gap:3px}
.archive-drop p b{font-size:14px;font-weight:600}
.archive-drop p span{font-size:12.5px;color:var(--gx-muted)}
.archive-choose{cursor:pointer}
.archive-choose:focus-within{outline:2px solid var(--gx-accent);outline-offset:2px}
.archive-progress{margin:16px 0 0}
.archive-meter{height:4px;overflow:hidden;border-radius:2px;background:var(--gx-soft)}
.archive-meter span{display:block;width:0;height:100%;border-radius:2px;background:var(--gx-accent);transition:width .3s var(--gx-ease)}
.archive-progress p{margin:8px 0 0;font-size:12.5px;color:var(--gx-muted);font-variant-numeric:tabular-nums}
.archive-privacy{max-width:64ch;margin-top:14px}
.archive-held{padding:20px 20px 16px;border-radius:var(--gx-r-card);background:var(--gx-surface);box-shadow:0 0 0 1px var(--gx-stroke)}
.archive-coverage{--cols:2}
.archive-coverage dd small{display:block;margin:3px 0 0}
.archive-imports-title{margin:22px 0 4px;font-size:12px;font-weight:500;color:var(--gx-muted)}
.archive-imports{list-style:none;margin:0;padding:0}
.archive-imports li{display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding:9px 0;border-top:1px solid var(--gx-hair);font-size:13px}
.archive-imports b{font-weight:500}
.archive-imports small{margin-left:6px;font-size:12px;color:var(--gx-muted)}
.archive-clear{margin:16px 0 0 -10px;color:var(--gx-loss)}
.archive-clear:hover:not(:disabled){background:var(--gx-loss-wash)}
.profit-dialog-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-top:6px}
.primary-button.profit-danger{background:var(--gx-loss);color:var(--gx-surface)}
.primary-button.profit-danger:hover{background:color-mix(in oklab,var(--gx-loss) 86%,var(--gx-ink))}
#clear-bets-dialog .status{margin:0 0 6px}
.profit-signed-out{max-width:460px;margin:64px auto 96px}

/* ── Narrower screens ───────────────────────────────────────────────────── */
@media (max-width:1180px){
 .profit-overview{grid-template-columns:minmax(0,1fr)}
 .calendar-body{grid-template-columns:minmax(0,1fr)}
 .calendar-day{position:static}
}
@media (max-width:1023px){.profit-facts,.calendar-totals{--cols:3;row-gap:14px}}
@media (max-width:767px){
 .profit-facts,.calendar-totals{--cols:2}
 .profit-first{grid-template-columns:minmax(0,1fr);padding:20px}
 .profit-first-art{grid-template-columns:repeat(7,16px)}
 .profit-first-art span{width:16px;height:16px;border-radius:4px}
 .calendar-nav h2{min-width:0;flex:1;font-size:17px}
 .calendar-totals{order:2;margin:20px 0 0}
 .calendar-body{order:1}
 .calendar-weekdays,.calendar-week{gap:3px}
 .calendar-grid{gap:3px}
 .calendar-weekdays{padding:0 4px;font-size:11px}
 .calendar-cell{border-radius:8px}
 .calendar-cell[data-outside],.calendar-day-button{min-height:56px;padding:5px 4px 6px}
 .calendar-date{font-size:11px}
 .calendar-net{font-size:clamp(9.5px,2.7vw,12px);letter-spacing:-.3px}
 .calendar-approx{display:none}
 .calendar-meta{display:none}
 .calendar-flag{top:4px;right:4px;width:12px;height:12px;font-size:9px}
 .calendar-cell[aria-selected=true]{box-shadow:0 0 0 2px var(--gx-ink)}
 .archive-columns{grid-template-columns:minmax(0,1fr)}
 .games-search{max-width:none;flex-basis:100%}
 /* Tables become short cards: the name and its result, then bets, wagered and RTP on one quiet line. */
 .stats-table thead{display:none}
 .stats-table,.stats-table tbody{display:block}
 .stats-row{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 12px;padding:12px 14px;border-top:1px solid var(--gx-hair)}
 .stats-row:first-child{border-top:0}
 .stats-row::after{content:'';order:1;flex-basis:100%;height:0}
 .stats-table .stats-row>td{display:block;padding:0;border:0}
 .stats-row>td:first-child{flex:1 1 0;min-width:0}
 .stats-row>td[data-label=Result]{order:1;flex:none;text-align:right;font-size:13px}
 .stats-row>td[data-label]:not([data-label=Result]){order:2;font-size:12px;color:var(--gx-muted)}
 .stats-row>td[data-label]:not([data-label=Result])::before{content:attr(data-label) ' ';color:var(--gx-faint)}
 .stats-row>td:is([data-label=Games],[data-label='Last played'],[data-label=Best],[data-label='Best win']){display:none}
}
@media (prefers-reduced-motion:reduce){.calendar-grid,.archive-meter span{transition:none}}
