.hidden {
  display: none !important;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.75rem 0;
  font-size: 12px;
}

:root {
  --blue-dark: #1f4e78;
  --blue-mid: #bdd7ee;
  --blue-light: #deebf7;
  --white: #ffffff;
  --border: #2f2f2f;
  --text: #1a1a1a;
  --error: #c00000;
  --ok: #1e7a3c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Tahoma, 'Segoe UI', sans-serif;
  font-size: 11px;
  color: var(--text);
  background: #eef3f8;
}

.page {
  max-width: 1680px;
  margin: 0 auto;
  padding: 1rem 1.25rem 3rem;
}

.sheet-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 1rem;
  align-items: start;
}

.col-matches .section-card--compact {
  margin-bottom: 0.75rem;
}

.phase-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0 0 0.6rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed #ccc;
}

.phase-toolbar-hint {
  font-size: 0.68rem;
  color: #555;
}

.btn-sm {
  font-size: 0.72rem;
  padding: 0.35rem 0.75rem;
}

/* Match score tables (left column) — slightly smaller than default */
.col-matches .data-table {
  font-size: 9px;
}

.col-matches .data-table th,
.col-matches .data-table td {
  padding: 0.15rem 0.25rem;
}

.col-matches .data-table td.team-cell,
.col-matches .data-table td.team {
  min-width: 100px;
}

.col-bracket .section-card--compact {
  margin-bottom: 0.75rem;
}

.standings-card {
  border-left: 4px solid var(--blue-dark);
}

.standings-card .hint {
  font-size: 0.7rem;
  font-weight: 400;
  color: #555;
}

.standings-note {
  margin: 0 0 0.6rem;
  font-size: 0.68rem;
  color: #444;
}

.standings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 0.5rem;
}

.group-mini {
  border: 1px solid #bbb;
  border-radius: 4px;
  overflow: visible;
  background: #fafcff;
}

.group-mini-title {
  background: var(--blue-mid);
  font-weight: 700;
  font-size: 0.68rem;
  text-align: center;
  padding: 0.2rem;
}

.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.62rem;
}

.standings-table th,
.standings-table td {
  border: 1px solid #ccc;
  padding: 0.15rem 0.2rem;
  text-align: center;
}

.standings-table th:nth-child(3),
.standings-table th:nth-child(4),
.standings-table td:nth-child(3),
.standings-table td:nth-child(4) {
  width: 1.4rem;
  padding-left: 0.1rem;
  padding-right: 0.1rem;
}

.standings-table th:last-child,
.standings-table td:last-child {
  min-width: 2.75rem;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.standings-table .team-name {
  text-align: left;
  max-width: 5.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.standings-table .rank-1 td {
  background: #e8f4e8;
}

.standings-table .rank-2 td {
  background: #f0f6fc;
}

.standings-table tr.rank-third-qualified td {
  background: #fff8e1;
  font-weight: 600;
}

.standings-table tr.rank-third-qualified .team-name::after {
  content: ' ★';
  color: #e6a800;
  font-size: 0.65rem;
}

.standings-table tr.rank-third-out td {
  background: #f5f5f5;
  color: #888;
}

.standings-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin: 0 0 0.5rem;
  font-size: 0.65rem;
  color: #444;
}

.standings-legend .legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.legend-swatch {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 2px;
  border: 1px solid #bbb;
}

.legend-swatch--third-ok {
  background: #fff8e1;
}

.legend-swatch--third-out {
  background: #f0f0f0;
}

.team-cell--locked {
  background: #eef6ee;
}

.knockout-select--locked {
  background: #eef6ee;
  color: #1a3a5c;
  font-weight: 700;
  cursor: default;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: none;
  pointer-events: none;
}

.knockout-select--third {
  border-color: #e6a800;
  background: #fffdf5;
}

.select-grid--dense {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.5rem;
}

select.select-auto {
  background: #e8f4fc;
  border-color: var(--blue-dark);
}

.auto-pick {
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border, #c5d0de);
  border-radius: 6px;
  background: #f4f7fb;
  min-height: 2.25rem;
  line-height: 1.35;
  color: var(--text);
}

.auto-pick-filled {
  font-weight: 700;
  color: #0d1b2a;
  background: #e8f4e8;
  border-color: var(--blue-dark);
}

.field-block--auto.select-auto .auto-pick {
  background: #e8f4e8;
}

.team-dynamic.team-placeholder {
  color: #5a6a7a;
  font-style: italic;
  font-weight: 500;
}

.team-dynamic:not(.team-placeholder) {
  font-weight: 600;
  color: var(--text, #1a2a3a);
}

.bracket-info .standings-note {
  margin: 0;
}

@media (max-width: 1100px) {
  .sheet-layout {
    grid-template-columns: 1fr;
  }
}

.header {
  text-align: center;
  margin-bottom: 1.25rem;
}

.header h1 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--white);
  background: var(--blue-dark);
  padding: 0.5rem 0.85rem;
  border-radius: 4px;
}

.subtitle {
  margin: 0.4rem 0 0;
  color: var(--error);
  font-weight: 700;
  font-size: 0.75rem;
}

.card {
  background: var(--white);
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

#form-sections .section-card {
  margin-bottom: 1.25rem;
}

#form-sections .section-card h2 {
  border-bottom: 2px solid var(--blue-mid);
  padding-bottom: 0.4rem;
}

.card h2 {
  margin: 0 0 0.6rem;
  font-size: 0.85rem;
  color: var(--blue-dark);
}

.participant-card {
  border-left: 4px solid var(--blue-dark);
}

.field-label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.input-text,
.input-score,
select {
  font: inherit;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.25rem 0.35rem;
  background: var(--white);
}

.input-lg {
  width: 100%;
  max-width: 420px;
  font-size: 0.9rem;
}

.input-score {
  width: 3rem;
  text-align: center;
}

select {
  width: 100%;
  max-width: 280px;
}

.table-wrap {
  overflow-x: auto;
  overflow-y: visible;
}

section[data-phase-section='r32'] .table-wrap,
section[data-phase-section='r16'] .table-wrap,
section[data-phase-section='r8'] .table-wrap,
section[data-phase-section='r4'] .table-wrap,
section[data-phase-section='final'] .table-wrap {
  overflow: visible;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}

.data-table th,
.data-table td {
  border: 1px solid var(--border);
  padding: 0.2rem 0.3rem;
  text-align: center;
  vertical-align: middle;
}

.data-table th {
  background: var(--blue-mid);
  font-weight: 700;
}

.data-table td.team {
  text-align: left;
  min-width: 110px;
  background: var(--blue-light);
}

.data-table td.readonly {
  background: var(--blue-light);
}

.data-table input,
.data-table select {
  width: 100%;
  min-width: 2.5rem;
}

.sign-cell {
  background: var(--blue-light);
}

.sign-display {
  display: inline-block;
  min-width: 1.5rem;
  font-weight: 700;
  color: #666;
}

.sign-display.sign-filled {
  color: var(--text);
  background: #e8f4e8;
  border-radius: 3px;
  padding: 0.1rem 0.35rem;
}

.select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem 1rem;
}

.field-block label {
  display: block;
  font-weight: 700;
  font-size: 0.72rem;
  margin-bottom: 0.2rem;
}

.field-block.invalid input,
.field-block.invalid select,
input.invalid,
select.invalid,
tr.invalid input,
tr.invalid select {
  outline: 2px solid var(--error);
}

.footer {
  text-align: center;
  padding: 1rem 0;
}

.status {
  min-height: 1.4em;
  margin: 0 0 0.75rem;
  font-weight: 700;
}

.status.error {
  color: var(--error);
}

.status.ok {
  color: var(--ok);
}

.btn-primary {
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.6rem 1.6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #f0f0f0;
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--blue-mid);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.portal-page {
  max-width: 420px;
  margin: 0 auto;
}

/* Официални резултати — по-широко за таблици с домакин/гост */
.portal-page--wide {
  max-width: min(100%, 720px);
}

.portal-card {
  padding: 1.25rem;
}

.portal-form .field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.field-hint {
  margin: 0.25rem 0 0;
  font-size: 0.68rem;
  color: #555;
}

.btn-block {
  width: 100%;
  margin-top: 0.5rem;
}

.btn-secondary {
  font: inherit;
  font-weight: 700;
  padding: 0.5rem 1.2rem;
  margin-left: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
}

a.btn-primary,
a.btn-secondary {
  display: inline-block;
  text-decoration: none;
  color: inherit;
  vertical-align: middle;
}

a.btn-primary:hover,
a.btn-secondary:hover {
  color: inherit;
}

.portal-footer {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.85rem;
}

.participant-bar {
  margin-bottom: 0.75rem;
  padding: 0.65rem 1rem;
}

.participant-bar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.participant-label {
  margin: 0;
  font-weight: 700;
}

.points-label {
  margin: 0;
  font-weight: 700;
  color: var(--ok);
}

.participant-actions {
  display: flex;
  gap: 1rem;
}

.btn-link {
  font: inherit;
  background: none;
  border: none;
  color: var(--blue-dark);
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.view-only-banner {
  background: #fff8e6;
  border: 1px solid #e6c200;
  padding: 0.6rem 1rem;
  margin-bottom: 0.75rem;
  border-radius: 4px;
  text-align: center;
  font-weight: 600;
}

.view-only-banner.admin-edit-banner {
  background: #fff3e0;
  border-color: #ff9800;
  color: #5d4037;
}

.save-feedback {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #e8f5e9;
  border: 1px solid #81c784;
  padding: 0.55rem 1rem;
  margin-bottom: 0.75rem;
  border-radius: 4px;
  text-align: center;
  font-weight: 600;
  color: var(--ok);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.save-feedback--pending {
  background: #f3f6fb;
  border-color: #9eb8d4;
  color: var(--blue-dark);
}

.save-feedback--error {
  background: #ffebee;
  border-color: #ef9a9a;
  color: var(--error);
}

.save-feedback--ok {
  background: #e8f5e9;
  border-color: #81c784;
  color: var(--ok);
}

body.admin-scorer-edit .admin-editable-scorer {
  background: #fffde7 !important;
  border: 2px solid #f9a825 !important;
  font-weight: 600;
}

body.admin-scorer-edit.form-readonly .admin-editable-scorer:enabled {
  opacity: 1;
  color: var(--text) !important;
  -webkit-text-fill-color: var(--text);
}

.knockout-select {
  width: 100%;
  min-width: 7rem;
  font-size: inherit;
  color: var(--text);
  font-weight: 600;
  background: #fff;
}

select,
.input-text {
  color: var(--text);
}

select.select-has-value,
.knockout-select.select-has-value {
  color: #0d1b2a;
  font-weight: 700;
}

.input-text.input-has-value {
  color: #0d1b2a;
  font-weight: 600;
}

.form-readonly select:disabled,
.form-readonly input:disabled,
.form-readonly .input-text:disabled {
  opacity: 1;
  color: var(--text) !important;
  -webkit-text-fill-color: var(--text);
  background: #fff;
  font-weight: 600;
  cursor: default;
}

.form-readonly .knockout-select--locked:disabled {
  background: #eef6ee;
  color: #1a3a5c !important;
  -webkit-text-fill-color: #1a3a5c;
  font-weight: 700;
}

.form-readonly .knockout-select.select-has-value:disabled {
  color: #0d1b2a !important;
  -webkit-text-fill-color: #0d1b2a;
  font-weight: 700;
  background: #fff;
}

.data-table--knockout td.team-cell {
  min-width: 120px;
  background: #fafcff;
}

.data-table--knockout-r32 th.knockout-slot-col,
.data-table--knockout-r32 td.knockout-slot-col {
  width: 4.5rem;
  min-width: 4.5rem;
  max-width: 5.5rem;
  padding: 0.35rem 0.4rem;
  vertical-align: middle;
  text-align: center;
  background: #f5f7fa;
  border-left: 1px dashed #c5d0dc;
}

.data-table--knockout-r32 th.knockout-slot-col {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5a6a7a;
}

.knockout-slot-hint {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.25;
  color: #1a3a5c;
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  cursor: help;
}

.knockout-slot-hint--third {
  color: #b45309;
  background: #fff8e6;
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
  border: 1px solid #f9a825;
}

.third-place-guide-mount {
  margin-top: 1rem;
}

.third-place-guide {
  padding: 0.85rem 1rem;
  background: #f0f6fc;
  border: 1px solid #90caf9;
  border-radius: 6px;
  font-size: 0.88rem;
  line-height: 1.45;
}

.third-place-guide--pending {
  background: #fff8e6;
  border-color: #ffe082;
}

.third-place-guide__title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: #1565c0;
}

.third-place-guide__text {
  margin: 0 0 0.75rem;
  color: #333;
}

.third-place-guide__warn {
  margin: 0 0 0.75rem;
  padding: 0.5rem 0.65rem;
  border-left: 3px solid #c0392b;
  background: #fdf0ef;
  font-size: 0.88rem;
  line-height: 1.4;
}

.third-place-guide__auto {
  margin: 0 0 0.75rem;
  padding: 0.45rem 0.65rem;
  border-left: 3px solid #1a7f37;
  background: #eefbf1;
  font-size: 0.88rem;
}

.third-place-guide__cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 720px) {
  .third-place-guide__cols {
    grid-template-columns: 1fr;
  }
}

.third-place-guide__subtitle {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #555;
}

.third-place-guide__list {
  margin: 0;
  padding-left: 1.1rem;
}

.third-place-guide__team--done {
  color: #2e7d32;
}

.third-place-guide__team--free {
  color: #333;
}

.third-place-guide__slot-row--blocked {
  color: #b71c1c;
  margin-bottom: 0.5rem;
}

.third-place-guide__slot-row--open {
  color: #1565c0;
}

.third-place-guide__hint {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.8rem;
  color: #555;
  font-style: italic;
}

.third-place-guide__gr {
  color: #666;
  font-weight: 600;
}

.third-place-guide code {
  font-size: 0.85em;
  background: #fff;
  padding: 0.05rem 0.25rem;
  border-radius: 2px;
}

tr.knockout-pairing-error td {
  background: #ffe8e8 !important;
  outline: 2px solid #c62828;
  outline-offset: -2px;
}

.knockout-warnings {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 4px;
  background: #fff3f3;
  border: 1px solid #e57373;
  font-size: 0.9rem;
  line-height: 1.4;
}

.match-points-col,
td.match-points,
.field-points {
  text-align: center;
  font-weight: 700;
  min-width: 52px;
  background: #f8fafc;
}

td.match-points--pending,
.field-points.match-points--pending {
  color: #5a6a7a;
  font-weight: 600;
}

td.match-points--earned,
.field-points.match-points--earned {
  color: #1b5e20;
  background: #e8f5e9;
}

td.match-points--missed,
.field-points.match-points--missed {
  color: #b71c1c;
  background: #ffebee;
}

.field-block--with-points {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  gap: 0.5rem;
  align-items: start;
}

.field-block--with-points .field-points {
  margin-top: 1.65rem;
  padding: 0.35rem 0.25rem;
  border: 1px solid #c5d0de;
  border-radius: 4px;
  min-height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.field-block--with-points .field-block-content {
  min-width: 0;
}

.sign-display.sign-filled {
  color: #0d1b2a;
  font-weight: 800;
}

.scorer-name-field,
.scorer-name-field--filled {
  color: #0d1b2a;
  font-weight: 600;
}

.form-readonly .scorer-name-field[readonly] {
  color: #0d1b2a !important;
  -webkit-text-fill-color: #0d1b2a;
  font-weight: 700;
  background: #fff;
}

.admin-top-scorer-form {
  max-width: 420px;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed #ccc;
}

.phase-points {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1565c0;
}

.match-no-cell--official {
  cursor: help;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
}

.match-no-cell--official:focus-visible {
  outline: 2px solid #1565c0;
  outline-offset: 2px;
}

.knockout-select--earned,
select.select--earned {
  background-color: #dafbe1 !important;
  border-color: #2da44e !important;
  color: #116329;
  font-weight: 600;
}

.form-readonly .knockout-select--earned:disabled,
.form-readonly select.select--earned:disabled {
  opacity: 1;
  -webkit-text-fill-color: #116329;
}

.input-score--earned {
  background-color: #dafbe1 !important;
  border-color: #2da44e !important;
  color: #116329;
  font-weight: 700;
}

.sign-cell--earned .sign-display {
  color: #116329;
  font-weight: 700;
}

.auto-pick.auto-pick--earned {
  background-color: #dafbe1;
  border: 1px solid #2da44e;
  color: #116329;
  font-weight: 600;
}

.match-points-badge {
  font-weight: 700;
  color: #1b5e20;
  font-size: 0.9rem;
}

.admin-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.admin-list li {
  padding: 0.85rem 0;
  border-bottom: 1px solid #ddd;
}

.admin-btn-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
}

.admin-btn {
  display: inline-block;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.25;
  padding: 0.5rem 0.9rem;
  border-radius: 5px;
  border: 1px solid #9eb4c8;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
  color: #0d1b2a;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.admin-btn:hover {
  text-decoration: none;
  color: #0d1b2a;
}

.admin-btn--primary {
  background: var(--blue-mid);
  border-color: #5a8fb8;
}

.admin-btn--primary:hover {
  background: #7eb8e8;
}

.admin-btn--secondary {
  background: #fff;
  border-color: #9eb4c8;
}

.admin-btn--secondary:hover {
  background: #f0f6fc;
}

.admin-btn--muted {
  background: #f5f7fa;
  border-color: #c5d0dc;
  color: #334155;
}

.admin-btn--muted:hover {
  background: #e8eef5;
}

.admin-btn--ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--blue-dark);
  text-decoration: underline;
  font-weight: 600;
  padding: 0.5rem 0.35rem;
}

.admin-btn--ghost:hover {
  background: transparent;
  color: #0d47a1;
}

.admin-btn.is-disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: default;
  box-shadow: none;
}

.admin-tournament-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.55rem;
}

.admin-tournament-meta {
  line-height: 1.4;
}

.admin-subnav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.admin-subnav > a:first-child {
  margin-right: 0.25rem;
}

.admin-group-row {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 0.75rem;
  align-items: start;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed #ccc;
}

.admin-table-wrap {
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table th,
.admin-table td {
  border: 1px solid #ccc;
  padding: 6px 8px;
  vertical-align: middle;
}

.admin-table th {
  background: #e8f0f8;
  text-align: left;
}

.admin-table input.input-text {
  width: 100%;
  min-width: 48px;
}

.admin-knockout-phases {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.75rem;
}

.admin-knockout-phase {
  margin: 0;
}

.admin-knockout-phase .admin-phase-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: #1a3a5c;
  line-height: 1.3;
}

.admin-knockout-phase .admin-table-wrap {
  margin-bottom: 0;
}

.admin-password-form {
  max-width: 360px;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #e0e0e0;
}

.hint {
  font-size: 0.9rem;
  color: #555;
  margin: 0.25rem 0 0.75rem;
}

.import-errors {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 1rem;
  max-height: 200px;
  overflow-y: auto;
  font-size: 0.85rem;
  color: #a00;
}

.import-errors li {
  padding: 0.25rem 0;
  border-bottom: 1px solid #eee;
}

@media print {
  .participant-bar,
  .footer,
  .view-only-banner,
  .save-feedback,
  #standings-panel {
    display: none !important;
  }
}

@media (max-width: 640px) {
  .data-table {
    font-size: 9px;
  }

  .portal-form .field-row {
    grid-template-columns: 1fr;
  }

  .portal-page--wide {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  .portal-page--wide .portal-card,
  .portal-page--wide .admin-knockout-phase {
    padding-left: 0.6rem;
    padding-right: 0.6rem;
  }
}

/* Нокаут таблици — без хоризонтален скрол на тесен екран */
@media (max-width: 520px) {
  .page {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  #form-sections .section-card--compact,
  .admin-knockout-phase {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  .table-wrap,
  .admin-table-wrap {
    overflow-x: visible;
  }

  .data-table--knockout {
    table-layout: fixed;
    width: 100%;
  }

  .data-table--knockout th:nth-child(1),
  .data-table--knockout td:nth-child(1) {
    width: 8%;
  }

  .data-table--knockout th:nth-child(2),
  .data-table--knockout td:nth-child(2) {
    width: 17%;
  }

  .data-table--knockout th:nth-child(3),
  .data-table--knockout td:nth-child(3) {
    width: 13%;
  }

  .data-table--knockout th:nth-child(4),
  .data-table--knockout td:nth-child(4),
  .data-table--knockout th:nth-child(5),
  .data-table--knockout td:nth-child(5) {
    width: 31%;
  }

  .data-table--knockout th:nth-child(6),
  .data-table--knockout td:nth-child(6) {
    width: 12%;
  }

  .data-table--knockout.data-table--with-points th:nth-child(2),
  .data-table--knockout.data-table--with-points td:nth-child(2) {
    width: 9%;
  }

  .data-table--knockout.data-table--with-points th:nth-child(3),
  .data-table--knockout.data-table--with-points td:nth-child(3) {
    width: 14%;
  }

  .data-table--knockout.data-table--with-points th:nth-child(4),
  .data-table--knockout.data-table--with-points td:nth-child(4) {
    width: 11%;
  }

  .data-table--knockout.data-table--with-points th:nth-child(5),
  .data-table--knockout.data-table--with-points td:nth-child(5),
  .data-table--knockout.data-table--with-points th:nth-child(6),
  .data-table--knockout.data-table--with-points td:nth-child(6) {
    width: 28%;
  }

  .data-table--knockout.data-table--with-points th:nth-child(7),
  .data-table--knockout.data-table--with-points td:nth-child(7) {
    width: 10%;
  }

  .data-table--knockout td.team-cell,
  .col-matches .data-table--knockout td.team-cell {
    min-width: 0;
  }

  .data-table--knockout .knockout-select,
  .data-table--knockout select {
    min-width: 0;
    max-width: none;
    padding: 0.15rem 0.1rem;
    font-size: 8px;
  }

  .data-table--knockout th,
  .data-table--knockout td {
    padding: 0.15rem 0.12rem;
  }

  .data-table--knockout-r32 th:nth-child(2),
  .data-table--knockout-r32 td:nth-child(2),
  .data-table--knockout-r32 th:nth-child(3),
  .data-table--knockout-r32 td:nth-child(3) {
    display: none;
  }

  .data-table--knockout-r32 th:nth-child(1),
  .data-table--knockout-r32 td:nth-child(1) {
    width: 8%;
  }

  .data-table--knockout-r32 th:nth-child(4),
  .data-table--knockout-r32 td:nth-child(4),
  .data-table--knockout-r32 th:nth-child(6),
  .data-table--knockout-r32 td:nth-child(6) {
    width: 31%;
  }

  .data-table--knockout-r32 th.knockout-slot-col,
  .data-table--knockout-r32 td.knockout-slot-col {
    width: 15%;
    min-width: 0;
    max-width: none;
    padding-left: 0.08rem;
    padding-right: 0.08rem;
  }

  .data-table--knockout-r32 .knockout-slot-hint {
    font-size: 0.66rem;
    line-height: 1.1;
  }

  .data-table--knockout-r32 .knockout-slot-hint--third {
    padding: 0.1rem 0.18rem;
  }

  .data-table--knockout-r32.data-table--with-points th:nth-child(2),
  .data-table--knockout-r32.data-table--with-points td:nth-child(2) {
    display: table-cell;
    width: 9%;
  }

  .data-table--knockout-r32.data-table--with-points th:nth-child(3),
  .data-table--knockout-r32.data-table--with-points td:nth-child(3),
  .data-table--knockout-r32.data-table--with-points th:nth-child(4),
  .data-table--knockout-r32.data-table--with-points td:nth-child(4) {
    display: none;
  }

  .data-table--knockout-r32.data-table--with-points th:nth-child(5),
  .data-table--knockout-r32.data-table--with-points td:nth-child(5),
  .data-table--knockout-r32.data-table--with-points th:nth-child(7),
  .data-table--knockout-r32.data-table--with-points td:nth-child(7) {
    width: 28%;
  }
}

.scoring-rules-card {
  background: var(--blue-dark);
  color: var(--white);
  border: none;
}

.scoring-rules-card h2 {
  color: var(--white);
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
}

.scoring-rules-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem 1rem;
}

.scoring-rules-list {
  margin: 0;
  padding: 0 0 0 1.1rem;
  font-size: 10px;
  line-height: 1.45;
}

.scoring-rules-list li {
  margin: 0.15rem 0;
}

.admin-standings-grid {
  margin-bottom: 1rem;
}

.admin-standings-override {
  margin-bottom: 1.25rem;
  padding: 0.75rem;
  background: #f8fafc;
  border: 1px solid #c5d4e8;
  border-radius: 4px;
}

.admin-override-title {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
}

.admin-override-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}

.admin-override-group h4 {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  color: var(--blue-dark);
}

.field-block--compact label {
  font-size: 10px;
}

@media (max-width: 900px) {
  .scoring-rules-grid {
    grid-template-columns: 1fr;
  }
}
