/* MLB mobile controls. Scoped to MLB; the network dock remains unchanged. */
#mlb-pages-button, #mlb-search-button, #mlb-dialog button {
  min-height:44px; min-width:44px; padding:8px 12px; border-radius:12px;
  border:1px solid var(--r-apple-border, #647080); background:var(--r-apple-panel, #202530);
  color:inherit; font:inherit; font-size:14px; cursor:pointer; touch-action:manipulation;
}
.r-mlb-command-strip.mlb-controls-ready { grid-template-columns:auto minmax(0,1fr) auto; gap:8px; }
.r-mlb-command-strip.mlb-controls-ready .r-mlb-data-sentinel-label { grid-column:1/-1; grid-row:2; justify-self:start; min-height:22px; padding:2px 6px; }
.r-mlb-command-strip.mlb-controls-ready .r-mlb-data-sentinel-row { display:none; }
#mlb-pages-button { grid-column:1; grid-row:1; white-space:nowrap; }
.mlb-controls-ready .r-mlb-section-nav { grid-column:2; grid-row:1; }
#mlb-search-button { grid-column:3; grid-row:1; }
#mlb-dialog {
  box-sizing:border-box; width:min(560px, calc(100vw - 24px)); max-width:calc(100vw - 24px);
  padding:0; border:1px solid var(--r-apple-border, #657080); border-radius:20px;
  background:var(--r-apple-bg, #161923); color:var(--r-apple-text, #e8e8ee);
  margin:auto; max-height:calc(var(--mlb-visible-height, 100dvh) - 32px);
  box-shadow:0 18px 65px #0007; overflow:hidden;
}
#mlb-dialog[open] { display:flex; flex-direction:column; }
#mlb-dialog::backdrop { background:rgba(8,12,20,.66); }
#mlb-dialog header { display:flex; align-items:center; gap:10px; padding:12px 14px 8px; flex:none; }
#mlb-dialog h2 { font:600 18px/1.3 system-ui,sans-serif; margin:0; flex:1; }
#mlb-dialog input { box-sizing:border-box; display:block; width:calc(100% - 28px); margin:0 14px; min-height:46px; border:1px solid var(--r-apple-border, #657080); border-radius:12px; padding:10px 12px; font:16px/1.4 system-ui,sans-serif; color:inherit; background:var(--r-apple-panel, #242936); flex:none; }
#mlb-dialog-status { margin:8px 16px; font:13px/1.4 system-ui,sans-serif; opacity:.8; }
#mlb-dialog-results { min-height:0; overflow:auto; overscroll-behavior:contain; -webkit-overflow-scrolling:touch; padding:0 10px max(14px,env(safe-area-inset-bottom)); }
#mlb-dialog-results a { display:flex; gap:12px; align-items:center; min-height:48px; padding:8px 12px; margin:3px 0; border-radius:10px; color:inherit; text-decoration:none; box-sizing:border-box; font:15px/1.35 system-ui,sans-serif; }
#mlb-dialog-results a span { flex:1; min-width:0; overflow-wrap:anywhere; }
#mlb-dialog-results a small { opacity:.68; font-size:12px; }
#mlb-dialog-results a:hover, #mlb-dialog-results a:focus-visible { background:var(--r-apple-panel, #30394a); outline:2px solid currentColor; outline-offset:-2px; }
#mlb-dialog button:focus-visible, #mlb-pages-button:focus-visible, #mlb-search-button:focus-visible { outline:2px solid currentColor; outline-offset:2px; }
#mlb-connection-notice { margin:8px 12px; padding:12px; border-radius:12px; border:1px solid #c99a51; font:14px/1.4 system-ui,sans-serif; }
#mlb-connection-notice[hidden] { display:none; }
@media(max-width:720px) {
  .r-mlb-command-strip.mlb-controls-ready { padding:6px max(10px,env(safe-area-inset-right)) 5px max(10px,env(safe-area-inset-left)); }
  #mlb-dialog { margin-top:max(12px,var(--mlb-viewport-top,12px)); }
  .r-mlb-command-strip.mlb-controls-ready .r-mlb-section-nav { border-radius:12px; }
  main input:not([type=checkbox]):not([type=radio]):not([type=range]), main select, main textarea { font-size:16px !important; min-height:44px; max-width:100%; }
  main .r-btn, main button, main .r-game-link { min-height:44px; touch-action:manipulation; }
  main { padding-bottom:calc(104px + env(safe-area-inset-bottom)) !important; }
  .r-card.is-flush, .r-scroll-panel { max-width:100%; overscroll-behavior-x:contain; -webkit-overflow-scrolling:touch; }
}
@media(max-height:500px) {
  #mlb-dialog { margin-top:8px; max-height:calc(var(--mlb-visible-height,100dvh) - 16px); }
  #mlb-dialog header { padding:6px 12px; }
  .r-mlb-command-strip.mlb-controls-ready { position:relative; top:auto; }
}

/* Existing site button styles must not resurrect the retired rail search. */
.r-mlb-command-strip.mlb-controls-ready [data-cmdk-trigger][hidden] { display:none !important; }

/* Restore MLB navigation in the phone GameDay shell without changing its panels. */
@media (max-width:940px) {
  html:has(main.r-game-live-shell), body:has(main.r-game-live-shell) {
    height:auto !important; min-height:100dvh !important; overflow-x:clip !important; overflow-y:auto !important;
  }
  body:has(main.r-game-live-shell) > aside.r-mlb-command-strip.mlb-controls-ready {
    display:grid !important; position:relative !important; top:auto !important; visibility:visible !important;
  }
}
