/* ==========================================================================
   zzzzzzzzzzzzzz_editor_bar_mode.css — Create post bottom bar B on phones (P3, D-1 / D-2).
   Posts that come from Explore get a Data | Design switch above the bar:
     Design = the category bar (Title … More), Data = the real Explore nodes
     (Players, Filters, Type, Total, Format) positioned as bar items.
   State: #editor-workspace-root[data-bar-mode="design|data"] (assets/editor_quick_controls.js).
   The canvas never moves: transport 44 + switch 24 + bar 56 = the 124 px the first
   screen has always reserved (transport 48 + 8 + bar 68). Header 48 and the reserves
   180 / 348 / keyboard stay. Uploaded and direct Studio documents keep the old bar.
   Loads after zzzzzzzzzzz_editor_categories.css and the Explore sheet CSS on purpose.
   ========================================================================== */

/* The switch exists in the DOM for Explore posts only; it shows on the phone with the bar. */
.sp-editor-bar-mode { display: none; }

/* Chart > Type (chart kind + Total) repeats Explore's own header / Data bar on every viewport, so Explore posts hide the
   subtab (ids stay mounted; `skipHiddenType` in editor_quick_controls.js activates another subtab). A ranking keeps it:
   it is the only subtab a ranking's Chart category has (the way back to a line chart). */
#editor-workspace-root[data-mode="design"][data-chrome="explore"]:not([data-kind="ranking"]) #editor-panel-chart .sp-editor-subtab[data-subtab="type"] { display: none; }

@media (max-width: 599px), (max-width: 767px) and (max-aspect-ratio: 10/13) {
  /* 44 + 24 + 56: the transport and the closed #editor-tools (switch row + bar, bottom 56 unchanged). */
  #editor-workspace-root[data-mode="design"][data-origin="explore"] #editor-canvas-column .sp-transport-bar { height: 44px; min-height: 44px; }
  #editor-workspace-root[data-mode="design"][data-origin="explore"][data-tool="home"] #editor-tools.sp-editor-sheet { height: 80px; justify-content: flex-end; background: var(--sp-bg); }
  /* D1B: the bar is the page background (not chrome), items 72 x 55 touching, label 11.5, icon in the text colour. */
  #editor-workspace-root[data-mode="design"][data-origin="explore"][data-tool="home"] #editor-tools .sp-editor-category-bar { height: 56px; gap: 0; padding: 0; background: var(--sp-bg); }
  #editor-workspace-root[data-mode="design"][data-origin="explore"][data-tool="home"] #editor-tools .sp-editor-category-bar :is(.sp-editor-category, #editor-open-filters) {
    width: 72px; height: 55px; gap: 3px; font-size: 11.5px; border-radius: 0;
  }
  #editor-workspace-root[data-mode="design"][data-origin="explore"][data-tool="home"] #editor-tools .sp-editor-category-bar .sp-editor-icon { color: var(--sp-text); }
  /* Data is the other half of the switch now; the item stays in the DOM (the editor's own helpers click it). */
  #editor-workspace-root[data-mode="design"][data-origin="explore"] #editor-category-bar #editor-open-filters { display: none; }
  /* Chart type, Total and Format now live in the Data bar (Explore's own items): they leave the panels. Every id stays
     mounted (cfg-chart-kind in #editor-shared-type, display-target in #editor-shared-format). A ranking has nothing left in Chart. */
  #editor-workspace-root[data-mode="design"][data-chrome="explore"] #editor-shared-format { display: none; }
  #editor-workspace-root[data-mode="design"][data-origin="explore"][data-kind="ranking"] #editor-category-bar .sp-editor-category[data-group="chart"] { display: none; }
  /* F-05: more items than fit, so the right edge fades until the bar is scrolled to its end. */
  #editor-workspace-root[data-mode="design"][data-origin="explore"][data-tool="home"] #editor-category-bar:not([data-end]) {
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent);
  }

  /* The switch: 136 x 24, centred above the bar. The 44 px touch rule lives in each half's ::after
     (12 px up, 8 down: the items below keep 44 px in these columns, the Data dock items start 8 px lower, see below). */
  #editor-workspace-root[data-mode="design"][data-origin="explore"][data-tool="home"] .sp-editor-bar-mode {
    position: absolute; top: 0; left: 50%; transform: translateX(-50%); z-index: 2; box-sizing: border-box; display: flex; width: 136px; height: 24px; padding: 2px;
    border-radius: 12px; background: var(--sp-surface); border: 1px solid var(--sp-border-strong);
  }
  #editor-workspace-root .sp-editor-bar-mode button {
    position: relative; flex: 1; box-sizing: border-box; height: 18px; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 9px; background: transparent; cursor: pointer;
    font: 600 12px/18px var(--sp-font-ui); color: var(--sp-text-2);
  }
  #editor-workspace-root .sp-editor-bar-mode button::after { content: ''; position: absolute; inset: -15px 0 -11px; }
  #editor-workspace-root .sp-editor-bar-mode button[aria-pressed="true"] { background: var(--sp-text); color: var(--sp-bg); }

  /* Data mode: the category bar steps aside, the Explore dock takes its place. */
  #editor-workspace-root[data-mode="design"][data-origin="explore"][data-bar-mode="data"][data-tool="home"] #editor-category-bar { display: none; }

  /* Data mode dock: Browse's item counting (zzzzzzz_explore_final.css: 5, 4 without Players or Total, 3 without both) on a 56 px strip,
     equal items without padding or gap as artboard D1B2 draws them. */
  body:where([data-sp-has~="editor-explore-design-bar-data-home"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell {
    --pb-items: 5; --pb-first: 2; --pb-gap: 0px; --pb-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    --pb-w: calc(100vw / var(--pb-items));
  }
  body:where([data-sp-has~="editor-explore-design-bar-data-home"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell:has(#cmp-roster[hidden]) { --pb-items: 4; --pb-first: 1; }
  body:where([data-sp-has~="editor-explore-design-bar-data-home"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell:has(#cmp-aggregate-help[hidden]) { --pb-items: 4; }
  body:where([data-sp-has~="editor-explore-design-bar-data-home"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell:has(#cmp-roster[hidden]):has(#cmp-aggregate-help[hidden]) { --pb-items: 3; --pb-first: 1; }
  /* The header rule of zzzzzzzzzzz_editor_categories.css hides this pair through an :is() that counts as an id: match it. */
  body:where([data-sp-has~="editor-explore-design-bar-data-home"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell :is(.cmp-workbench-slot, #cmp-summary-row) { display: block; }
  body:where([data-sp-has~="editor-explore-design-bar-data-home"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-workbench-slot {
    position: fixed; z-index: 30; left: 0; right: 0; bottom: var(--pb-bottom); height: 56px; box-sizing: border-box; margin: 0; padding: 0;
    background: var(--sp-bg); border: 0; border-top: 1px solid var(--sp-border); border-radius: 0;
  }
  /* An open chart-type / format sheet lives inside this slot (it used to sit in a portal under <body>): the slot
     rises above the bottom bar while it is open, as zzzzzzzzz_explore_presentation.css does outside the Data bar. */
  body:where([data-sp-has~="editor-explore-design-bar-data-home"]):where([data-sp-has~="cmp-presentation-menu-open"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-workbench-slot { z-index: 2100; }
  body:where([data-sp-has~="editor-explore-design-bar-data-home"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell #cmp-summary-row { display: contents; }
  body:where([data-sp-has~="editor-explore-design-bar-data-home"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell :is(#cmp-roster, #cmp-filters) { position: fixed; z-index: 31; bottom: var(--pb-bottom); height: 55px; margin: 0; width: var(--pb-w); }
  body:where([data-sp-has~="editor-explore-design-bar-data-home"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell #cmp-roster { left: 0; }
  body:where([data-sp-has~="editor-explore-design-bar-data-home"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell #cmp-filters { left: var(--pb-w); }
  body:where([data-sp-has~="editor-explore-design-bar-data-home"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell #cmp-summary-row:has(#cmp-roster[hidden]) #cmp-filters { left: 0; }
  body:where([data-sp-has~="editor-explore-design-bar-data-home"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-view-wrap {
    position: absolute; top: 0; right: auto; bottom: auto; left: calc(var(--pb-first) * var(--pb-w)); transform: none; box-sizing: border-box;
    width: calc(3 * var(--pb-w)); height: 55px; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--pb-gap);
    background: transparent; border: 0; overflow: visible;
  }
  body:where([data-sp-has~="editor-explore-design-bar-data-home"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell:has(#cmp-aggregate-help[hidden]) .cmp-view-wrap { width: calc(2 * var(--pb-w)); grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body:where([data-sp-has~="editor-explore-design-bar-data-home"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell:has(#cmp-aggregate-help[hidden]) .cmp-format-control { grid-column: 2; }
  body:where([data-sp-has~="editor-explore-design-bar-data-home"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-view-menu { grid-column: 1; grid-row: 1; }
  body:where([data-sp-has~="editor-explore-design-bar-data-home"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell #cmp-aggregate-help { grid-column: 2; grid-row: 1; }
  body:where([data-sp-has~="editor-explore-design-bar-data-home"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-format-control { grid-column: 3; grid-row: 1; }
  body:where([data-sp-has~="editor-explore-design-bar-data-home"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell :is(.cmp-view-menu, #cmp-aggregate-help)::after { display: none; }
  body:where([data-sp-has~="editor-explore-design-bar-data-home"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell :is(#cmp-roster, #cmp-filters, #cmp-view-trigger, #cmp-format-trigger, .cmp-total-menu > summary).cmp-chip {
    box-sizing: border-box; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 3px; width: 100%; min-width: 0; max-width: none; height: 55px; min-height: 55px;
    margin: 0; padding: 0 2px; border: 0; border-radius: 0; background: transparent; color: var(--sp-text-2); font: 500 11.5px/13px var(--sp-font-ui); text-align: center;
  }
  body:where([data-sp-has~="editor-explore-design-bar-data-home"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell :is(#cmp-roster, #cmp-filters).cmp-chip { width: var(--pb-w); }
  /* The dock sits above the host (z 30 vs 5): its top 8 px must not take the switch's downward touch slop. Nothing is drawn there. */
  body:where([data-sp-has~="editor-explore-design-bar-data-home"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-workbench-slot { pointer-events: none; }
  body:where([data-sp-has~="editor-explore-design-bar-data-home"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-chip { pointer-events: auto; clip-path: inset(8px 0 0 0); }
  body:where([data-sp-has~="editor-explore-design-bar-data-home"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell div:has(> :is(#cmp-view-trigger, #cmp-format-trigger)) { width: 100% !important; }
  body:where([data-sp-has~="editor-explore-design-bar-data-home"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-chip:hover { background: var(--sp-surface); color: var(--sp-text); }
  body:where([data-sp-has~="editor-explore-design-bar-data-home"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-chip .cmp-chart-icon, body:where([data-sp-has~="editor-explore-design-bar-data-home"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-chip .cmp-mobile-label .cmp-chart-icon { width: 22px; height: 22px; color: var(--sp-text); }
  body:where([data-sp-has~="editor-explore-design-bar-data-home"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-mobile-label { display: inline-flex; flex-direction: column; align-items: center; gap: 3px; }
  body:where([data-sp-has~="editor-explore-design-bar-data-home"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-format-content { display: contents; }
  body:where([data-sp-has~="editor-explore-design-bar-data-home"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-chip .cmp-data-copy { display: flex; flex: none; flex-direction: column; align-items: center; gap: 0; min-width: 0; max-width: 100%; }
  body:where([data-sp-has~="editor-explore-design-bar-data-home"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-chip .cmp-data-copy strong { font: 500 11.5px/13px var(--sp-font-ui); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body:where([data-sp-has~="editor-explore-design-bar-data-home"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-chip .cmp-chip-value, body:where([data-sp-has~="editor-explore-design-bar-data-home"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell #cmp-roster-count { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
  body:where([data-sp-has~="editor-explore-design-bar-data-home"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-chip > .cmp-menu-chevron, body:where([data-sp-has~="editor-explore-design-bar-data-home"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-chip .cmp-menu-chevron, body:where([data-sp-has~="editor-explore-design-bar-data-home"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-total-menu > summary.cmp-chip::after { display: none; }
  body:where([data-sp-has~="editor-explore-design-bar-data-home"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell :is(#cmp-view-name, #cmp-total-current, .cmp-format-name) { display: inline; font: 500 11.5px/13px var(--sp-font-ui); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* Explore hides the Type label outside Browse with !important (zzzzzzz_explore_final.css:11). */
  body:where([data-sp-has~="editor-explore-design-bar-data-home"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell #cmp-view-trigger > .cmp-mobile-label { display: inline !important; }
  body:where([data-sp-has~="editor-explore-design-bar-data-home"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell #cmp-format-icon { display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; }
  body:where([data-sp-has~="editor-explore-design-bar-data-home"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell #cmp-format-icon .cmp-aspect-icon {
    width: 22px; height: 22px; border: 0; background: var(--sp-text);
    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' stroke-linejoin='round'%3E%3Crect x='5' y='3' width='14' height='18' rx='2'/%3E%3C/svg%3E") center/contain no-repeat;
  }
  body:where([data-sp-has~="editor-explore-design-bar-data-home"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell #cmp-format-icon .cmp-aspect-icon--horizontal { mask-image: 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' stroke-linejoin='round'%3E%3Crect x='2' y='6' width='20' height='12' rx='2'/%3E%3C/svg%3E"); }
}
