/* Match recording is shared by the schedule dialog and the standalone editor.
   Size the ledger from its available panel width, including browser zoom. */
.schedule-centre-page .match-record-dialog {
  box-sizing: border-box;
  width: min(1160px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  background: var(--surface-2);
  color: var(--text-1);
}
.schedule-centre-page .match-record-dialog-body { padding: 22px; }
.schedule-centre-page .match-record-dialog .dialog-close {
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  margin: 10px 10px -46px 0;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.schedule-centre-page .match-record-dialog-body > .compact-report-editor > .compact-report-score > header {
  padding-right: 48px;
}
.compact-report-editor,
.compact-report-editor .tournament-panel,
.compact-report-editor .tournament-panel > header > div,
.compact-report-editor .compact-score-grid > label,
.compact-report-editor .goal-side > header > b {
  min-width: 0;
}
.compact-report-editor .tournament-panel {
  box-sizing: border-box;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}
.compact-report-editor .tournament-panel > header { align-items: flex-start; }
.compact-report-editor .tournament-panel > header > b { flex: 0 0 auto; padding-top: 3px; }
.compact-report-editor h3 { overflow-wrap: anywhere; }
.compact-report-editor .report-match-teams {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}
.compact-report-editor .report-match-teams > span {
  min-width: 0;
  overflow: hidden;
  color: var(--text-1);
  font: inherit;
  letter-spacing: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.compact-report-editor .compact-score-grid {
  grid-template-columns: minmax(0, 1fr) 30px minmax(0, 1fr);
}
.compact-score-grid > label > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compact-report-editor .compact-score-grid input { min-width: 0; min-height: 46px; }
.compact-report-editor .compact-goals-panel { container-type: inline-size; container-name: goal-ledger; }
.compact-report-editor .team-goal-columns {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 0 16px 16px;
}
.compact-report-editor .goal-stats-hint { margin: 0; padding: 14px 16px; color: var(--text-2); line-height: 1.6; }
.compact-report-editor :is(.match-card-hint, .match-card-panel-actions > small, .match-card-empty) { color: var(--text-2); }
.compact-report-editor .report-notes { max-width: none; }
.compact-report-editor .goal-side {
  min-width: 0;
  border-color: var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-inset);
}
.compact-report-editor .goal-side > header { align-items: center; gap: 8px; }
.compact-report-editor .goal-side > header small { flex: 0 0 auto; color: var(--text-2); }
.compact-report-editor .compact-goal-row {
  box-sizing: border-box;
  min-width: 0;
  border-color: var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.compact-report-editor .compact-goal-row legend { max-width: 100%; flex-wrap: wrap; gap: 6px; }
.compact-report-editor .compact-goal-row label { color: var(--text-2); }
.compact-report-editor .compact-goal-row :is(input:not([type="checkbox"]), select) {
  box-sizing: border-box;
  min-width: 0;
  min-height: 40px;
  background: var(--surface-input);
  color: var(--text-1);
  font-size: 15px;
}
.compact-report-editor :is(.score-section-label, .shootout-toggle) small { color: var(--text-2); }
.compact-report-editor .shootout-toggle > input:disabled + span { opacity: 1; color: var(--text-2); }
.compact-report-editor .shootout-toggle > input:disabled { opacity: .65; }
.compact-report-editor :is(input, select, textarea, button):focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}
.compact-report-editor .report-editor-actions { flex-wrap: wrap; padding-block: 2px; }
.compact-report-editor .compact-cards-panel { container-type: inline-size; container-name: card-ledger; }
.compact-report-editor .match-card-fields {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, .8fr) minmax(0, .5fr) minmax(0, .5fr);
}
.compact-report-editor .match-card-fields :is(label, input, select) { min-width: 0; }
.compact-report-editor .match-card-panel-actions { min-width: 0; flex-wrap: wrap; }
html[data-theme="light"] .two-leg-scoreboard {
  background: linear-gradient(135deg, color-mix(in srgb, var(--blue) 7%, var(--surface-2)), var(--surface-2));
}
html[data-theme="light"] .two-leg-report-tabs [role="tab"][aria-selected="true"] { color: var(--lime); }
html[data-theme="light"] .match-record-dialog::backdrop { background: rgba(35, 55, 62, .28); }
@container goal-ledger (max-width: 680px) {
  .compact-report-editor .team-goal-columns { grid-template-columns: minmax(0, 1fr); }
}
@container card-ledger (max-width: 820px) {
  .compact-report-editor .match-card-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .compact-report-editor :is(.match-card-team-field, .match-card-player-field, .match-card-notes-field) { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .schedule-centre-page .match-record-dialog { width: calc(100vw - 24px); max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); }
  .schedule-centre-page .match-record-dialog-body { padding: 12px; }
  .compact-report-editor .score-section-label { align-items: flex-start; flex-direction: column; gap: 4px; }
  .compact-report-editor .tournament-panel > header { gap: 8px; padding: 14px 12px; }
  .compact-report-editor .report-match-teams { gap: 6px; font-size: 17px; }
}
@media (min-width: 2400px) {
  .schedule-centre-page .match-record-dialog { width: min(1680px, calc(100vw - 64px)); }
  .schedule-centre-page .match-record-dialog-body { padding: 28px; }
  .compact-report-editor .compact-score-grid input { min-height: 52px; font-size: 24px; }
  .compact-report-editor .goal-stats-hint { font-size: 16px; }
}
