/* ==========================================================================
   CREATE POST HEADER ON DESKTOP (P8, D-11; layout 2 "Lišta u kraje", owner 2026-11-24): one band with a hairline
   under it (width >= 1100; 92 px high since 2026-11-29, 56 before), and from 1380 up three zones on ONE row in both
   inspector dock states.
   Zone 1 (Back, name, chart-kind chips, Total) ends on the canvas column edge; zone 2 (Format, Undo, Redo, Save,
   Export) keeps fixed widths, so nothing changes size or wording when the inspector docks to the rail (it used to
   drop Undo/Redo to a second row there). Every control is 40 px high. Only the layout of the header changes: the
   canvas and every id stay as they were. Browse and narrower windows keep the Explore header of
   assets/zzzzz_explore_workspace.css; the band's colours under the Home look are in
   zzzzzzzzzzzzzzzzzzzz_explore_home_look.css.
   ========================================================================== */
/* The format word ("Portrait", "Landscape") is written by assets/explore_workspace.js as data-word and shown
   in front of the ratio, as before; the three-zone header below drops it (icon + ratio). */
.cmp-format-name[data-word]::before { content: attr(data-word) ' '; }

@media (min-width: 1100px) {
  body:where([data-sp-has~="editor-explore-design"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-head {
    /* The band reaches over the Filters column to the left edge (owner 2026-11-28, assets/explore_workspace.js).
       --cmp-head-air makes it taller beside the desktop sidebar, so its first row stands on the logo's line as in
       Browse (owner 2026-11-29; set and explained in assets/zzzzz_explore_workspace.css). */
    box-sizing: border-box; min-height: calc(56px + var(--cmp-head-air,0px)); margin: 0 0 0 calc(-1 * var(--sp-data-head-shift,0px));
    padding: calc(2px + var(--cmp-head-air,0px) / 2) 16px calc(1px + var(--cmp-head-air,0px) / 2);
    background-color: var(--sp-chrome); border-bottom: 1px solid var(--sp-border);
  }
}

@media (min-width: 1380px) {
  body:where([data-sp-has~="editor-explore-design"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-head {
    /* Back | name | chips | Total (line only) | gap 24 | Format | Undo Redo | Save | Export (gaps 8 are columns, so no column-gap) */
    grid-template-columns: 24px minmax(0, 1fr) auto auto 24px 84px 8px 72px 8px 90px 8px 114px;
    grid-template-rows: auto auto; column-gap: 0; row-gap: 0; align-items: center;
  }
  body:where([data-sp-has~="editor-explore-design"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-head :is(.cmp-view-wrap, .cmp-workspace-actions) { display: contents; }
  body:where([data-sp-has~="editor-explore-design"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-head .cmp-workspace-heading { grid-column: 2; grid-row: 1 / 3; align-self: center; min-width: 0; margin-left: 12px; }
  /* The summary line sits inside the heading, so the heading's indent is the only one. */
  body:where([data-sp-has~="editor-explore-design"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-head #cmp-filter-summary { grid-column: 2; margin-left: 0; }
  /* Zone 1: chips (Line, Bar, Vertical lines, Ranking) and the stub. */
  body:where([data-sp-has~="editor-explore-design"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-head .cmp-view-options {
    grid-column: 3; grid-row: 1 / 3; align-self: center; justify-self: end; margin-left: 12px;
    box-sizing: border-box; height: 40px; padding: 2px; gap: 2px; align-items: stretch;
  }
  body:where([data-sp-has~="editor-explore-design"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-head .cmp-view-chip .mantine-Chip-label { height: 36px; min-height: 36px; }
  body:where([data-sp-has~="editor-explore-design"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-head .cmp-view-menu { grid-column: 4; grid-row: 1 / 3; align-self: center; justify-self: end; }
  /* Vertical lines is a chip here (it stays hidden in Browse); it follows Bar, Ranking comes last (D11After). */
  body:where([data-sp-has~="editor-explore-design"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-head .cmp-view-chip:has(input[value='vertical']) { display: block; order: 1; }
  body:where([data-sp-has~="editor-explore-design"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-head .cmp-view-chip:has(input[value='ranking']) { order: 2; }
  /* Zone 2: Format | Undo Redo | Save | Export. Total (a line-chart option) rides with the chips. */
  body:where([data-sp-has~="editor-explore-design"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-head #cmp-aggregate-help { grid-column: 4; grid-row: 1 / 3; align-self: center; justify-self: start; width: 76px; margin-left: 8px; order: 0; }
  body:where([data-sp-has~="editor-explore-design"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-head #cmp-format-control { grid-column: 6; grid-row: 1 / 3; align-self: center; }
  body:where([data-sp-has~="editor-explore-design"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-head #cmp-workspace-save { grid-column: 10; grid-row: 1 / 3; align-self: center; }
  body:where([data-sp-has~="editor-explore-design"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-head #cmp-workspace-export { grid-column: 12; grid-row: 1 / 3; align-self: center; }
  /* One height (40) and one width per control. */
  body:where([data-sp-has~="editor-explore-design"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-head :is(.cmp-total-menu > summary, #cmp-format-trigger, #cmp-workspace-save, #cmp-workspace-export) {
    box-sizing: border-box; width: 100%; min-width: 0; height: 40px; min-height: 40px; padding: 0 10px;
  }
  body:where([data-sp-has~="editor-explore-design"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-head :is(#cmp-workspace-save, #cmp-workspace-export) { padding: 0 10px; white-space: nowrap; }
  body:where([data-sp-has~="editor-explore-design"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-head #cmp-format-control { display: block; }
  /* Format = icon + ratio ("9:16"); the word is dropped (D-11, D-12). */
  body:where([data-sp-has~="editor-explore-design"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-head #cmp-format-trigger { justify-content: space-between; white-space: nowrap; }
  body:where([data-sp-has~="editor-explore-design"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-head .cmp-format-content { gap: 6px; }
  body:where([data-sp-has~="editor-explore-design"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-head #cmp-format-icon { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 22px; }
  body:where([data-sp-has~="editor-explore-design"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-head #cmp-format-icon .cmp-aspect-icon--vertical { width: 11px; height: 15px; }
  body:where([data-sp-has~="editor-explore-design"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-head #cmp-format-icon .cmp-aspect-icon--horizontal { width: 16px; height: 10px; }
  body:where([data-sp-has~="editor-explore-design"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-head .cmp-format-name[data-word]::before { content: none; }
  /* One line always: a long name is cut, so the header keeps its height (and the canvas its size). */
  body:where([data-sp-has~="editor-explore-design"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-head .cmp-workspace-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* Type as drawn in D11After: name 22/700, controls 13/600 (line heights unchanged). */
  body:where([data-sp-has~="editor-explore-design"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-head .cmp-workspace-title { font: 700 22px/32px var(--sp-font-display); letter-spacing: 0; }
  body:where([data-sp-has~="editor-explore-design"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-head :is(.cmp-total-menu > summary, #cmp-format-trigger, #cmp-workspace-save, #cmp-workspace-export) { font: 600 13px/20px var(--sp-font-ui); }
  body:where([data-sp-has~="editor-explore-design"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-head #cmp-aggregate-help .cmp-total-menu > summary { padding-left: 13px; }
  /* The Total list opens under its button, inside zone 2 (it used to hang to the left over the stub). */
  body:where([data-sp-has~="editor-explore-design"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-head .cmp-total-menu .cmp-total-options { left: 0; right: auto; }
}

/* ==========================================================================
   UNDO / REDO IN THE HEADER (owner, 2026-10-31). On Explore posts the editor's own
   #editor-undo / #editor-redo stay as hidden owners (like Save / Export); the header buttons
   #cmp-workspace-undo / -redo forward to them (assets/explore_workspace.js). Desktop from 1380,
   both dock states: they sit between Format and Save (the retired "···" chart-type stub is hidden: every chart type is a
   chip there). Phones: floating over the preview, no fill, so the 48 px header stays as it is.
   ========================================================================== */
#editor-workspace-root[data-chrome="explore"] .sp-editor-sheet-head :is(#editor-undo, #editor-redo) { display: none; }
.cmp-workspace-history { display: flex; align-items: center; gap: 2px; }
.cmp-workspace-history[hidden] { display: none; }
/* Narrower windows (below 1380): at the right end of the chip row. */
#compare-shell.sp-data-shell .cmp-head .cmp-workspace-history { grid-column: 3; grid-row: 3; justify-self: end; align-self: center; }
.cmp-history-button {
  box-sizing: border-box; display: inline-flex; flex: none; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0;
  border: 0; border-radius: 10px; background: transparent; color: var(--sp-text); cursor: pointer;
}
.cmp-history-button:hover:not(:disabled) { background: var(--sp-surface); }
.cmp-history-button:focus-visible { outline: 2px solid var(--sp-accent); outline-offset: 1px; }
.cmp-history-button:disabled { color: var(--sp-text-3); cursor: default; }
.cmp-history-icon { display: block; width: 20px; height: 20px; background: currentColor; mask: var(--cmp-history-icon) center/contain no-repeat; }
#cmp-workspace-undo .cmp-history-icon { --cmp-history-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M9%2010%204%205m0%200%205-4M4%205h9a7%207%200%200%201%200%2014h-3%22%2F%3E%3C%2Fsvg%3E"); }
#cmp-workspace-redo .cmp-history-icon { --cmp-history-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m15%2010%205-5m0%200-5-4m5%204h-9a7%207%200%200%200%200%2014h3%22%2F%3E%3C%2Fsvg%3E"); }
@media (min-width: 1380px) {
  body:where([data-sp-has~="editor-explore-design"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-head .cmp-view-menu { display: none; }
  body:where([data-sp-has~="editor-explore-design"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-head .cmp-workspace-history { grid-column: 8; grid-row: 1 / 3; align-self: center; justify-self: stretch; justify-content: space-between; gap: 0; }
  body:where([data-sp-has~="editor-explore-design"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-head .cmp-history-button { width: 36px; height: 40px; }
}
@media (max-width: 599px), (max-width: 767px) and (max-aspect-ratio: 10/13) {
  body:where([data-sp-has~="editor-explore-design"]):not(#sp-s):not(.sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .cmp-head .cmp-workspace-history {
    position: fixed; top: 56px; right: 16px; z-index: 40; gap: 0; background: transparent;
  }
  .cmp-workspace-history .cmp-history-button { background: transparent; }
  /* While a tool sheet is open the header is hidden: the editor's own round buttons float beside Done (zzzzzzzzzzz_editor_categories.css). */
  #editor-workspace-root[data-chrome="explore"][data-mode="design"]:not([data-tool="home"], [data-keyboard="true"], [data-kind="ranking"]) .sp-editor-sheet-head :is(#editor-undo, #editor-redo) { display: inline-flex; }
}

/* ==========================================================================
   BROWSE (Explore) ON DESKTOP: the same four chart types as Create post (owner, 2026-10-31). Vertical lines is a
   chip here too, after Bar; Ranking comes last. The "···" chart-type menu repeated those types, so it is hidden —
   except for a saved question that offers Scatter, which only the menu lists. Phones keep their Type sheet.
   ========================================================================== */
@media (min-width: 768px), (min-width: 600px) and (min-aspect-ratio: 10/13) {
  #compare-shell.sp-data-shell .cmp-view-chip:has(input[value='vertical']) { display: block; order: 1; }
  #compare-shell.sp-data-shell .cmp-view-chip:has(input[value='ranking']) { order: 2; }
  #compare-shell.sp-data-shell .cmp-view-wrap:not([data-kinds~='scatter']) .cmp-view-menu { display: none; }
}
