:root {
    --coach-bg: #eef3fa;
    --coach-card: rgba(255, 255, 255, 0.96);
    --coach-border: #d9e4f4;
    --coach-text: #10213a;
    --coach-muted: #6d7f99;
    --coach-primary: #2563eb;
    --coach-danger: #ef4444;
    --coach-success: #16a34a;
    --coach-warning: #f59e0b;
    --coach-shadow: 0 10px 24px rgba(16, 33, 58, 0.06);

    --player1-color: #2563eb;
    --player2-color: #ef4444;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

html {
    font-size: 14px;
}

body {
    margin: 0;
}

.coach-page-body {
    background: var(--coach-bg);
    color: var(--coach-text);
}

.coach-page {
    min-height: 100vh;
    padding: 8px 8px 16px;
    overflow-x: clip;
}

.coach-container {
    width: min(1420px, 100%);
    margin: 0 auto;
    overflow-x: clip;
}

.coach-topbar {
    display: grid;
    gap: 8px;
    margin-bottom: 8px;
}

.coach-topbar__main,
.coach-topbar__meta {
    background: linear-gradient(135deg, #2455d8 0%, #4d81ef 58%, #79a9ff 100%);
    color: #fff;
    border-radius: 16px;
    box-shadow: var(--coach-shadow);
}

.coach-topbar__main {
    padding: 12px;
}

.coach-topbar__main h1 {
    margin: 5px 0 4px;
    font-size: 1.1rem;
    line-height: 1.06;
    font-weight: 900;
}

.coach-topbar__main p {
    margin: 0;
    color: rgba(255,255,255,0.88);
    font-size: 0.78rem;
}

.coach-topbar__meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 6px;
}

.coach-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: rgba(255,255,255,0.16);
    color: #fff;
    padding: 4px 8px;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.coach-mini-stat {
    background: rgba(255,255,255,0.12);
    border-radius: 12px;
    min-height: 54px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

.coach-mini-stat span {
    color: rgba(255,255,255,0.82);
    font-size: 0.64rem;
}

.coach-mini-stat strong {
    font-size: 0.8rem;
    font-weight: 900;
}

.coach-scoreboard {
    display: grid;
    gap: 6px;
    margin-bottom: 8px;
}

.coach-main-layout {
    display: grid;
    gap: 8px;
}

.coach-main-column,
.coach-side-column {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.coach-card {
    background: var(--coach-card);
    border: 1px solid var(--coach-border);
    border-radius: 16px;
    padding: 10px;
    box-shadow: var(--coach-shadow);
    min-width: 0;
}

.coach-card__header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
    min-width: 0;
}

.coach-card__header h2,
.coach-card__header h3 {
    margin: 0;
    font-weight: 900;
    font-size: 0.92rem;
}

.coach-card__header p {
    margin: 2px 0 0;
    color: var(--coach-muted);
    font-size: 0.74rem;
}

.coach-player-card {
    display: grid;
    gap: 6px;
    border-radius: 14px;
    padding: 8px;
    background: #fbfdff;
    min-width: 0;
}

.coach-player-card--1 {
    border: 2px solid color-mix(in srgb, var(--player1-color) 38%, #d7e4fb);
    box-shadow: 0 6px 14px color-mix(in srgb, var(--player1-color) 8%, transparent);
}

.coach-player-card--2 {
    border: 2px solid color-mix(in srgb, var(--player2-color) 38%, #f4dcdc);
    box-shadow: 0 6px 14px color-mix(in srgb, var(--player2-color) 8%, transparent);
}

.coach-player-card__left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.coach-player-accent {
    width: 6px;
    min-height: 34px;
    border-radius: 999px;
    flex: 0 0 auto;
}

#accent1 {
    background: var(--player1-color);
}

#accent2 {
    background: var(--player2-color);
}

.coach-player-card__left strong {
    display: block;
    font-size: 0.84rem;
    font-weight: 900;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.coach-player-card__left span {
    color: var(--coach-muted);
    font-size: 0.7rem;
}

.coach-player-card__right {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    min-width: 0;
}

.coach-box {
    background: #f4f8ff;
    border: 1px solid #d9e5f6;
    border-radius: 12px;
    padding: 6px;
    text-align: center;
    min-width: 0;
}

.coach-box span {
    display: block;
    color: var(--coach-muted);
    font-size: 0.54rem;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.coach-box strong {
    font-size: 0.92rem;
    font-weight: 900;
}

.coach-box--big {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    font-size: 1.12rem;
    font-weight: 900;
    color: #1c4eb1;
}

.coach-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 8px;
    min-width: 0;
}

.coach-form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.coach-label {
    color: #5f749d;
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.coach-input,
.coach-color {
    width: 100%;
    min-height: 38px;
    border-radius: 10px;
    border: 1px solid #d9e5f6;
    background: #f9fbff;
    padding: 0 10px;
    color: var(--coach-text);
    font-size: 0.8rem;
}

.coach-color {
    padding: 3px;
}

.coach-action-row,
.coach-composer-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}

.coach-btn {
    appearance: none;
    border: none;
    border-radius: 10px;
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.72rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    min-width: 0;
}

.coach-btn:hover {
    transform: translateY(-1px);
}

.coach-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.coach-btn--primary {
    background: linear-gradient(135deg, #2f6df6 0%, #5b90ff 100%);
    color: #fff;
    box-shadow: 0 6px 14px rgba(47, 109, 246, 0.16);
}

.coach-btn--soft {
    background: #edf4ff;
    color: #355483;
    border: 1px solid #d7e4fb;
}

.coach-btn--danger {
    background: linear-gradient(135deg, #f25757 0%, #ff7a7a 100%);
    color: #fff;
    box-shadow: 0 6px 14px rgba(239, 68, 68, 0.14);
}

.coach-btn--success {
    background: linear-gradient(135deg, #159947 0%, #22c55e 100%);
    color: #fff;
    box-shadow: 0 6px 14px rgba(34, 197, 94, 0.16);
}

.coach-card--composer {
    overflow: hidden;
}

.coach-step-badge {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: #edf4ff;
    border: 1px solid #d7e4fb;
    color: #355483;
    font-size: 0.68rem;
    font-weight: 800;
}

.coach-summary-strip {
    min-height: 36px;
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: 10px;
    background: #f7faff;
    border: 1px solid #d8e5f7;
    color: #375584;
    font-weight: 700;
    font-size: 0.72rem;
    margin-bottom: 8px;
    overflow-wrap: anywhere;
}

.coach-step-stage {
    min-height: 250px;
    overflow: hidden;
}

.coach-step-view {
    display: none;
}

.coach-step-view.is-active {
    display: block;
}

.coach-step-title {
    font-size: 0.86rem;
    font-weight: 900;
    margin-bottom: 8px;
    overflow-wrap: anywhere;
}

.coach-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.coach-choice-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.coach-choice {
    min-height: 42px;
    border-radius: 12px;
    border: 1px solid #d8e5f7;
    background: #f8fbff;
    color: #28487a;
    font-size: 0.76rem;
    font-weight: 800;
    padding: 8px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
    min-width: 0;
}

.coach-choice:hover {
    transform: translateY(-1px);
    border-color: #bcd0f2;
    box-shadow: 0 6px 12px rgba(47, 109, 246, 0.06);
}

.coach-choice.is-selected {
    color: #fff;
    border-color: transparent;
    box-shadow: 0 6px 12px rgba(47, 109, 246, 0.12);
}

.coach-choice--player1.is-selected {
    background: linear-gradient(135deg, var(--player1-color) 0%, color-mix(in srgb, var(--player1-color) 70%, white) 100%);
}

.coach-choice--player2.is-selected {
    background: linear-gradient(135deg, var(--player2-color) 0%, color-mix(in srgb, var(--player2-color) 70%, white) 100%);
}

.coach-choice--positive {
    border-color: #cbe7d5;
    background: #f4fcf7;
    color: #17653a;
}

.coach-choice--positive.is-selected {
    background: linear-gradient(135deg, #159947 0%, #22c55e 100%);
}

.coach-choice--negative {
    border-color: #f3caca;
    background: #fff5f5;
    color: #a52d2d;
}

.coach-choice--negative.is-selected {
    background: linear-gradient(135deg, #e43c3c 0%, #ff6a6a 100%);
}

.coach-choice--neutral {
    border-color: #d9e5f6;
    background: #f8fbff;
    color: #28487a;
}

.coach-choice--neutral.is-selected {
    background: linear-gradient(135deg, #446aa8 0%, #7295d1 100%);
}

.coach-court-map {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 8px;
    border-radius: 14px;
    background:
        linear-gradient(to bottom, rgba(255,255,255,0) 49%, #bfd4f9 49%, #bfd4f9 51%, rgba(255,255,255,0) 51%),
        linear-gradient(to right, transparent 33.333%, #bfd4f9 33.333%, #bfd4f9 34.5%, transparent 34.5%, transparent 66.666%, #bfd4f9 66.666%, #bfd4f9 67.8%, transparent 67.8%),
        linear-gradient(180deg, #dff0ff 0%, #c9e1ff 100%);
    border: 1px solid #c4d9f6;
}

.coach-court-zone {
    min-height: 58px;
    border-radius: 12px;
    border: 1px solid rgba(73, 118, 183, 0.22);
    background: rgba(255,255,255,0.52);
    color: #244474;
    font-weight: 800;
    font-size: 0.66rem;
    cursor: pointer;
    padding: 6px;
    transition: all 0.2s ease;
    min-width: 0;
}

.coach-court-zone:hover {
    transform: translateY(-1px);
    background: rgba(255,255,255,0.8);
}

.coach-court-zone.is-selected {
    border: 2px solid var(--coach-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: rgba(255,255,255,0.92);
}

.coach-log,
.coach-insights {
    display: grid;
    gap: 8px;
}

.coach-log-item,
.coach-insight-item {
    border: 1px solid #d8e5f6;
    background: #fbfdff;
    border-radius: 12px;
    padding: 8px;
    overflow-wrap: anywhere;
}

.coach-log-item--winner,
.coach-log-item--ace,
.coach-log-item--return_winner {
    border-left: 4px solid #22c55e;
}

.coach-log-item--unforced_error,
.coach-log-item--forced_error,
.coach-log-item--double_fault {
    border-left: 4px solid #ef4444;
}

.coach-log-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.coach-log-title {
    font-weight: 900;
    font-size: 0.76rem;
}

.coach-log-meta,
.coach-insight-item {
    color: var(--coach-muted);
    font-size: 0.7rem;
}

.coach-log-meta--highlight {
    color: #20488f;
    font-weight: 800;
    margin-top: 4px;
}

.coach-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.coach-stats-grid--advanced {
    margin-bottom: 10px;
}

.coach-stat-box {
    background: #f5f9ff;
    border: 1px solid #d9e5f7;
    border-radius: 12px;
    padding: 8px;
    min-width: 0;
}

.coach-stat-box span {
    display: block;
    color: var(--coach-muted);
    font-size: 0.62rem;
    margin-bottom: 3px;
}

.coach-stat-box strong {
    font-size: 0.9rem;
    font-weight: 900;
}

.coach-set-tabs,
.coach-analytics-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
    margin-bottom: 8px;
    scrollbar-width: none;
}

.coach-set-tabs::-webkit-scrollbar,
.coach-analytics-tabs::-webkit-scrollbar {
    display: none;
}

.coach-set-tab,
.coach-analytics-tab {
    appearance: none;
    border: 1px solid #d7e4fb;
    background: #edf4ff;
    color: #355483;
    border-radius: 999px;
    min-height: 32px;
    padding: 0 12px;
    font-size: 0.7rem;
    font-weight: 900;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    flex: 0 0 auto;
}

.coach-set-tab:hover,
.coach-analytics-tab:hover {
    transform: translateY(-1px);
}

.coach-set-tab.is-active,
.coach-analytics-tab.is-active {
    background: linear-gradient(135deg, #2f6df6 0%, #5b90ff 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 6px 14px rgba(47, 109, 246, 0.14);
}

.coach-analytics-panel {
    display: none;
}

.coach-analytics-panel.is-active {
    display: block;
}

.coach-compare-table {
    display: grid;
    gap: 8px;
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
}

.coach-compare-table__head {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.8fr) minmax(0, 0.8fr);
    gap: 8px;
    padding: 0 2px;
    color: #5e749d;
    font-size: 0.62rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.coach-compare-table__body {
    display: grid;
    gap: 8px;
}

.coach-compare-row {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.8fr) minmax(0, 0.8fr);
    gap: 8px;
    padding: 10px;
    border-radius: 12px;
    background: #fbfdff;
    border: 1px solid #d8e5f7;
    min-width: 0;
}

.coach-compare-row__label {
    font-size: 0.74rem;
    font-weight: 800;
    color: #28487a;
    grid-column: 1 / 2;
    min-width: 0;
    overflow-wrap: anywhere;
}

.coach-compare-row__value {
    font-size: 0.72rem;
    font-weight: 900;
    color: #10213a;
    min-width: 0;
    overflow-wrap: anywhere;
}

.coach-compare-row__value--p1 {
    color: color-mix(in srgb, var(--player1-color) 72%, #10213a);
}

.coach-compare-row__value--p2 {
    color: color-mix(in srgb, var(--player2-color) 72%, #10213a);
}

.coach-compare-row__bar {
    grid-column: 1 / -1;
    position: relative;
    height: 8px;
    border-radius: 999px;
    background: #e8eef8;
    overflow: hidden;
}

.coach-compare-row__bar-p1,
.coach-compare-row__bar-p2 {
    position: absolute;
    top: 0;
    bottom: 0;
}

.coach-compare-row__bar-p1 {
    left: 0;
    background: linear-gradient(135deg, var(--player1-color), color-mix(in srgb, var(--player1-color) 70%, white));
}

.coach-compare-row__bar-p2 {
    right: 0;
    background: linear-gradient(135deg, color-mix(in srgb, var(--player2-color) 70%, white), var(--player2-color));
}

.coach-card--match-summary {
    background:
        radial-gradient(circle at top left, rgba(67, 113, 231, 0.08), transparent 35%),
        radial-gradient(circle at top right, rgba(239, 68, 68, 0.07), transparent 30%),
        var(--coach-card);
}

.coach-match-summary {
    display: grid;
    gap: 8px;
}

.coach-match-summary__top {
    display: grid;
    gap: 8px;
}

.coach-summary-winner {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    background: #ebf3ff;
    border: 1px solid #d5e3fb;
    color: #2b4f93;
    font-size: 0.74rem;
    font-weight: 900;
    width: fit-content;
}

.coach-scoreline-card {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-radius: 14px;
    background: #f7faff;
    border: 1px solid #d8e5f7;
}

.coach-scoreline-player {
    display: grid;
    gap: 4px;
}

.coach-scoreline-player strong {
    font-size: 0.8rem;
    font-weight: 900;
    color: #10213a;
    overflow-wrap: anywhere;
}

.coach-scoreline-player span {
    color: var(--coach-muted);
    font-size: 0.68rem;
}

.coach-scoreline-player--right {
    text-align: right;
}

.coach-scoreline-center {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 68px;
    min-height: 42px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid #d8e5f7;
    font-size: 0.92rem;
    font-weight: 900;
    color: #20488f;
}

.coach-sets-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.coach-set-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid #d8e5f7;
    background: #fbfdff;
    font-size: 0.7rem;
    font-weight: 800;
    color: #355483;
}

.coach-set-pill strong {
    font-size: 0.76rem;
    font-weight: 900;
    color: #10213a;
}

.coach-set-pill--p1 {
    border-color: color-mix(in srgb, var(--player1-color) 35%, #d8e5f7);
    background: color-mix(in srgb, var(--player1-color) 10%, #ffffff);
}

.coach-set-pill--p2 {
    border-color: color-mix(in srgb, var(--player2-color) 35%, #d8e5f7);
    background: color-mix(in srgb, var(--player2-color) 10%, #ffffff);
}

.coach-match-summary__grid {
    display: grid;
    gap: 8px;
}

.coach-summary-stat {
    display: grid;
    gap: 6px;
    padding: 8px;
    border-radius: 12px;
    background: #fbfdff;
    border: 1px solid #d8e5f7;
}

.coach-summary-stat__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.coach-summary-stat__label {
    font-size: 0.74rem;
    font-weight: 800;
    color: #28487a;
}

.coach-summary-stat__values {
    font-size: 0.7rem;
    color: var(--coach-muted);
    font-weight: 700;
    overflow-wrap: anywhere;
}

.coach-compare-bar {
    position: relative;
    height: 8px;
    border-radius: 999px;
    background: #e8eef8;
    overflow: hidden;
}

.coach-compare-bar__p1,
.coach-compare-bar__p2 {
    position: absolute;
    top: 0;
    bottom: 0;
}

.coach-compare-bar__p1 {
    left: 0;
    background: linear-gradient(135deg, var(--player1-color), color-mix(in srgb, var(--player1-color) 70%, white));
    border-radius: 999px 0 0 999px;
}

.coach-compare-bar__p2 {
    right: 0;
    background: linear-gradient(135deg, color-mix(in srgb, var(--player2-color) 70%, white), var(--player2-color));
    border-radius: 0 999px 999px 0;
}

.coach-summary-stat__bottom {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.64rem;
    color: #54709e;
    font-weight: 800;
}

.coach-summary-notes {
    display: grid;
    gap: 8px;
}

.coach-summary-note {
    padding: 8px 10px;
    border-radius: 12px;
    background: #f7faff;
    border: 1px solid #d8e5f7;
    color: #355483;
    font-size: 0.72rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.coach-empty {
    color: var(--coach-muted);
    padding: 4px 0;
    font-size: 0.7rem;
}

.coach-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    padding: 16px;
    max-width: 100vw;
    overflow: hidden;
}

.coach-modal.is-open {
    display: flex;
}

.coach-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(16, 33, 58, 0.56);
    backdrop-filter: blur(4px);
}

.coach-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(760px, 100%);
    max-width: 100%;
    max-height: calc(100vh - 32px);
    overflow: auto;
    overscroll-behavior: contain;
}

.coach-card--setup-modal {
    margin: 0;
    width: 100%;
}

.coach-btn,
.coach-choice,
.coach-court-zone,
.coach-set-tab,
.coach-analytics-tab {
    -webkit-tap-highlight-color: transparent;
}

.coach-btn:active,
.coach-choice:active,
.coach-court-zone:active,
.coach-set-tab:active,
.coach-analytics-tab:active {
    transform: scale(0.98);
}

.coach-btn:focus-visible,
.coach-choice:focus-visible,
.coach-court-zone:focus-visible,
.coach-set-tab:focus-visible,
.coach-analytics-tab:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.22);
    outline-offset: 2px;
}

.coach-choice,
.coach-btn,
.coach-court-zone,
.coach-set-tab,
.coach-analytics-tab {
    position: relative;
    overflow: hidden;
}

.coach-choice::after,
.coach-btn::after,
.coach-court-zone::after,
.coach-set-tab::after,
.coach-analytics-tab::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(255,255,255,0.14) 0%,
        rgba(255,255,255,0) 55%
    );
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.coach-choice:hover::after,
.coach-btn:hover::after,
.coach-court-zone:hover::after,
.coach-set-tab:hover::after,
.coach-analytics-tab:hover::after {
    opacity: 1;
}

@media (min-width: 768px) {
    html {
        font-size: 15px;
    }

    .coach-page {
        padding: 14px 14px 24px;
    }

    .coach-topbar {
        grid-template-columns: 1.7fr 1fr;
        align-items: stretch;
    }

    .coach-main-layout {
        grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.85fr);
        align-items: start;
    }

    .coach-card {
        padding: 14px;
    }

    .coach-card__header {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
    }

    .coach-scoreboard {
        grid-template-columns: 1fr 1fr;
    }

    .coach-player-card {
        grid-template-columns: 1.2fr auto;
        align-items: center;
        padding: 10px;
    }

    .coach-player-accent {
        min-height: 40px;
    }

    .coach-player-card__left strong {
        font-size: 0.9rem;
    }

    .coach-box--big {
        min-height: 52px;
        font-size: 1.2rem;
    }

    .coach-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .coach-choice-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .coach-court-zone {
        min-height: 64px;
        font-size: 0.7rem;
    }

    .coach-match-summary__grid {
        grid-template-columns: 1fr 1fr;
    }

    .coach-stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .coach-composer-footer .coach-btn {
        flex: 1 1 calc(33.333% - 6px);
    }

    .coach-action-row .coach-btn {
        flex: 1 1 calc(33.333% - 6px);
    }
}

@media (min-width: 1100px) {
    .coach-topbar__main h1 {
        font-size: 1.4rem;
    }

    .coach-main-layout {
        grid-template-columns: minmax(0, 1.6fr) minmax(360px, 0.9fr);
    }

    .coach-step-stage {
        min-height: 290px;
    }

    .coach-stats-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .coach-page {
        padding-left: 8px;
        padding-right: 8px;
    }

    .coach-container {
        width: 100%;
    }

    .coach-player-card {
        grid-template-columns: 1fr;
    }

    .coach-player-card__right {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .coach-choice-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .coach-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .coach-composer-footer .coach-btn,
    .coach-action-row .coach-btn {
        flex: 1 1 100%;
    }

    .coach-compare-table__head {
        font-size: 0.58rem;
        gap: 6px;
    }

    .coach-compare-row {
        gap: 6px;
        padding: 8px;
    }

    .coach-compare-row__label {
        font-size: 0.68rem;
    }

    .coach-compare-row__value {
        font-size: 0.66rem;
    }

    .coach-modal {
        padding: 8px;
        align-items: flex-start;
    }

    .coach-modal__dialog {
        width: 100%;
        max-height: calc(100vh - 16px);
        margin-top: 0;
    }
}

@media (max-width: 768px) {
    .coach-modal {
        align-items: flex-start;
        justify-content: center;
        padding: 12px;
        overflow-y: auto;
    }

    .coach-modal__dialog--setup {
        width: 100%;
        max-width: 100%;
        margin: 12px auto;
        max-height: calc(100dvh - 24px);
        overflow-y: auto;
    }

    .coach-card--setup-modal {
        max-height: calc(100dvh - 24px);
        overflow-y: auto;
        padding: 16px;
    }

    .coach-setup-actions {
        position: sticky;
        bottom: 0;
        background: #fff;
        padding-top: 12px;
    }
}

.coach-log-meta strong {
    color: #28487a;
}



/* =========================
   FINAL SETUP REDESIGN
   ========================= */
.coach-btn--ghost {
    background: #fff;
    color: #355483;
    border: 1px solid #d7e4fb;
}

.coach-modal__dialog--setup {
    width: min(760px, calc(100vw - 24px));
    max-height: calc(100dvh - 24px);
    overflow: auto;
}

.coach-card--setup-modal {
    padding: 16px;
    border-radius: 24px;
    background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}

.coach-setup-topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.coach-setup-topbar h2 {
    margin: 0;
    font-size: 1.15rem;
    line-height: 1.1;
    font-weight: 900;
}

.coach-setup-topbar p {
    margin: 6px 0 0;
    color: var(--coach-muted);
    font-size: 0.78rem;
}

.coach-setup-close {
    min-height: 38px;
    padding: 0 14px;
}

.coach-setup-sections,
.coach-setup-players {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.coach-setup-block {
    border: 1px solid #dbe5f5;
    background: #fff;
    border-radius: 18px;
    padding: 12px;
    margin-bottom: 12px;
    min-width: 0;
}

.coach-setup-block--premium {
    background: linear-gradient(180deg, #fffdf6 0%, #fffaf0 100%);
    border-color: #f3ddb0;
}

.coach-setup-block__title {
    margin: 0 0 10px;
    font-size: 0.88rem;
    font-weight: 900;
    color: #182840;
}

.coach-setup-player {
    border: 1px solid #e4ebf7;
    border-radius: 16px;
    padding: 10px;
    background: #fcfdff;
    min-width: 0;
}

.coach-setup-player__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.coach-setup-player__identity {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.coach-setup-player__identity strong {
    display: block;
    font-size: 0.84rem;
    line-height: 1.1;
    font-weight: 900;
}

.coach-setup-player__identity span {
    display: block;
    margin-top: 4px;
    color: var(--coach-muted);
    font-size: 0.68rem;
}

.coach-setup-shirt {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex: 0 0 38px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.22);
}

.coach-setup-shirt svg {
    width: 24px;
    height: 24px;
}

.coach-setup-shirt--p1 {
    background: linear-gradient(180deg, color-mix(in srgb, var(--player1-color) 82%, white), var(--player1-color));
}

.coach-setup-shirt--p2 {
    background: linear-gradient(180deg, color-mix(in srgb, var(--player2-color) 82%, white), var(--player2-color));
}

.coach-setup-color-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #5f749d;
    font-size: 0.56rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex: 0 0 auto;
}

.coach-setup-color-wrap .coach-color {
    width: 42px;
    min-width: 42px;
    height: 34px;
    min-height: 34px;
    border-radius: 10px;
    padding: 3px;
}

.coach-setup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.coach-toggle-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid #f0d38e;
    background: rgba(245, 185, 23, 0.08);
    cursor: pointer;
}

.coach-toggle-card__copy {
    min-width: 0;
}

.coach-toggle-card__copy strong {
    display: block;
    font-size: 0.84rem;
    font-weight: 900;
}

.coach-toggle-card__copy span {
    display: block;
    margin-top: 4px;
    color: var(--coach-muted);
    font-size: 0.72rem;
    line-height: 1.35;
}

.coach-toggle {
    position: relative;
    flex: 0 0 auto;
}

.coach-toggle input {
    position: absolute;
    opacity: 0;
    inset: 0;
}

.coach-toggle__track {
    width: 50px;
    height: 30px;
    display: block;
    border-radius: 999px;
    background: #dfe7f5;
    border: 1px solid #cbd8ef;
    position: relative;
    transition: 0.2s ease;
}

.coach-toggle__track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 3px 10px rgba(16, 33, 58, 0.14);
    transition: 0.2s ease;
}

.coach-toggle input:checked + .coach-toggle__track {
    background: #f5bf27;
    border-color: #ebb116;
}

.coach-toggle input:checked + .coach-toggle__track::after {
    transform: translateX(20px);
}

.coach-setup-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

.coach-setup-actions .coach-btn,
.coach-setup-actions a.coach-btn {
    flex: 0 0 auto;
    min-width: 150px;
    min-height: 42px;
    padding: 0 16px;
    font-size: 0.76rem;
}

.coach-setup-actions .coach-btn--primary {
    min-width: 220px;
}

.coach-match-controls {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 10px;
    z-index: 1210;
    width: min(680px, calc(100vw - 20px));
    display: none;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 8px;
    border-radius: 18px;
    background: rgba(255,255,255,0.94);
    backdrop-filter: blur(12px);
    border: 1px solid #d7e4fb;
    box-shadow: 0 12px 32px rgba(16, 33, 58, 0.14);
}

.coach-match-controls.is-visible {
    display: grid;
}

.coach-match-controls .coach-btn {
    min-height: 44px;
    width: 100%;
    padding: 0 12px;
    font-size: 0.74rem;
}

body:has(.coach-modal.is-open) .coach-match-controls {
    display: none !important;
}

@media (max-width: 767px) {
    html {
        font-size: 12px;
    }

    .coach-page {
        padding: 6px;
    }

    .coach-container {
        width: 100%;
    }

    .coach-modal {
        padding: 6px;
        align-items: flex-start;
        overflow-y: auto;
    }

    .coach-modal__dialog--setup {
        width: 100%;
        max-height: none;
        overflow: visible;
    }

    .coach-card--setup-modal {
        padding: 10px;
        border-radius: 18px;
    }

    .coach-setup-topbar {
        gap: 8px;
        margin-bottom: 10px;
    }

    .coach-setup-topbar h2 {
        font-size: 0.92rem;
    }

    .coach-setup-topbar p {
        font-size: 0.62rem;
        margin-top: 4px;
    }

    .coach-setup-close {
        min-height: 32px;
        padding: 0 10px;
        font-size: 0.64rem;
    }

    .coach-setup-sections,
    .coach-setup-players,
    .coach-setup-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .coach-setup-block {
        padding: 8px;
        border-radius: 14px;
        margin-bottom: 8px;
    }

    .coach-setup-block__title {
        margin-bottom: 8px;
        font-size: 0.76rem;
    }

    .coach-setup-player {
        padding: 8px;
        border-radius: 14px;
    }

    .coach-setup-player__head {
        gap: 8px;
        margin-bottom: 8px;
    }

    .coach-setup-player__identity {
        gap: 8px;
    }

    .coach-setup-player__identity strong {
        font-size: 0.72rem;
    }

    .coach-setup-player__identity span,
    .coach-setup-color-wrap,
    .coach-label {
        font-size: 0.5rem;
    }

    .coach-setup-shirt {
        width: 32px;
        height: 32px;
        flex-basis: 32px;
        border-radius: 10px;
    }

    .coach-setup-shirt svg {
        width: 20px;
        height: 20px;
    }

    .coach-setup-color-wrap .coach-color {
        width: 34px;
        min-width: 34px;
        height: 28px;
        min-height: 28px;
        border-radius: 8px;
    }

    .coach-input,
    .coach-color {
        min-height: 34px;
        height: 34px;
        padding: 0 9px;
        font-size: 0.68rem;
        border-radius: 9px;
    }

    .coach-form-group {
        gap: 3px;
    }

    .coach-toggle-card {
        padding: 8px;
        border-radius: 12px;
    }

    .coach-toggle-card__copy strong {
        font-size: 0.72rem;
    }

    .coach-toggle-card__copy span {
        font-size: 0.6rem;
    }

    .coach-toggle__track {
        width: 42px;
        height: 24px;
    }

    .coach-toggle__track::after {
        width: 18px;
        height: 18px;
    }

    .coach-toggle input:checked + .coach-toggle__track::after {
        transform: translateX(18px);
    }

    .coach-setup-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .coach-setup-actions .coach-btn,
    .coach-setup-actions a.coach-btn {
        min-width: 0;
        min-height: 36px;
        height: 36px;
        padding: 0 10px;
        font-size: 0.64rem;
        border-radius: 10px;
    }

    .coach-setup-actions .coach-btn--primary {
        grid-column: 1 / -1;
    }

    .coach-match-controls {
        width: calc(100vw - 12px);
        bottom: 6px;
        padding: 6px;
        gap: 6px;
        border-radius: 14px;
    }

    .coach-match-controls .coach-btn {
        min-height: 38px;
        font-size: 0.62rem;
        padding: 0 8px;
        white-space: normal;
    }

    .coach-page {
        padding-bottom: 68px;
    }
}

/* Final UX swap: sticky action save, inline finish match */

.coach-composer-footer .coach-btn--danger {
    border: 1px solid rgba(239, 68, 68, 0.18);
}

.coach-match-controls .coach-btn--success {
    box-shadow: 0 8px 18px rgba(34, 197, 94, 0.16);
}

.coach-btn {
    display: flex;
    align-items: center;
    justify-content: center; /* to centruje tekst */
    text-align: center;
}

/* jeśli ten przycisk ma osobną klasę */
.coach-btn--soft,
.coach-btn--ghost {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================
   COACH PANEL UX UPGRADE
   ========================= */
.coach-topbar__meta {
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    align-items: stretch;
}

.coach-topbar-action {
    appearance: none;
    border: 1px solid rgba(255,255,255,0.28);
    border-radius: 12px;
    min-height: 54px;
    padding: 0 14px;
    background: rgba(255,255,255,0.18);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 900;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.18s ease, background 0.18s ease;
}

.coach-topbar-action:hover {
    transform: translateY(-1px);
    background: rgba(255,255,255,0.25);
}

.coach-topbar-action.is-active {
    background: #fff;
    color: #2455d8;
}

.coach-scoreboard {
    position: sticky;
    top: 8px;
    z-index: 20;
}

.coach-flow-track {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    margin: -2px 0 10px;
}

.coach-flow-chip {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid #d8e5f7;
    background: #f4f8ff;
    color: #5f749d;
    font-size: 0.64rem;
    font-weight: 900;
    white-space: nowrap;
}

.coach-flow-chip.is-active {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, #2563eb 0%, #60a5fa 100%);
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.14);
}

.coach-flow-chip.is-done {
    color: #17653a;
    border-color: #cbe7d5;
    background: #effaf3;
}

.coach-summary-strip {
    display: none;
    align-items: center;
    min-height: 34px;
    padding: 8px 10px;
    margin: 0 0 10px;
    border-radius: 12px;
    border: 1px solid #d8e5f7;
    background: #f7faff;
    color: #315484;
    font-weight: 800;
    font-size: 0.72rem;
    line-height: 1.35;
}

.coach-summary-strip:empty {
    display: none !important;
}

.coach-card--composer {
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.06), transparent 34%),
        #ffffff;
}

.coach-step-stage {
    min-height: 210px;
}

.coach-choice {
    min-height: 52px;
    font-size: 0.8rem;
    border-width: 2px;
}

.coach-choice--player1 {
    border-color: color-mix(in srgb, var(--player1-color) 30%, #d8e5f7);
    background: color-mix(in srgb, var(--player1-color) 8%, #ffffff);
    color: color-mix(in srgb, var(--player1-color) 75%, #10213a);
}

.coach-choice--player2 {
    border-color: color-mix(in srgb, var(--player2-color) 30%, #d8e5f7);
    background: color-mix(in srgb, var(--player2-color) 8%, #ffffff);
    color: color-mix(in srgb, var(--player2-color) 75%, #10213a);
}

.coach-composer-footer {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid #edf2fb;
}

.coach-composer-footer .coach-btn {
    min-height: 38px;
}

.coach-quick-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.coach-quick-stat {
    min-width: 0;
    padding: 10px;
    border-radius: 14px;
    background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
    border: 1px solid #d8e5f7;
}

.coach-quick-stat span {
    display: block;
    color: #5f749d;
    font-size: 0.62rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.coach-quick-stat strong {
    display: block;
    color: #10213a;
    font-size: 0.92rem;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.coach-mobile-stats-toggle {
    display: none;
    appearance: none;
    border: 1px solid #d7e4fb;
    background: #ffffff;
    color: #244474;
    border-radius: 14px;
    min-height: 42px;
    padding: 0 12px;
    font-size: 0.76rem;
    font-weight: 900;
    box-shadow: var(--coach-shadow);
    cursor: pointer;
}

body.coach-focus-mode {
    background: #eaf1fb;
}

body.coach-focus-mode #header,
body.coach-focus-mode #footer,
body.coach-focus-mode .coach-side-column,
body.coach-focus-mode .coach-mobile-stats-toggle {
    display: none !important;
}

body.coach-focus-mode .coach-page {
    padding-top: 10px;
    padding-bottom: 88px;
}

body.coach-focus-mode .coach-container {
    width: min(1040px, 100%);
}

body.coach-focus-mode .coach-main-layout {
    grid-template-columns: 1fr !important;
}

body.coach-focus-mode .coach-topbar {
    margin-bottom: 6px;
}

body.coach-focus-mode .coach-scoreboard {
    top: 6px;
}

body.coach-focus-mode .coach-card--composer {
    min-height: min(58vh, 620px);
}

body.coach-focus-mode .coach-step-stage {
    min-height: min(38vh, 360px);
}

body.coach-focus-mode .coach-choice {
    min-height: 62px;
    font-size: 0.9rem;
}

body.coach-focus-mode .coach-match-controls {
    display: grid;
}

body.coach-focus-mode .coach-match-controls .coach-btn--success {
    font-size: 0.82rem;
}

@media (min-width: 768px) {
    .coach-topbar {
        grid-template-columns: 1fr;
    }

    .coach-topbar__meta {
        max-width: 880px;
    }

    .coach-main-layout {
        grid-template-columns: minmax(0, 1.65fr) minmax(320px, 0.78fr);
    }

    .coach-side-column {
        position: sticky;
        top: 104px;
    }
}

@media (max-width: 767px) {
    .coach-topbar__meta {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 5px;
        padding: 5px;
    }

    .coach-topbar-action {
        grid-column: 1 / -1;
        min-height: 34px;
        font-size: 0.66rem;
    }

    .coach-mini-stat {
        min-height: 44px;
        padding: 7px;
    }

    .coach-scoreboard {
        top: 4px;
    }

    .coach-player-card {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        padding: 7px;
    }

    .coach-player-card__right {
        width: min(42vw, 160px);
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .coach-box {
        border-radius: 10px;
        padding: 4px;
    }

    .coach-box--big {
        min-height: 38px;
        font-size: 1rem;
    }

    .coach-flow-track {
        gap: 4px;
        margin-bottom: 8px;
    }

    .coach-flow-chip {
        min-height: 24px;
        padding: 0 3px;
        font-size: 0.52rem;
    }

    .coach-card__header {
        gap: 4px;
        margin-bottom: 7px;
    }

    .coach-step-title {
        font-size: 0.82rem;
        margin-bottom: 8px;
    }

    .coach-step-stage {
        min-height: 170px;
    }

    .coach-choice-grid,
    .coach-choice-grid--2 {
        gap: 7px;
    }

    .coach-choice {
        min-height: 46px;
        padding: 7px 5px;
        font-size: 0.68rem;
        border-radius: 12px;
    }

    .coach-composer-footer {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .coach-composer-footer .coach-btn {
        flex: initial !important;
        min-height: 34px;
        font-size: 0.62rem;
    }

    .coach-mobile-stats-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        margin-bottom: 8px;
    }

    .coach-side-column {
        display: none;
    }

    body.coach-mobile-stats-open .coach-side-column {
        display: grid;
    }

    .coach-quick-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .coach-quick-stat {
        padding: 8px;
        border-radius: 12px;
    }

    .coach-quick-stat span {
        font-size: 0.54rem;
    }

    .coach-quick-stat strong {
        font-size: 0.76rem;
    }

    body.coach-focus-mode .coach-page {
        padding: 6px 6px 74px;
    }

    body.coach-focus-mode .coach-topbar {
        margin-bottom: 5px;
    }

    body.coach-focus-mode .coach-card--composer {
        min-height: calc(100dvh - 285px);
    }

    body.coach-focus-mode .coach-step-stage {
        min-height: 160px;
    }

    body.coach-focus-mode .coach-choice {
        min-height: 54px;
        font-size: 0.74rem;
    }

    body.coach-focus-mode .coach-match-controls {
        grid-template-columns: 1.15fr 0.9fr 0.9fr;
    }
}

/* League match bridge */
.coach-linked-match-context {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    margin: 0 0 16px;
    border: 1px solid rgba(37, 99, 235, .16);
    border-radius: 18px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 16px 40px rgba(15, 23, 42, .08);
}
.coach-linked-match-context span {
    display: block;
    font-size: 10px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #2563eb;
    margin-bottom: 5px;
}
.coach-linked-match-context strong {
    display: block;
    font-size: 16px;
    line-height: 1.2;
    color: #0f172a;
}
.coach-linked-match-context em {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.35;
    font-style: normal;
    font-weight: 700;
    color: #64748b;
}
.coach-linked-match-context a {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(37, 99, 235, .22);
}
.coach-linked-match-context--error {
    border-color: rgba(239, 68, 68, .22);
    background: #fff7f7;
}
.coach-linked-match-context--error span {
    color: #dc2626;
}

@media (max-width: 700px) {
    .coach-linked-match-context {
        align-items: flex-start;
        flex-direction: column;
        padding: 12px;
        border-radius: 16px;
    }
    .coach-linked-match-context strong {
        font-size: 14px;
    }
    .coach-linked-match-context em {
        font-size: 11px;
    }
    .coach-linked-match-context a {
        width: 100%;
        min-height: 34px;
        font-size: 11px;
    }
}


/* V2 — premium setup modal + registered profile suggestions */
.coach-modal__dialog--setup {
    width: min(760px, calc(100vw - 24px));
}

.coach-card--setup-modal {
    position: relative;
    overflow: visible;
    border-radius: 28px;
    border: 1px solid rgba(219, 231, 246, .95);
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, .10), transparent 18rem),
        linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 28px 80px rgba(15, 23, 42, .22);
}

.coach-setup-topbar {
    align-items: center;
    padding-bottom: 14px;
    border-bottom: 1px solid #e6eef8;
}

.coach-setup-topbar h2 {
    margin: 0;
    font-size: 22px;
    line-height: 1.05;
    letter-spacing: -.045em;
}

.coach-setup-topbar p {
    margin-top: 5px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.coach-card--setup-modal .coach-setup-block {
    border: 1px solid #e1eaf6;
    border-radius: 22px;
    background: rgba(255, 255, 255, .84);
    box-shadow: 0 12px 28px rgba(15, 23, 42, .045);
}

.coach-card--setup-modal .coach-setup-block__title {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 12px;
    color: #0f172a;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .065em;
    text-transform: uppercase;
}

.coach-card--setup-modal .coach-setup-block__title::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(135deg, #2563eb, #38bdf8);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .10);
}

.coach-setup-players {
    gap: 12px;
}

.coach-setup-player {
    position: relative;
    border-radius: 20px;
    border: 1px solid #e2eaf6;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .04);
}

.coach-setup-player__head {
    padding-bottom: 12px;
    border-bottom: 1px solid #edf3fb;
}

.coach-setup-shirt {
    width: 38px;
    height: 38px;
    border-radius: 14px;
}

.coach-setup-player__identity strong {
    font-size: 14px;
    letter-spacing: -.02em;
}

.coach-setup-player__identity span {
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
}

.coach-card--setup-modal .coach-label {
    margin-bottom: 6px;
    color: #64748b;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .07em;
}

.coach-card--setup-modal .coach-input {
    min-height: 42px;
    border-radius: 14px;
    border: 1px solid #dce7f5;
    background: #f8fbff;
    color: #0f172a;
    font-size: 13px;
    font-weight: 750;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.coach-card--setup-modal .coach-input:focus {
    border-color: #93c5fd;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .11);
}

.coach-form-group {
    position: relative;
}

.coach-player-suggest {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 70;
    max-height: 236px;
    overflow-y: auto;
    padding: 7px;
    border-radius: 16px;
    border: 1px solid #dbe7f5;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 20px 50px rgba(15, 23, 42, .16);
    backdrop-filter: blur(12px);
}

.coach-player-suggest[hidden] {
    display: none !important;
}

.coach-player-suggest__item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 10px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #0f172a;
    text-align: left;
    cursor: pointer;
}

.coach-player-suggest__item:hover {
    background: #eef6ff;
}

.coach-player-suggest__item span {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.coach-player-suggest__item strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #0f172a;
    font-size: 12px;
    font-weight: 900;
}

.coach-player-suggest__item small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #64748b;
    font-size: 10px;
    font-weight: 750;
}

.coach-player-suggest__item em {
    flex: 0 0 auto;
    padding: 4px 7px;
    border-radius: 999px;
    background: #dcfce7;
    color: #047857;
    font-size: 9px;
    font-style: normal;
    font-weight: 900;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.coach-player-suggest__empty {
    padding: 10px;
    color: #64748b;
    font-size: 11px;
    font-weight: 750;
    text-align: center;
}

.coach-setup-block--premium {
    background:
        radial-gradient(circle at top right, rgba(245, 158, 11, .13), transparent 14rem),
        linear-gradient(180deg, #fffdf7 0%, #fff 100%) !important;
    border-color: #fde7b5 !important;
}

.coach-toggle-card {
    border-radius: 18px;
    border-color: #e4edf8;
    background: rgba(255, 255, 255, .88);
}

.coach-toggle-card--profile-save {
    border-color: #f7d994;
    background: linear-gradient(180deg, #fff8e8 0%, #fff 100%);
}

.coach-setup-actions {
    gap: 9px;
    padding-top: 14px;
}

.coach-setup-actions .coach-btn {
    min-height: 42px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 900;
}

@media (max-width: 760px) {
    .coach-modal__dialog--setup {
        width: min(390px, calc(100vw - 18px));
    }

    .coach-card--setup-modal {
        border-radius: 22px;
        padding: 12px;
    }

    .coach-setup-topbar h2 {
        font-size: 19px;
    }

    .coach-setup-players,
    .coach-setup-sections {
        grid-template-columns: 1fr !important;
    }

    .coach-setup-player {
        padding: 12px;
    }

    .coach-card--setup-modal .coach-input {
        min-height: 40px;
        font-size: 12px;
    }

    .coach-player-suggest {
        max-height: 190px;
    }

    .coach-setup-actions {
        grid-template-columns: 1fr;
    }
}


/* V3 — fix visible profile suggestions inside setup modal */
.coach-card--setup-modal,
.coach-card--setup-modal .coach-setup-block,
.coach-card--setup-modal .coach-setup-player,
.coach-card--setup-modal .coach-form-group {
    overflow: visible !important;
}

.coach-player-suggest {
    z-index: 9999 !important;
}

.coach-player-suggest__selected {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-top: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #dcfce7;
    color: #047857;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .045em;
    text-transform: uppercase;
}
/* =========================================================
   TFP COACH MOBILE MODAL FIX — 01.07.2026
   Naprawia przezroczyste nakładanie się modala na mobile.
   Modal setupu działa jak pełnoekranowy, czysty panel.
   ========================================================= */

body[data-page="coach"]:has(.coach-modal.is-open) {
    overflow: hidden !important;
    touch-action: none;
}

body[data-page="coach"] .coach-modal {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483000 !important;
    display: none !important;
    width: 100vw !important;
    max-width: none !important;
    height: 100vh !important;
    height: 100dvh !important;
    padding: 16px !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
}

body[data-page="coach"] .coach-modal.is-open {
    display: flex !important;
}

body[data-page="coach"] .coach-modal__backdrop {
    position: fixed !important;
    inset: 0 !important;
    z-index: 0 !important;
    background: rgba(9, 18, 42, .76) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
}

body[data-page="coach"] .coach-modal__dialog,
body[data-page="coach"] .coach-modal__dialog--setup {
    position: relative !important;
    z-index: 1 !important;
    width: min(760px, calc(100vw - 32px)) !important;
    max-width: 100% !important;
    max-height: calc(100dvh - 32px) !important;
    margin: 0 auto !important;
    overflow: hidden !important;
    overscroll-behavior: contain !important;
}

body[data-page="coach"] .coach-card--setup-modal {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-height: calc(100dvh - 32px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    border-radius: 28px !important;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%) !important;
}

body[data-page="coach"] .coach-card--setup-modal .coach-setup-block,
body[data-page="coach"] .coach-card--setup-modal .coach-setup-player,
body[data-page="coach"] .coach-card--setup-modal .coach-setup-sections {
    overflow: visible !important;
}

body[data-page="coach"] .coach-player-suggest {
    z-index: 20 !important;
}

body[data-page="coach"] .coach-modal.is-open ~ .coach-match-controls,
body[data-page="coach"]:has(.coach-modal.is-open) .coach-match-controls {
    display: none !important;
}

@media (max-width: 767px) {
    body[data-page="coach"]:has(.coach-modal.is-open) {
        overflow: hidden !important;
    }

    body[data-page="coach"] .coach-modal {
        padding: 0 !important;
        align-items: stretch !important;
        justify-content: stretch !important;
        background: #f4f8ff !important;
        overflow: hidden !important;
    }

    body[data-page="coach"] .coach-modal__backdrop {
        display: none !important;
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    body[data-page="coach"] .coach-modal__dialog,
    body[data-page="coach"] .coach-modal__dialog--setup {
        width: 100vw !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        margin: 0 !important;
        border-radius: 0 !important;
        overflow: hidden !important;
    }

    body[data-page="coach"] .coach-card--setup-modal {
        min-height: 100dvh !important;
        max-height: 100dvh !important;
        padding: calc(12px + env(safe-area-inset-top, 0px)) 12px calc(16px + env(safe-area-inset-bottom, 0px)) !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        background: #f4f8ff !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }

    body[data-page="coach"] .coach-setup-topbar {
        position: sticky !important;
        top: 0 !important;
        z-index: 30 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 10px !important;
        margin: -12px -12px 10px !important;
        padding: calc(12px + env(safe-area-inset-top, 0px)) 12px 10px !important;
        border-bottom: 1px solid #dbe7f5 !important;
        background: rgba(244, 248, 255, .98) !important;
        backdrop-filter: blur(12px) !important;
        -webkit-backdrop-filter: blur(12px) !important;
    }

    body[data-page="coach"] .coach-setup-topbar h2 {
        margin: 0 !important;
        font-size: 18px !important;
        line-height: 1.05 !important;
        letter-spacing: -.035em !important;
    }

    body[data-page="coach"] .coach-setup-topbar p {
        display: none !important;
    }

    body[data-page="coach"] .coach-setup-close {
        flex: 0 0 auto !important;
        min-height: 34px !important;
        padding: 0 12px !important;
        border-radius: 999px !important;
        font-size: 11px !important;
    }

    body[data-page="coach"] .coach-card--setup-modal .coach-setup-block,
    body[data-page="coach"] .coach-card--setup-modal .coach-setup-player,
    body[data-page="coach"] .coach-card--setup-modal .coach-setup-sections {
        overflow: visible !important;
    }

    body[data-page="coach"] .coach-setup-block {
        margin-bottom: 10px !important;
        padding: 12px !important;
        border-radius: 18px !important;
        background: #fff !important;
        box-shadow: 0 10px 24px rgba(15, 23, 42, .055) !important;
    }

    body[data-page="coach"] .coach-setup-block__title {
        margin-bottom: 9px !important;
        font-size: 10px !important;
        line-height: 1 !important;
    }

    body[data-page="coach"] .coach-setup-players,
    body[data-page="coach"] .coach-setup-sections,
    body[data-page="coach"] .coach-setup-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    body[data-page="coach"] .coach-setup-player {
        padding: 11px !important;
        border-radius: 17px !important;
        background: #fff !important;
    }

    body[data-page="coach"] .coach-setup-player__head {
        padding-bottom: 9px !important;
        margin-bottom: 9px !important;
    }

    body[data-page="coach"] .coach-setup-shirt {
        width: 34px !important;
        height: 34px !important;
        border-radius: 12px !important;
    }

    body[data-page="coach"] .coach-setup-player__identity strong {
        font-size: 13px !important;
    }

    body[data-page="coach"] .coach-setup-player__identity span {
        font-size: 10px !important;
    }

    body[data-page="coach"] .coach-label,
    body[data-page="coach"] .coach-card--setup-modal .coach-label {
        margin-bottom: 5px !important;
        font-size: 8px !important;
    }

    body[data-page="coach"] .coach-input,
    body[data-page="coach"] .coach-card--setup-modal .coach-input {
        min-height: 38px !important;
        height: 38px !important;
        border-radius: 13px !important;
        font-size: 11.5px !important;
    }

    body[data-page="coach"] .coach-player-suggest {
        position: static !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        z-index: 20 !important;
        max-height: 160px !important;
        margin-top: 6px !important;
        overflow-y: auto !important;
        border-radius: 14px !important;
        background: #fff !important;
        box-shadow: 0 14px 32px rgba(15,23,42,.12) !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    body[data-page="coach"] .coach-player-suggest[hidden] {
        display: none !important;
    }

    body[data-page="coach"] .coach-toggle-card {
        padding: 10px !important;
        border-radius: 15px !important;
    }

    body[data-page="coach"] .coach-toggle-card__copy strong {
        font-size: 12px !important;
    }

    body[data-page="coach"] .coach-toggle-card__copy span {
        font-size: 10px !important;
        line-height: 1.35 !important;
    }

    body[data-page="coach"] .coach-setup-actions {
        position: sticky !important;
        bottom: 0 !important;
        z-index: 25 !important;
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        margin: 8px -12px calc(-16px - env(safe-area-inset-bottom, 0px)) !important;
        padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px)) !important;
        border-top: 1px solid #dbe7f5 !important;
        background: rgba(244, 248, 255, .98) !important;
        backdrop-filter: blur(12px) !important;
        -webkit-backdrop-filter: blur(12px) !important;
    }

    body[data-page="coach"] .coach-setup-actions .coach-btn {
        min-height: 38px !important;
        border-radius: 13px !important;
        font-size: 11px !important;
    }
}

/* =========================================================
   COACH MATCH CENTER PRO — cockpit, quick mode, autosave
   ========================================================= */
body[data-page="coach"] {
    --coach-navy: #071f4c;
    --coach-navy-2: #103c83;
    --coach-blue: #1477f8;
    --coach-cyan: #12bde4;
    --coach-surface: rgba(255,255,255,.97);
    --coach-line: #d9e6f5;
    --coach-ink: #071a3a;
    --coach-soft: #667b9d;
    background:
        radial-gradient(circle at 8% 4%, rgba(28,112,246,.12), transparent 26rem),
        radial-gradient(circle at 92% 8%, rgba(18,189,228,.10), transparent 24rem),
        linear-gradient(180deg, #edf5ff 0%, #f7faff 50%, #eef4fb 100%) !important;
}

body[data-page="coach"] .coach-page {
    padding: 14px 16px 94px !important;
}

body[data-page="coach"] .coach-container {
    width: min(1320px, 100%) !important;
}

body[data-page="coach"] .coach-command-bar {
    position: relative;
    display: grid;
    grid-template-columns: minmax(150px, 1.2fr) repeat(3, minmax(92px, .7fr)) minmax(150px, 1fr) auto;
    align-items: stretch;
    gap: 7px;
    margin-bottom: 9px;
    padding: 7px;
    color: #fff;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 18px;
    background:
        radial-gradient(circle at 94% 0%, rgba(21,190,228,.34), transparent 22rem),
        linear-gradient(115deg, #071f4c 0%, #123f8c 55%, #126cb8 100%);
    box-shadow: 0 16px 40px rgba(7,31,76,.18);
    overflow: hidden;
}

body[data-page="coach"] .coach-command-status,
body[data-page="coach"] .coach-command-stat {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    min-height: 54px;
    padding: 8px 11px;
    border-radius: 13px;
    background: rgba(255,255,255,.09);
    border: 1px solid rgba(255,255,255,.10);
}

body[data-page="coach"] .coach-command-stat {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
}

body[data-page="coach"] .coach-command-status span:not(.coach-connection-dot),
body[data-page="coach"] .coach-command-stat span {
    display: block;
    color: rgba(255,255,255,.68);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

body[data-page="coach"] .coach-command-status strong,
body[data-page="coach"] .coach-command-stat strong {
    display: block;
    min-width: 0;
    max-width: 100%;
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    line-height: 1.12;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body[data-page="coach"] .coach-connection-dot {
    width: 11px;
    height: 11px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: #34d399;
    box-shadow: 0 0 0 5px rgba(52,211,153,.14), 0 0 18px rgba(52,211,153,.8);
}

body[data-page="coach"] .coach-connection-dot.is-offline {
    background: #fb7185;
    box-shadow: 0 0 0 5px rgba(251,113,133,.15);
}

body[data-page="coach"] .coach-command-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

body[data-page="coach"] .coach-mode-switch {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 3px;
    border-radius: 12px;
    background: rgba(0,0,0,.16);
}

body[data-page="coach"] .coach-mode-btn,
body[data-page="coach"] .coach-topbar-action {
    appearance: none;
    border: 0;
    min-height: 34px;
    padding: 0 11px;
    border-radius: 9px;
    color: rgba(255,255,255,.76);
    background: transparent;
    font-size: 10px;
    font-weight: 900;
    white-space: nowrap;
    cursor: pointer;
}

body[data-page="coach"] .coach-mode-btn.is-active {
    color: #08306d;
    background: #fff;
    box-shadow: 0 6px 16px rgba(0,0,0,.16);
}

body[data-page="coach"] .coach-topbar-action {
    color: #fff;
    border: 1px solid rgba(255,255,255,.18);
    background: rgba(255,255,255,.10);
}

body[data-page="coach"] .coach-command-events {
    position: absolute;
    right: 10px;
    bottom: 4px;
    color: rgba(255,255,255,.54);
    font-size: 8px;
    font-weight: 800;
}

body[data-page="coach"] .coach-scoreboard {
    position: sticky !important;
    top: calc(var(--tfp-header-fixed-height, 63px) + 5px) !important;
    z-index: 48 !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin-bottom: 8px !important;
    padding: 0 !important;
    background: transparent !important;
}

body[data-page="coach"] .coach-player-card {
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    min-height: 74px !important;
    padding: 9px 10px !important;
    border-width: 1px !important;
    border-radius: 16px !important;
    background: rgba(255,255,255,.96) !important;
    box-shadow: 0 12px 30px rgba(7,31,76,.08) !important;
    backdrop-filter: blur(16px);
}

body[data-page="coach"] .coach-player-card__left strong {
    color: var(--coach-ink) !important;
    font-size: 14px !important;
}

body[data-page="coach"] .coach-player-card__left span {
    font-size: 10px !important;
    font-weight: 800 !important;
}

body[data-page="coach"] .coach-player-card__right {
    width: 208px !important;
    grid-template-columns: 58px 58px 76px !important;
    gap: 5px !important;
}

body[data-page="coach"] .coach-box {
    min-height: 50px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 5px !important;
    border-radius: 12px !important;
    background: #f4f8ff !important;
}

body[data-page="coach"] .coach-box--big {
    min-height: 50px !important;
    color: #073f9e !important;
    font-size: 22px !important;
}

body[data-page="coach"] .coach-live-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(100px, .55fr)) minmax(260px, 1.7fr);
    gap: 7px;
    margin-bottom: 8px;
    padding: 7px;
    border: 1px solid var(--coach-line);
    border-radius: 15px;
    background: rgba(255,255,255,.92);
    box-shadow: 0 8px 22px rgba(7,31,76,.05);
}

body[data-page="coach"] .coach-live-metric {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 38px;
    padding: 6px 9px;
    border-radius: 10px;
    background: #f5f9ff;
}

body[data-page="coach"] .coach-live-metric span {
    color: #6a7d9e;
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .05em;
}

body[data-page="coach"] .coach-live-metric strong {
    color: var(--coach-ink);
    font-size: 14px;
    font-weight: 950;
}

body[data-page="coach"] .coach-momentum {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    min-height: 20px;
}

body[data-page="coach"] .coach-momentum span {
    width: 18px;
    height: 8px;
    border-radius: 999px;
    background: var(--player1-color);
}

body[data-page="coach"] .coach-momentum span.is-player-2 {
    background: var(--player2-color);
}

body[data-page="coach"] .coach-momentum i {
    color: #91a2bb;
    font-size: 9px;
    font-style: normal;
    font-weight: 800;
}

body[data-page="coach"] .coach-main-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 1.62fr) minmax(350px, .82fr) !important;
    align-items: start !important;
    gap: 10px !important;
}

body[data-page="coach"] .coach-main-column,
body[data-page="coach"] .coach-side-column {
    gap: 10px !important;
}

body[data-page="coach"] .coach-side-column {
    position: sticky !important;
    top: calc(var(--tfp-header-fixed-height, 63px) + 92px) !important;
    max-height: calc(100dvh - var(--tfp-header-fixed-height, 63px) - 104px) !important;
    padding-right: 2px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

body[data-page="coach"] .coach-card {
    border: 1px solid var(--coach-line) !important;
    border-radius: 18px !important;
    background: var(--coach-surface) !important;
    box-shadow: 0 12px 32px rgba(7,31,76,.07) !important;
}

body[data-page="coach"] .coach-card--composer {
    min-height: 0 !important;
    padding: 13px !important;
    overflow: hidden;
}

body[data-page="coach"] .coach-card--composer .coach-card__header {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin-bottom: 10px !important;
}

body[data-page="coach"] .coach-card--composer .coach-card__header h2 {
    color: var(--coach-ink);
    font-size: 18px !important;
    letter-spacing: -.035em;
}

body[data-page="coach"] .coach-step-badge {
    min-height: 28px;
    padding: 0 9px;
    border-radius: 999px;
    color: #175fc1;
    background: #eaf3ff;
    border: 1px solid #d7e7fb;
    font-size: 10px;
    font-weight: 900;
}

body[data-page="coach"] .coach-quick-panel {
    display: grid;
    gap: 10px;
    padding: 12px;
    border-radius: 17px;
    border: 1px solid #d9e8f8;
    background:
        radial-gradient(circle at 100% 0%, rgba(18,189,228,.12), transparent 18rem),
        linear-gradient(180deg, #f8fbff 0%, #eef6ff 100%);
}

body[data-page="coach"] .coach-quick-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
}

body[data-page="coach"] .coach-quick-head span {
    display: block;
    margin-bottom: 3px;
    color: #1477f8;
    font-size: 9px;
    font-weight: 950;
    letter-spacing: .08em;
}

body[data-page="coach"] .coach-quick-head strong {
    color: var(--coach-ink);
    font-size: 13px;
    font-weight: 900;
}

body[data-page="coach"] .coach-quick-head em {
    color: #7183a0;
    font-size: 10px;
    font-style: normal;
    font-weight: 700;
}

body[data-page="coach"] .coach-quick-point-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

body[data-page="coach"] .coach-quick-point {
    appearance: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 86px;
    padding: 14px 17px;
    border: 0;
    border-radius: 16px;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 14px 28px rgba(7,31,76,.14);
    transition: transform .16s ease, filter .16s ease;
}

body[data-page="coach"] .coach-quick-point:hover {
    transform: translateY(-2px);
    filter: saturate(1.08);
}

body[data-page="coach"] .coach-quick-point--p1 {
    background: linear-gradient(135deg, color-mix(in srgb, var(--player1-color) 88%, #071f4c), var(--player1-color));
}

body[data-page="coach"] .coach-quick-point--p2 {
    background: linear-gradient(135deg, color-mix(in srgb, var(--player2-color) 86%, #7f1025), var(--player2-color));
}

body[data-page="coach"] .coach-quick-point span {
    color: rgba(255,255,255,.72);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .07em;
}

body[data-page="coach"] .coach-quick-point strong {
    max-width: 72%;
    font-size: 18px;
    font-weight: 950;
    text-align: right;
    line-height: 1.05;
    overflow-wrap: anywhere;
}

body[data-page="coach"] .coach-quick-presets {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
}

body[data-page="coach"] .coach-quick-presets button {
    appearance: none;
    min-height: 38px;
    padding: 0 8px;
    border: 1px solid #d8e5f6;
    border-radius: 11px;
    color: #244976;
    background: #fff;
    font-size: 10px;
    font-weight: 900;
    cursor: pointer;
}

body[data-page="coach"] .coach-flow-track {
    margin-bottom: 8px !important;
}

body[data-page="coach"] .coach-step-stage {
    min-height: 235px !important;
    padding: 12px !important;
    border: 1px solid #e0eaf6;
    border-radius: 16px;
    background: linear-gradient(180deg, #fbfdff 0%, #f5f9ff 100%);
}

body[data-page="coach"] .coach-choice {
    min-height: 54px !important;
    border-radius: 13px !important;
    font-size: 12px !important;
}

body[data-page="coach"] .coach-composer-footer {
    display: flex !important;
    align-items: center !important;
    gap: 7px !important;
    margin-top: 10px !important;
    padding-top: 10px;
    border-top: 1px solid #edf2f8;
}

body[data-page="coach"] .coach-composer-footer .coach-btn {
    min-height: 36px !important;
    border-radius: 10px !important;
    font-size: 10px !important;
}

body[data-page="coach"] .coach-composer-footer #finishMatchBtn {
    margin-left: auto;
}

body[data-page="coach"] .coach-card--analytics {
    order: 2;
}

body[data-page="coach"] .coach-side-column > .coach-card:not(.coach-card--analytics):has(#eventLog) {
    order: 1;
}

body[data-page="coach"] .coach-side-column > .coach-card:has(#insightsBox) {
    order: 3;
}

body[data-page="coach"] .coach-side-column > .coach-card--match-summary {
    order: 4;
}

body[data-page="coach"] .coach-log {
    max-height: 290px !important;
    overflow-y: auto;
}

body[data-page="coach"] .coach-log-item {
    border-radius: 12px !important;
    padding: 9px !important;
}

body[data-page="coach"] .coach-match-controls {
    position: fixed !important;
    left: 50% !important;
    right: auto !important;
    bottom: max(10px, env(safe-area-inset-bottom, 0px)) !important;
    z-index: 1200 !important;
    transform: translateX(-50%) !important;
    width: min(760px, calc(100vw - 24px)) !important;
    display: none;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 7px !important;
    padding: 7px !important;
    border: 1px solid rgba(188,208,234,.9) !important;
    border-radius: 17px !important;
    background: rgba(255,255,255,.94) !important;
    box-shadow: 0 18px 48px rgba(7,31,76,.18) !important;
    backdrop-filter: blur(18px) !important;
}

body[data-page="coach"] .coach-match-controls.is-visible {
    display: grid !important;
}

body[data-page="coach"] .coach-match-controls .coach-btn {
    min-height: 42px !important;
    border-radius: 11px !important;
    font-size: 10px !important;
}

body[data-page="coach"].coach-mode-quick .coach-pro-only {
    display: none !important;
}

body[data-page="coach"].coach-mode-pro .coach-quick-panel {
    display: none !important;
}

body[data-page="coach"].coach-mode-quick .coach-card--composer .coach-step-badge {
    display: none !important;
}

body[data-page="coach"].coach-mode-quick .coach-match-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

body[data-page="coach"].coach-mode-pro .coach-match-controls {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

body[data-page="coach"] .coach-mobile-stats-toggle {
    display: none !important;
}

@media (max-width: 980px) {
    body[data-page="coach"] .coach-command-bar {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    body[data-page="coach"] .coach-command-status {
        grid-column: span 2;
    }

    body[data-page="coach"] .coach-command-stat--server {
        grid-column: span 2;
    }

    body[data-page="coach"] .coach-command-stat--save {
        grid-column: span 2;
    }

    body[data-page="coach"] .coach-command-actions {
        grid-column: span 2;
        justify-content: flex-end;
    }

    body[data-page="coach"] .coach-main-layout {
        grid-template-columns: 1fr !important;
    }

    body[data-page="coach"] .coach-side-column {
        position: static !important;
        max-height: none !important;
        overflow: visible !important;
    }

    body[data-page="coach"] .coach-live-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    body[data-page="coach"] .coach-live-metric--wide {
        grid-column: 1 / -1;
    }
}

@media (max-width: 767px) {
    body[data-page="coach"] .coach-page {
        padding: 6px 6px 82px !important;
    }

    body[data-page="coach"] .coach-command-bar {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 4px;
        margin-bottom: 5px;
        padding: 5px;
        border-radius: 14px;
    }

    body[data-page="coach"] .coach-command-status,
    body[data-page="coach"] .coach-command-stat {
        grid-column: auto;
        min-height: 44px;
        padding: 6px 7px;
        border-radius: 10px;
    }

    body[data-page="coach"] .coach-command-status {
        grid-column: span 1;
        gap: 6px;
    }

    body[data-page="coach"] .coach-command-stat--server {
        grid-column: span 1;
    }

    body[data-page="coach"] .coach-command-stat--save {
        grid-column: span 2;
    }

    body[data-page="coach"] .coach-command-actions {
        grid-column: span 3;
        justify-content: stretch;
    }

    body[data-page="coach"] .coach-mode-switch {
        flex: 1 1 auto;
    }

    body[data-page="coach"] .coach-mode-btn {
        flex: 1 1 50%;
    }

    body[data-page="coach"] .coach-topbar-action {
        flex: 0 0 auto;
    }

    body[data-page="coach"] .coach-command-status strong,
    body[data-page="coach"] .coach-command-stat strong {
        font-size: 10px;
    }

    body[data-page="coach"] .coach-command-status span:not(.coach-connection-dot),
    body[data-page="coach"] .coach-command-stat span {
        font-size: 7px;
    }

    body[data-page="coach"] .coach-command-events {
        display: none;
    }

    body[data-page="coach"] .coach-scoreboard {
        top: calc(var(--tfp-header-fixed-height, 63px) + 2px) !important;
        gap: 4px !important;
        margin-bottom: 5px !important;
    }

    body[data-page="coach"] .coach-player-card {
        min-height: 58px !important;
        padding: 6px !important;
        border-radius: 12px !important;
    }

    body[data-page="coach"] .coach-player-accent {
        width: 4px !important;
        min-height: 30px !important;
    }

    body[data-page="coach"] .coach-player-card__left {
        gap: 5px !important;
    }

    body[data-page="coach"] .coach-player-card__left strong {
        font-size: 10px !important;
    }

    body[data-page="coach"] .coach-player-card__left span {
        font-size: 8px !important;
    }

    body[data-page="coach"] .coach-player-card__right {
        width: 112px !important;
        grid-template-columns: 32px 32px 42px !important;
        gap: 3px !important;
    }

    body[data-page="coach"] .coach-box {
        min-height: 40px !important;
        padding: 2px !important;
        border-radius: 8px !important;
    }

    body[data-page="coach"] .coach-box span {
        font-size: 6px !important;
    }

    body[data-page="coach"] .coach-box strong {
        font-size: 10px !important;
    }

    body[data-page="coach"] .coach-box--big {
        min-height: 40px !important;
        font-size: 16px !important;
    }

    body[data-page="coach"] .coach-live-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 4px;
        margin-bottom: 5px;
        padding: 4px;
        border-radius: 12px;
    }

    body[data-page="coach"] .coach-live-metric {
        min-height: 32px;
        padding: 4px 5px;
        border-radius: 8px;
    }

    body[data-page="coach"] .coach-live-metric span {
        font-size: 6.5px;
    }

    body[data-page="coach"] .coach-live-metric strong {
        font-size: 10px;
    }

    body[data-page="coach"] .coach-live-metric--wide {
        grid-column: 1 / -1;
    }

    body[data-page="coach"] .coach-momentum span {
        width: 13px;
        height: 6px;
    }

    body[data-page="coach"] .coach-card--composer {
        padding: 8px !important;
        border-radius: 14px !important;
    }

    body[data-page="coach"] .coach-card--composer .coach-card__header {
        margin-bottom: 7px !important;
    }

    body[data-page="coach"] .coach-card--composer .coach-card__header h2 {
        font-size: 14px !important;
    }

    body[data-page="coach"] .coach-card--composer .coach-card__header p {
        font-size: 9px !important;
    }

    body[data-page="coach"] .coach-quick-panel {
        gap: 7px;
        padding: 8px;
        border-radius: 13px;
    }

    body[data-page="coach"] .coach-quick-head {
        align-items: flex-start;
    }

    body[data-page="coach"] .coach-quick-head strong {
        font-size: 10px;
    }

    body[data-page="coach"] .coach-quick-head em {
        display: none;
    }

    body[data-page="coach"] .coach-quick-point-grid {
        gap: 6px;
    }

    body[data-page="coach"] .coach-quick-point {
        min-height: 76px;
        padding: 9px;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        gap: 4px;
        border-radius: 13px;
    }

    body[data-page="coach"] .coach-quick-point strong {
        max-width: 100%;
        font-size: 13px;
        text-align: left;
    }

    body[data-page="coach"] .coach-quick-point span {
        font-size: 8px;
    }

    body[data-page="coach"] .coach-quick-presets {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 5px;
    }

    body[data-page="coach"] .coach-quick-presets button {
        min-height: 34px;
        font-size: 8px;
    }

    body[data-page="coach"] .coach-step-stage {
        min-height: 150px !important;
        padding: 8px !important;
    }

    body[data-page="coach"] .coach-choice {
        min-height: 46px !important;
        font-size: 10px !important;
    }

    body[data-page="coach"] .coach-composer-footer {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 5px !important;
    }

    body[data-page="coach"] .coach-composer-footer #finishMatchBtn {
        margin-left: 0;
    }

    body[data-page="coach"] .coach-composer-footer .coach-btn {
        min-height: 34px !important;
        font-size: 8px !important;
    }

    body[data-page="coach"] .coach-side-column {
        display: none !important;
    }

    body[data-page="coach"].coach-mobile-stats-open .coach-side-column {
        display: grid !important;
        margin-top: 6px;
    }

    body[data-page="coach"] .coach-match-controls {
        width: calc(100vw - 12px) !important;
        bottom: max(5px, env(safe-area-inset-bottom, 0px)) !important;
        gap: 4px !important;
        padding: 5px !important;
        border-radius: 14px !important;
    }

    body[data-page="coach"] .coach-match-controls .coach-btn {
        min-height: 38px !important;
        padding: 0 4px !important;
        font-size: 8px !important;
    }

    body[data-page="coach"].coach-mode-pro .coach-match-controls {
        grid-template-columns: 1.15fr .9fr .9fr .9fr !important;
    }
}
@media (max-width: 767px) {
    body[data-page="coach"] .coach-scoreboard {
        grid-template-columns: 1fr !important;
    }
    body[data-page="coach"] .coach-player-card__right {
        width: 138px !important;
        grid-template-columns: 38px 38px 54px !important;
    }
}

/* =========================================================
   TFP Coach PRO — serwis jako piłka + rozszerzony szybki tryb
   ========================================================= */
body[data-page="coach"] .coach-player-name-line {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

body[data-page="coach"] .coach-player-name-line > strong {
    min-width: 0;
}

body[data-page="coach"] .coach-serving-ball {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: rgba(190, 242, 100, .16);
    border: 1px solid rgba(132, 204, 22, .26);
    box-shadow: 0 5px 12px rgba(77, 124, 15, .12);
    animation: coachServePulse 1.8s ease-in-out infinite;
}

body[data-page="coach"] .coach-serving-ball[hidden] {
    display: none !important;
}

body[data-page="coach"] .coach-tennis-ball {
    position: relative;
    display: inline-block;
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    overflow: hidden;
    border-radius: 50%;
    background: linear-gradient(145deg, #eaff55 0%, #c8f323 52%, #9fce13 100%);
    border: 1px solid rgba(79, 108, 0, .26);
    box-shadow:
        inset -2px -2px 3px rgba(68, 97, 0, .18),
        inset 2px 2px 3px rgba(255,255,255,.52),
        0 2px 5px rgba(68, 97, 0, .18);
}

body[data-page="coach"] .coach-tennis-ball::before,
body[data-page="coach"] .coach-tennis-ball::after {
    content: "";
    position: absolute;
    top: -2px;
    width: 9px;
    height: 17px;
    border: 1.5px solid rgba(255,255,255,.94);
    border-top-color: transparent;
    border-bottom-color: transparent;
    border-radius: 50%;
}

body[data-page="coach"] .coach-tennis-ball::before {
    left: -5px;
}

body[data-page="coach"] .coach-tennis-ball::after {
    right: -5px;
}

body[data-page="coach"] .coach-tennis-ball--command {
    width: 14px;
    height: 14px;
}

body[data-page="coach"] .coach-command-stat--server strong {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

body[data-page="coach"] .coach-command-stat--server strong > span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@keyframes coachServePulse {
    0%, 100% { transform: scale(1); box-shadow: 0 5px 12px rgba(77, 124, 15, .12); }
    50% { transform: scale(1.08); box-shadow: 0 7px 18px rgba(101, 163, 13, .24); }
}

body[data-page="coach"] .coach-quick-toolbox {
    display: grid;
    grid-template-columns: .82fr 1.22fr 1.22fr;
    gap: 8px;
    min-width: 0;
}

body[data-page="coach"] .coach-quick-group {
    min-width: 0;
    padding: 9px;
    border: 1px solid #dce8f7;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(247,250,255,.98));
    box-shadow: 0 8px 20px rgba(15, 44, 88, .045);
}

body[data-page="coach"] .coach-quick-group--serve {
    border-color: #d8e8ff;
    background: linear-gradient(180deg, #f8fbff 0%, #edf5ff 100%);
}

body[data-page="coach"] .coach-quick-group--finish {
    border-color: #d7f0e2;
    background: linear-gradient(180deg, #fbfffd 0%, #f1fbf5 100%);
}

body[data-page="coach"] .coach-quick-group--errors {
    border-color: #f4dfe4;
    background: linear-gradient(180deg, #fffdfd 0%, #fff5f6 100%);
}

body[data-page="coach"] .coach-quick-group__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 7px;
}

body[data-page="coach"] .coach-quick-group__head strong {
    color: #102b54;
    font-size: 10px;
    font-weight: 950;
    line-height: 1.1;
}

body[data-page="coach"] .coach-quick-group__head span {
    max-width: 58%;
    color: #7a8ba5;
    font-size: 7.5px;
    font-weight: 750;
    line-height: 1.25;
    text-align: right;
}

body[data-page="coach"] .coach-quick-presets,
body[data-page="coach"] .coach-quick-presets--2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

body[data-page="coach"] .coach-quick-preset,
body[data-page="coach"] .coach-quick-presets button {
    appearance: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 0;
    min-height: 40px;
    padding: 7px 8px;
    border-radius: 11px;
    border: 1px solid #d7e4f4;
    background: #fff;
    color: #173a69;
    font-size: 9px;
    font-weight: 900;
    line-height: 1.15;
    text-align: center;
    overflow-wrap: anywhere;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease;
}

body[data-page="coach"] .coach-quick-preset:hover,
body[data-page="coach"] .coach-quick-presets button:hover {
    transform: translateY(-1px);
    border-color: #9fc5ff;
    box-shadow: 0 7px 16px rgba(25, 89, 190, .10);
}

body[data-page="coach"] .coach-quick-preset--ace {
    color: #14532d;
    border-color: #bfe8cd;
    background: #effcf4;
}

body[data-page="coach"] .coach-quick-preset--fault,
body[data-page="coach"] .coach-quick-preset--unforced {
    color: #9f1239;
    border-color: #fecdd6;
    background: #fff1f4;
}

body[data-page="coach"] .coach-quick-preset--winner,
body[data-page="coach"] .coach-quick-preset--return {
    color: #075985;
    border-color: #bae6fd;
    background: #f0f9ff;
}

body[data-page="coach"] .coach-quick-preset--forced {
    color: #9a3412;
    border-color: #fed7aa;
    background: #fff7ed;
}

body[data-page="coach"] .coach-quick-preset__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 19px;
    height: 19px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: rgba(255,255,255,.82);
    box-shadow: inset 0 0 0 1px rgba(15, 42, 80, .09);
    font-size: 10px;
    font-weight: 950;
}

body[data-page="coach"] .coach-quick-preset > span:last-child {
    display: grid;
    gap: 1px;
    min-width: 0;
    text-align: left;
}

body[data-page="coach"] .coach-quick-preset small {
    color: #7a8ba5;
    font-size: 6.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

body[data-page="coach"] .coach-quick-preset strong {
    color: inherit;
    font-size: 8.5px;
    font-weight: 950;
    line-height: 1.1;
}

body[data-page="coach"] .coach-choice--with-help {
    display: grid !important;
    place-items: center;
    gap: 3px;
    padding: 9px 11px !important;
}

body[data-page="coach"] .coach-choice--with-help strong {
    color: inherit;
    font-size: inherit;
    font-weight: 950;
}

body[data-page="coach"] .coach-choice--with-help small {
    color: #6f809a;
    font-size: 8px;
    font-weight: 750;
    line-height: 1.2;
}

body[data-page="coach"] .coach-result-explainer {
    margin: 9px 0 0;
    padding: 8px 10px;
    border: 1px solid #dce8f7;
    border-radius: 11px;
    background: #f7faff;
    color: #5d7190;
    font-size: 9px;
    font-weight: 650;
    line-height: 1.45;
}

body[data-page="coach"] .coach-result-explainer strong {
    color: #143d75;
}

@media (max-width: 1080px) {
    body[data-page="coach"] .coach-quick-toolbox {
        grid-template-columns: 1fr 1fr;
    }

    body[data-page="coach"] .coach-quick-group--serve {
        grid-column: 1 / -1;
    }
}

@media (max-width: 767px) {
    body[data-page="coach"] .coach-serving-ball {
        width: 21px;
        height: 21px;
    }

    body[data-page="coach"] .coach-tennis-ball {
        width: 13px;
        height: 13px;
    }

    body[data-page="coach"] .coach-quick-toolbox {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    body[data-page="coach"] .coach-quick-group--serve {
        grid-column: auto;
    }

    body[data-page="coach"] .coach-quick-group {
        padding: 7px;
        border-radius: 12px;
    }

    body[data-page="coach"] .coach-quick-group__head {
        align-items: center;
        margin-bottom: 5px;
    }

    body[data-page="coach"] .coach-quick-group__head strong {
        font-size: 9px;
    }

    body[data-page="coach"] .coach-quick-group__head span {
        font-size: 6.5px;
    }

    body[data-page="coach"] .coach-quick-preset,
    body[data-page="coach"] .coach-quick-presets button {
        min-height: 35px;
        padding: 5px 6px;
        font-size: 7.5px;
        border-radius: 9px;
    }

    body[data-page="coach"] .coach-quick-preset__icon {
        width: 17px;
        height: 17px;
        font-size: 8px;
    }

    body[data-page="coach"] .coach-result-explainer {
        font-size: 8px;
    }
}

body[data-page="coach"] .coach-quick-preset--wide {
    grid-column: 1 / -1;
}

/* =========================================================
   QUICK MODE — VIVID PRO CONTROL DECK
   Final visual override: stronger hierarchy, player colors,
   event colors and thumb-friendly controls.
========================================================= */
body[data-page="coach"].coach-mode-quick .coach-card--composer {
    overflow: visible;
    border: 1px solid #bfd5f3;
    box-shadow: 0 18px 46px rgba(8, 35, 82, .13);
}

body[data-page="coach"].coach-mode-quick .coach-quick-panel {
    gap: 12px;
    padding: 0 12px 12px;
    overflow: hidden;
    border: 1px solid #bdd4f2;
    border-radius: 18px;
    background:
        radial-gradient(circle at 4% 4%, rgba(30, 144, 255, .10), transparent 22rem),
        linear-gradient(180deg, #f8fbff 0%, #edf5ff 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 12px 30px rgba(20, 72, 145, .08);
}

body[data-page="coach"].coach-mode-quick .coach-quick-head {
    align-items: center;
    margin: 0 -12px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255,255,255,.16);
    background:
        radial-gradient(circle at 100% 0%, rgba(34, 211, 238, .34), transparent 15rem),
        linear-gradient(118deg, #071d49 0%, #123f8c 58%, #0b73b9 100%);
    box-shadow: 0 8px 20px rgba(7, 29, 73, .18);
}

body[data-page="coach"].coach-mode-quick .coach-quick-head span {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    margin: 0 0 5px;
    padding: 0 9px;
    border: 1px solid rgba(125, 211, 252, .44);
    border-radius: 999px;
    color: #dff8ff;
    background: rgba(14, 165, 233, .22);
    font-size: 8px;
    letter-spacing: .10em;
}

body[data-page="coach"].coach-mode-quick .coach-quick-head strong {
    display: block;
    color: #fff;
    font-size: 14px;
    line-height: 1.25;
    text-shadow: 0 1px 2px rgba(0,0,0,.12);
}

body[data-page="coach"].coach-mode-quick .coach-quick-head em {
    max-width: 260px;
    padding: 7px 10px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 10px;
    color: #d7e9ff;
    background: rgba(255,255,255,.08);
    font-size: 9px;
    line-height: 1.35;
    text-align: right;
}

body[data-page="coach"].coach-mode-quick .coach-quick-point-grid {
    gap: 10px;
}

body[data-page="coach"].coach-mode-quick .coach-quick-point {
    position: relative;
    isolation: isolate;
    min-height: 96px;
    padding: 16px 18px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.38);
    border-radius: 17px;
    box-shadow: 0 14px 28px rgba(6, 31, 76, .17), inset 0 1px 0 rgba(255,255,255,.24);
}

body[data-page="coach"].coach-mode-quick .coach-quick-point::before {
    content: '';
    position: absolute;
    z-index: -1;
    width: 116px;
    height: 116px;
    right: -34px;
    top: -48px;
    border: 18px solid rgba(255,255,255,.11);
    border-radius: 50%;
}

body[data-page="coach"].coach-mode-quick .coach-quick-point::after {
    content: '＋';
    display: grid;
    place-items: center;
    position: absolute;
    right: 14px;
    bottom: 12px;
    width: 28px;
    height: 28px;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 50%;
    color: #fff;
    background: rgba(255,255,255,.13);
    font-size: 18px;
    font-weight: 700;
}

body[data-page="coach"].coach-mode-quick .coach-quick-point--p1 {
    background: linear-gradient(135deg, #123fa5 0%, #1769e8 58%, #22a7ef 100%);
}

body[data-page="coach"].coach-mode-quick .coach-quick-point--p2 {
    background: linear-gradient(135deg, #9f1239 0%, #e11d48 55%, #fb5c62 100%);
}

body[data-page="coach"].coach-mode-quick .coach-quick-point:hover {
    transform: translateY(-3px) scale(1.008);
    filter: brightness(1.04) saturate(1.10);
    box-shadow: 0 18px 34px rgba(6, 31, 76, .22), inset 0 1px 0 rgba(255,255,255,.28);
}

body[data-page="coach"].coach-mode-quick .coach-quick-point:active {
    transform: translateY(0) scale(.992);
}

body[data-page="coach"].coach-mode-quick .coach-quick-point span {
    align-self: flex-start;
    padding: 5px 8px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 999px;
    color: rgba(255,255,255,.94);
    background: rgba(255,255,255,.12);
    font-size: 8px;
}

body[data-page="coach"].coach-mode-quick .coach-quick-point strong {
    padding-right: 30px;
    color: #fff;
    font-size: 19px;
    text-shadow: 0 2px 8px rgba(0,0,0,.15);
}

body[data-page="coach"].coach-mode-quick .coach-quick-toolbox {
    grid-template-columns: .88fr 1.2fr 1.3fr;
    gap: 9px;
}

body[data-page="coach"].coach-mode-quick .coach-quick-group {
    position: relative;
    padding: 10px;
    overflow: hidden;
    border-width: 1px;
    border-radius: 15px;
    box-shadow: 0 10px 22px rgba(8, 40, 88, .07), inset 0 1px 0 rgba(255,255,255,.86);
}

body[data-page="coach"].coach-mode-quick .coach-quick-group::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
}

body[data-page="coach"].coach-mode-quick .coach-quick-group--serve {
    border-color: #c8dca1;
    background: linear-gradient(145deg, #f9ffe8 0%, #eff9cd 100%);
}
body[data-page="coach"].coach-mode-quick .coach-quick-group--serve::before {
    background: linear-gradient(180deg, #84cc16, #eab308);
}

body[data-page="coach"].coach-mode-quick .coach-quick-group--finish {
    border-color: #b9d9f5;
    background: linear-gradient(145deg, #f4faff 0%, #e8f5ff 100%);
}
body[data-page="coach"].coach-mode-quick .coach-quick-group--finish::before {
    background: linear-gradient(180deg, #2563eb, #06b6d4);
}

body[data-page="coach"].coach-mode-quick .coach-quick-group--errors {
    border-color: #f3c8c8;
    background: linear-gradient(145deg, #fff8f5 0%, #fff0ed 100%);
}
body[data-page="coach"].coach-mode-quick .coach-quick-group--errors::before {
    background: linear-gradient(180deg, #f97316, #e11d48);
}

body[data-page="coach"].coach-mode-quick .coach-quick-group__head {
    align-items: center;
    margin: -1px 0 9px;
    padding-left: 4px;
}

body[data-page="coach"].coach-mode-quick .coach-quick-group__head strong {
    color: #081d42;
    font-size: 11px;
}

body[data-page="coach"].coach-mode-quick .coach-quick-group__head span {
    color: #61738f;
    font-size: 7px;
}

body[data-page="coach"].coach-mode-quick .coach-quick-preset,
body[data-page="coach"].coach-mode-quick .coach-quick-presets button {
    position: relative;
    min-height: 44px;
    padding: 8px 9px;
    border-width: 1px;
    border-radius: 11px;
    color: #10264c;
    background: #fff;
    box-shadow: 0 5px 12px rgba(12, 44, 91, .06);
    font-size: 8.5px;
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}

body[data-page="coach"].coach-mode-quick .coach-quick-preset:hover,
body[data-page="coach"].coach-mode-quick .coach-quick-presets button:hover {
    transform: translateY(-2px);
    filter: saturate(1.08) brightness(1.02);
    box-shadow: 0 9px 18px rgba(12, 44, 91, .13);
}

/* Serwis: tenisowa zieleń i alarmowa czerwień */
body[data-page="coach"].coach-mode-quick .coach-quick-preset--ace {
    border-color: #86c944;
    color: #244c0b;
    background: linear-gradient(145deg, #eaffbe, #c9f36b);
}
body[data-page="coach"].coach-mode-quick .coach-quick-preset--fault {
    border-color: #f29a9a;
    color: #7f1d1d;
    background: linear-gradient(145deg, #fff0f0, #ffc5c5);
}

/* Winner: konsekwentne kolory zawodników */
body[data-page="coach"].coach-mode-quick .coach-quick-group--finish .coach-quick-preset--winner:nth-child(1) {
    border-color: #6aa9ff;
    color: #fff;
    background: linear-gradient(135deg, #1554c0, #2784ef);
}
body[data-page="coach"].coach-mode-quick .coach-quick-group--finish .coach-quick-preset--winner:nth-child(2) {
    border-color: #fb8792;
    color: #fff;
    background: linear-gradient(135deg, #bd1745, #f04455);
}
body[data-page="coach"].coach-mode-quick .coach-quick-preset--return {
    border-color: #a78bfa;
    color: #fff;
    background: linear-gradient(135deg, #6d28d9, #8b5cf6 55%, #4f8ff7);
}

/* Błędy: rodzaj zdarzenia + kolor zawodnika po lewej/prawej */
body[data-page="coach"].coach-mode-quick .coach-quick-group--errors .coach-quick-preset:nth-child(odd) {
    border-left: 5px solid #2563eb;
}
body[data-page="coach"].coach-mode-quick .coach-quick-group--errors .coach-quick-preset:nth-child(even) {
    border-left: 5px solid #ef334f;
}
body[data-page="coach"].coach-mode-quick .coach-quick-preset--unforced {
    border-color: #ffc08a;
    color: #8a3411;
    background: linear-gradient(145deg, #fff7ed, #ffe0bd);
}
body[data-page="coach"].coach-mode-quick .coach-quick-preset--forced {
    border-color: #e7a7bd;
    color: #831843;
    background: linear-gradient(145deg, #fff1f5, #ffcbdc);
}

body[data-page="coach"].coach-mode-quick .coach-quick-preset__icon {
    width: 23px;
    height: 23px;
    color: inherit;
    background: rgba(255,255,255,.7);
    box-shadow: inset 0 0 0 1px rgba(13, 39, 77, .10), 0 3px 8px rgba(13,39,77,.08);
}

body[data-page="coach"].coach-mode-quick .coach-quick-preset small {
    color: currentColor;
    opacity: .68;
}

body[data-page="coach"].coach-mode-quick .coach-quick-preset strong {
    color: inherit;
}

body[data-page="coach"].coach-mode-quick .coach-match-controls {
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid #d8e5f6;
}

body[data-page="coach"].coach-mode-quick .coach-match-controls .coach-btn--danger,
body[data-page="coach"].coach-mode-quick #finishMatchBtn {
    color: #fff;
    border-color: #e63c4d;
    background: linear-gradient(135deg, #dc263c, #ff5c63);
    box-shadow: 0 8px 18px rgba(220, 38, 60, .18);
}

@media (max-width: 1080px) {
    body[data-page="coach"].coach-mode-quick .coach-quick-toolbox {
        grid-template-columns: 1fr 1fr;
    }

    body[data-page="coach"].coach-mode-quick .coach-quick-group--serve {
        grid-column: 1 / -1;
    }
}

@media (max-width: 767px) {
    body[data-page="coach"].coach-mode-quick .coach-quick-panel {
        gap: 8px;
        padding: 0 8px 9px;
        border-radius: 15px;
    }

    body[data-page="coach"].coach-mode-quick .coach-quick-head {
        margin: 0 -8px;
        padding: 10px;
    }

    body[data-page="coach"].coach-mode-quick .coach-quick-head strong {
        font-size: 11px;
    }

    body[data-page="coach"].coach-mode-quick .coach-quick-head em {
        display: none;
    }

    body[data-page="coach"].coach-mode-quick .coach-quick-point-grid {
        gap: 7px;
    }

    body[data-page="coach"].coach-mode-quick .coach-quick-point {
        min-height: 78px;
        padding: 11px;
        border-radius: 13px;
    }

    body[data-page="coach"].coach-mode-quick .coach-quick-point::after {
        right: 8px;
        bottom: 8px;
        width: 23px;
        height: 23px;
        font-size: 15px;
    }

    body[data-page="coach"].coach-mode-quick .coach-quick-point span {
        padding: 3px 6px;
        font-size: 6.5px;
    }

    body[data-page="coach"].coach-mode-quick .coach-quick-point strong {
        max-width: 78%;
        padding-right: 18px;
        font-size: 13px;
    }

    body[data-page="coach"].coach-mode-quick .coach-quick-toolbox {
        grid-template-columns: 1fr;
        gap: 7px;
    }

    body[data-page="coach"].coach-mode-quick .coach-quick-group--serve {
        grid-column: auto;
    }

    body[data-page="coach"].coach-mode-quick .coach-quick-group {
        padding: 8px;
    }

    body[data-page="coach"].coach-mode-quick .coach-quick-group__head {
        margin-bottom: 6px;
    }

    body[data-page="coach"].coach-mode-quick .coach-quick-preset,
    body[data-page="coach"].coach-mode-quick .coach-quick-presets button {
        min-height: 40px;
        padding: 7px;
        font-size: 7.5px;
    }
}
