:root {
  --bet-profit: #23663d;
  --bet-return: #F2D28A;
}

html[data-theme="dark"] { --bet-profit: #8cdda9; }

.schedule-mode {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  max-width: 340px;
  padding: 4px;
  border: 1px solid var(--ui-edge);
  border-radius: var(--ui-radius-sm);
  background: var(--ui-canvas);
}

.schedule-mode-choice {
  display: grid;
  place-items: center;
  min-height: var(--ui-tap);
  padding: 8px 12px;
  border-radius: 5px;
  color: var(--ui-ink);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}

.schedule-mode-choice[aria-current="page"] { background: var(--ui-accent); color: var(--ui-on-accent); }
.schedule-mode-choice:hover:not([aria-current]) { background: var(--ui-soft); }
.schedule-view .schedule-matchup { max-width: none; }
.schedule-view .schedule-status { width: 100%; }
.schedule-view .schedule-matchup:has(.schedule-score) .schedule-status { grid-row: 4; }
.schedule-view .schedule-matchup:has(.schedule-score) .tracking-bar { grid-row: 5; }

.tracking-bar {
  grid-area: 4 / 1 / 5 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  min-width: 0;
  margin-top: 2px;
  border: 1px solid var(--week-border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--week-accent) 8%, transparent);
  container: trackingbar / inline-size;
}

.tracking-action {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 46px;
  padding: 5px;
  background: transparent;
  color: var(--week-accent);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.tracking-action + .tracking-action { border-left: 1px solid var(--week-border); }
.tracking-action:first-child { border-radius: 9px 0 0 9px; }
.tracking-action:last-child { border-radius: 0 9px 9px 0; }
.tracking-action:hover:not([aria-disabled]) { background: color-mix(in srgb, var(--week-accent) 16%, transparent); }
.tracking-save[aria-pressed="true"] { background: var(--week-accent); color: var(--week-ticket); }
.tracking-save[aria-pressed="true"] .tracking-icon { fill: currentColor; }
.tracking-bet[data-has-bet="true"] { background: color-mix(in srgb, var(--week-accent) 24%, transparent); color: var(--ui-ink); }
.tracking-action[aria-disabled] { color: var(--ui-muted); font-weight: 500; }
.tracking-icon { flex: none; width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.bet-stub { display: grid; align-self: stretch; gap: 7px; margin: 4px 0 0; padding-top: 8px; border-top: 1px dashed var(--week-border); }
.bet-stub-line { display: grid; min-width: 0; line-height: 1.2; }
.bet-stub dt { color: var(--week-accent); font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.bet-stub dd { min-width: 0; max-width: 100%; margin: 0; font-size: 13px; font-weight: 750; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.bet-profit { color: var(--bet-profit); }
.bet-return { color: var(--bet-return); }
html[data-theme="light"] .bet-return { width: fit-content; max-width: 100%; padding: 1px 4px; border-radius: 4px; background: #22362c; }
.tracking-count { padding: 6px 10px; border: 1px solid var(--ui-rule); border-radius: var(--ui-radius-pill); background: var(--ui-panel); color: var(--ui-muted); font-size: 11px; font-weight: 650; }
.bet-summary { display: flex; flex-wrap: wrap; gap: 3px 7px; margin: -6px 0 12px; color: var(--ui-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.bet-summary-part { min-width: 0; overflow-wrap: anywhere; }
.bet-summary-part::before { content: "\00b7"; margin-right: 7px; }
.bet-summary strong { color: var(--ui-ink); }
.bet-summary strong.bet-profit { color: var(--bet-profit); }
.bet-summary strong.bet-return { color: var(--bet-return); }
.tracking-storage { overflow-wrap: anywhere; }
.tracking-empty { display: grid; justify-items: center; gap: 10px; padding: 36px 20px 32px; border: 1px dashed var(--ui-edge); border-radius: var(--ui-radius-md); background: var(--ui-panel); text-align: center; }
.tracking-empty-badge { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--ui-soft); color: var(--ui-accent); }
.tracking-empty-badge .tracking-icon { width: 26px; height: 26px; }
.tracking-empty h4 { margin: 4px 0 0; font-size: 17px; }
.tracking-empty p { max-width: 300px; margin: 0 0 6px; color: var(--ui-muted); font-size: 13px; }

dialog.bet-dialog { width: min(400px, calc(100% - 32px)); padding: 20px; }
.bet-dialog .dialog-head { margin-bottom: 6px; }
.bet-dialog .dialog-head h2 { font-family: var(--ui-font-body); font-size: 10px; letter-spacing: 1.4px; }
.bet-dialog .close-button { display: grid; place-items: center; width: 44px; height: 44px; margin: -8px -8px -8px 0; color: var(--ui-muted); }
.bet-dialog-matchup { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 8px 0; }
.bet-dialog-team { display: grid; justify-items: center; gap: 5px; width: 112px; min-width: 0; }
.bet-dialog-logo { width: 64px; height: 64px; padding: 5px; border-radius: 12px; background: #fff; object-fit: contain; }
.bet-dialog-team-name { font-size: 12px; font-weight: 650; line-height: 1.3; text-align: center; overflow-wrap: anywhere; }
.bet-dialog-versus { color: var(--ui-muted); font-size: 12px; font-weight: 750; }
.bet-dialog-when { margin: 6px 0 18px; color: var(--ui-muted); font-size: 12px; text-align: center; }
.bet-field { display: grid; grid-template-columns: minmax(0, 1fr) 120px; align-items: center; gap: 6px 12px; margin-bottom: 12px; }
.bet-field label { font-size: 13px; font-weight: 650; }
.bet-money { display: flex; align-items: center; height: 46px; padding: 0 10px; border: 1px solid var(--ui-edge); border-radius: 10px; background: var(--ui-canvas); }
.bet-money:focus-within { outline: 2px solid var(--ui-accent); outline-offset: 1px; }
.bet-money:has([aria-invalid="true"]) { border-color: var(--ui-red); }
.bet-money span { color: var(--ui-muted); font-size: 16px; font-weight: 650; }
.bet-money input { flex: 1; min-width: 0; width: 100%; height: 100%; padding: 0 0 0 6px; border: 0; outline: 0; background: transparent; color: var(--ui-ink); font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums; }
#bet-profit { color: var(--bet-profit); }
.bet-error { grid-column: 1 / -1; margin: 0; color: var(--ui-red); font-size: 12px; line-height: 1.3; }
.bet-error:empty { display: none; }
.bet-dialog-total { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: flex-end; gap: 8px 12px; margin: 4px 0 18px; padding-top: 10px; border-top: 1px dashed var(--ui-rule); color: var(--ui-muted); font-size: 13px; }
.bet-dialog-total output { max-width: 100%; font-size: 17px; font-weight: 750; overflow-wrap: anywhere; }
.bet-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.bet-actions-end { display: flex; gap: 8px; margin-left: auto; }
.bet-actions button { min-height: var(--ui-tap); padding: 0 16px; border: 1px solid var(--ui-rule); border-radius: var(--ui-radius-pill); background: transparent; color: var(--ui-ink); font-size: 13px; font-weight: 650; }
.bet-actions .bet-save { border-color: var(--ui-accent); background: var(--ui-accent); color: var(--ui-on-accent); }
.bet-actions .bet-remove { padding: 0 4px; border-color: transparent; color: var(--ui-red); }
.bet-actions button:hover { background: var(--ui-hover); }
.bet-actions .bet-save:hover { background: color-mix(in srgb, var(--ui-accent) 88%, var(--ui-ink)); }

@container trackingbar (max-width: 300px) {
  .tracking-action { flex-direction: column; gap: 2px; font-size: 10px; padding: 4px 2px; }
  .tracking-icon { width: 15px; height: 15px; }
}

@media (max-width: 600px) {
  .schedule-mode { max-width: none; }
}

@media (max-width: 360px) {
  .bet-stub dd { font-size: 12px; }
  dialog.bet-dialog { padding: 20px; }
}
