/* Portal-wide viewport contract: pages must never require horizontal scrolling. */
html,body,#app,.app-shell,.workspace,.page{width:100%;max-width:100%;overflow-x:hidden}
img,svg,canvas,video,iframe,embed{max-width:100%;height:auto}
.page>*,.card,.toolbar,.page-header,.section-title,.activity-item,.timeline,.table-wrap{min-width:0;max-width:100%}
.table-wrap{width:100%;overflow-x:hidden}
.data-table{width:100%;min-width:0!important;table-layout:fixed}
.data-table th,.data-table td{min-width:0!important;max-width:none;white-space:normal;overflow-wrap:anywhere;word-break:normal}
.page-header>div,.section-title>*,.activity-item>*,.start-list-commandbar-copy>div{min-width:0}
.page-header h1,.page-header p,.activity-item strong,.activity-item small{overflow-wrap:anywhere}
.page-header>div:last-child,.start-list-commandbar-actions,.dialog-actions{max-width:100%;flex-wrap:wrap}
.start-list-more-menu{max-width:min(280px,calc(100vw - 28px));overflow-wrap:anywhere}
.toolbar,.page-header,.section-title,.topbar,.topbar-actions,.context-picker{max-width:100%;flex-wrap:wrap}
.toolbar input,.toolbar select,.context-picker select{min-width:0;max-width:100%}

/* Keep every Start List field, including Recovery Break, inside the page width. */
.start-list-table{width:100%;min-width:0!important;table-layout:fixed;font-size:clamp(.68rem,.72vw,.82rem)}
.start-list-table th,.start-list-table td{padding:7px 5px;line-height:1.25}
.start-list-table th:nth-child(1),.start-list-table td:nth-child(1){width:6%}
.start-list-table th:nth-child(2),.start-list-table td:nth-child(2){width:3.5%}
.start-list-table th:nth-child(3),.start-list-table td:nth-child(3){width:7%}
.start-list-table th:nth-child(4),.start-list-table td:nth-child(4){width:15%;white-space:normal}
.start-list-table th:nth-child(5),.start-list-table td:nth-child(5){width:15%;white-space:normal}
.start-list-table th:nth-child(6),.start-list-table td:nth-child(6){width:5%}
.start-list-table th:nth-child(7),.start-list-table td:nth-child(7){width:17%}
.start-list-table th:nth-child(8),.start-list-table td:nth-child(8){width:6%}
.start-list-table th:nth-child(9),.start-list-table td:nth-child(9){width:10%}
.start-list-table th:nth-child(10),.start-list-table td:nth-child(10){width:15.5%}
.start-list-actions{white-space:normal;flex-wrap:wrap}
.recovery-time,.recovery-first{white-space:normal}
.category-duration-summary .block-summary-table{min-width:0!important}

@media(max-width:1050px){
  /* A Start List becomes compact record rows rather than a sideways table. */
  .start-list-table,.start-list-table tbody{display:block}
  .start-list-table thead{display:none}
  .start-list-table tbody{display:grid;gap:8px;padding:8px}
  .start-list-table tbody tr{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px 10px;padding:10px;border:1px solid var(--line);border-radius:10px;background:#fff}
  .start-list-table tbody tr td{display:block;width:auto!important;height:auto;min-height:0;padding:0;border:0;background:transparent!important;white-space:normal}
  .start-list-table tbody tr td::before{display:block;margin-bottom:2px;color:var(--muted);font-size:.58rem;font-weight:800;letter-spacing:.05em;text-transform:uppercase}
  .start-list-table tbody tr td:nth-child(1)::before{content:"Start"}
  .start-list-table tbody tr td:nth-child(2){display:none}
  .start-list-table tbody tr td:nth-child(3)::before{content:"Country"}
  .start-list-table tbody tr td:nth-child(4){grid-column:span 2}
  .start-list-table tbody tr td:nth-child(4)::before{content:"Name"}
  .start-list-table tbody tr td:nth-child(5){grid-column:span 2}
  .start-list-table tbody tr td:nth-child(5)::before{content:"Club"}
  .start-list-table tbody tr td:nth-child(6)::before{content:"Year"}
  .start-list-table tbody tr td:nth-child(7){grid-column:span 2}
  .start-list-table tbody tr td:nth-child(7)::before{content:"Category"}
  .start-list-table tbody tr td:nth-child(8)::before{content:"App"}
  .start-list-table tbody tr td:nth-child(9)::before{content:"Recovery Break"}
  .start-list-table tbody tr td:nth-child(10){grid-column:1/-1}
  .start-list-table tbody tr td:nth-child(10)::before{content:"Actions"}
  .start-list-table tbody tr.start-list-break{display:block;background:#efe5eb}
  .start-list-table tbody tr.start-list-break td{display:block!important}
  .start-list-table tbody tr.start-list-break td::before{content:none}
}

@media(max-width:760px){
  .page-header>div:last-child,.dialog-actions{width:100%}
  .page-header>div:last-child .button,.dialog-actions .button{flex:1 1 150px}
  .activity-item{align-items:flex-start}
  .activity-item>div{min-width:0}
  .modal-body{padding:16px}
  .data-table{font-size:.72rem}
  .data-table th,.data-table td{padding:7px 4px}
  .start-list-table tbody tr{grid-template-columns:repeat(2,minmax(0,1fr))}
  .start-list-table tbody tr td:nth-child(4),
  .start-list-table tbody tr td:nth-child(5),
  .start-list-table tbody tr td:nth-child(7){grid-column:1/-1}
  .schedule-block,.activity-item{max-width:100%}
}
