/* v1.23 Wellbeing Check + device-readiness containment.
 * Additive only: preserve the accepted Ops/Legacy visual system while making
 * the real manager routes reliable from narrow Android phones through tablets.
 */
#tlt-wellbeing-league,
#tlt-wellbeing-league * { box-sizing: border-box; }

#tlt-wellbeing-league {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: clip;
  container-type: inline-size;
}

#tlt-wellbeing-league :is(div, section, article, aside, header, footer, nav, form, fieldset, label) {
  min-width: 0;
}

#tlt-wellbeing-league :is(img, video, canvas, svg) {
  max-width: 100%;
  height: auto;
}

#tlt-wellbeing-league :is(button, [role="button"], input, select, textarea) {
  touch-action: manipulation;
}

#tlt-wellbeing-league :is(.ll-top, .ll-draftbar, .ll-modal) button,
#tlt-wb-market button,
#tlt-wellbeing-matrix-vfd button {
  min-height: 44px;
}

#tlt-wellbeing-league :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  min-height: 44px;
}

#tlt-wb-health:empty { display: none; }
#tlt-wb-health { margin-top: 10px; }
#tlt-wellbeing-league .ll-node-health {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 14px;
  border: 1px solid rgba(128, 153, 143, .28);
  border-radius: 10px;
  background: linear-gradient(110deg, rgba(13, 25, 23, .96), rgba(8, 13, 15, .96));
  color: #eef1eb;
}
#tlt-wellbeing-league .ll-node-health > div:first-child {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 2px 9px;
}
#tlt-wellbeing-league .ll-node-health strong {
  font-size: 13px;
  line-height: 1.25;
}
#tlt-wellbeing-league .ll-node-health small {
  grid-column: 2;
  color: rgba(232, 238, 231, .7);
  font-size: 10px;
  line-height: 1.35;
}
#tlt-wellbeing-league .ll-node-dot {
  grid-row: 1 / 3;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d0a95f;
  box-shadow: 0 0 0 4px rgba(208, 169, 95, .1);
}
#tlt-wellbeing-league .ll-node-health.is-online .ll-node-dot { background: #65d9c4; box-shadow: 0 0 0 4px rgba(101, 217, 196, .1); }
#tlt-wellbeing-league .ll-node-health.is-delayed .ll-node-dot,
#tlt-wellbeing-league .ll-node-health.is-paired_waiting .ll-node-dot { background: #e7bd68; }
#tlt-wellbeing-league .ll-node-health.is-offline .ll-node-dot,
#tlt-wellbeing-league .ll-node-health.is-sidecars_unavailable .ll-node-dot,
#tlt-wellbeing-league .ll-node-health.is-unknown .ll-node-dot { background: #ee7a7e; }
#tlt-wellbeing-league .ll-node-health-meta {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}
#tlt-wellbeing-league .ll-node-health-meta span {
  padding: 5px 8px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 999px;
  color: rgba(238, 241, 235, .76);
  background: rgba(255,255,255,.025);
  font-size: 9px;
  line-height: 1.25;
  white-space: normal;
}

#tlt-wellbeing-league .ll-team-select select { width: min(270px, 100%); }
#tlt-wellbeing-league .ll-draft-actions,
#tlt-wellbeing-league .ll-actual-utilities { min-width: 0; }
#tlt-wellbeing-league .ll-actual-utilities { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
#tlt-wellbeing-league .ll-stage-current strong,
#tlt-wellbeing-league .ll-stage-current small { overflow-wrap: anywhere; }

#tlt-wellbeing-matrix-vfd,
#tlt-wellbeing-matrix-vfd .mxvfd-shell,
#tlt-wellbeing-matrix-vfd .mxvfd-main,
#tlt-wb-market,
#tlt-wb-market .league-shell,
#tlt-wb-market .league-workspace { width: 100%; max-width: 100%; min-width: 0; }

#tlt-wellbeing-matrix-vfd [data-role="board-scroll-wrap"],
#tlt-wellbeing-matrix-vfd .mxvfd-stat-detail-scroll,
#tlt-wellbeing-matrix-vfd .mxvfd-stat-table-wrap,
#tlt-wellbeing-league .ll-table-wrap,
#tlt-wb-market .table-scroll,
#tlt-wb-market .lui-table-scroll {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

#tlt-wellbeing-league :is(table, .mxvfd-board) { max-width: none; }
#tlt-wellbeing-league .ll-modal-backdrop {
  padding-top: max(10px, env(safe-area-inset-top));
  padding-right: max(10px, env(safe-area-inset-right));
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  padding-left: max(10px, env(safe-area-inset-left));
}
#tlt-wellbeing-league .ll-modal {
  max-width: min(880px, calc(100vw - 20px));
  max-height: calc(100dvh - 20px);
}
#tlt-wellbeing-league .ll-dialog-actions {
  position: sticky;
  bottom: -1px;
  z-index: 2;
  padding-top: 10px;
  padding-bottom: max(2px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(16,22,16,0), #101610 24%);
}

@media (max-width: 900px) {
  #tlt-wellbeing-league .ll-top { align-items: stretch; }
  #tlt-wellbeing-league .ll-top > div { width: 100%; }
  #tlt-wellbeing-league .ll-top nav {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 4px;
  }
  #tlt-wellbeing-league .ll-top nav > * { flex: 0 0 auto; }
  #tlt-wellbeing-league .ll-team-select { width: min(250px, 72vw); }
  #tlt-wellbeing-league .ll-team-select select { width: 100%; }
  #tlt-wellbeing-league .ll-node-health { align-items: flex-start; flex-direction: column; }
  #tlt-wellbeing-league .ll-node-health-meta { justify-content: flex-start; }
  #tlt-wellbeing-league .ll-draftbar { align-items: stretch; }
  #tlt-wellbeing-league .ll-draft-actions,
  #tlt-wellbeing-league .ll-actual-utilities { width: 100%; }
}

@media (max-width: 600px) {
  #tlt-wellbeing-league { padding: 5px; }
  #tlt-wellbeing-league .ll-top { padding: 12px 9px; }
  #tlt-wellbeing-league .ll-top strong { font-size: 20px; }
  #tlt-wellbeing-league .ll-top small { font-size: 10px; line-height: 1.4; }
  #tlt-wellbeing-league .ll-top nav { margin-inline: -2px; }
  #tlt-wellbeing-league .ll-top nav button { min-width: max-content; }
  #tlt-wellbeing-league .ll-node-health { padding: 10px; gap: 10px; }
  #tlt-wellbeing-league .ll-node-health-meta { display: grid; grid-template-columns: 1fr; width: 100%; }
  #tlt-wellbeing-league .ll-node-health-meta span { border-radius: 7px; }
  #tlt-wellbeing-league .ll-draftbar { display: grid; grid-template-columns: minmax(0, 1fr); padding: 10px 9px; }
  #tlt-wellbeing-league .ll-draftbar > * { width: 100%; max-width: 100%; }
  #tlt-wellbeing-league .ll-draft-actions,
  #tlt-wellbeing-league .ll-actual-utilities { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  #tlt-wellbeing-league .ll-draft-actions button,
  #tlt-wellbeing-league .ll-actual-utilities button,
  #tlt-wellbeing-league .ll-board-size { width: 100%; }
  #tlt-wellbeing-league .ll-board-size { grid-column: 1 / -1; }
  #tlt-wellbeing-league .ll-board-size select { width: 100%; }
  #tlt-wellbeing-league .ll-stage-progress,
  #tlt-wellbeing-league .ll-source { grid-column: 1 / -1; }
  #tlt-wellbeing-league .ll-modal { width: 100%; padding: 13px 11px; border-radius: 10px; }
  #tlt-wellbeing-league .ll-modal h2 { font-size: 20px; }
  #tlt-wellbeing-league .ll-modal :is(input, select, textarea) { font-size: 16px; }
  #tlt-wellbeing-league .ll-dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  #tlt-wellbeing-league .ll-dialog-actions button { width: 100%; }
  #tlt-wellbeing-league .ll-stage-manager-list article { width: 100%; }
  #tlt-wellbeing-league .ll-stage-manager-list article > div:last-child { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); width: 100%; }
  #tlt-wellbeing-league .ll-stage-manager-list article button { width: 100%; }
  #tlt-wellbeing-matrix-vfd .mxvfd-board-session-actions,
  #tlt-wellbeing-matrix-vfd .mxvfd-board-card-actions { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #tlt-wb-market .league-nav { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-inline: contain; -webkit-overflow-scrolling: touch; }
  #tlt-wb-market .league-nav button { flex: 0 0 auto; min-height: 44px; }
}

@media (max-width: 390px) {
  #tlt-wellbeing-league .ll-draft-actions,
  #tlt-wellbeing-league .ll-actual-utilities,
  #tlt-wellbeing-league .ll-dialog-actions,
  #tlt-wellbeing-league .ll-stage-manager-list article > div:last-child { grid-template-columns: 1fr; }
  #tlt-wellbeing-league .ll-team-select { width: 78vw; }
}
