/* r5 sheet wrappers; the original form remains the only source of inputs. */
.cmp-filter-body, .cmp-filter-foot, .cmp-player-foot { display: contents; }
.cmp-panel-vector { display:none; }
.cmp-player-selection, .cmp-player-title-mobile { display:none; }
.cmp-setup-players-value-mobile { display:none; }
@media (max-width: 599px), (max-width: 767px) and (max-aspect-ratio: 10/13) {
  /* The visible grip and its entire heading form a comfortable drag area.
     Body scrolling stays native until a downward gesture is claimed in JS. */
  body.sp-explore-sheets :is(.sp-data-screen-heading,.cmp-sheet--tall .cmp-sheet-header,.cmp-presentation-head) {
    -webkit-user-select:none; user-select:none;
  }
  [data-swipe-active='true'] { will-change:translate; }
  body.sp-explore-sheets #compare-shell[data-panel-page='comparison'] .cmp-setup-players-value { display:none; }
  body.sp-explore-sheets #compare-shell[data-panel-page='comparison'] .cmp-setup-players-value-mobile { display:inline; }
  body.sp-explore-sheets #compare-shell[data-panel-page='comparison'] #editor-data-panel {
    display:flex; position:fixed; inset:0; z-index:2100; align-items:flex-end;
    width:100%; max-width:none; height:100dvh; margin:0; padding:0; background:transparent; overflow:hidden;
    background:#0008;
    visibility:hidden; pointer-events:none; contain:layout style;
  }
  /* Keep the form laid out while closed; opening must not rebuild its layout. */
  body.sp-explore-sheets #compare-shell[data-final-filters='true'] #editor-data-panel {
    visibility:visible; pointer-events:auto; animation:cmp-backdrop-enter 100ms ease-out;
  }
  body.sp-explore-sheets #compare-shell[data-final-filters='true'] #editor-data-comparison {
    animation:cmp-sheet-enter 140ms cubic-bezier(.16,1,.3,1);
  }
  body.sp-explore-sheets #compare-shell[data-panel-page='comparison'] #editor-data-comparison {
    display:flex; flex-direction:column; width:100%; height:82%; max-height:82%;
    background:#0d0e12; border-radius:20px 20px 0 0; overflow:hidden; box-shadow:0 -8px 30px #0003;
  }
  body.sp-explore-sheets #compare-shell[data-panel-page='comparison'] #editor-data-comparison::before {
    content:''; flex:none; width:30px; height:3px; border-radius:3px; background:#7c818b; margin:7px auto 2px;
  }
  body.sp-explore-sheets #compare-shell[data-panel-page='comparison'] .sp-data-screen-heading {
    display:flex; min-height:64px; flex:none; margin:0; padding:6px 16px 12px; justify-content:space-between;
  }
  body.sp-explore-sheets #compare-shell[data-panel-page='comparison'] .sp-data-screen-heading h2 {
    font:800 17px/1.4 var(--sp-font-display); letter-spacing:-.025em;
  }
  body.sp-explore-sheets #compare-shell[data-panel-page='comparison'] #editor-filter-close {
    display:grid; place-items:center; width:44px; height:44px; min-height:44px; padding:0; border:0;
    border-radius:4px; color:#cac7c0; background:transparent;
  }
  body.sp-explore-sheets #editor-filter-close .sp-data-close-label { display:none; }
  body.sp-explore-sheets #editor-filter-close::before {
    content:''; width:18px; height:18px; background:currentColor;
    mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'%3E%3Cpath d='m6 6 12 12M6 18 18 6'/%3E%3C/svg%3E") center/contain no-repeat;
  }
  body.sp-explore-sheets #compare-shell[data-panel-page='comparison'] :is(#cmp-setup,.cmp-setup-card) {
    display:flex; flex-direction:column; flex:1; min-height:0; padding:0; overflow:hidden; gap:0;
  }
  body.sp-explore-sheets #compare-shell[data-panel-page='comparison'] .cmp-filter-body {
    display:flex; flex-direction:column; gap:22px; flex:1; min-height:0; padding:12px 16px 20px; overflow-y:auto;
    overscroll-behavior:contain; scrollbar-width:thin; scrollbar-color:#555862 transparent;
  }
  body.sp-explore-sheets #compare-shell[data-panel-page='comparison'] .cmp-filter-foot {
    display:block; flex:none; padding:12px 16px calc(18px + env(safe-area-inset-bottom,0px)); background:#0d0e12;
  }
  body.sp-explore-sheets #compare-shell[data-panel-page='comparison'] .cmp-setup-cta { position:static; margin:0; }
  body.sp-explore-sheets #compare-shell[data-panel-page='comparison'] .cmp-section { flex:none; }
  body.sp-explore-sheets #compare-shell[data-panel-page='comparison'] .cmp-section-icon { display:none; }
  body.sp-explore-sheets #compare-shell[data-panel-page='comparison'] .cmp-section-head { gap:0; }
  body.sp-explore-sheets #compare-shell[data-panel-page='comparison'] .cmp-metric-all { gap:0; }
  body.sp-explore-sheets #compare-shell[data-panel-page='comparison'] :is(.cmp-section-label,.cmp-setup-players,.mantine-Chip-label,.cmp-setup-cta,.cmp-metric-all) { line-height:1.4; }
  /* 44 px switches (explore menus plan 3.3): on the first selection's page too, which is not a sheet */
  #compare-shell[data-panel-page='comparison'] .cmp-setup .mantine-SegmentedControl-label { display:flex; align-items:center; justify-content:center; height:36px; padding-block:0; }
  body.sp-explore-sheets #compare-shell[data-panel-page='comparison'] .mantine-SegmentedControl-root { height:44px; padding:4px; border-radius:4px; background:#22242b; }
  body.sp-explore-sheets #compare-shell[data-panel-page='comparison'] .mantine-SegmentedControl-label { display:flex; align-items:center; justify-content:center; height:36px; padding:0; border-radius:3px; font:500 14px/1.4 var(--sp-font-ui); color:#b8b4ac; }
  body.sp-explore-sheets #compare-shell[data-panel-page='comparison'] .mantine-SegmentedControl-label[data-active] { color:#0d0e12; }
  body.sp-explore-sheets #compare-shell[data-panel-page='comparison'] .mantine-SegmentedControl-indicator { background:#f2efe9; border-radius:3px; box-shadow:none; transition:none; }
  body.sp-explore-sheets #compare-shell[data-panel-page='comparison'] .mantine-SegmentedControl-control::before { display:none; }
  body.sp-explore-sheets #compare-shell[data-panel-page='comparison'] :is(#editor-data-home,#editor-data-view-stats,#editor-data-return-post) { display:none; }
  /* Keep the existing scrim while the nested picker enters/exits. Hiding it
     first exposes a bright frame behind the incoming drawer. */
  body.sp-explore-sheets:where([data-sp-has~="explore-final-filters"]):not(#sp-s):not(.sp-s) .cmp-sheet .cmp-sheet-overlay { background:transparent!important; }
  body.sp-explore-sheets:where([data-sp-has~="app"]):not(#sp-s) #compare-shell.sp-data-shell :is(#cmp-filters,#cmp-roster)[aria-expanded='true'] { border-color:#ee956c; background:#302820; }
  body.sp-explore-sheets:where([data-sp-has~="app"]):not(#sp-s) :is(#cmp-filters,#cmp-roster):focus-visible { outline:2px solid #ffb28c; outline-offset:2px; }
  body.sp-explore-sheets .cmp-sheet .cmp-sheet-overlay { background:#0008!important; backdrop-filter:none; }
  body.sp-explore-sheets dialog.cmp-sheet--tall {
    top:var(--cmp-player-viewport-top,0px); bottom:auto; height:var(--cmp-player-viewport-height,100dvh);
  }
  /* Leave the app header visible; give all remaining space to the picker. */
  body.sp-explore-sheets .cmp-sheet--tall .cmp-sheet-content { height:calc(var(--cmp-player-viewport-height,100dvh) - var(--sp-header-h,44px) - 8px)!important; max-height:100%!important; background:#17191f; border:0; box-shadow:0 -8px 30px #0003; }
  body.sp-explore-sheets dialog.cmp-sheet[open] .cmp-sheet-content { animation:cmp-sheet-enter 140ms cubic-bezier(.16,1,.3,1); }
  body.sp-explore-sheets .cmp-sheet--tall .cmp-sheet-content::before { content:''; flex:none; width:30px; height:3px; border-radius:3px; background:#7c818b; margin:7px auto 2px; }
  body.sp-explore-sheets .cmp-sheet--tall .cmp-sheet-header { flex:none; min-height:56px; padding:5px 16px 6px; gap:12px; background:#17191f; }
  body.sp-explore-sheets .cmp-sheet--tall .cmp-sheet-title { font:700 19px/1.3 var(--sp-font-display); letter-spacing:-.025em; }
  body.sp-explore-sheets .cmp-player-title-mobile { display:inline; }
  body.sp-explore-sheets .cmp-player-title-desktop { display:none; }
  body.sp-explore-sheets .cmp-sheet--tall .cmp-sheet-close { width:44px; height:44px; margin:0; color:#cac7c0; }
  body.sp-explore-sheets .cmp-sheet--tall .cmp-sheet-body { padding:0; }
  body.sp-explore-sheets .cmp-sheet--tall .cmp-sheet-stack { gap:0; }
  body.sp-explore-sheets .cmp-sheet--tall .cmp-player-selection { display:block; padding:4px 16px 12px; }
  body.sp-explore-sheets .cmp-sheet--tall #cmp-player-feedback { padding:0 16px 8px; color:#b8bdc9; }
  body.sp-explore-sheets .cmp-sheet--tall #cmp-player-feedback:empty { display:none; }
  body.sp-explore-sheets .cmp-selection-label { display:flex; align-items:center; justify-content:space-between; font:400 12px/1.4 var(--sp-font-ui); color:#b8bdc9; margin-bottom:8px; }
  body.sp-explore-sheets .cmp-selection-label>span { font-variant-numeric:tabular-nums; }
  body.sp-explore-sheets .cmp-selection-chips { display:flex; gap:6px; overflow-x:auto; scrollbar-width:thin; scrollbar-color:#545b68 transparent; }
  body.sp-explore-sheets .cmp-selection-chip { display:flex; gap:6px; align-items:center; flex:none; height:38px; padding:3px 10px 3px 4px; background:#24262e; border:1px solid transparent; border-radius:22px; font:400 12px/1.4 var(--sp-font-ui); }
  body.sp-explore-sheets .cmp-selection-avatar { width:28px; height:28px; display:grid; place-items:center; border-radius:50%; border:1px solid; font:650 9px/1.4 var(--sp-font-ui); letter-spacing:.02em; }
  body.sp-explore-sheets .cmp-selection-series-0 { color:#e0c4ff; background:#372447; border-color:#8055ad; }
  body.sp-explore-sheets .cmp-selection-series-1 { color:#ffc8d3; background:#47242e; border-color:#ad4a63; }
  body.sp-explore-sheets .cmp-selection-series-2 { color:#ffdda8; background:#41341e; border-color:#947143; }
  body.sp-explore-sheets .cmp-sheet--tall .cmp-player-search { margin:0 16px 8px; }
  body.sp-explore-sheets .cmp-sheet--tall .cmp-player-search input { height:46px; padding-left:40px; background:#24272e; border:1px solid #3c414c; border-radius:12px; font:400 16px/1.4 var(--sp-font-ui); }
  body.sp-explore-sheets .cmp-sheet--tall .cmp-player-search input::placeholder { color:#aaaeb8; }
  body.sp-explore-sheets .cmp-sheet--tall .cmp-player-list { margin:0; padding:0 16px; gap:0; overscroll-behavior:contain; scrollbar-width:thin; scrollbar-color:#545b68 transparent; }
  body.sp-explore-sheets .cmp-sheet--tall .cmp-player-row { min-height:58px; padding:8px 4px; border:0; border-bottom:1px solid #30343e; border-radius:0; background:transparent; color:#f2efe9; font:400 14px/1.3 var(--sp-font-ui); }
  body.sp-explore-sheets .cmp-sheet--tall .cmp-player-avatar--initials { width:34px; height:34px; background:#262a32; border:1px solid #414653; color:#ced3df; font:650 10px/1.4 var(--sp-font-ui); letter-spacing:.02em; }
  body.sp-explore-sheets .cmp-sheet--tall .cmp-player-check { width:18px; height:18px; border:0; border-radius:0; background:transparent; color:#b8bdc9; font-size:0; }
  body.sp-explore-sheets .cmp-sheet--tall .cmp-player-row.is-selected .cmp-player-check { background:transparent; color:#ff9a6e; }
  body.sp-explore-sheets .cmp-sheet--tall .cmp-sheet-hint { display:none; }
  body.sp-explore-sheets .cmp-sheet--tall .cmp-player-foot { display:block; border-top:1px solid #30343e; padding:10px 16px calc(14px + env(safe-area-inset-bottom,0px)); }
  body.sp-explore-sheets .cmp-sheet--tall .cmp-sheet-cta { margin:0; width:100%; height:44px; border-radius:7px; font:600 14px/1.4 var(--sp-font-ui); }
  body.sp-explore-sheets .cmp-sheet--tall .cmp-sheet-cta .mantine-Button-label { font:inherit; }
  body.sp-explore-sheets .cmp-sheet--tall .cmp-sheet-cta:disabled { background:var(--sp-accent)!important; color:#0d0e12!important; opacity:.45; }
  body.sp-explore-sheets .cmp-sheet--tall .cmp-panel-vector { display:block; width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; flex:none; }
  body.sp-explore-sheets .cmp-sheet--tall .cmp-sheet-close>svg:not(.cmp-panel-vector),
  body.sp-explore-sheets .cmp-sheet--tall .cmp-player-search .mantine-Input-section>svg:not(.cmp-panel-vector) { display:none; }
  body.sp-explore-sheets .cmp-sheet--tall .cmp-player-search .mantine-Input-section { width:44px; color:#b8bdc9; }
  body.sp-explore-sheets .cmp-sheet--tall .cmp-player-search .cmp-panel-vector { transform:translate(-1px,-1px); }
  body.sp-explore-sheets .cmp-sheet--tall .cmp-player-check::before { content:none; }
  /* Explore menus (docs/design/explore_menus_plan_2026-11.md, 3.2): the sheet shows one part of the form and
     stands on the tile row (row 68 + navigation 56 above the bottom), which stays visible and usable; the dim layer
     covers only what is above. The height follows the content, up to 8 px under the top of the screen. */
  body.sp-explore-sheets #compare-shell[data-final-menu] #editor-data-panel { bottom:calc(var(--final-nav-h,56px) + var(--final-dock-h,68px) + env(safe-area-inset-bottom,0px)); height:auto; }
  body.sp-explore-sheets #compare-shell[data-final-menu] #editor-data-comparison { height:auto; max-height:calc(100% - 8px); }
  body.sp-explore-sheets #compare-shell[data-final-menu] .sp-data-screen-heading { min-height:56px; padding:0 6px 0 16px; }
  body.sp-explore-sheets #compare-shell[data-final-menu] :is(#editor-comparison-back,.sp-data-title-filters) { display:none; }
  body.sp-explore-sheets #compare-shell[data-final-menu] .sp-data-title-menu { display:inline; }
  body.sp-explore-sheets #compare-shell[data-final-menu] .cmp-filter-body { flex:0 1 auto; gap:18px; padding:4px 16px 18px; }
  body.sp-explore-sheets #compare-shell[data-final-menu] .cmp-filter-foot { padding:10px 16px 14px; }
  /* The first label of a part sits under the title (Most used, Compared by). */
  body.sp-explore-sheets #compare-shell[data-final-menu] :is(.cmp-section-head + .cmp-sub-label, .cmp-metric-grid > .cmp-sub-label:first-child) { margin-top:0; }
  body.sp-explore-sheets #compare-shell[data-final-menu] .cmp-filter-body > :not(.cmp-menu-part),
  body.sp-explore-sheets #compare-shell[data-final-menu='who'] .cmp-menu-part:not(.cmp-menu-part--who),
  body.sp-explore-sheets #compare-shell[data-final-menu='stat'] .cmp-menu-part:not(.cmp-menu-part--stat),
  body.sp-explore-sheets #compare-shell[data-final-menu='season'] .cmp-menu-part:not(.cmp-menu-part--season),
  body.sp-explore-sheets #compare-shell[data-final-menu='period'] .cmp-menu-part:not(.cmp-menu-part--period),
  body.sp-explore-sheets #compare-shell[data-final-menu='look'] .cmp-menu-part:not(.cmp-menu-part--look) { display:none; }
  /* Look is hidden everywhere else (zz_compare.css); every tap applies at once, so it has no button (plan 3.7). */
  body.sp-explore-sheets #compare-shell[data-final-menu='look'] #cmp-setup .cmp-menu-part--look { display:flex; }
  body.sp-explore-sheets #compare-shell[data-final-menu='look'] .cmp-filter-foot { display:none; }
  /* The title names the part: Stat, Season, Period and Look drop their own header (Teams / Players keeps its labels). */
  body.sp-explore-sheets #compare-shell[data-final-menu] :is(.cmp-menu-part--stat,.cmp-menu-part--season,.cmp-menu-part--period,.cmp-menu-part--look) > .cmp-section-head { display:none; }
  /* The button says what the menu will show (plan 5.5). */
  body.sp-explore-sheets #compare-shell[data-final-menu] .cmp-cta-text--form { display:none; }
  body.sp-explore-sheets #compare-shell[data-final-menu='who'] .cmp-cta-text--who,
  body.sp-explore-sheets #compare-shell[data-final-menu='stat'] .cmp-cta-text--stat,
  body.sp-explore-sheets #compare-shell[data-final-menu='season'] .cmp-cta-text--season,
  body.sp-explore-sheets #compare-shell[data-final-menu='period'] .cmp-cta-text--period { display:inline; }
}
@keyframes cmp-backdrop-enter { from { opacity:0; } to { opacity:1; } }
@keyframes cmp-sheet-enter { from { transform:translateY(16px); } to { transform:translateY(0); } }
@media (prefers-reduced-motion:reduce) {
  body.sp-explore-sheets #compare-shell[data-final-filters='true'] :is(#editor-data-panel,#editor-data-comparison) { animation:none; }
  body.sp-explore-sheets .cmp-sheet :is(.cmp-sheet-content,.cmp-sheet-overlay) { transition:none!important; }
  body.sp-explore-sheets dialog.cmp-sheet[open] .cmp-sheet-content { animation:none; }
}
