/* Soccer tab — minimal additions on top of the iTrade design system.
 * (anh chốt 2026-06-03) Reuses .itrade-panel / .itrade-input / .itrade-button /
 * .itrade-status / .itrade-meta; only adds what the system lacks (inline radio
 * group, the strategy step table, the accounts grid + a couple status tints). */

.itrade-soccer-main {
  flex: 1 1 auto;
  min-height: 0;
}

.itrade-soccer-frame {
  background: transparent;
}

.itrade-soccer-host {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: transparent;
}

.itrade-soccer-toolbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--itrade-border, #e6e6ec);
  background: #fff;
}

.itrade-soccer-toolbar > div {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.itrade-soccer-toolbar strong {
  font-size: 14px;
  font-weight: 900;
}

.itrade-soccer-toolbar span {
  color: var(--itrade-muted, #6b7280);
  font-size: 12px;
}

.itrade-soccer-toolbar .itrade-page-connect-btn {
  margin-left: 0;
}

.itrade-soccer-workspace {
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 12px 12px;
  overflow: hidden;
  min-width: 0;
  background: transparent;
}

.itrade-soccer-tabs {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 0 0 2px;
  scrollbar-width: thin;
}

.itrade-soccer-tab {
  flex: 0 0 auto;
  box-sizing: border-box;
  min-height: 34px;
  max-width: 180px;
  padding: 7px 14px;
  border: 1px solid var(--itrade-border, #e6e6ec);
  border-radius: 999px;
  color: var(--itrade-fg-muted, #6b7280);
  background: #fff;
  line-height: 1.25;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.itrade-soccer-tab.is-active {
  color: #fff;
  border-color: var(--itrade-red, #dc1c1c);
  background: var(--itrade-red, #dc1c1c);
}

.itrade-soccer-tab-panel {
  display: none;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
}

.itrade-soccer-tab-panel.is-active {
  display: flex;
  flex-direction: column;
}

.itrade-soccer-settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.itrade-soccer-settings .itrade-panel {
  margin: 0;
  border-radius: 8px;
}

/* MỘT LUẬT CHO MỌI HỘP WORKSPACE — không liệt kê tên tab (anh 21/08: "nó là 1 chuẩn css sao phải
 * làm riêng từng cái member riêng master riêng làm gì").
 *
 * Bản trước chỉ có [data-itrade-view="soccer-bookie-workspace"], nên hộp master — vốn là một <div>
 * trần do JS đẻ ra — không nhận được dòng nào, và bảng vé master không cuộn được. Cách chữa SAI là
 * thêm selector thứ hai: hai hộp anh em mà hai luật thì đúng là thứ đã sinh ra bug này, và tab thứ
 * ba sau này lại gãy y hệt.
 *
 * Khoá theo HẬU TỐ tên: bất cứ thứ gì tự khai là "-workspace" đều nhận cùng bộ khung, kể cả tab
 * chưa tồn tại.
 *
 * Vì sao đúng hai dòng min- này mới là cái chữa: `min-height: 0` — mặc định của con trong flex là
 * min-height:auto, tức TO BẰNG NỘI DUNG, nên nó tràn thay vì cuộn. `min-width: 0` — thiếu nó thì
 * GỠ `min-width: 0` (21/08): em TỰ THÊM dòng đó theo phỏng đoán về thanh cuộn ngang, nhưng cái sửa
 * cuộn THẬT hoá ra nằm ở cấu trúc thân bảng (.itrade-soccer-bookie-body + -body-panel), không phải
 * ở đây. Mà `min-width: 0` cho phép hộp co về 0 bề ngang khi hộp cha là flex ngang — đúng triệu
 * chứng TRẮNG TRANG anh gặp. Bốn dòng còn lại là bản gốc của hộp bookie, đã chạy tốt từ lâu:
 * chỉ nới selector ra theo hậu tố để hộp master dùng chung, không thêm thuộc tính nào mới. */
[data-itrade-view$="-workspace"] {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.itrade-soccer-bookie-shell {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.itrade-soccer-bookie-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(104px, 1fr));
  gap: 8px;
}

.itrade-soccer-bookie-card {
  min-height: 58px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* 05/11 anh: "sát number quá cho xa ra tí và font number lớn hơn 1px nữa" — nhãn ↔ số ↔ dòng phụ 2px → 5px. */
  gap: 5px;
  padding: 7px 12px;
  border: 1px solid var(--itrade-border, #e6e6ec);
  border-radius: 10px;
  background: linear-gradient(180deg, #fff 0%, #fbfbfd 100%);
}

.itrade-soccer-bookie-card .k {
  color: var(--itrade-muted, #6b7280);
  font-size: 10px;
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.itrade-soccer-bookie-card .v {
  margin: 0;
  font-size: 16px; /* 05/11 anh: +1px (15 → 16) */
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -.01em;
}

/* 05/11 anh: "dolla sign $ quá sát number" — span.dau-tien (soTheHtml). 07/11 anh: "class dau-tien nằm quá sát với số, giống như nó dính
 * vô số luôn" — .15em (~2px, lại bị letter-spacing −.01em của .v ăn bớt) không thấy được trên chữ đậm 800 → .35em (~5–6px), khối riêng
 * để khoảng cách không phụ thuộc letter-spacing của số. */
.itrade-soccer-bookie-card .v .dau-tien { display: inline-block; margin-right: .35em; letter-spacing: 0; }

.itrade-soccer-bookie-card .itrade-meta {
  width: 100%;
  margin: 0;
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.itrade-soccer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.itrade-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding-top: 4px;
}
.itrade-radio-group label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  margin: 0;
  color: var(--itrade-muted, #6b7280);
  font-size: 13px;
  line-height: 1.3;
  font-weight: 700;
  cursor: pointer;
}
.itrade-radio-group input[type="radio"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--itrade-red, #dc1c1c);
}


.itrade-soccer-bookie-main-card {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.itrade-soccer-bookie-card--clickable {
  width: 100%;
  text-align: center;
  cursor: pointer;
}

.itrade-soccer-bookie-card--clickable:hover {
  border-color: var(--itrade-red, #dc1c1c);
  box-shadow: 0 6px 14px rgba(15, 23, 42, .07);
}

.itrade-soccer-bookie-card[data-bw-card="balance"].is-online {
  border-color: rgba(34, 197, 94, .55);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, .14), 0 0 18px rgba(34, 197, 94, .16);
  animation: itrade-soccer-online-pulse 2.2s ease-in-out infinite;
}

.itrade-soccer-bookie-actions-card [data-soccer-workspace-action="login"].is-login-error,
.itrade-soccer-bookie-actions-card [data-soccer-workspace-action="logout"].is-login-error {
  border-color: rgba(220, 38, 38, .65);
  color: #b91c1c;
}

.itrade-soccer-bookie-card[data-bw-card="settled"].is-profit {
  border-color: rgba(34, 197, 94, .55);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, .14), 0 0 18px rgba(34, 197, 94, .16);
  animation: itrade-soccer-profit-pulse 2.2s ease-in-out infinite;
}

.itrade-soccer-bookie-card[data-bw-card="settled"].is-loss {
  border-color: rgba(239, 68, 68, .55);
  box-shadow: 0 0 0 1px rgba(239, 68, 68, .14), 0 0 18px rgba(239, 68, 68, .16);
  animation: itrade-soccer-loss-pulse 2.2s ease-in-out infinite;
}

.itrade-soccer-bookie-card[data-bw-card="pl"].is-profit {
  border-color: rgba(34, 197, 94, .55);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, .14), 0 0 18px rgba(34, 197, 94, .16);
  animation: itrade-soccer-profit-pulse 2.2s ease-in-out infinite;
}

.itrade-soccer-bookie-card[data-bw-card="pl"].is-loss {
  border-color: rgba(239, 68, 68, .55);
  box-shadow: 0 0 0 1px rgba(239, 68, 68, .14), 0 0 18px rgba(239, 68, 68, .16);
  animation: itrade-soccer-loss-pulse 2.2s ease-in-out infinite;
}

@keyframes itrade-soccer-online-pulse {
  0%, 100% {
    box-shadow: 0 0 0 1px rgba(34, 197, 94, .12), 0 0 12px rgba(34, 197, 94, .12);
  }
  50% {
    box-shadow: 0 0 0 1px rgba(34, 197, 94, .24), 0 0 22px rgba(34, 197, 94, .28);
  }
}

@keyframes itrade-soccer-profit-pulse {
  0%, 100% {
    box-shadow: 0 0 0 1px rgba(34, 197, 94, .12), 0 0 12px rgba(34, 197, 94, .12);
  }
  50% {
    box-shadow: 0 0 0 1px rgba(34, 197, 94, .24), 0 0 22px rgba(34, 197, 94, .28);
  }
}

@keyframes itrade-soccer-loss-pulse {
  0%, 100% {
    box-shadow: 0 0 0 1px rgba(239, 68, 68, .12), 0 0 12px rgba(239, 68, 68, .12);
  }
  50% {
    box-shadow: 0 0 0 1px rgba(239, 68, 68, .24), 0 0 22px rgba(239, 68, 68, .28);
  }
}

.itrade-soccer-bookie-body-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  align-content: flex-start;
  gap: 6px;
  overflow: visible;
  padding: 3px 0 5px;
}

.itrade-soccer-bookie-body-tabs .itrade-soccer-tab,
.itrade-soccer-bookie-body-tabs .itrade-soccer-bw-tab {
  flex: 0 1 auto;
  max-width: 100%;
  min-width: 0;
  min-height: 32px;
  padding-block: 6px;
}

.itrade-soccer-bw-tab {
  appearance: none;
  border: 1px solid var(--itrade-border, #e6e6ec);
  border-radius: 999px;
  background: #fff;
  color: var(--itrade-text, #111827);
  font: inherit;
  font-size: 13px;
  line-height: 1.2;
  padding: 6px 12px;
  cursor: pointer;
}

.itrade-soccer-bw-tab.is-active {
  border-color: var(--itrade-accent, #2563eb);
  background: rgba(37, 99, 235, .08);
  color: var(--itrade-accent, #2563eb);
  font-weight: 600;
}

.itrade-soccer-bookie-body-panel[hidden] {
  display: none !important;
}

.itrade-soccer-bookie-body-panel.is-bw-active {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.itrade-soccer-bookie-main-tab-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 1 auto;
}

.itrade-soccer-novnc-reset[hidden] {
  display: none !important;
}

.itrade-soccer-novnc-pending {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: wrap;
}

.itrade-soccer-novnc-pending-copy {
  flex: 1 1 240px;
  min-width: 0;
}

.itrade-soccer-novnc-pending .itrade-form-actions {
  flex: 0 0 auto;
  margin: 0 0 0 auto;
  padding-top: 0;
  border-top: 0;
}

.itrade-soccer-auto-bet-consent {
  margin-right: auto;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid #d1fadf;
  border-radius: 999px;
  color: #166534;
  background: #f0fdf4;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
}

.itrade-soccer-auto-bet-consent input {
  margin: 0;
  accent-color: #1a7f37;
}

.itrade-soccer-auto-bet-consent.is-active {
  border-color: #dc2626;
  background: #fee2e2;
  color: #7f1d1d;
}

.itrade-soccer-auto-bet-consent.is-not-ready {
  border-color: #e5e7eb;
  background: #f9fafb;
  color: #4b5563;
}

/* Member pressed Open Browser: they hold the account by hand and the schedule stands down until they
   tick Auto Bet again. Amber, not grey — this is a state the member has to act on, not an unavailable
   control. Without it the box simply read as "off" and gave no hint that a tick would hand it back. */
.itrade-soccer-auto-bet-consent.is-manual-override {
  border-color: #f59e0b;
  background: #fef3c7;
  color: #7c2d12;
}

/* Consent given, but not betting right now (schedule window closed, or the member pressed Stop — which
   by design pauses only THIS window and keeps the tick for tomorrow). is-runtime-active was toggled in
   JS since 2026-07-27 and never had a rule, so this state was pixel-identical to actively betting: a
   member pressed Stop, saw nothing change, and pressed again. Muted, dashed — clearly "on but idle". */
.itrade-soccer-auto-bet-consent.is-active:not(.is-runtime-active) {
  border-style: dashed;
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #475569;
}

.itrade-soccer-bookie-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.itrade-soccer-bookie-body-panel {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.itrade-soccer-novnc {
  width: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
}

.itrade-soccer-novnc-status {
  margin-bottom: 10px;
}

.itrade-soccer-novnc-frame {
  flex: 0 1 auto;
  width: 100%;
  min-height: min(540px, calc(100vh - 350px)); min-height: min(540px, calc(100dvh - 350px));
  max-height: calc(100vh - 270px); max-height: calc(100dvh - 270px);
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  background: #000;
  overflow: hidden;
}

.itrade-soccer-novnc-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 10px;
  background: #000;
  opacity: 0;
  pointer-events: auto;
  transition: opacity .15s ease;
}

.itrade-soccer-novnc-frame.is-loaded iframe {
  opacity: 1;
}

/* Bookie accounts table */
.itrade-soccer-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.itrade-soccer-table th,
.itrade-soccer-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--itrade-border, #e6e6ec); vertical-align: middle; }
.itrade-soccer-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--itrade-muted, #6b7280); }
.itrade-soccer-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* connector_status tints (reusing the .itrade-status chip shape) */
.itrade-status--online { background: #e7f6ec; color: #1a7f37; }
.itrade-status--offline,
.itrade-status--login_failed { background: #fdecea; color: #b42318; }
.itrade-status--limited { background: #fef3c7; color: #92400e; }
.itrade-status--disabled,
.itrade-status--unknown { background: #eef0f3; color: #4b5563; }

/* Session pill sits inline next to the Stop/Auto-Bet controls — align it to the
   middle so the label is level with the neighbouring text (boss 2026-07-12). */
.itrade-soccer-session-pill {
  /* The parent .itrade-soccer-bookie-actions-card is a 58px flex row with the
     default align-items:stretch, which stretched the pill and pushed its label
     to the top. align-self:center centres the pill in the row (works on the
     flex item regardless of its own display). The base .itrade-status is
     inline-block and wins the display cascade, so centre the label with
     text-align, not justify-content. */
  align-self: center;
  min-width: 80px;
  text-align: center;
  box-sizing: border-box;
}

/* Live session pill: green pulse emanating from the centre and spreading out to
   fill the whole pill (boss 2026-07-12 — replaces the old leading "●" dot). */
.itrade-soccer-session-pill.itrade-status--running {
  position: relative;
  z-index: 0;
  overflow: hidden;
}
.itrade-soccer-session-pill.itrade-status--running::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(26, 127, 55, .55) 0%, rgba(26, 127, 55, .28) 45%, rgba(26, 127, 55, 0) 72%);
  transform: scale(0);
  z-index: -1;
  animation: itrade-soccer-session-live-pulse 1.9s ease-out infinite;
}
@keyframes itrade-soccer-session-live-pulse {
  0%   { transform: scale(0);  opacity: .9; }
  70%  { opacity: .35; }
  100% { transform: scale(16); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .itrade-soccer-session-pill.itrade-status--running::before { animation: none; }
}

/* Strategy preview step table */
.itrade-soccer-strat-summary { display: flex; flex-wrap: wrap; gap: 18px; margin: 8px 0; }
.itrade-soccer-strat-summary .k { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--itrade-muted, #6b7280); }
.itrade-soccer-strat-summary .v { font-size: 18px; font-weight: 700; }
.itrade-soccer-steps { width: 100%; border-collapse: collapse; font-size: 13px; }
.itrade-soccer-steps th,
.itrade-soccer-steps td { padding: 5px 10px; text-align: right; border-bottom: 1px solid var(--itrade-border, #e6e6ec); }
.itrade-soccer-steps th:first-child,
.itrade-soccer-steps td:first-child { text-align: left; }

/* Leagues & fixtures panel */
.itrade-soccer-league-pick { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.itrade-soccer-league-pick .itrade-input { width: auto; min-width: 220px; }
.itrade-soccer-sources { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0 12px; }
.itrade-soccer-pending {
  padding: 14px 16px;
  border: 1px dashed var(--itrade-border, #e6e6ec);
  border-radius: 8px;
  background: var(--itrade-bg-alt, #f8f9fb);
  color: var(--itrade-muted, #6b7280);
  font-size: 14px;
}
.itrade-soccer-pending strong { color: var(--itrade-warn, #92400e); }


.itrade-soccer-league-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.itrade-soccer-league-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border: 1px solid var(--itrade-border, #e6e6ec);
  border-radius: 999px;
  background: #fff;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}
.itrade-soccer-league-check input { accent-color: var(--itrade-red, #dc1c1c); }
.itrade-soccer-league-check em {
  color: var(--itrade-muted, #6b7280);
  font-style: normal;
  font-weight: 600;
}
/* League favorite star (sort only — never changes betting) */
.itrade-soccer-league-row { display: inline-flex; align-items: center; gap: 2px; }
.itrade-soccer-fav-star {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 2px 5px;
  color: var(--itrade-muted, #9ca3af);
}
.itrade-soccer-fav-star.is-fav { color: #f5b301; }

/* Add/edit modal form grid */
.itrade-soccer-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.itrade-soccer-form-grid .full { grid-column: 1 / -1; }
/* Unit (wide, a value or a list) + OU Unit (narrow, just a number or two) on one 70/30 row */
.itrade-soccer-unit-row { display: grid; grid-template-columns: 7fr 3fr; gap: 10px 16px; align-items: end; }
/* Bet count + Đánh O/U chung một hàng (anh 2026-08-04). Ô số hẹp, ô toggle mang cả mô tả nên rộng. */
.itrade-soccer-unit-row--narrow-first { grid-template-columns: 3fr 7fr; }
@media (max-width: 640px) { .itrade-soccer-unit-row { grid-template-columns: 1fr; } }
.itrade-soccer-form-grid label {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0;
  color: var(--itrade-muted, #6b7280);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}
.itrade-soccer-form-grid .itrade-input,
.itrade-soccer-form-grid .itrade-select,
.itrade-soccer-form-grid textarea {
  width: 100%;
  min-width: 0;
}
.itrade-soccer-form-grid select.itrade-input,
.itrade-soccer-form-grid .itrade-select {
  min-height: var(--itrade-control-height, 40px);
}
.itrade-soccer-field-label {
  color: var(--itrade-muted, #6b7280);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}
@keyframes itrade-soccer-autobet-blink {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 28, 28, 0); }
  35%, 75% { box-shadow: 0 0 0 4px rgba(220, 28, 28, .18); }
}
.itrade-soccer-field-needs-fix .itrade-soccer-field-label,
.itrade-soccer-field-needs-fix.itrade-field .itrade-label {
  color: var(--itrade-red, #dc1c1c);
}
.itrade-input.itrade-soccer-field-needs-fix,
.itrade-soccer-field-needs-fix input,
.itrade-soccer-field-needs-fix select {
  border-color: var(--itrade-red, #dc1c1c) !important;
  background: #fff7f7;
  animation: itrade-soccer-autobet-blink 1.2s ease-in-out 3;
}
.itrade-soccer-checks { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.itrade-soccer-checks label {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 7px;
  min-height: 24px;
  margin: 0;
  color: var(--itrade-muted, #6b7280);
  font-size: 13px;
  line-height: 1.3;
}
.itrade-soccer-checks .itrade-checkbox {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--itrade-red, #dc1c1c);
}
/* Bookie modal — grouped sections for a cleaner, scannable layout (anh chốt 2026-07-19).
   Each field group is a light card with an emoji-tagged header; replaces the flat one-grid form. */
.itrade-soccer-section {
  margin: 0 0 12px;
  padding: 13px 15px 15px;
  border: 1px solid var(--itrade-border, #e6e6ec);
  border-radius: 12px;
  background: var(--itrade-bg-alt, #f8f9fb);
}
.itrade-soccer-section:last-of-type { margin-bottom: 0; }
.itrade-soccer-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--itrade-muted, #6b7280);
}
.itrade-soccer-section-ic { font-size: 14px; line-height: 1; }
.itrade-soccer-section .itrade-meta { margin-top: 0; }
/* Schedule modal — 7 day-sections default collapsed, header click toggles (anh chốt 2026-07-21). */
.itrade-soccer-section[data-schedule-day] .itrade-soccer-section-head { cursor: pointer; user-select: none; margin-bottom: 0; }
.itrade-soccer-section[data-schedule-day]:not(.itrade-collapsed) .itrade-soccer-section-head { margin-bottom: 12px; }
.itrade-soccer-section[data-schedule-day].itrade-collapsed .itrade-schedule-windows { display: none; }
.itrade-schedule-caret { display: inline-block; transition: transform .15s ease; }
.itrade-soccer-section[data-schedule-day].itrade-collapsed .itrade-schedule-caret { transform: rotate(-90deg); }
.itrade-schedule-count { color: var(--itrade-muted, #6b7280); font-weight: 700; }
/* O/U on/off rendered as a distinct toggle row instead of a bare inline checkbox */
.itrade-soccer-toggle-row {
  flex-direction: row !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border: 1px solid var(--itrade-border, #e6e6ec);
  border-radius: 10px;
  background: var(--itrade-bg, #fff);
  cursor: pointer;
}
.itrade-soccer-toggle-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.itrade-soccer-toggle-text strong { color: var(--itrade-text, #111827); font-size: 13px; font-weight: 700; }
.itrade-soccer-toggle-desc { color: var(--itrade-muted, #6b7280); font-size: 11px; font-weight: 500; }
.itrade-soccer-toggle-row .itrade-checkbox { width: 18px; height: 18px; margin: 0; accent-color: var(--itrade-red, #dc1c1c); flex: 0 0 auto; }
.itrade-soccer-form-actions {
  margin-top: 14px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}
/* Auto-login sits in the action bar between Cancel and Save, styled as a button-height pill so the
   checkbox + label read as one control on a single line, matching the Cancel/Save buttons. */
.itrade-soccer-action-check {
  display: inline-flex;
  flex-direction: row !important;   /* beat the global `label { flex-direction: column }` so tick + text share a row */
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-sizing: border-box;
  margin: 0;
  min-height: var(--itrade-button-height, 36px);        /* match .itrade-btn exactly */
  padding: 0 var(--itrade-button-pad-x, 16px);
  border: 1px solid var(--itrade-border, #e6e9f0);
  border-radius: var(--itrade-button-radius, 999px);
  background: #fff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--itrade-fg-muted, #666);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
.itrade-soccer-action-check:hover { border-color: var(--itrade-fg-soft, #888); }
.itrade-soccer-action-check .itrade-checkbox { width: 15px; height: 15px; margin: 0; accent-color: var(--itrade-red, #dc1c1c); flex: 0 0 auto; }
@media (max-width: 900px) {
  .itrade-soccer-settings { grid-template-columns: 1fr; }
  .itrade-soccer-bookie-summary { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
}
@media (max-width: 640px) {
  .itrade-soccer-toolbar { align-items: stretch; flex-direction: column; }
  .itrade-soccer-toolbar > div { flex-direction: column; gap: 2px; }
  .itrade-soccer-toolbar .itrade-button,
  .itrade-soccer-toolbar .itrade-page-connect-btn { width: 100%; }
  .itrade-soccer-form-grid { grid-template-columns: 1fr; }

  /* Two-up, not one-up. anh, 2026-07-31: the four summary cards (Balance / Total running / Win-Lose /
   * P/L) were eating a third of the phone screen and Betlist Running — the reason the page exists —
   * got the scraps. One card per row is what did it: four full-width rows at 58px + gaps before any
   * content. A 2x2 grid halves that for free; these are four short numbers, not paragraphs.
   * Note ≤900px above is already 2-up, so ≤640px dropping to 1-up made phones WORSE than tablets. */
  .itrade-soccer-bookie-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .itrade-soccer-bookie-card { min-height: 48px; padding: 6px 8px; }
  .itrade-soccer-bookie-card .v { font-size: 15px; } /* 05/11: +1px như bản rộng */

  /* The topbar is a 2-column grid (tabs | actions). On a phone the tabs wrap to two rows, so the
   * actions cell becomes two rows tall and its align-items:center floated "Add Bookie" and the avatar
   * to the vertical middle — level with neither row, which is the misalignment anh reported. Pin them
   * to the top row. Scoped to the soccer surface so the crypto/bots topbars are untouched. */
  .itrade-soccer-surface .itrade-product-topbar-actions {
    align-self: start;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}


/* Soccer settings popup shell */
.itrade-soccer-empty-state {
  min-height: min(520px, 62vh);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px;
}
.itrade-soccer-empty-state h1 {
  margin: 0 0 8px;
  font-size: clamp(24px, 3vw, 36px);
  letter-spacing: -0.04em;
}
.itrade-soccer-empty-actions {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}
.itrade-soccer-settings-modal {
  min-width: min(100%, 960px);
  min-height: min(560px, calc(92vh - 120px));
  display: flex;
  flex-direction: column;
}
.itrade-soccer-settings-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 0 0 10px;
  margin: 0 0 14px;
  border-bottom: 1px solid var(--itrade-border, #e6e6ec);
  scrollbar-width: thin;
}
.itrade-soccer-settings-tabs .itrade-soccer-tab {
  max-width: 170px;
}
/* "+ Add Bookie" once every plan tab is used — greyed and unclickable (Boss 2026-07-17). Covers both the
   settings-modal tab and any main-page/empty-state add button ([data-itrade-soccer-add]). */
.itrade-soccer-tab[disabled],
.itrade-soccer-tab:disabled,
[data-itrade-soccer-add][disabled],
[data-itrade-soccer-add]:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}
.itrade-soccer-settings-panel {
  flex: 1 1 auto;
  min-height: min(460px, calc(92vh - 190px));
  max-height: calc(92vh - 170px);
  overflow: auto;
  padding-right: 2px;
}
.itrade-soccer-proxy-panel .itrade-soccer-head {
  align-items: center;
}
.itrade-soccer-plan-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.itrade-soccer-plan-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--itrade-border, #e5e7eb);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}
.itrade-soccer-plan-option.is-on {
  border-color: var(--itrade-red, #DC1C1C);
  box-shadow: 0 0 0 2px rgba(220, 28, 28, 0.08);
}
.itrade-soccer-plan-option input {
  margin: 0;
}
.itrade-soccer-plan-option span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
}
.itrade-soccer-plan-option small {
  color: var(--itrade-fg-muted, #667085);
  font-weight: 500;
}
.itrade-soccer-plan-option b {
  white-space: nowrap;
}
.itrade-soccer-settings-panel .itrade-panel {
  margin: 0;
  border-radius: 12px;
}
.itrade-soccer-leagues-panel .itrade-soccer-league-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin-top: 10px;
}
.itrade-soccer-leagues-panel .itrade-soccer-league-check {
  width: 100%;
  justify-content: space-between;
  border-radius: 10px;
  padding: 10px 12px;
}
.itrade-soccer-leagues-panel .itrade-soccer-league-check span {
  flex: 1 1 auto;
  min-width: 0;
}
@media (max-width: 640px) {
  .itrade-soccer-empty-state { align-items: stretch; flex-direction: column; min-height: auto; }
  .itrade-soccer-empty-actions { justify-content: flex-start; }
  .itrade-soccer-empty-actions .itrade-button,
  .itrade-soccer-empty-actions .itrade-btn { width: 100%; }
  .itrade-soccer-settings-panel { max-height: calc(92vh - 190px); }
}

.itrade-soccer-surface .itrade-product-topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.itrade-soccer-subtabs {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 14px;
  padding-left: 14px;
  border-left: 1px solid var(--itrade-border, #e6e6ec);
}

.itrade-soccer-subtabs-label {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--itrade-muted, #6b7280);
  background: var(--itrade-bg-alt, #f8f9fb);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* Member-wide Schedule nav entry, next to the "Bookies" label (Boss 2026-07-21). Uses the
 * same .itrade-soccer-bw-tab pill look as the Betlist Running / Bet Settled /
 * Main tabs -- the parent .itrade-soccer-subtabs flex row already has gap:8px for spacing. */
.itrade-soccer-schedule-nav-btn {
  flex: 0 0 auto;
}

.itrade-soccer-tabs--topbar {
  min-width: 0;
  flex: 1 1 auto;
  padding: 0;
}

.itrade-soccer-tabs--topbar .itrade-soccer-tab {
  min-height: 28px;
  max-width: 150px;
  padding: 5px 10px;
  font-size: 12px;
}

.itrade-soccer-bookie-actions-card {
  min-height: 58px;
  box-sizing: border-box;
  padding: 7px 8px 7px 0;
  align-self: stretch;
  justify-content: flex-start;
  align-content: center;
}

.itrade-soccer-bookie-actions-card .itrade-btn {
  white-space: nowrap;
}

/* Uniform action row (anh chốt 2026-07-12): the 4 controls — Auto Bet pill, session
   pill, Edit, Settings — are a <label>, a <span> and two <button>s, each carrying its
   own base height/padding (auto-bet 30px/5px, status pill ~18px/2px, btn--sm 32px).
   That made them mismatched. Normalize all four to one 32px pill height, identical
   horizontal padding, and vertical centering so the row reads as one set. */
.itrade-soccer-bookie-actions-card > .itrade-soccer-auto-bet-consent,
.itrade-soccer-bookie-actions-card > .itrade-soccer-session-pill,
.itrade-soccer-bookie-actions-card > .itrade-btn {
  height: 32px;
  min-height: 32px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  padding: 0 12px;
  font-size: 12px;
  line-height: 1;
}

@media (min-width: 901px) {
  .itrade-soccer-bookie-summary {
    grid-template-columns: minmax(250px, auto) repeat(4, minmax(104px, 1fr));
    align-items: stretch;
  }
  /* MASTER TAB HAS ONLY 4 CARDS, NO ACTION CELL (owner 19/08: "why are the 4 Master cards not aligned evenly, why do they all align left").
   * The desktop grid is FIVE columns: the first column >= 250px holds the member's [Auto Bet | pill | Edit | Settings] cell. The master tab has no such
   * cell (master deliberately cannot open a browser), so 4 cards fell into columns 1..4 — the first card stretched to 250px, column 5 empty, the row
   * pushed left. The master tab uses exactly four equal columns; everything else shares the member card layout. */
  .itrade-soccer-bookie-summary--master {
    grid-template-columns: repeat(4, minmax(104px, 1fr));
  }
  /* Paper tab second card row: FIVE equal cards (07/11: BG · GBC · GBS5 paper · GBS4 paper · GBS3 paper). Screens <= 900px fall back to 2 columns like every tab. */
  .itrade-soccer-bookie-summary--master.itrade-soccer-bookie-summary--nam {
    grid-template-columns: repeat(5, minmax(96px, 1fr));
  }
  /* 08/11: SIX cards (SPB paper added — owner "let's see whether SPB or GBS6 does better"). */
  .itrade-soccer-bookie-summary--master.itrade-soccer-bookie-summary--sau {
    grid-template-columns: repeat(6, minmax(88px, 1fr));
  }
  /* 17/11: Paper tab top row SEVEN cards (BS real money switched on, owner). */
  .itrade-soccer-bookie-summary--master.itrade-soccer-bookie-summary--bay {
    grid-template-columns: repeat(7, minmax(80px, 1fr));
  }
  /* 17/11: Paper tab top row EIGHT cards (SPB real money switched on, owner). */
  .itrade-soccer-bookie-summary--master.itrade-soccer-bookie-summary--tam {
    grid-template-columns: repeat(8, minmax(72px, 1fr));
  }
}

@media (max-width: 980px) {
  .itrade-soccer-tabs--topbar .itrade-soccer-tab {
    max-width: 120px;
    padding-inline: 9px;
  }
}

@media (max-width: 640px) {
  .itrade-soccer-surface .itrade-product-topbar-left {
    max-width: none;
    flex-wrap: wrap;
    gap: 6px;
  }
  .itrade-soccer-subtabs {
    flex-basis: 100%;
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
  }
  .itrade-soccer-tabs--topbar {
    flex-basis: auto;
  }
  /* This card is the FIRST CELL of .itrade-soccer-bookie-summary, not a block above it — the grid holds
   * five children: [Auto Bet | session pill | Edit | Settings], then Balance, Running, Win/Lose, P/L.
   * So a plain 2-column grid put the action row beside Balance and left P/L alone on a third row.
   * Span it across both columns and it becomes its own row, with the four stat cards falling into the
   * 2x2 anh asked for underneath (anh, 2026-07-31). */
  .itrade-soccer-bookie-actions-card {
    grid-column: 1 / -1;
    padding-right: 0;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 4px;
  }
  /* One row, always. The four controls total ~290px against a 390px phone, so they fit — but the
   * parent's flex-wrap:wrap would drop Settings onto a second line the moment a longer label appears
   * ("Auto Bet (tạm dừng)" is the real case). Let them shrink instead of wrapping. */
  .itrade-soccer-bookie-actions-card > .itrade-soccer-auto-bet-consent,
  .itrade-soccer-bookie-actions-card > .itrade-soccer-session-pill,
  .itrade-soccer-bookie-actions-card > .itrade-btn {
    flex: 0 1 auto;
    min-width: 0;
  }
  .itrade-soccer-bookie-actions-card .itrade-btn {
    padding-inline: 10px;
  }
}

/* Account-real betlist mirror (2026-06-12) — manual bets read from the bookmaker's own betlist. */
.itrade-soccer-manual-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid rgba(245, 158, 11, .55);
  background: rgba(245, 158, 11, .12);
  color: #b45309;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
}
.itrade-soccer-betlist-meta {
  margin: 0 0 6px;
}
.itrade-soccer-betlist-meta.is-failed {
  color: #c1272d;
}
.itrade-soccer-betlist-meta.is-deferred {
  color: #b8860b;
}

/* Settled-view date filter bar */
.itrade-settled-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 8px;
}
.itrade-settled-filter-btn {
  flex: 0 0 auto;
  padding: 4px 12px;
  border: 1px solid var(--itrade-border, #e6e6ec);
  border-radius: 999px;
  background: #fff;
  color: var(--itrade-fg-muted, #6b7280);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.4;
  transition: background .12s, color .12s, border-color .12s;
}
.itrade-settled-filter-btn:hover {
  border-color: var(--itrade-red, #dc1c1c);
  color: var(--itrade-red, #dc1c1c);
}
.itrade-settled-filter-btn.is-active {
  background: var(--itrade-red, #dc1c1c);
  border-color: var(--itrade-red, #dc1c1c);
  color: #fff;
}

/* Settled pager (anh, 2026-08-03 — the tab stopped at 200 while an account already held 617 tickets).
 * Borrows the filter bar's pill/border vocabulary above rather than inventing a second one, so the two
 * rows read as one control block. The count sits left and the controls right; on a phone they wrap and
 * the arrows stay thumb-sized, since this is a control that gets touched repeatedly, unlike the period
 * chips. Arrows rather than page numbers: the row count is what tells you where you are, and a member
 * with 617 settled tickets would otherwise get 13 numbered buttons on a 390px screen. */
.itrade-settled-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
}
.itrade-settled-pager-count {
  flex: 1 1 auto;
  white-space: nowrap;
}
/* Arrows and the size select are ONE group that never breaks apart (anh, 2026-08-03: "50 / trang cho
 * nằm sau nút sau margin với nút sau 10px để đở chiếm diện tích"). Left to wrap on its own the select
 * dropped to a second row and cost a whole line of height on a phone for a control used in passing. */
.itrade-settled-pager-nav {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px;
}
/* anh, 2026-08-03: "cái nút thấy gớm". They were 34px squares at 15px type sitting directly under the
 * period chips, which are 4px/12px pills at 12px — nearly half the weight. Two rows of controls doing
 * the same kind of job should not be two different sizes, so these now take the chip's exact metrics.
 * Only min-height is kept, as a touch target: a 12px pill is comfortable to read but small to hit. */
.itrade-settled-pager-btn {
  padding: 4px 12px;
  min-height: 30px;
  border: 1px solid var(--itrade-border, #e6e6ec);
  border-radius: 999px;
  background: #fff;
  color: var(--itrade-fg-muted, #6b7280);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.itrade-settled-pager-btn:hover:not(:disabled) {
  border-color: var(--itrade-red, #dc1c1c);
  color: var(--itrade-red, #dc1c1c);
}
/* Disabled must not merely look inert — at the ends of the list it is the only signal that there is
 * nothing further, since the arrows stay in place rather than disappearing and reflowing the row. */
.itrade-settled-pager-btn:disabled {
  opacity: .38;
  cursor: default;
}
.itrade-settled-pager-size {
  margin-left: 10px;   /* 10px off "Sau ›", not the 4px that separates the two arrows from each other */
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid var(--itrade-border, #e6e6ec);
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  color: var(--itrade-fg-muted, #6b7280);
  cursor: pointer;
}

/* Horizontal scroll for the wide bet tables (Betlist Running / Bet Settled).
 *
 * anh, iPhone, 2026-07-31: the STAKE @ ODDS columns were simply gone off the right edge, cut mid-header.
 * .itrade-table sets width:100%, which cannot shrink below the cells' min-content — 13 columns at 12px
 * padding do not fit 390px — so the table overflows its box. The inline style="overflow:auto" wrapper was
 * meant to catch that, but .itrade-soccer-workspace above it is overflow:hidden, so the overflow got
 * CLIPPED instead of scrolled and the last columns became unreachable rather than merely off-screen.
 *
 * min-width:0 is the part that actually matters: without it a flex descendant is sized by its content,
 * so the wrapper grows to the table's full width and never becomes a scroll port at all. It is the same
 * fix already applied to .itrade-soccer-workspace and .itrade-soccer-subtabs in this file.
 *
 * The min-width on mobile is deliberate: letting 13 columns compress to fit turns every cell into a
 * four-line wrap (the match name in anh's screenshot took four lines). Better to keep the columns
 * legible and let the table scroll sideways. */
.itrade-soccer-table-scroll {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Settled period filter: chips on desktop, one select on a phone (anh, 2026-07-31 — mobile only).
 * Both are in the markup and CSS picks one, so there is no resize handler and no JS that can disagree
 * with what is on screen. The chip row cost ~130px on a phone because seven chips wrap to two lines,
 * for a control that gets touched once per session. */
.itrade-settled-filter-select { display: none; }
@media (max-width: 640px) {
  .itrade-settled-filter-chips { display: none; }
  .itrade-settled-filter-select {
    display: block;
    width: 100%;
    box-sizing: border-box;
    min-height: 36px;
    padding: 6px 10px;
    border: 1px solid var(--itrade-border, #e6e6ec);
    border-radius: 10px;
    background: #fff;
    font-size: 14px;
    font-weight: 600;
    color: var(--itrade-fg, #1a1a1a);
  }
}

/* Topbar: Crypto / Soccer / Add Bookie / Wallet folded into ONE button on the Bookies row, phone only
 * (anh, 2026-07-31: "gom lại thành 1 cho gọn rồi cho nằm chung hàng với chữ bookie").
 *
 * The header used to be a 2-column grid whose left cell stacked Crypto/Soccer above
 * Bookies/GHT/LOC/Schedule, because .itrade-soccer-subtabs takes flex-basis:100% at this width. That
 * second row cost ~85px and forced the actions cell to match its height.
 *
 * The markup ships <details open> with the tabs and both buttons inside it, and soccer.js closes it only
 * on a phone. That ordering matters: DESKTOP never depends on overriding a CLOSED details' content
 * hiding, which browsers implement inconsistently (::details-content vs slot) — it is simply open, the
 * summary is hidden, and display:contents lets the header lay out its grandchildren in the old order.
 * If the JS never runs, a phone degrades to the menu being open, which is today's layout, not a broken
 * one. Failing back to "slightly tall" beats failing back to "buttons you cannot reach".
 *
 * The buttons are MOVED into the panel, not copied: plan-selector.js and desktop-auth.js both resolve
 * the wallet button with a singular document.querySelector, so a duplicate would be inert. */

/* Desktop: byte-for-byte the old arrangement — tabs, subtabs, then the two buttons pushed right. */
@media (min-width: 641px) {
  .itrade-soccer-surface .itrade-product-topbar--compact {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .itrade-soccer-surface .itrade-product-topbar--compact .itrade-topbar-more,
  .itrade-soccer-surface .itrade-product-topbar--compact .itrade-topbar-more-panel { display: contents; }
  .itrade-soccer-surface .itrade-product-topbar--compact .itrade-topbar-more-btn { display: none; }
  .itrade-soccer-surface .itrade-product-topbar--compact .itrade-product-tabs { order: 1; }
  .itrade-soccer-surface .itrade-product-topbar--compact .itrade-product-topbar-left {
    order: 2;
    flex: 1 1 auto;
    min-width: 0;
  }
  .itrade-soccer-surface .itrade-product-topbar--compact .itrade-product-action { order: 3; }
  .itrade-soccer-surface .itrade-product-topbar--compact .itrade-product-avatar { order: 4; }
}

/* Phone: [Bookies GHT LOC Schedule] ......... [☰] */
@media (max-width: 640px) {
  .itrade-soccer-surface .itrade-product-topbar--compact {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
  }
  .itrade-soccer-surface .itrade-product-topbar--compact .itrade-product-topbar-left {
    order: 1;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .itrade-soccer-surface .itrade-product-topbar--compact .itrade-product-topbar-left::-webkit-scrollbar { display: none; }
  .itrade-soccer-surface .itrade-soccer-subtabs {
    flex-basis: auto;
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
  }
  .itrade-soccer-surface .itrade-topbar-more {
    order: 2;
    flex: 0 0 auto;
    position: relative;
  }
  .itrade-soccer-surface .itrade-topbar-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 34px;
    box-sizing: border-box;
    border: 1px solid var(--itrade-border, #e6e6ec);
    border-radius: 10px;
    background: #fff;
    color: inherit;
    font: inherit;
    font-size: 16px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
  }
  /* Closed by DEFAULT, opened by a class. The panel used to depend on the <details> open attribute,
     which meant the markup shipped open and JavaScript had to close it on phones — so a slow or failed
     script left every control spilled across the header. Now the quiet state is the correct one. */
  .itrade-soccer-surface .itrade-topbar-more-panel { display: none; }
  .itrade-soccer-surface .itrade-topbar-more.is-open > .itrade-topbar-more-panel {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 60;
    min-width: 190px;
    padding: 10px;
    border: 1px solid var(--itrade-border, #e6e6ec);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(16, 18, 27, 0.16);
  }
  .itrade-soccer-surface .itrade-topbar-more-panel .itrade-product-tabs { display: flex; gap: 6px; }
  .itrade-soccer-surface .itrade-topbar-more-panel .itrade-product-tab { flex: 1 1 0; text-align: center; }
  .itrade-soccer-surface .itrade-topbar-more-panel .itrade-button { width: 100%; white-space: nowrap; }
}
@media (max-width: 640px) {
  .itrade-soccer-table-scroll > table { min-width: 780px; }
  .itrade-soccer-table-scroll > table thead th,
  .itrade-soccer-table-scroll > table tbody td { padding: 8px 9px; }
}
}

/* Ba cấp Unit — mỗi cấp một khối THU GỌN sẵn (anh 2026-08-05: "mặc định là closepand"). Dùng
   <details> gốc nên đóng/mở không cần JS và không có trạng thái nào để lệch. */
/* Khối cấp giải (.itrade-tier-*) GỠ 18/10 cùng unit theo giải. */

/* Thẻ tab Paper GBS6 + Sharp (anh 04/11 "làm 4 card lại cho đẹp đẹp tí") — cùng thẻ tab bookie, viền + chữ xanh/đỏ y như thẻ P/L member;
   data-pw-card để không lọt vào nhánh data-bw-card. */
.itrade-soccer-bookie-card[data-pw-card] .v { font-size: 17px; font-variant-numeric: tabular-nums; }
.itrade-soccer-bookie-card[data-pw-card].is-profit {
  border-color: rgba(34, 197, 94, .55);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, .14), 0 0 18px rgba(34, 197, 94, .16);
}
.itrade-soccer-bookie-card[data-pw-card].is-profit .v { color: #1a7f37; }
.itrade-soccer-bookie-card[data-pw-card].is-loss {
  border-color: rgba(239, 68, 68, .55);
  box-shadow: 0 0 0 1px rgba(239, 68, 68, .14), 0 0 18px rgba(239, 68, 68, .16);
}
.itrade-soccer-bookie-card[data-pw-card].is-loss .v { color: #b91c1c; }

/* Hard Soccer gate (owner 23/11/2026, amendment A1 C5): while js/soccer-gate.js has not confirmed sign-in +
 * Soccer subscription, show none of the Soccer UI — only the gate step it renders into .itrade-soccer-main. */
.itrade-soccer[data-soccer-gate="locked"] .itrade-soccer-subtabs,
.itrade-soccer[data-soccer-gate="locked"] .itrade-product-action,
.itrade-soccer[data-soccer-gate="locked"] .itrade-soccer-workspace {
  display: none !important;
}
