/* Admin match page (admin/fixtures/show): header, progress and next step, Mark Final,
   Automatic updates, manual entry and footnote. Colours come from design_tokens.css so
   one rule serves both themes; tone chips use .cb-tone from zz_ui_refresh.css. The
   leading :root .cb-home keeps these rules ahead of the older dark/light admin themes. */

/* Tone chips (generic .cb-status rules would otherwise override the tone colours). */
:root .cb-home .cb-admin-workspace .cb-admin-match .cb-status.cb-tone {
  gap: 6px;
  padding: 4px 10px;
  border-color: var(--chip-border);
  background: var(--chip-bg);
  box-shadow: none;
  /* A touch of body text keeps 11px chip text above AA on tinted panels in both themes. */
  color: color-mix(in srgb, var(--chip-fg) 85%, var(--cb-text));
  font-size: 11px;
  white-space: nowrap;
}

/* Header. */
:root .cb-home .cb-admin-workspace .cb-admin-match .cb-match-header { padding: 26px 28px; margin-bottom: 18px; }
.cb-admin-match .cb-match-header .cb-eyebrow { margin-bottom: 10px; }
.cb-admin-match .cb-match-header-title { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; }
.cb-admin-match .cb-match-header-title h1 { margin: 0; }
.cb-admin-match .cb-match-header-title .cb-admin-secondary { min-height: 40px; }
.cb-admin-match .cb-match-header-teams { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 16px; }
.cb-admin-match .cb-match-header-team { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.cb-admin-match .cb-match-header-team strong { color: var(--cb-text); font-size: 15px; font-weight: 650; overflow-wrap: anywhere; }
:root .cb-home .cb-admin-workspace .cb-admin-match .cb-match-header-team .cb-team-logo { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 9px; font-size: 10px; }
.cb-admin-match .cb-match-header-vs { color: var(--cb-text-muted); font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; }
:root .cb-home .cb-admin-workspace .cb-admin-match .cb-match-header-meta { display: flex; flex-wrap: wrap; gap: 2px 14px; max-width: none; margin: 12px 0 0; color: var(--cb-text-muted); font-size: 13px; line-height: 1.6; }
.cb-admin-match .cb-match-header-meta > span + span::before { content: "·"; margin-right: 14px; }
.cb-admin-match .cb-match-header-meta time { color: var(--cb-text); font-weight: 600; }
.cb-admin-match .cb-match-header-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
/* The header's tinted panel needs chip text a step closer to the body text. */
:root .cb-home .cb-admin-workspace .cb-admin-match .cb-match-header-chips .cb-status.cb-tone { color: color-mix(in srgb, var(--chip-fg) 72%, var(--cb-text)); }
.cb-admin-match .cb-match-header > .cb-text-link { margin-top: 16px; }

/* Progress bar and next step. */
.cb-admin-match .cb-match-progress { overflow: hidden; border: 1px solid var(--cb-border); border-radius: 14px; background: var(--cb-surface-card); }
.cb-admin-match .cb-match-steps { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 0; padding: 18px 12px 14px; list-style: none; }
.cb-admin-match .cb-match-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 7px; min-width: 0; text-align: center; }
.cb-admin-match .cb-match-step + .cb-match-step::before {
  content: "";
  position: absolute;
  top: 11px;
  right: calc(50% + 15px);
  left: calc(-50% + 15px);
  height: 2px;
  border-radius: 2px;
  background: var(--cb-border);
}
.cb-admin-match .cb-match-step:is(.is-done, .is-current, .is-missing) + .cb-match-step:is(.is-done, .is-current, .is-missing)::before { background: var(--cb-accent); }
.cb-admin-match .cb-match-step-dot {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 2px solid var(--cb-border);
  border-radius: 50%;
  background: var(--cb-surface-card);
  color: var(--cb-surface-page);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}
.cb-admin-match .cb-match-step.is-done .cb-match-step-dot { border-color: var(--cb-accent); background: var(--cb-accent); }
.cb-admin-match .cb-match-step.is-current .cb-match-step-dot { border-color: var(--cb-accent); background: color-mix(in srgb, var(--cb-accent) 22%, var(--cb-surface-card)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--cb-accent) 18%, transparent); }
.cb-admin-match .cb-match-step-label { color: var(--cb-text-muted); font-size: 11px; font-weight: 600; line-height: 1.3; overflow-wrap: normal; }
.cb-admin-match .cb-match-step.is-done .cb-match-step-label { color: var(--cb-text); }
.cb-admin-match .cb-match-step.is-current .cb-match-step-label { color: var(--cb-accent); font-weight: 750; }
/* Passed without a saved toss or XI: hollow dashed dot, never a tick. */
.cb-admin-match .cb-match-step.is-missing .cb-match-step-dot { border-style: dashed; border-color: var(--cb-text-muted); color: var(--cb-text-muted); }
/* Cancelled: dim the dots and lines only, so the labels keep their contrast. */
.cb-admin-match .cb-match-progress.is-cancelled .cb-match-step-dot,
.cb-admin-match .cb-match-progress.is-cancelled .cb-match-step + .cb-match-step::before { opacity: .5; }

.cb-admin-match .cb-match-next {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  padding: 18px 22px 20px;
  border-top: 1px solid var(--cb-border-subtle);
  box-shadow: inset 3px 0 var(--tone);
  background: color-mix(in srgb, var(--tone) 7%, var(--cb-surface-card));
}
.cb-admin-match .cb-match-next-copy { flex: 1 1 340px; min-width: 0; }
:root .cb-home .cb-admin-workspace .cb-admin-match .cb-match-next .cb-eyebrow { margin: 0 0 4px; color: var(--tone); }
.cb-admin-match .cb-match-next h2 { margin: 0; color: var(--cb-text); font-size: 20px; font-weight: 700; letter-spacing: -.02em; line-height: 1.3; overflow-wrap: anywhere; }
.cb-admin-match .cb-match-next-copy > p:not(.cb-eyebrow) { max-width: 72ch; margin: 6px 0 0; color: var(--cb-text-muted); font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.cb-admin-match .cb-match-next .cb-button { flex: 0 0 auto; min-height: 44px; }

/* Shared section heading. */
.cb-admin-match .cb-match-section-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; }
:root .cb-home .cb-admin-workspace .cb-admin-match .cb-match-section-head h2 { margin: 0; }
.cb-admin-match .cb-match-section-head > div > .cb-field-help { margin: 6px 0 0; }
.cb-admin-match .cb-match-section-head .cb-scoring-status { margin: 0; }

/* Mark Final. */
:root .cb-home .cb-admin-workspace .cb-admin-match .cb-match-final.is-prominent {
  border-color: color-mix(in srgb, var(--cb-accent) 50%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--cb-accent) 14%, transparent), 0 14px 32px #0000001f;
}
:root .cb-home .cb-admin-workspace .cb-admin-match .cb-match-final.is-compact { padding: 20px 24px; }
:root .cb-home .cb-admin-workspace .cb-admin-match .cb-match-final.is-compact h2 { font-size: 18px; }
.cb-admin-match .cb-match-final > .cb-field-help { margin: 10px 0 0; }
.cb-admin-match .cb-match-final > p:not(.cb-field-help, .cb-form-errors) { margin: 12px 0 0; color: var(--cb-text); font-size: 14px; line-height: 1.6; }
.cb-admin-match .cb-match-checklist { display: grid; gap: 8px; margin: 16px 0; padding: 0; list-style: none; }
.cb-admin-match .cb-match-checklist li { display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: start; gap: 12px; padding: 11px 14px; border: 1px solid var(--cb-border-subtle); border-radius: 10px; }
.cb-admin-match .cb-match-checklist li.is-ok { --tone: var(--cb-tone-open); }
.cb-admin-match .cb-match-checklist li.is-blocking { --tone: var(--cb-tone-live); border-color: color-mix(in srgb, var(--cb-tone-live) 32%, transparent); }
.cb-admin-match .cb-match-checklist li.is-info { --tone: var(--cb-tone-progress); }
.cb-admin-match .cb-match-check-mark { display: grid; place-items: center; width: 26px; height: 26px; border: 1px solid color-mix(in srgb, var(--tone) 45%, transparent); border-radius: 50%; background: color-mix(in srgb, var(--tone) 13%, transparent); color: color-mix(in srgb, var(--tone) 85%, var(--cb-text)); font-size: 13px; font-weight: 800; }
.cb-admin-match .cb-match-check-copy { min-width: 0; padding-top: 2px; }
.cb-admin-match .cb-match-check-copy strong { color: var(--cb-text); font-size: 14px; font-weight: 650; line-height: 1.5; overflow-wrap: anywhere; }
.cb-admin-match .cb-match-check-copy em { margin-left: 8px; padding: 1px 7px; border: 1px solid var(--cb-border-subtle); border-radius: 20px; color: var(--cb-text-muted); font-size: 10.5px; font-style: normal; font-weight: 600; white-space: nowrap; }
.cb-admin-match .cb-match-check-copy small { display: block; margin-top: 2px; color: var(--cb-text-muted); font-size: 12.5px; line-height: 1.55; overflow-wrap: anywhere; }
.cb-admin-match .cb-match-blockers { margin: 0 0 16px; padding: 12px 16px; border-left: 3px solid var(--cb-tone-live); border-radius: 0 10px 10px 0; background: color-mix(in srgb, var(--cb-tone-live) 7%, transparent); color: var(--cb-text); font-size: 13px; line-height: 1.6; }
.cb-admin-match .cb-match-blockers p { margin: 0; }
.cb-admin-match .cb-match-blockers ul { margin: 6px 0 0; padding-left: 18px; list-style: disc; }
.cb-admin-match .cb-match-warning { margin: 0 0 12px; color: var(--cb-tone-progress); font-size: 13px; font-weight: 600; line-height: 1.6; }
:root .cb-home .cb-admin-workspace .cb-admin-match .cb-match-final-form .cb-scoring-confirm { margin-block: 4px 16px; }
.cb-admin-match .cb-match-final-form .cb-button { min-width: 180px; }

/* Small disclosures: flex summaries lose the native marker, so draw a chevron. */
.cb-admin-match :is(.cb-match-details, .cb-match-cricbuzz-review, .cb-match-no-play-toggle, .cb-match-alt-path) > summary { list-style: none; }
.cb-admin-match :is(.cb-match-details, .cb-match-cricbuzz-review, .cb-match-no-play-toggle, .cb-match-alt-path) > summary::-webkit-details-marker { display: none; }
.cb-admin-match :is(.cb-match-details, .cb-match-cricbuzz-review, .cb-match-no-play-toggle, .cb-match-alt-path) > summary::before {
  content: "▸";
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 14px;
  height: 14px;
  margin-right: 6px;
  color: var(--cb-text-muted);
  line-height: 1;
  text-align: center;
  transition: transform .2s;
}
.cb-admin-match :is(.cb-match-details, .cb-match-cricbuzz-review, .cb-match-no-play-toggle, .cb-match-alt-path)[open] > summary::before { transform: rotate(90deg); }

/* Scores checklist tucked away while "Confirm no play" is the way to Final. */
.cb-admin-match .cb-match-alt-path { margin-top: 14px; border-top: 1px solid var(--cb-border-subtle); }
.cb-admin-match .cb-match-alt-path > summary { display: flex; align-items: center; min-height: 44px; color: var(--cb-text-muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.cb-admin-match .cb-match-alt-path > summary:hover { color: var(--cb-text); }

/* What Cricbuzz shows (inside Mark Final). */
.cb-admin-match .cb-match-cricbuzz-review { margin-top: 16px; padding-top: 4px; border-top: 1px solid var(--cb-border-subtle); color: var(--cb-text); font-size: 13px; line-height: 1.6; }
.cb-admin-match .cb-match-cricbuzz-review > summary { display: flex; align-items: center; min-height: 44px; color: var(--cb-text); font-weight: 650; cursor: pointer; }
.cb-admin-match .cb-match-cricbuzz-review p { margin: 0 0 8px; overflow-wrap: anywhere; }
.cb-admin-match .cb-match-cricbuzz-review .cb-scoring-checks { margin: 8px 0; padding: 10px 14px; }
.cb-admin-match .cb-match-cricbuzz-review .cb-scoring-checks ul { margin: 6px 0 0; padding-left: 18px; list-style: disc; }

/* No play. */
:root .cb-home .cb-admin-workspace .cb-admin-match .cb-match-no-play { margin: 16px 0; padding: 18px 20px; }
.cb-admin-match .cb-match-no-play-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.cb-admin-match .cb-match-no-play-head h3 { margin: 0; color: var(--cb-text); font-size: 17px; font-weight: 700; }
.cb-admin-match .cb-match-no-play .cb-no-play-zero { padding: 6px 12px; font-size: 1.4rem; }
.cb-admin-match .cb-match-no-play > p { margin: 12px 0; color: var(--cb-text-muted); font-size: 14px; line-height: 1.7; }
:root .cb-home .cb-admin-workspace .cb-admin-match .cb-match-no-play .cb-scoring-checks { margin: 12px 0; padding: 10px 14px 10px 32px; font-size: 13px; line-height: 1.6; list-style: disc; }
.cb-admin-match .cb-match-no-play-toggle { margin-top: 14px; border-top: 1px solid var(--cb-border-subtle); }
.cb-admin-match .cb-match-no-play-toggle > summary { display: flex; align-items: center; min-height: 44px; color: var(--cb-text-muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.cb-admin-match .cb-match-no-play-toggle > summary:hover { color: var(--cb-text); }
:root .cb-home .cb-admin-workspace .cb-admin-match .cb-match-no-play-toggle .cb-match-no-play { margin-top: 4px; }

/* Automatic updates. */
.cb-admin-match .cb-match-auto-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cb-admin-match .cb-match-auto-actions form, .cb-admin-match .cb-match-details form { margin: 0; }
:root .cb-home .cb-admin-workspace .cb-admin-match :is(.cb-match-auto-actions, .cb-match-details) .cb-admin-secondary { min-height: 40px; font-family: inherit; cursor: pointer; }
.cb-admin-match .cb-match-auto-rows { margin: 16px 0 0; padding: 0; list-style: none; }
.cb-admin-match .cb-match-auto-row {
  display: grid;
  grid-template-columns: 96px 124px minmax(0, 1fr);
  align-items: baseline;
  gap: 4px 14px;
  padding: 12px 0;
  border-top: 1px solid var(--cb-border-subtle);
}
.cb-admin-match .cb-match-auto-label { color: var(--cb-text); font-size: 14px; font-weight: 650; }
.cb-admin-match .cb-match-auto-row .cb-status { justify-self: start; }
.cb-admin-match .cb-match-auto-line { min-width: 0; color: var(--cb-text); font-size: 13.5px; line-height: 1.55; overflow-wrap: anywhere; }
.cb-admin-match .cb-match-auto-times { grid-column: 3; color: var(--cb-text-muted); font-size: 12px; }
.cb-admin-match .cb-match-details { border-top: 1px solid var(--cb-border-subtle); }
.cb-admin-match .cb-match-details > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 0; padding: 12px 0; color: var(--cb-text); font-size: 14px; font-weight: 650; cursor: pointer; }
.cb-admin-match .cb-match-details > summary small { flex-basis: 100%; padding-left: 20px; color: var(--cb-text-muted); font-size: 12px; font-weight: 500; line-height: 1.5; }
.cb-admin-match .cb-match-detail-block { padding: 14px 0; border-top: 1px dashed var(--cb-border-subtle); }
.cb-admin-match .cb-match-detail-block h3 { margin: 0 0 6px; color: var(--cb-text); font-size: 14px; font-weight: 700; }
.cb-admin-match .cb-match-detail-block > p { margin: 0 0 6px; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.cb-admin-match .cb-match-detail-block .cb-source-actions { margin-top: 10px; }
.cb-admin-match .cb-match-detail-block .cb-source-actions + p { margin-top: 10px; }
.cb-admin-match .cb-match-detail-times { display: flex; flex-wrap: wrap; gap: 4px 22px; color: var(--cb-text-muted); font-size: 12px; }
.cb-admin-match .cb-match-detail-times strong { color: var(--cb-text); font-weight: 600; }
:root .cb-home .cb-admin-workspace .cb-admin-match .cb-match-details .cb-source-history { margin-top: 0; padding-top: 14px; }
.cb-admin-match .cb-match-details .cb-source-history ul { margin: 8px 0 0; padding-left: 18px; list-style: disc; }
.cb-admin-match .cb-match-details > .cb-field-help { margin: 0; padding: 12px 0; border-top: 1px dashed var(--cb-border-subtle); }

/* Toss and result. */
.cb-admin-match .cb-match-summary > .cb-field-help { margin: 8px 0 0; }
:root .cb-home .cb-admin-workspace .cb-admin-match .cb-match-summary .cb-fixture-toss-summary { margin: 0 0 12px; }

/* Manual entry & corrections. */
.cb-admin-match .cb-match-manual { padding: 0 22px; border: 1px solid var(--cb-border); border-radius: 14px; background: var(--cb-surface-card); }
.cb-admin-match .cb-match-manual > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 3px 16px; min-height: 44px; padding: 16px 0; list-style: none; cursor: pointer; }
.cb-admin-match .cb-match-manual > summary::-webkit-details-marker { display: none; }
.cb-admin-match .cb-match-manual > summary::after { content: "▾"; grid-column: 2; grid-row: 1 / span 2; color: var(--cb-text-muted); font-size: 14px; transition: transform .2s; }
.cb-admin-match .cb-match-manual[open] > summary::after { transform: rotate(180deg); }
:root .cb-home .cb-admin-workspace .cb-admin-match .cb-match-manual-title { grid-column: 1; margin: 0; color: var(--cb-text); font-family: inherit; font-size: 16px; font-weight: 700; letter-spacing: normal; line-height: 1.4; }
.cb-admin-match .cb-match-manual-help { grid-column: 1; color: var(--cb-text-muted); font-size: 12.5px; line-height: 1.5; }
.cb-admin-match .cb-match-manual > .cb-field-help { margin: 0 0 12px; }
.cb-admin-match .cb-match-manual-tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin: 0 0 16px; padding: 0; list-style: none; }
.cb-admin-match .cb-match-manual-tool { display: flex; align-items: center; gap: 12px; height: 100%; padding: 12px 14px; border: 1px solid var(--cb-border-subtle); border-radius: 10px; color: var(--cb-text); text-decoration: none; }
.cb-admin-match .cb-match-manual-tool:is(:hover, :focus-visible) { border-color: color-mix(in srgb, var(--cb-accent) 55%, transparent); background: color-mix(in srgb, var(--cb-accent) 5%, transparent); }
.cb-admin-match .cb-match-manual-icon { display: grid; flex: 0 0 36px; place-items: center; width: 36px; height: 36px; border: 1px solid var(--cb-border); border-radius: 9px; color: var(--cb-accent); }
.cb-admin-match .cb-match-manual-icon svg { width: 19px; height: 19px; }
.cb-admin-match .cb-match-manual-copy { min-width: 0; }
.cb-admin-match .cb-match-manual-copy strong { display: block; font-size: 14px; font-weight: 650; line-height: 1.4; }
.cb-admin-match .cb-match-manual-copy small { display: block; margin-top: 2px; color: var(--cb-text-muted); font-size: 12px; line-height: 1.45; }
.cb-admin-match .cb-match-manual-fixture { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 14px 0 18px; border-top: 1px solid var(--cb-border-subtle); }
.cb-admin-match .cb-match-manual-fixture form { margin: 0; }
:root .cb-home .cb-admin-workspace .cb-admin-match .cb-match-manual-fixture .cb-admin-secondary { min-height: 40px; font-family: inherit; cursor: pointer; }
.cb-admin-match .cb-match-manual-fixture small { color: var(--cb-text-muted); font-size: 12px; line-height: 1.5; }

.cb-admin-match .cb-match-points-link { margin: 0 0 24px; }

/* Footnote. */
.cb-admin-match .cb-match-footnote { padding-top: 16px; border-top: 1px solid var(--cb-border-subtle); color: var(--cb-text-muted); font-size: 12px; line-height: 1.6; }
.cb-admin-match .cb-match-footnote > p { margin: 0 0 8px; overflow-wrap: anywhere; }
.cb-admin-match .cb-match-footnote .cb-lock-notice { font-size: 12px; }
:root .cb-home .cb-admin-workspace .cb-admin-match .cb-match-footnote .cb-scoring-audit { margin-top: 10px; padding-top: 0; border-top: 0; }

@media (max-width: 640px) {
  :root .cb-home .cb-admin-workspace .cb-admin-match .cb-match-header { padding: 20px; }
  .cb-admin-match .cb-match-steps { padding: 14px 4px 12px; }
  .cb-admin-match .cb-match-step-label { font-size: 9.5px; letter-spacing: -.01em; }
  :root .cb-home .cb-admin-workspace .cb-admin-match .cb-match-header-meta { flex-direction: column; }
  .cb-admin-match .cb-match-header-meta > span + span::before { content: none; }
  .cb-admin-match .cb-match-step-dot { width: 20px; height: 20px; font-size: 11px; }
  .cb-admin-match .cb-match-step + .cb-match-step::before { top: 9px; right: calc(50% + 13px); left: calc(-50% + 13px); }
  .cb-admin-match .cb-match-next { padding: 16px; }
  .cb-admin-match .cb-match-next-copy { flex-basis: 100%; }
  .cb-admin-match .cb-match-next h2 { font-size: 18px; }
  .cb-admin-match .cb-match-next .cb-button { width: 100%; }
  :root .cb-home .cb-admin-workspace .cb-admin-match .cb-match-final.is-compact { padding: 18px; }
  .cb-admin-match .cb-match-checklist li { padding: 10px 12px; }
  .cb-admin-match .cb-match-final-form .cb-button { width: 100%; }
  .cb-admin-match .cb-match-auto-row { grid-template-columns: minmax(0, 1fr) auto; }
  .cb-admin-match .cb-match-auto-row .cb-status { justify-self: end; }
  .cb-admin-match :is(.cb-match-auto-line, .cb-match-auto-times) { grid-column: 1 / -1; }
  .cb-admin-match .cb-match-manual { padding: 0 16px; }
  .cb-admin-match .cb-match-manual-tools { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .cb-admin-match .cb-match-manual > summary::after,
  .cb-admin-match :is(.cb-match-details, .cb-match-cricbuzz-review, .cb-match-no-play-toggle, .cb-match-alt-path) > summary::before { transition: none; }
}
