/* Общий слой только для соревнований. Журнал, админка, профиль ученика и
   печатные протоколы не меняются. Цвета предупреждений и статусов сохранены. */
body.sport-ui:is(.page-sport-competition-list,.page-school-tournament-list) :is(.tournament-hero,.school-tm-head),
body.sport-ui.page-sport-competition-detail .tm-hero,
body.sport-ui.page-teacher-mrds-competitions .mrds-head,
body.sport-ui .pc-workspace .pc-header {
  padding:12px; background:#e7f1eb; border:0; border-bottom:2px solid #c1d9cb;
  border-radius:0; box-shadow:none;
}
body.sport-ui:is(.page-sport-competition-list,.page-school-tournament-list) :is(.tournament-card--compact,.school-tm-card),
body.sport-ui.page-teacher-mrds-competitions .mrds-card { background:#f1f8f4; border-color:#ccdfd3; }
body.sport-ui:is(.page-sport-competition-list,.page-school-tournament-list) :is(.tournament-card__title,.school-tm-card__title) { font-size:16px; line-height:1.4; }
body.sport-ui:is(.page-sport-competition-list,.page-school-tournament-list) :is(.tournament-card__compact-meta>span,.school-tm-stat>span,.school-tm-stat>strong,.school-tm-card__meta) { font-size:13px; }
/* Нативная ссылка позволяет открыть карточку и клавиатурой, и в новой вкладке.
   Прозрачная область расширяет нажатие; действия не перекрываются ссылкой. */
body.sport-ui :is(.tournament-card--compact,.school-tm-card) { position:relative; }
body.sport-ui .competition-title-link { color:inherit; text-decoration:none; }
body.sport-ui .competition-title-link::after { content:""; position:absolute; inset:0; z-index:1; border-radius:6px; }
body.sport-ui .competition-title-link:hover { color:#086a4b; }
body.sport-ui .competition-title-link:focus-visible { outline:none; }
body.sport-ui .competition-title-link:focus-visible::after { outline:2px solid #087f59; outline-offset:2px; }
body.sport-ui :is(.tournament-card__footer,.school-tm-card__footer) { position:relative; z-index:2; }
body.sport-ui.page-sport-competition-detail .tm-section-toggle { background:#edf5f0; }
body.sport-ui.page-sport-competition-detail :is(.tm-subtitle,.tm-input,.tm-select) { font-size:15px; }
body.sport-ui.page-sport-competition-detail :is(.tm-group__head,.tm-table thead) { background:#eaf1f5; }
body.sport-ui.page-teacher-mrds-competitions .mrds-stat { background:#e6f0f4; }
body.sport-ui .pc-workspace .pc-settings label { font-size:14px; }
body.sport-ui .pc-workspace .pc-team-tabs button { background:#f0f6f3; }
body.sport-ui .pc-workspace .pc-team-tabs button.is-active { background:#dceee2; }

/* Многоборье: цвет обозначает назначение блока, а не оценку ребёнка.
   Чередование строк помогает вести взгляд от ФИО к результату и баллам. */
body.sport-ui .pc-workspace .pc-tabs { background:#eaf1f5; border-bottom-color:#c8d8e2; }
body.sport-ui .pc-workspace .pc-tabs button { color:#40596a; }
body.sport-ui .pc-workspace .pc-tabs button.is-active { background:#dceee3; color:#145638; }
body.sport-ui .pc-workspace .pc-tabs button:focus-visible { outline:2px solid #087f59; outline-offset:-3px; }
body.sport-ui .pc-workspace .pc-journal-head { padding:12px; background:#e8f1f8; border-bottom:2px solid #bdd3e3; }
body.sport-ui .pc-workspace .pc-total { border-color:#39809c; }
body.sport-ui .pc-workspace .pc-total strong { color:#174b61; }
body.sport-ui .pc-workspace .pc-theory { margin:10px 0; padding:10px 12px; background:#fff4d9; border-left:3px solid #c49335; color:#664b1b; font-weight:600; }
body.sport-ui .pc-workspace .pc-journal-labels { background:#dcebe2; color:#285940; font-weight:650; }
body.sport-ui .pc-workspace .pc-person { background:#fff; border-bottom-color:#cfded8; }
body.sport-ui .pc-workspace .pc-person:nth-child(even) { background:#edf3f7; }
body.sport-ui .pc-workspace .pc-person:hover { background:#e5f1e9; }
body.sport-ui .pc-workspace .pc-person output { padding:7px 3px; border-radius:4px; background:#dceee2; color:#16583b; font-variant-numeric:tabular-nums; }
body.sport-ui .pc-workspace .pc-standings-head { background:#dfeaf2; color:#31576d; }
body.sport-ui .pc-workspace .pc-standing { background:#fff; }
body.sport-ui .pc-workspace .pc-standing:nth-child(even) { background:#edf3f7; }
body.sport-ui .pc-workspace .pc-metric:last-child strong { color:#174b61; }
body.sport-ui .pc-workspace [data-panel="settings"] { padding:14px 12px; background:#eaf1f6; }
body.sport-ui .pc-workspace .pc-contest { padding:14px 12px; background:#fff; border-left:3px solid #b9d2c3; }
body.sport-ui .pc-workspace .pc-contest:nth-child(even) { background:#edf3f7; border-left-color:#b6cedf; }

/* Две вкладки выбора формата одинаковы по ширине и высоте. На телефоне
   длинное «Шахматы/Шашки» переносится внутри своей половины, а не выталкивает её. */
body.sport-ui .nav-pills.tournament-create-tabs { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:stretch; }
body.sport-ui .tournament-create-tabs .nav-item { min-width:0; }
body.sport-ui .nav-pills.tournament-create-tabs .nav-link { display:flex; align-items:center; justify-content:center; gap:7px; width:100%; height:100%; min-height:48px; padding:10px; border:1px solid #9dc4ae; border-radius:6px; background:#edf6f0; color:#175d43; font-size:14px; font-weight:650; line-height:1.4; white-space:normal; }
body.sport-ui .nav-pills.tournament-create-tabs .nav-link span { min-width:0; overflow-wrap:anywhere; }
body.sport-ui .nav-pills.tournament-create-tabs .nav-link .bi { flex-shrink:0; font-size:18px; }
body.sport-ui .nav-pills.tournament-create-tabs .nav-link:hover { background:#dceee3; color:#134d38; }
body.sport-ui .nav-pills.tournament-create-tabs .nav-link.active { background:#087f59; border-color:#087f59; color:#fff; }

/* Шапка шахмат/шашек — компактная полоса, а не высокая декоративная карточка.
   Иконки подписаны aria-label/title, POST-формы остаются самостоятельными. */
body.sport-ui .tournament-workspace .tournament-heading { padding:12px 14px; background:#e7f1eb; border:0; border-bottom:2px solid #bed8c9; border-radius:0; }
body.sport-ui .tournament-workspace .chess-heading-layout { display:flex; align-items:center; justify-content:space-between; gap:10px 16px; flex-wrap:wrap; }
body.sport-ui .tournament-workspace .chess-heading-copy { flex:1 1 340px; min-width:0; }
body.sport-ui .tournament-workspace .chess-heading-copy .page-hero__eyebrow { margin-bottom:3px; font-size:11px; }
body.sport-ui .tournament-workspace .chess-heading-copy .page-hero__title { margin:0 0 5px!important; font-size:21px; line-height:1.25; overflow-wrap:anywhere; }
body.sport-ui .tournament-workspace .chess-heading-meta { font-size:13px; line-height:1.4; overflow-wrap:anywhere; }
body.sport-ui .tournament-workspace :is(.chess-heading-actions,.chess-round-actions) { display:flex; align-items:center; flex-wrap:wrap; gap:6px; min-width:0; }
body.sport-ui .tournament-workspace :is(.chess-heading-actions,.chess-round-actions) form { margin:0; display:inline-flex; }
body.sport-ui .tournament-workspace :is(.chess-heading-actions,.chess-round-actions) .btn { display:inline-flex; align-items:center; justify-content:center; gap:5px; min-height:36px; padding:6px 9px; font-size:13px; line-height:1.3; border-radius:5px; }
body.sport-ui .tournament-workspace .chess-label-short { display:none; }

/* Печать — обычный details: работает мышью/клавиатурой и без Bootstrap JS.
   Меню ограничено высотой окна и не увеличивает высоту шапки. */
body.sport-ui .tournament-workspace .chess-print-chooser { position:relative; margin:0; z-index:20; }
body.sport-ui .tournament-workspace .chess-print-chooser summary { list-style:none; cursor:pointer; }
body.sport-ui .tournament-workspace .chess-print-chooser summary::-webkit-details-marker { display:none; }
body.sport-ui .tournament-workspace .chess-print-chooser[open] summary { background:#d7eadd; }
body.sport-ui .tournament-workspace .chess-print-options { position:absolute; top:calc(100% + 5px); right:0; width:190px; max-width:calc(100vw - 32px); max-height:min(55dvh,340px); overflow-y:auto; padding:5px; background:#fff; border:1px solid #c7dbce; border-radius:6px; box-shadow:0 5px 18px #153b2620; }
body.sport-ui .tournament-workspace .chess-print-options a { display:block; padding:10px; min-height:40px; color:#202927; font-size:14px; text-decoration:none; border-radius:3px; }
body.sport-ui .tournament-workspace .chess-print-options a:is(:hover,:focus-visible) { background:#e7f1eb; color:#065b3f; }
body.sport-ui .tournament-workspace .chess-print-chooser summary:focus-visible { outline:2px solid #087f59; outline-offset:2px; }

/* Панель тура остаётся частью страницы. Список партий под ней не сжимается. */
body.sport-ui .tournament-workspace .tournament-rounds-panel { padding:0; border:0; background:transparent; }
body.sport-ui .tournament-workspace .round-stage-card { padding:10px 12px; background:#eaf1f5; border:0; border-bottom:1px solid #ccdce6; border-radius:0; }
body.sport-ui .tournament-workspace .chess-round-heading { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:8px 14px; }
body.sport-ui .tournament-workspace .chess-round-caption { display:flex; flex-wrap:wrap; align-items:baseline; gap:3px 10px; min-width:0; }
body.sport-ui .tournament-workspace .chess-round-caption .page-hero__eyebrow { margin:0; font-size:12px; }
body.sport-ui .tournament-workspace .chess-round-caption h2 { margin:0!important; font-size:16px; line-height:1.3; }
body.sport-ui .tournament-workspace .chess-round-caption .text-muted { font-size:13px; }
body.sport-ui .tournament-workspace .tournament-section-intro { margin-bottom:10px; }
body.sport-ui .tournament-workspace .tournament-section-intro h2 { font-size:17px; }
body.sport-ui .tournament-workspace .tournament-section-intro p { font-size:13px; line-height:1.4; }
body.sport-ui .tournament-workspace .team-match-card__header { background:#e6f0f5; }
/* ФИО заметнее служебных подписей; перенос разрешён, поля счёта не сжимаются. */
body.sport-ui .tournament-workspace :is(.team-board-side__name,.chess-player-name),
body.sport-ui .pc-workspace .pc-person>div>strong,
body.sport-ui .psi-row__title { font-size:16px; font-weight:650; line-height:1.4; overflow-wrap:anywhere; }
body.sport-ui .tournament-workspace .team-board-result { background:#f0f7f2; }
/* Прописные буквы — только отображение: ФИО в БД и выгрузках не меняются. */
body.sport-ui .tournament-workspace :is(.team-board-side__name,.chess-player-name) { text-transform:uppercase; }
body.sport-ui .tournament-workspace .result-special-status { font-size:12px; line-height:1.25; text-align:center; overflow-wrap:anywhere; }
body.sport-ui .tournament-workspace .result-quick-buttons .btn { min-width:0; white-space:nowrap; overflow-wrap:normal; word-break:normal; }
/* Цвет относится к фигурам игрока, не к стороне команды: на чётных досках
   слева могут быть чёрные. Классы приходят из прежнего шаблона, счёт не меняем.
   Последнее слово и маркер переносятся вместе. Очень длинное слово может
   переноситься внутри своей части, но круг остаётся справа у последней строки. */
body.sport-ui .tournament-workspace .team-board-side { display:flex; flex-direction:column; justify-content:center; gap:3px; }
body.sport-ui .tournament-workspace .team-board-side__name { display:block; min-width:0; }
body.sport-ui .tournament-workspace :is(.team-board-side--white,.chess-player-cell--white) { background:#fbfdfc; }
body.sport-ui .tournament-workspace :is(.team-board-side--black,.chess-player-cell--black) { background:#dce3df; }
body.sport-ui .tournament-workspace .color-dot { float:none; width:12px; height:12px; min-width:12px; margin:0; vertical-align:-1px; }
body.sport-ui .tournament-workspace .color-dot--white { background:#fff; border:1px solid #91a297; }
body.sport-ui .tournament-workspace .color-dot--black { background:#46524c; border:1px solid #46524c; }
body.sport-ui .tournament-workspace .chess-name-tail { display:inline-flex; align-items:flex-end; gap:4px; max-width:100%; vertical-align:bottom; white-space:normal; }
body.sport-ui .tournament-workspace .chess-name-tail__word { min-width:0; overflow-wrap:anywhere; }
body.sport-ui .tournament-workspace .chess-name-tail .color-dot { flex:none; margin-bottom:3px; }
body.sport-ui .tournament-workspace .chess-player-cell { white-space:normal; min-width:160px; }
/* Сокращаем только вертикальные отступы свёрнутой строки примерно на треть.
   Размер шрифта и поля раскрытой формы остаются прежними. */
body.sport-ui .tournament-workspace .team-board-row>.manual-correction { margin-top:3px; }
body.sport-ui .tournament-workspace .team-board-row>.manual-correction:not([open]) { padding:2px 12px 4px; }
body.sport-ui .tournament-workspace .individual-correction-row>td { padding-top:3px; padding-bottom:3px; }
body.sport-ui .tournament-workspace .individual-correction-row .manual-correction:not([open]) { padding:0 12px 3px; }
@media(max-width:992px) {
  body.sport-ui .tournament-workspace .team-board-side { padding:8px 6px; }
}
@media(max-width:760px) {
  body.sport-ui .tournament-workspace :is(.team-board-head,.team-board-row) { grid-template-columns:minmax(0,1fr) 96px minmax(0,1fr); }
}
body.sport-ui .tournament-workspace .chess-round-tabs .nav-link { font-size:14px; }

@media(max-width:760px) {
  body.sport-ui .tournament-workspace { padding-top:4px!important; }
  body.sport-ui .tournament-workspace .tournament-heading { padding:10px; margin-bottom:10px!important; }
  body.sport-ui .tournament-workspace .chess-heading-layout { gap:8px; }
  body.sport-ui .tournament-workspace .chess-heading-copy { flex-basis:100%; }
  body.sport-ui .tournament-workspace .chess-heading-copy .page-hero__eyebrow { display:none; }
  body.sport-ui .tournament-workspace .chess-heading-copy .page-hero__title { font-size:18px; }
  body.sport-ui .tournament-workspace .chess-heading-meta { font-size:12px; }
  body.sport-ui .tournament-workspace :is(.chess-heading-actions,.chess-round-actions) { gap:5px; }
  body.sport-ui .tournament-workspace :is(.chess-heading-actions,.chess-round-actions) .btn { min-height:40px; padding:7px 8px; font-size:12px; }
  body.sport-ui .tournament-workspace .chess-action-icon-mobile { width:40px; min-width:40px; padding:7px!important; }
  body.sport-ui .tournament-workspace .chess-action-icon-mobile span { display:none; }
  body.sport-ui .tournament-workspace .chess-label-full { display:none; }
  body.sport-ui .tournament-workspace .chess-label-short { display:inline; }
  body.sport-ui .tournament-workspace .tournament-section-intro { display:none; }
  body.sport-ui .tournament-workspace .tournament-navigation { margin-bottom:8px; }
  body.sport-ui .tournament-workspace .tournament-navigation button { padding:9px 11px; font-size:13px; }
  body.sport-ui .tournament-workspace .chess-round-tabs { margin-bottom:8px!important; }
  body.sport-ui .tournament-workspace .chess-round-tabs .nav-link { min-width:65px; height:36px; padding:6px 10px; font-size:13px; }
  body.sport-ui .tournament-workspace .round-stage-card { padding:9px 10px; margin-bottom:8px!important; }
  body.sport-ui .tournament-workspace .chess-round-caption { gap:3px 8px; }
  body.sport-ui .tournament-workspace .chess-round-caption h2 { font-size:15px; }
  body.sport-ui .tournament-workspace :is(.team-board-side__name,.chess-player-name) { font-size:14px; }
  body.sport-ui .pc-workspace .pc-person>div>strong,
  body.sport-ui .psi-row__title { font-size:15px; }
  body.sport-ui:is(.page-sport-competition-list,.page-school-tournament-list) :is(.tournament-card__title,.school-tm-card__title) { font-size:15px; }
  body.sport-ui.page-sport-competition-detail :is(.tm-input,.tm-select),
  body.sport-ui .pc-workspace :is(input,select) { font-size:16px; }
}
