/* Shared working surfaces. Loaded after the component styles. The court,
   charts, score strip, coloured event actions and printed documents keep their
   own colours/geometry; club accents continue to come from --green/--lime. */
@media screen {
  :is(.coach-portal,.club-management,.participant-portal,.club-operations,.scouting-area,.scouting-notebooks,.coach-dialog,.club-dialog) {
    --eco-ink:var(--ui-text,#24282e);
    --eco-muted:var(--ui-muted,#606973);
    --eco-surface:var(--ui-surface,#fff);
    --eco-subtle:var(--ui-subtle,#f1f2f3);
    --eco-line:var(--ui-border,#d7dadd);
    --club-muted:var(--eco-muted);
    --participant-muted:var(--eco-muted);
    --ops-muted:var(--eco-muted);
    min-width:0;
    font-variant-numeric:tabular-nums;
  }

  /* Consistent interaction feedback, including controls in narrow dialogs. */
  :is(.coach-portal,.club-management,.participant-portal,.club-operations,.scouting-area,.scouting-notebooks,.coach-dialog,.club-dialog,.tablet-game) :is(button,input,select,textarea,summary) {
    scroll-margin-block:16px;
  }
  :is(.coach-portal,.club-management,.participant-portal,.club-operations,.scouting-area,.scouting-notebooks,.coach-dialog,.club-dialog) button {
    min-height:44px;
    line-height:1.35;
    touch-action:manipulation;
  }
  :is(.coach-portal,.club-management,.participant-portal,.club-operations,.scouting-area,.scouting-notebooks,.coach-dialog,.club-dialog,.tablet-game) :is(button,a,input,select,textarea,summary):focus-visible {
    outline:3px solid var(--ui-focus,#2454ba);
    outline-offset:3px;
  }
  :is(.coach-portal,.club-management,.participant-portal,.club-operations,.scouting-area,.scouting-notebooks,.coach-dialog,.club-dialog) :is(button,input,select,textarea):disabled {
    opacity:1;
    color:var(--eco-muted);
    background:var(--eco-subtle);
    border-color:var(--eco-line);
    border-style:dashed;
    cursor:not-allowed;
    transition:none;
    box-shadow:none;
    -webkit-text-fill-color:currentColor;
  }
  :is(.coach-portal,.club-management,.participant-portal,.club-operations,.scouting-area,.scouting-notebooks,.coach-dialog,.club-dialog) :is(button.primary,button.lime):disabled {
    color:var(--eco-muted)!important;
    background:var(--eco-subtle);
    border-color:var(--eco-line);
  }
  :is(.coach-form,.club-form,.participant-profile-form,.ops-form,#scouting-notebook-form) :is(input,select,textarea):not([type=checkbox],[type=radio],[type=color],[type=range]) {
    width:100%;min-width:0;max-width:100%;min-height:46px;
    color:var(--ui-text,#24282e);background:var(--ui-surface,#fff);
    border-color:var(--ui-input-border,#8c949d);font:inherit;
  }
  :is(.coach-form,.club-form,.participant-profile-form,.ops-form) label {
    color:var(--ui-muted,#606973);line-height:1.5;min-width:0;
  }
  :is(.coach-form,.club-form,.participant-profile-form,.ops-form) :is(input,textarea)::placeholder {
    color:var(--ui-muted,#606973);opacity:1;
  }
  .participant-portal :is(.participant-actions,.participant-notice-action,.participant-training-answer) button.primary:not(:disabled) {
    background:var(--green,#2454ba);border-color:var(--green,#2454ba);color:var(--on-primary,#fff);
  }
  :is(.coach-portal,.club-management,.club-operations,.coach-dialog,.club-dialog,.tablet-game) button.primary:not(:disabled) {
    background:var(--green,#2454ba);border-color:var(--green,#2454ba);color:var(--on-primary,#fff);
  }

  /* Long names, dates and actions can wrap without enlarging the page. */
  :is(.coach-section-heading,.coach-training-top,.coach-calendar-toolbar,.club-header,.club-section-heading,.participant-section-heading,.ops-list-heading,.scouting-area .panel-head) {
    flex-wrap:wrap;min-width:0;gap:12px;
  }
  :is(.coach-section-heading,.coach-training-top,.club-header,.club-section-heading,.participant-heading,.coach-member) > div {min-width:0}
  :is(.coach-training-top,.club-section-heading,.club-header) > .toolbar {flex-shrink:1}
  :is(.club-filters,.ops-toolbar,.coach-calendar-toolbar) :is(input,select,label) {min-width:0;max-width:100%}
  :is(.club-filters,.ops-toolbar) label {flex:1 1 180px}
  .club-management .club-filters input {flex:1 1 230px;width:auto}
  .club-management .club-filters select {flex:0 1 200px;width:auto}
  :is(.club-management,.participant-portal,.club-operations,.scouting-notebooks) :is(h2,h3,h4) {overflow-wrap:anywhere}
  :is(.coach-member,.coach-team-card,.club-teams-list>div,.ops-message footer) {flex-wrap:wrap}
  :is(.coach-member,.club-teams-list>div)>div:first-child {flex:1 1 180px;min-width:0}
  :is(.coach-member,.club-teams-list>div) strong {overflow-wrap:anywhere}

  /* Financial and coordination details previously used pale 9px labels. */
  .club-management :is(.club-table td,.club-table td strong,.club-age-bars strong,.club-methods strong,.club-category-bars strong,.club-teams-list strong,.club-season-history strong,.club-audit strong) {color:var(--eco-ink)}
  .club-management :is(.club-table td small,.club-stat-cards small,.club-stat-cards span,.club-category-bars span,.club-category-bars small,.club-aging span,.club-methods span,.club-balance p,.club-balance small,.club-season-history span,.club-season-history small,.club-teams-list small,.club-internal-note,.club-audit p,.club-audit small,.legend) {color:var(--eco-muted);font-size:12px;line-height:1.5}
  .club-management :is(.club-finance-kpis span,.club-finance-kpis small,.club-age-bars span) {color:var(--eco-muted);line-height:1.5}
  .club-management :is(.club-finance-kpis strong,.club-finance-kpis .received strong,.club-finance-kpis .pending strong,.club-finance-kpis .overdue strong,.club-aging strong) {color:var(--eco-ink);font-variant-numeric:tabular-nums;letter-spacing:-.02em}
  .club-management .club-table-wrap {min-width:0;max-width:100%;overscroll-behavior-inline:contain;scroll-padding-inline:12px}
  .club-management .club-table :is(th,td) {line-height:1.5}
  .club-management .club-table th {font-size:11px;letter-spacing:.025em;color:var(--eco-muted)}
  .club-management .club-table td button {font-size:12px}
  .club-management .club-table tbody tr:focus-within {outline:2px solid var(--ui-focus,#2454ba);outline-offset:-2px}
  .club-management .club-status {font-size:12px;line-height:1.35}
  .club-management .club-status.pending {color:#66512b;background:#f5eedf}
  .club-management .club-status.partial {color:#775015;background:#fff0d1}
  .club-management .club-status.overdue {color:#8f2e47;background:#fdebf0}
  .club-management .club-status.paid {color:#215e50;background:#e4f3ec}
  .club-management .club-status.void {color:#4f5c6d;background:#edf0f4}

  /* Navigation remains legible even when a club chooses a very light accent. */
  .coach-portal :is(.coach-tabs,.club-tabs) button.active {color:var(--eco-ink);font-weight:750}
  .club-management .club-tabs button {color:var(--eco-muted)}
  .club-management .club-tabs button.active {color:var(--eco-ink);font-weight:750;box-shadow:inset 0 -3px var(--green,var(--ui-accent,#2454ba))}
  .coach-portal .coach-tabs button.active {box-shadow:inset 3px 0 var(--green,var(--ui-accent,#2454ba))}
  .coach-portal .club-tabs button.active {box-shadow:inset 0 -3px var(--green,var(--ui-accent,#2454ba))}
  .coach-portal :is(.coach-tabs,.club-tabs,.coach-workspace-switch) {scroll-padding:8px}
  .coach-portal .coach-session-chip {min-width:0;text-align:left;white-space:normal}
  .coach-portal :is(.coach-session-chip,.coach-match-chip) :is(strong,span) {overflow-wrap:anywhere;line-height:1.4}
  .scouting-notebooks [data-scouting-list] .panel,.scouting-notebooks [data-scouting-related] .panel {margin-block:14px}
  .scouting-notebooks :is(p,.legend) {line-height:1.6}
  .tablet-game :is(.touch-counter strong,.game-score .score-num,.game-score .clock,.player .ptime) {font-variant-numeric:tabular-nums}
  .tablet-game .bench {scroll-padding-inline:8px}
  .tablet-game .bench button:focus-visible {outline-offset:-3px}

  /* On compact landscape tablets, reserve a full-width row above BOTH panes.
     Move the existing counters there; no duplicate actions and no overlay on
     the pitch. The remaining court tools keep their normal scroll container. */
  @media (min-width:900px) and (max-width:1199px) and (max-height:650px) and (orientation:landscape) {
    .game-shell.match-focus .tablet-game {position:relative;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin}
    .game-shell.match-focus .game-top {display:contents}
    .game-shell.match-focus .game-score {order:0;flex-shrink:0;padding:4px 9px;background:var(--pulso-ink,#17232a);color:#fff}
    .game-shell.match-focus .game-controls {order:1;flex-shrink:0;margin-top:0;padding:4px 9px;background:var(--pulso-ink,#17232a)}
    .game-shell.match-focus .technical-banner {order:2;flex-shrink:0}
    .game-shell.match-focus .game-workspace {order:3;flex:0 0 calc(100dvh - 136px);height:calc(100dvh - 136px)}
    .game-shell.match-focus :is(.game-save-bar,.live-score-control,.match-context-bar) {order:4;flex-shrink:0}
    .game-shell.match-focus .game-save-bar {padding:10px;background:var(--pulso-ink,#17232a);color:#fff}
    .game-shell.match-focus .game-controls {gap:5px}
    .game-shell.match-focus .game-controls button {padding-inline:8px;font-size:11px;min-height:44px}
    .game-shell.match-focus .game-controls .timer-toggle {min-width:108px;min-height:46px;font-size:12px}
    .game-shell.match-focus .timer-adjust button {min-width:64px;min-height:46px;font-size:13px}
    .game-shell.match-focus .game-workspace {position:relative;padding-top:74px}
    .game-shell.match-focus .court-pane {position:static}
    .game-shell.match-focus .court-heading {margin-bottom:4px}
    .game-shell.match-focus .court-heading button {min-height:44px}
    .game-shell.match-focus .pitch {min-height:232px}
    .game-shell.match-focus .pitch .player {min-height:64px;padding-block:2px}
    .game-shell.match-focus .pitch .player-portrait {height:20px}
    .game-shell.match-focus .pitch .player-portrait b {font-size:21px;line-height:1}
    .game-shell.match-focus .pitch .player .pos {line-height:1.1}
    .game-shell.match-focus .pitch .player .ptime {font-size:10px;line-height:1.2}
    .game-shell.match-focus .bench-heading {margin-block:4px}
    .game-shell.match-focus .bench {min-height:69px}
    .game-shell.match-focus .bench button {min-height:64px}
    .game-shell.match-focus .court-counters {display:contents}
    .game-shell.match-focus .court-counters .score-counters {
      position:absolute;inset:0 0 auto;min-height:66px;
      display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;
    }
    .game-shell.match-focus .court-counters .touch-counter {
      display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;
      gap:6px;padding:6px 8px;min-width:0;min-height:66px;
      border:1px solid var(--ui-border,#d7dadd);
    }
    .game-shell.match-focus .court-counters .touch-counter>span {font-size:12px;line-height:1.25}
    .game-shell.match-focus .court-counters .touch-counter small {font-size:10px;line-height:1.25;margin-top:3px}
    .game-shell.match-focus .court-counters .touch-counter>div {margin:0;gap:4px}
    .game-shell.match-focus .court-counters .touch-counter button {width:44px;min-width:44px;height:44px;min-height:44px}
    .game-shell.match-focus .court-counters .touch-counter strong {font-size:22px;min-width:18px;text-align:center}
    .game-shell.match-focus .court-counters .timeout-row {flex-shrink:0;margin-top:8px}
    .game-shell.match-focus .scout-actions {grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
    .game-shell.match-focus .scout-actions button {font-size:12px;min-height:60px}
    .game-shell.match-focus .discipline-controls {position:static}
  }

  @media (max-width:700px) {
    :is(.coach-form,.club-form,.participant-profile-form,.ops-form) :is(input,select,textarea):not([type=checkbox],[type=radio],[type=color],[type=range]) {font-size:16px}
    :is(.coach-training-top,.club-section-heading,.club-header)> .toolbar {width:100%;flex-wrap:wrap}
    :is(.club-filters,.ops-toolbar) :is(input,select) {flex:1 1 150px;width:auto}
    .club-management .club-finance-kpis article {min-width:0;padding:16px 12px}
    .club-management .club-finance-kpis strong {white-space:normal;overflow-wrap:anywhere;font-size:clamp(19px,5vw,25px)}
    .participant-callup>header {flex-wrap:wrap}
    .participant-callup>header small {white-space:normal}
  }
  @media (prefers-reduced-motion:reduce) {
    :is(.coach-portal,.club-management,.participant-portal,.club-operations,.scouting-area,.scouting-notebooks) :is(button,input,select,textarea) {transition:none}
  }
}
