.browse-view { margin-top: 8px; }
/* Betslip stays visible in Browse too, same as the main dashboard. The full
   overlay needs no forced-hide rule here -- it's already closed by default
   (.hidden class) and showBrowse() closes it on entering the view; a CSS
   force-hide would fight the "Show full betslip" button's own open/close
   toggle and leave body.modal-open's scroll-lock stuck with nothing
   visible to close it. */

.browse-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.browse-toolbar h2, .browse-toolbar p { margin: 0; }
.browse-toolbar p { margin-top: 2px; color: var(--muted); }
.browse-toolbar-actions { display: flex; gap: 8px; }
.browse-toolbar-actions button {
  color: #f3f5f7 !important;
  background: #11181e !important;
  border: 1px solid #465661 !important;
  border-radius: 7px;
  padding: 7px 12px;
  cursor: pointer;
}
.browse-toolbar-actions button:hover {
  background: linear-gradient(90deg, rgba(34, 197, 94, .22), rgba(34, 197, 94, .03)) !important;
  border-color: rgba(34, 197, 94, .45) !important;
}

.browse-empty { color: var(--muted); padding: 30px 0; text-align: center; }

/* ---- two-column layout: persistent sidebar + filterable main area ---- */
.browse-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  align-items: start;
}
.browse-sidebar {
  position: sticky;
  top: 0;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 4px;
}
.browse-sidebar-all,
.browse-sidebar-country,
.browse-sidebar-league {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: left;
  color: #f3f5f7 !important;
  background: transparent !important;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 6px 8px;
  cursor: pointer;
  font-size: 13px;
}
.browse-sidebar-all { font-weight: 700; border-color: #33414c !important; margin-bottom: 4px; }
.browse-sidebar-country { font-weight: 700; margin-top: 6px; justify-content: flex-start; }
.browse-sidebar-country > span { margin-left: auto; }
.browse-sidebar-caret {
  flex: 0 0 auto;
  font-style: normal;
  font-size: 10px;
  color: var(--muted);
  transition: transform .12s ease;
}
.browse-sidebar-country.expanded .browse-sidebar-caret { transform: rotate(90deg); }
.browse-sidebar-league { padding-left: 18px; color: var(--muted) !important; font-size: 12px; }
.browse-sidebar-all span,
.browse-sidebar-country span,
.browse-sidebar-league span:last-child {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}
.browse-sidebar-all:hover,
.browse-sidebar-country:hover,
.browse-sidebar-league:hover {
  background: linear-gradient(90deg, rgba(34, 197, 94, .16), rgba(34, 197, 94, .02)) !important;
}
.browse-sidebar-all.active,
.browse-sidebar-country.active,
.browse-sidebar-league.active {
  background: rgba(98, 216, 59, .16) !important;
  border-color: rgba(98, 216, 59, .4) !important;
  color: #62d83b !important;
}
.browse-sidebar-all.active span,
.browse-sidebar-country.active span,
.browse-sidebar-league.active span:last-child {
  color: #62d83b;
}

/* ---- main area: search + date tabs + market toggles + fixture list ---- */
.browse-main { min-width: 0; }
.browse-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
/* width:100% forces this pair onto its own line within the wrapping
   .browse-controls flex row, same trick .browse-market-toggles already
   uses below it. */
.browse-controls-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  width: 100%;
}
#browse-search {
  flex: 0 1 160px;
  min-width: 120px;
  color: #f3f5f7 !important;
  background: #11181e !important;
  border: 1px solid #465661 !important;
  border-radius: 7px;
  padding: 8px 10px;
  font: inherit;
}
#browse-search:focus {
  outline: none;
  border-color: rgba(34, 197, 94, .45) !important;
}
/* Real mobile hides the persistent #betslip-panel entirely (mobile.css) in
   favor of the bottom-nav Betslip button -- but that nav belongs to the
   separate mobile app shell, not this view, so Leagues needs its own way
   in. Desktop (including force-desktop) keeps the persistent panel, so
   this stays hidden there. */
.browse-betslip-btn { display: none; }
@media (max-width: 900px) {
  html:not(.tipz365-force-desktop) .browse-betslip-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #0d1217 !important;
    background: #62d83b !important;
    border: 1px solid #62d83b !important;
    border-radius: 999px;
    padding: 8px 12px;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
  }
  html:not(.tipz365-force-desktop) .browse-betslip-btn b {
    min-width: 17px;
    height: 17px;
    line-height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    background: #0d1217;
    color: #62d83b;
    font-size: 10px;
    font-weight: 700;
  }
}
.browse-date-tabs { display: flex; gap: 4px; }
.browse-date-tab {
  color: #f3f5f7 !important;
  background: #11181e !important;
  border: 1px solid #465661 !important;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
}
.browse-date-tab:hover { border-color: rgba(34, 197, 94, .45) !important; }
.browse-date-tab.active {
  color: #0d1217 !important;
  background: #62d83b !important;
  border-color: #62d83b !important;
  font-weight: 700;
}
.browse-market-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  width: 100%;
  padding: 8px 10px;
  background: #151c22;
  border: 1px solid #33414c;
  border-radius: 8px;
}
/* Keep "Not kicked off yet" / "Mark playable" / "Hide no odds" together as
   one unit within the wrapping .browse-controls row -- either all three fit
   on the current line, or the whole group wraps together to a new one, they
   never get split up individually mid-group. */
.browse-toggle-group {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 12px;
}
.browse-market-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}
.browse-market-toggle input { accent-color: #62d83b; }

.browse-bookie-select {
  color: #f3f5f7 !important;
  background: #11181e !important;
  border: 1px solid #465661 !important;
  border-radius: 7px;
  padding: 7px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.browse-bookie-select:focus {
  outline: none;
  border-color: rgba(34, 197, 94, .45) !important;
}

.browse-truncated-banner {
  margin-bottom: 10px;
  padding: 8px 10px;
  color: #f1c40f;
  background: rgba(241, 196, 15, .12);
  border: 1px solid rgba(241, 196, 15, .35);
  border-radius: 7px;
  font-size: 12px;
}

.browse-fixture-list-inner { display: flex; flex-direction: column; gap: 10px; }
.browse-fixture-row {
  position: relative;
  padding: 10px 12px;
  background: #151c22;
  border: 1px solid #33414c;
  border-radius: 9px;
}
/* Quick-scan indicator: at least one market on this card clears the
   playable-odds bar. The wedge sits flush in the top-right corner so it
   reads as part of the card's own border, not a floating badge. */
.browse-fixture-row.browse-playable::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 20px;
  height: 20px;
  background: #62d83b;
  clip-path: polygon(100% 0%, 0% 0%, 100% 100%);
  border-top-right-radius: 9px;
  pointer-events: none;
}
.browse-fixture-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.browse-fixture-head strong { flex: 1 1 auto; min-width: 160px; }
.browse-fixture-head > span { color: var(--muted); font-size: 12px; white-space: nowrap; }

.browse-model-badges { display: flex; flex-wrap: wrap; gap: 4px; width: 100%; }
/* themes.css has a global `button { color, border-color: ... !important }`
   rule -- !important always beats a non-!important declaration regardless
   of specificity, so every state color below needs its own !important or
   it's silently overridden by that generic rule (this bit the .active
   state too, before now -- it was rendering bold but not actually green). */
.browse-model-badge {
  position: relative;
  padding: 3px 8px;
  color: var(--muted) !important;
  background: transparent !important;
  border: 1px solid #33414c !important;
  border-radius: 999px;
  font-size: 10.5px;
  cursor: pointer;
}
.browse-model-badge:hover:not(:disabled) {
  background: linear-gradient(90deg, rgba(34, 197, 94, .22), rgba(34, 197, 94, .03)) !important;
  border-color: rgba(34, 197, 94, .45) !important;
}
.browse-model-badge.active {
  color: #62d83b !important;
  background: transparent !important;
  border-color: #62d83b !important;
  font-weight: 600;
}
.browse-model-badge.unsupported { opacity: .4; cursor: not-allowed; }
/* "Switch to me" hint: this model has playable value somewhere on the card,
   even though it's not the one currently shown. Skipped for .active --
   the card's own green wedge already covers that case. A small corner dot
   reads far quieter than a colored border/text across up to 7 badges. */
.browse-model-badge-value:not(.active)::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #f1c40f;
}

.browse-fixture-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
  gap: 6px;
}
.browse-fixture-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 8px;
  background: #1b242c;
  border-radius: 6px;
}
.browse-fixture-cell span { color: var(--muted); font-size: 10px; }
.browse-fixture-cell strong { font-size: 13px; color: #f3f5f7; }
.browse-fixture-bookie { color: #62d83b; font-size: 10px; }
/* Same corner-wedge language as the card-level playable indicator, scaled
   down to the cell. Border is the separate "in betslip" state below, so
   the two never collide visually. */
.browse-fixture-cell-playable::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background: #62d83b;
  clip-path: polygon(100% 0%, 0% 0%, 100% 100%);
  border-top-right-radius: 6px;
  pointer-events: none;
}
.browse-fixture-cell-clickable { cursor: pointer; }
.browse-fixture-cell-in-betslip {
  outline: 1px solid #62d83b;
  outline-offset: -1px;
}
/* The cell sets its own `display: flex` above, which (as an author rule)
   otherwise outranks the UA stylesheet's `[hidden] { display: none }` at
   equal specificity — without this, unchecking a market toggle silently
   did nothing. */
.browse-fixture-cell[hidden] { display: none !important; }

@media (max-width: 900px) {
  html:not(.tipz365-force-desktop) .browse-layout { grid-template-columns: 1fr; }
  html:not(.tipz365-force-desktop) .browse-sidebar {
    position: static;
    max-height: 260px;
  }
  html:not(.tipz365-force-desktop) .browse-fixture-grid { grid-template-columns: repeat(3, 1fr); }
  html:not(.tipz365-force-desktop) .browse-toolbar { flex-wrap: wrap; }
}
