/* Pétanque24: mobile-first form, text and navigation refinements.
   Scope: platform/supermandant, tournament management, private club portal.
   Keep public live/OBS/tablet scoreboards and print layouts unchanged. */
@media screen {
:is(body.platform-v314,body.p24w-active,body.p24-product-ui,body.p24-portal,body.club-page){
  overflow-wrap:break-word;word-spacing:normal;
}
:is(body.platform-v314,body.p24w-active,body.p24-product-ui,body.p24-portal,body.club-page)
  :where(.v3-panel,.card,.panel,.club-panel,.p24p-panel,.ws-panel,.p24w-shell,.p24v5-dashboard,
    .tm-card,.ta-card,.hv-card,.p24p-card,.v3-columns>*,.ws-layout>*,.club-grid>*){
  min-width:0;
}
:is(body.platform-v314,body.p24w-active,body.p24-product-ui,body.p24-portal,body.club-page)
  :where(h1,h2,h3,h4,p,summary,legend,label,small,em,.v3-chip,.club-chip,.p24p-chip,
    .p24w-breadcrumb,.p24w-breadcrumb strong,.p24w-breadcrumb span,.p24-top-title,
    .p24-top-title strong,.p24w-tournament-card strong,.p24-sidebar-context strong){
  overflow-wrap:anywhere;word-break:normal;white-space:normal;
}
:is(body.platform-v314,body.p24w-active,body.p24-product-ui,body.p24-portal,body.club-page)
  :where(.v3-panelhead,.club-panel-heading,.p24p-panel-head,.ws-between,.sectionhead,.panelhead,
    .tenant-actions,.v3-actions,.p24p-header-inner,.p24w-top-actions,.actions,.links){
  column-gap:12px;row-gap:9px;
}
:is(body.platform-v314,body.p24w-active,body.p24-product-ui,body.p24-portal,body.club-page)
  :where(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),
    textarea,select){max-width:100%;min-width:0;}
:is(body.platform-v314,body.p24w-active,body.p24-product-ui,body.p24-portal,body.club-page)
  :where(input[type=checkbox],input[type=radio]){flex-shrink:0;}
:is(body.platform-v314,body.p24w-active,body.p24-product-ui,body.p24-portal,body.club-page)
  :where(label:has(input[type=checkbox]),label:has(input[type=radio])){column-gap:9px;line-height:1.45;}
:is(body.platform-v314,body.p24w-active,body.p24-product-ui,body.p24-portal,body.club-page)
  :where(.p24-responsive-scroll,.v3-tablewrap,.club-scroll){
  max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;
  scrollbar-width:thin;
}
:is(body.platform-v314,body.p24w-active,body.p24-product-ui,body.p24-portal,body.club-page)
  .p24-responsive-scroll{border-radius:10px;}
:is(body.platform-v314,body.p24w-active,body.p24-product-ui,body.p24-portal,body.club-page)
  .p24-responsive-scroll>table{min-width:max-content;max-width:none;}
/* Longer names should wrap, never run into the next action or checkbox. */
.platform-v314 .tenant-actions,.platform-v314 .split-actions,
body.club-page .club-headrow,body.p24-portal .p24p-header nav{flex-wrap:wrap;}
.platform-v314 .v3-table td,.platform-v314 .v3-table th{line-height:1.45;}
.platform-v314 .v3-tablewrap{scrollbar-gutter:stable;}
body.p24w-active :where(.p24w-topbar,.p24w-top-actions,.p24w-breadcrumb){min-width:0;}
body.p24w-active :where(.p24w-top-actions,.actions,.links,.toolbar,.roundrowactions){flex-wrap:wrap;row-gap:8px;}
body.club-page :where(.club-note,.club-panel,.club-tabs a,.club-scroll td){line-height:1.5;}
body.club-page .club-scroll td{overflow-wrap:anywhere;}
body.club-page .club-btn{max-width:100%;white-space:normal;overflow-wrap:anywhere;}
body.p24-portal :where(.p24p-tournament,.p24p-panel-head,.p24p-header-inner){min-width:0;}
body.p24-portal .p24p-header nav{row-gap:6px;column-gap:8px;}
body.p24-portal .p24p-header nav a{white-space:normal;overflow-wrap:anywhere;}

/* Labels, descriptions and KPI values must not read as one word when the
   HTML contains adjacent strong/small/span elements without source spaces. */
.platform-v314 .v3-check>span{display:grid;gap:3px;min-width:0;}
.platform-v314 .v3-check>span>strong,
.platform-v314 .v3-check>span>small{display:block;min-width:0;}
.platform-v314 .tenant-user-head>div>strong,
.platform-v314 .tenant-user-head>div>small{display:block;}
body.p24-product-ui :where(.route-top>div,.p24-compact-field,.v3-choice,.p24-feature-copy)
  >:where(strong,small){display:block;}
body.p24-product-ui :where(.p24-sidebar-bottom,.p24-sidebar-context)
  >:where(strong,small){display:block;}
body.p24-portal .p24p-tournament>span:first-child>strong,
body.p24-portal .p24p-tournament>span:first-child>small{display:block;}
/* Horizontal rows have explicit spacing instead of depending on HTML
   whitespace (which PHP templates may omit between elements). */
body.p24-product-ui :where(.tenant-actions,.split-actions,.p24-compact-names,
  .p24-compact-colhead,.admin-live-scores-v1-title,.admin-live-scores-v1-toggle-right,
  .route-top,.lr-actions,.admin-shell-v2-actions,.admin-subnav-v2){column-gap:9px;}
body.p24-product-ui :where(.checks label>span,.p24-feature-copy,.v3-check>span){
  row-gap:4px;}

/* Platform's navigation exists only in the desktop sidebar; expose it on
   small touchscreens instead of leaving the sidebar permanently off-screen. */
.platform-v314 .platform-mobile-bar{display:none!important;}
@media(max-width:1100px){
  /* Reading comfort on touchscreens, without shrinking desktop tables. */
  body.platform-v314 .v3-form label{font-size:13px;line-height:1.4;}
  body.platform-v314 .v3-statgrid span{font-size:11px;line-height:1.4;}
  body.platform-v314 .v3-table td small,
  body.platform-v314 .tenant-user-head small{font-size:12px;line-height:1.5;}
  body.platform-v314 .v3-panel p,body.platform-v314 .v3-callout{line-height:1.55;}
  body.p24w-active :where(.hint,.small,.desc,.meta,.sectionintro){line-height:1.5;}
  body.club-page .club-form label{font-size:14px;}
  body.club-page .club-note{line-height:1.55;}
  body.p24-portal :where(.ws-form label,.p24p-card small){line-height:1.5;}
  body.platform-v314 .v3-columns,
  body.platform-v314 .v3-account-grid{grid-template-columns:minmax(0,1fr) minmax(0,1fr);}
  body.platform-v314 .v3-statgrid{grid-template-columns:repeat(2,minmax(0,1fr));}
  body.platform-v314 .v3-panel{min-width:0;}
  body.p24w-active :where(.p24w-shell,.p24w-topbar){min-width:0;}
  body.p24-product-ui :where(.v3-page,.wrap,.adminwrap,.ah-wrap,.tm,.hv,.ta-wrap){
    max-width:100%!important;}
  body.club-page .club-wrap{width:min(100% - 30px,1280px);}
}
@media(max-width:900px){
  /* Product sidebar serves the Supermandant; tournament sidebar has its
     own independent 820px breakpoint, so do not override its navigation. */
  body.platform-v314 .platform-mobile-bar{
    display:flex!important;align-items:center;gap:12px;justify-content:space-between;
    position:sticky;top:0;z-index:8500;padding:12px 14px;margin:0 0 13px;
    border-radius:12px;background:#fff;border:1px solid #d7e4eb;box-shadow:0 3px 12px #142c4710;
  }
  .platform-v314 .platform-mobile-bar>strong{flex:1;min-width:0;color:#123850;font-size:15px;}
  .platform-v314 .platform-mobile-bar .p24-mobile-menu{display:grid!important;place-items:center;
    min-width:44px;min-height:44px;font-size:20px;}
  .platform-v314 .platform-mobile-bar a{min-height:40px;display:inline-flex;align-items:center;color:#0b5680;}
  body.platform-v314 :where(.v3-page,.v3-panel){min-width:0;}
  body.platform-v314 .platform-hero{display:none;}
  body.platform-v314 .platform-mobile-bar{margin-inline:auto;width:100%;}
  body.p24-product-ui:has(.p24-sidebar.open):not(.p24w-active)::before{
    content:"";position:fixed;inset:0;z-index:8999;background:#061d3390;}
}
@media(max-width:820px){
  body.p24w-active{padding-left:0!important;}
  body.p24w-active :where(.p24w-shell,.p24w-topbar,.wrap,.adminwrap,.ah-wrap,.tm,.hv,.ta-wrap,.v3-page){
    max-width:100%;min-width:0;}
  body.p24w-active :where(.p24w-topbar,.p24w-top-actions){gap:8px;}
  body.p24w-active .p24w-breadcrumb strong{overflow:visible;text-overflow:clip;}
  body.p24w-active .p24w-top-actions :where(a,button,select){min-height:40px;}
  body.p24w-active:has(.p24w-sidebar.open)::before{
    content:"";position:fixed;inset:0;z-index:9599;background:#061d3390;}
}
@media(max-width:760px){
  body.platform-v314 .v3-columns,
  body.platform-v314 .v3-account-grid,
  body.platform-v314 .v3-formrow,
  body.platform-v314 .tenant-user-reset,
  body.platform-v314 .v3-statgrid{grid-template-columns:minmax(0,1fr);}
  body.platform-v314 .v3-panel{padding:15px;}
  body.platform-v314 .v3-panelhead{flex-wrap:wrap;align-items:flex-start;}
  body.platform-v314 .v3-panelhead>*{min-width:0;}
  body.platform-v314 .v3-table{min-width:0;width:100%;border-collapse:separate;border-spacing:0;}
  body.platform-v314 .v3-table thead{display:none;}
  body.platform-v314 .v3-table tbody{display:grid;gap:12px;}
  body.platform-v314 .v3-table tr{display:block;border:1px solid #d4e2eb;
    border-radius:13px;padding:8px 12px;background:#fff;overflow:hidden;}
  body.platform-v314 .v3-table tr.selected{border-color:#4195bb;background:#f1f8fc;}
  body.platform-v314 .v3-table td{display:grid;grid-template-columns:minmax(92px,37%) minmax(0,1fr);
    align-items:start;gap:8px;min-width:0;width:100%;padding:9px 0;font-size:13px;}
  body.platform-v314 .v3-table td:last-child{border-bottom:0;}
  body.platform-v314 .v3-table td::before{content:attr(data-label);font-weight:800;
    color:#39556b;font-size:12px;overflow-wrap:break-word;}
  body.platform-v314 .v3-table td .tenant-actions{display:grid;grid-template-columns:1fr;gap:8px;}
  body.platform-v314 .v3-table td .tenant-actions :where(a,button){min-height:42px;justify-content:center;width:100%;}
  body.platform-v314 .v3-form :where(input,select,textarea){min-height:43px;max-width:100%;}
  body.platform-v314 .v3-btn{min-height:43px;white-space:normal;text-align:center;}
  body.club-page .club-tabs{overflow-x:auto;scrollbar-width:thin;
    overscroll-behavior-x:contain;flex-wrap:nowrap;}
  body.club-page .club-tabs a{flex:0 0 auto;min-height:44px;padding:11px 14px;}
  body.club-page .club-panel-heading{display:flex;flex-direction:column;align-items:stretch;}
  body.club-page .club-panel-heading .club-btn{align-self:stretch;text-align:center;}
  body.club-page .club-grid,body.club-page .club-season .club-grid{
    grid-template-columns:minmax(0,1fr)!important;}
  body.club-page .club-panel{padding:15px;}
  body.club-page .club-headrow{gap:9px;padding-block:12px;}
  body.club-page .club-headrow>div{flex:1 1 150px;min-width:0;}
  body.club-page .club-back{margin-left:0;min-height:42px;display:inline-flex;align-items:center;}
  body.club-page .club-scroll table.club-cards{
    display:block;width:100%;border-collapse:separate;border-spacing:0;}
  body.club-page .club-scroll table.club-cards thead{display:none;}
  body.club-page .club-scroll table.club-cards tbody{display:grid;gap:12px;}
  body.club-page .club-scroll table.club-cards tr{
    display:block;background:#faffff;border:1px solid #d4e3eb;border-radius:12px;padding:9px 12px;}
  body.club-page .club-scroll table.club-cards td{
    display:grid;grid-template-columns:minmax(84px,35%) minmax(0,1fr);
    gap:8px;padding:10px 0;min-width:0;font-size:13px;width:100%;align-items:start;}
  body.club-page .club-scroll table.club-cards td:last-child{border-bottom:0;}
  body.club-page .club-scroll table.club-cards td::before{
    content:attr(data-label);font-weight:800;color:#476579;font-size:12px;}
  body.club-page .club-scroll table.club-cards td:has(.club-btn) :where(button,a){width:100%;text-align:center;}
  body.club-page .club-form :where(input,select,textarea){max-width:100%;font-size:16px;}
  body.club-page .club-btn{min-height:44px;}
  body.p24-portal .p24p-header nav{display:flex;overflow-x:auto;
    overscroll-behavior-x:contain;flex-wrap:nowrap;max-width:100%;padding-bottom:3px;}
  body.p24-portal .p24p-header nav a{flex:0 0 auto;min-height:44px;display:inline-flex;align-items:center;}
  body.p24-portal .p24p-grid{grid-template-columns:1fr;}
  body.p24-portal :where(.ws-panel,.p24p-panel){min-width:0;}
}
@media(max-width:600px){
  body.p24-product-ui :where(.wrap,.adminwrap,.ah-wrap,.tm,.hv,.ta-wrap,.v3-page){
    width:min(100% - 20px,1540px)!important;min-width:0;}
  body.p24-product-ui :where(.v3-panel,.card,.panel,.tm-card,.ta-card,.hv-card){
    min-width:0;}
  body.p24-product-ui :where(.v3-formrow,.v3-columns,.grid,.formgrid,.fields,.tm-form,
     .tm-grid,.ta-grid,.hv-grid,.p24-import-mapping,.p24-import-steps){
    grid-template-columns:minmax(0,1fr)!important;}
  /* A controls-only table is intentionally scrollable rather than made narrower. */
  body.p24-product-ui .p24-responsive-scroll>table{font-size:12px;}
  body.p24-product-ui :where(.actions,.links,.toolbar,.roundrowactions){gap:8px;}
  body.p24-product-ui :where(.actions,.links,.toolbar,.roundrowactions)>:where(button,.btn,.btnx,a,form){
    max-width:100%;min-width:0;}
  body.p24-product-ui :where(button,.btn,.btnx,.v3-btn){min-height:42px;}
  body.p24-product-ui :where(input,select,textarea){font-size:16px;}
  body.p24w-active .p24w-topbar{padding:10px 6px;flex-wrap:wrap;}
  body.p24w-active .p24w-breadcrumb{flex:1 1 170px;min-width:0;}
  body.p24w-active .p24w-top-actions{flex:1 1 auto;justify-content:flex-start;}
  body.p24w-active .p24w-top-actions :where(form,button,a){max-width:100%;}
  body.p24w-active :where(.admin-mainnav-v2,.admin-subnav-v2){
    overflow-x:auto;scrollbar-width:thin;overscroll-behavior-x:contain;}
  body.p24w-active .admin-mainnav-v2 a{flex:0 0 144px!important;}
  body.p24w-active .admin-subnav-v2 a{white-space:normal;}
  body.club-page .club-wrap{width:min(100% - 20px,1280px);}
  body.club-page .club-headrow .club-brand img{max-width:110px;}
  body.club-page .club-btn{width:100%;text-align:center;}
  body.club-page .club-tabs a{font-size:13px;}
  body.p24-portal :where(.p24p-header-inner,.p24p-panel,.p24p-hero,.ws-panel){
    min-width:0;}
  body.p24-portal :where(.p24p-wrap,.ws-main){width:calc(100% - 20px);}
}
@media(min-width:761px){
  body.platform-v314 .v3-table{min-width:900px;}
}
} /* end @media screen */
@media print{
  .platform-v314 .platform-mobile-bar{display:none!important}
}
