/* KENROKU Web Team v2.9.0-rc.10
   SCREEN-ONLY layout layer. Deliberately never affects PDF sheets / @media print.
   Controls use one row only when they can fit without truncation.
*/
@media screen {
  body.kenroku-team-ui #main .players-page-controls {
    display:flex;gap:8px;align-items:center;flex-wrap:nowrap;min-width:0;
    margin:0 0 9px;
  }
  body.kenroku-team-ui #main .players-page-controls .players-page-tabs {
    display:grid;grid-template-columns:repeat(2,minmax(0,1fr));
    gap:7px;margin:0;min-width:0;flex:1 1 auto;width:auto;max-width:none;
  }
  body.kenroku-team-ui #main .players-page-controls .menu-page-primary-action {
    margin:0;min-width:0;display:flex;justify-content:flex-end;flex:0 0 auto;
  }
  body.kenroku-team-ui #main .players-page-controls .menu-page-primary-action .btn {
    width:auto!important;max-width:none;min-width:0;min-height:36px!important;
    padding:7px 12px!important;white-space:nowrap;
  }
  body.kenroku-team-ui #main .players-page-controls .players-page-tabs .btn {
    min-width:0;min-height:36px;white-space:nowrap;
  }
  body.kenroku-team-ui #main .team-page-actions-three .btn {white-space:nowrap;}
  body.kenroku-team-ui #main .team-page-bar {gap:8px;}
  body.kenroku-team-ui #main .team-page-bar :is(.app-back-btn,.team-page-help-button) {white-space:nowrap;}
  /* Leave match-scoring, timekeeper and destructive actions untouched. */
}
/* On phones: logo and menu remain fixed; sync stays in its existing place. */
@media screen and (max-width:760px) {
  .desktop-nav-sync-row,.desktop-cloud-sync-slot {display:none!important}
  .mobile-cloud-sync-slot {display:block;min-width:0;}
  body.kenroku-team-ui #main .players-page-controls {gap:5px;}
  body.kenroku-team-ui #main .players-page-controls .players-page-tabs {gap:5px;}
  body.kenroku-team-ui #main .players-page-controls .players-page-tabs .btn,
  body.kenroku-team-ui #main .players-page-controls .menu-page-primary-action .btn {
    font-size:clamp(11px,3.1vw,13px)!important;padding:7px 5px!important;
    height:36px!important;line-height:1.2;
  }
}
/* PC + tablets: actual nav and cloud sync share a single horizontal row. */
@media screen and (min-width:761px) {
  /* .app-shell's old overflow:hidden was an unintended sticky scroll container.
     The page root clips horizontal overflow instead; keep the header sticky. */
  #app,.app-shell:not(.public-entry-shell) {
    overflow-x:visible!important;
    overflow-y:visible!important;
  }
  .app-shell:not(.public-entry-shell) > .app-main-header {
    position:sticky!important;top:0!important;z-index:1100!important;
    isolation:isolate;
    background:rgba(246,248,251,.985);
    box-shadow:0 2px 6px rgba(15,23,42,.055);
  }
  .desktop-nav-sync-row {
    display:flex;gap:10px;align-items:center;justify-content:space-between;
    width:100%;min-width:0;
  }
  .desktop-nav-sync-row > nav {
    display:flex;align-items:center;flex:1 1 auto;min-width:0;
    width:auto;overflow-x:auto;overflow-y:hidden;
    padding-top:5px;padding-bottom:3px;
    gap:5px;scrollbar-width:thin;
  }
  .desktop-nav-sync-row > nav button {min-height:36px;padding:7px 11px;flex:0 0 auto;}
  .desktop-cloud-sync-slot {display:flex;flex:0 0 auto;min-width:0;}
  .desktop-cloud-sync-slot:empty {display:none;}
  .desktop-cloud-sync-slot .global-cloud-sync-bar {
    margin:0;min-height:36px;padding:0;gap:7px;
    background:transparent;border:none;border-radius:0;
    font-size:12px;white-space:nowrap;
  }
  .desktop-cloud-sync-slot .global-cloud-sync-state {min-width:0;white-space:nowrap;}
  .desktop-cloud-sync-slot .global-cloud-refresh {
    min-height:34px;height:34px;padding:5px 11px;font-size:12px;border-radius:9px;
  }
  .mobile-cloud-sync-slot {display:none!important;}
  body.kenroku-team-ui #main .team-analysis-head {
    display:grid;grid-template-columns:auto minmax(0,1fr);gap:8px 16px;align-items:center;
  }
  body.kenroku-team-ui #main .team-analysis-head > .team-page-title {margin:0;white-space:nowrap;}
  body.kenroku-team-ui #main .team-analysis-head > .team-page-actions-three {
    width:auto;max-width:480px;margin:0;justify-self:end;
  }
  body.kenroku-team-ui #main .team-analysis-head > .team-analysis-mode-row {grid-column:1/-1;}
  body.kenroku-team-ui #main .team-schedule-top {
    grid-template-columns:auto minmax(0,1fr);gap:12px;align-items:center;
  }
  body.kenroku-team-ui #main .team-schedule-top .team-schedule-tools {justify-self:end;max-width:390px;width:100%;}
  body.kenroku-team-ui #main .players-page-controls {max-width:860px;}
  body.kenroku-team-ui #main .players-page-controls .players-page-tabs {max-width:540px;}
  body.kenroku-team-ui #main .players-page-controls .menu-page-primary-action .btn {padding-inline:18px!important;}
}
/* Large desktops: enough room for the full menu + sync. */
@media screen and (min-width:1200px) {
  .desktop-nav-sync-row > nav {gap:7px;}
  .desktop-nav-sync-row > nav button {padding-inline:12px;}
}
/* Narrow tablets keep all controls usable without overflow. */
@media screen and (min-width:761px) and (max-width:940px) {
  .desktop-nav-sync-row {gap:5px;}
  .desktop-nav-sync-row > nav button {font-size:12px;padding-inline:8px;}
  .desktop-cloud-sync-slot .global-cloud-sync-state{font-size:11px;}
  .desktop-cloud-sync-slot .global-cloud-refresh{padding-inline:8px;}
}
/* rc.10 groups player tabs with the add button; restore the desktop/list
   sibling selector that rc.8 previously anchored on the tabs directly. */
@media screen and (min-width:768px) and (max-width:1199px) {
  body.kenroku-team-ui #main .players-page-controls ~ .list {
    display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;
  }
}
@media screen and (min-width:1200px) {
  body.kenroku-team-ui #main .players-page-controls ~ .list {
    display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;
  }
}
@media screen and (min-width:768px) {
  body.kenroku-team-ui #main .players-page-controls ~ .list > .item {min-width:0;}
}
