/* One Explore composition for Line, Bar and Ranking. The renderer and its
   controls remain mounted; this sheet only owns the surrounding workspace. */
#compare-shell.sp-data-shell { --explore-inspector-width: 304px; }
#compare-shell:not(.sp-data-shell) :is(.cmp-workspace-title,.cmp-workspace-actions) { display: none; }
#compare-shell:not(.sp-data-shell) .cmp-workspace-heading { display: contents; }
.cmp-total-menu > summary:focus-visible { outline: 2px solid var(--sp-accent); outline-offset: 3px; }
#compare-shell.sp-data-shell .sp-data-main { padding: 20px 24px; }
#compare-shell.sp-data-shell #cmp-setup .mantine-SegmentedControl-indicator { background: var(--sp-selected-bg); }
#compare-shell.sp-data-shell #cmp-setup .mantine-SegmentedControl-control[data-active] .mantine-SegmentedControl-label { color: var(--sp-selected-text); }
#compare-shell.sp-data-shell .cmp-head {
  display: grid; grid-template-columns: 24px minmax(180px,1fr) auto auto;
  grid-template-rows: auto auto; align-items: center; gap: 2px 12px;
  margin: 0 0 32px;
}
/* Stage 6: Back and the workspace actions are wrapped for the phone browse row;
   everywhere else the wrapper is transparent so the header grid keeps its placement. */
#compare-shell.sp-data-shell .cmp-head-actions { display: contents; }
#compare-shell.sp-data-shell .cmp-back { grid-column: 1; grid-row: 1; margin: 0; width: 24px; height: 32px; }
#compare-shell.sp-data-shell .cmp-back > .sp-data-back-icon { display: block; width: 18px; height: 18px; background: currentColor; }
#compare-shell.sp-data-shell .cmp-back::before { display: none; }
#compare-shell.sp-data-shell .cmp-workspace-heading { grid-column: 2; grid-row: 1; min-width: 0; }
#compare-shell.sp-data-shell .cmp-workspace-title { margin: 0; font: 750 24px/32px var(--sp-font-display); letter-spacing: -.035em; }
#compare-shell.sp-data-shell .cmp-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
#compare-shell.sp-data-shell .cmp-summary-row { display: contents; }
#compare-shell.sp-data-shell .cmp-filter-summary {
  grid-column: 2; grid-row: 2; display: block;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font: 400 12px/18px var(--sp-font-ui); color: var(--sp-text-2);
}
#compare-shell.sp-data-shell .cmp-filter-summary > span + span::before { content: '\00b7'; margin-right: 4px; }
#compare-shell.sp-data-shell :is(.cmp-summary-calculation,.cmp-filters-label) { display: none; }
#compare-shell.sp-data-shell .cmp-view-wrap {
  display: flex; grid-column: 3; grid-row: 1 / 3; justify-self: end;
  align-self: center; gap: 10px; margin: 0; flex-wrap: nowrap;
}
#compare-shell.sp-data-shell .cmp-view-options { display: flex; gap: 2px; padding: 2px; background: var(--sp-chrome); border: 1px solid var(--sp-border); border-radius: 7px; }
#compare-shell.sp-data-shell .cmp-view-chip .mantine-Chip-label { height: 36px; min-height: 36px; padding: 0 10px; font: 500 12px/20px var(--sp-font-ui); }
#compare-shell.sp-data-shell .cmp-view-chip .mantine-Chip-label { background: transparent; color: var(--sp-text-2); border-radius: 5px; border: 0; }
#compare-shell.sp-data-shell .cmp-view-chip .mantine-Chip-label[data-checked] { background: var(--sp-selected-bg); color: var(--sp-selected-text); }
#compare-shell.sp-data-shell .cmp-view-chip-content { display: inline-flex; align-items: center; gap: 6px; }
#compare-shell.sp-data-shell .cmp-view-chip-content .cmp-chart-icon { width: 16px; height: 16px; }
#compare-shell.sp-data-shell .cmp-view-chip .mantine-Chip-iconWrapper { display: none; }
#compare-shell.sp-data-shell .cmp-view-menu { display: block; order: 1; }
#compare-shell.sp-data-shell #cmp-view-trigger { width: 30px; min-width: 30px; padding: 0; border: 0; background: transparent; }
#compare-shell.sp-data-shell #cmp-view-trigger > * { display: none; }
#compare-shell.sp-data-shell #cmp-view-trigger::before { content: '\00b7\00b7\00b7'; font-size: 20px; }
#compare-shell.sp-data-shell #cmp-view-trigger::before { position: static; background: none; border: 0; }
#compare-shell.sp-data-shell #cmp-format-trigger { width: auto; min-width: 0; }
#compare-shell.sp-data-shell #cmp-format-trigger::before { display: none; }
#compare-shell.sp-data-shell .cmp-view-chip:has(input:is([value='vertical'],[value='scatter'],[value='table'])) { display: none; }
#compare-shell.sp-data-shell .cmp-format-options { display: none; }
#compare-shell.sp-data-shell .cmp-format-menu { display: block; }
#compare-shell.sp-data-shell .cmp-format-control { order: 3; }
#compare-shell.sp-data-shell #cmp-aggregate-help { order: 2; }
.cmp-total-menu { position: relative; }
.cmp-total-menu > summary {
  box-sizing: border-box; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; min-height: 40px; min-width: 88px; padding: 0 12px;
  border: 1px solid var(--sp-border); border-radius: 7px; list-style: none;
  background: var(--sp-chrome); color: var(--sp-text); font: 500 12px/20px var(--sp-font-ui); cursor: pointer;
}
.cmp-total-menu > summary::-webkit-details-marker { display: none; }
.cmp-total-menu > summary::after { content: ''; width: 5px; height: 5px; border: solid var(--sp-text-2); border-width: 0 1px 1px 0; transform: rotate(45deg); margin-top: -3px; }
.cmp-total-options { position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; width: 150px; padding: 5px; border: 1px solid var(--sp-border); border-radius: 8px; background: var(--sp-surface); }
.cmp-total-options button { display: block; width: 100%; min-height: 44px; border: 0; border-radius: 5px; padding: 8px 10px; text-align: left; background: transparent; color: var(--sp-text); font: 500 12px/20px var(--sp-font-ui); cursor: pointer; }
.cmp-total-options button[aria-pressed='true'] { color: var(--sp-selected-text); background: var(--sp-selected-bg); }
.cmp-total-options button:disabled { opacity: .45; cursor: default; }
#compare-shell.sp-data-shell .cmp-view-menu-trigger {
  min-height: 40px; height: 40px; padding: 0 12px; border-radius: 7px;
  background: var(--sp-chrome); border: 1px solid var(--sp-border); font-size: 12px;
}
.cmp-format-content { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
#compare-shell.sp-data-shell .cmp-format-control.is-disabled { opacity: 1; }
#compare-shell.sp-data-shell .cmp-total-toggle .mantine-Switch-label {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  box-sizing: border-box; height: 40px; min-width: 88px; padding: 0 12px;
  border: 1px solid var(--sp-border); border-radius: 7px;
  color: var(--sp-text); background: var(--sp-chrome); font: 500 12px/20px var(--sp-font-ui);
}
#compare-shell.sp-data-shell .cmp-total-toggle .mantine-Switch-label::after {
  content: ''; width: 5px; height: 5px; border: solid var(--sp-text-2);
  border-width: 0 1px 1px 0; transform: rotate(45deg); margin-top: -3px;
}
.cmp-workspace-actions { display: flex; gap: 8px; grid-column: 4; grid-row: 1 / 3; }
.cmp-workspace-actions button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; min-width: 92px; padding: 0 16px; border: 1px solid var(--sp-border-strong);
  border-radius: 7px; color: var(--sp-text); background: transparent;
  font: 600 12px/20px var(--sp-font-ui); cursor: pointer;
}
.cmp-workspace-actions button::before {
  content: ''; width: 16px; height: 16px; flex: 0 0 16px;
  background: currentColor; mask: var(--editor-action-icon) center/contain no-repeat;
}
#cmp-workspace-export { background: var(--sp-accent); border-color: var(--sp-accent); color: var(--sp-on-accent); }
.cmp-workspace-actions button:disabled { opacity: .45; cursor: wait; }
.cmp-workspace-actions button:focus-visible { outline: 2px solid var(--sp-accent); outline-offset: 3px; }
#compare-shell.sp-data-shell .cmp-preview--ranking:not(.cmp-preview--table) {
  grid-template-columns: minmax(0,1fr);
  grid-template-rows: minmax(0,1fr) auto; gap: 24px; min-height: 0;
}
#compare-shell.sp-data-shell .cmp-preview--ranking :is(.cmp-views,#cmp-visual) {
  grid-column: 1; grid-row: 1; width: 100%; max-width: none;
  display: flex; align-items: flex-start; justify-content: center;
  min-height: calc(100dvh - 204px - var(--cmp-head-air,0px)); padding: 24px 0; box-sizing: border-box;
}
#compare-shell.sp-data-shell .cmp-ranking[data-ranking-post] {
  width: min(100%, calc((100dvh - 304px - var(--cmp-head-air,0px)) * .8)); max-width: 760px;
  box-shadow: 0 18px 48px rgb(0 0 0 / .16);
}
#compare-shell.sp-data-shell .cmp-preview--ranking .cmp-views #cmp-visual { min-height: 0; padding: 0; }
#compare-shell.sp-data-shell .cmp-preview--ranking > .cmp-views { justify-content: flex-start; align-items: stretch; gap: 0; }
#compare-shell.sp-data-shell .cmp-publish-actions > button { display: none; }
#compare-shell.sp-data-shell .cmp-publish-actions { grid-column: 1; grid-row: 2; }
#editor-workspace-root[data-chrome='explore'] .sp-editor-view-toolbar { display: none; }
#editor-workspace-root[data-origin='explore'] .sp-editor-columns { gap: 24px; }
#editor-workspace-root[data-origin='explore'] #editor-tools {
  box-sizing: border-box; border-radius: 8px; background: var(--sp-bg); padding: 16px 8px;
}
#editor-workspace-root[data-origin='explore'] #editor-tool-content { padding: 0; }
.sp-editor-inspector-title {
  margin: 0 10px 16px; font: 600 18px/24px var(--sp-font-ui);
}
#editor-workspace-root[data-origin='explore'] .sp-editor-inspector-title { flex: none; }
#editor-workspace-root[data-origin='explore'] .sp-quick-group {
  margin: 0 0 8px; border: 1px solid var(--sp-border); border-radius: 8px;
  background: var(--sp-chrome); overflow: hidden;
}
#editor-workspace-root[data-origin='explore'] .sp-quick-group > summary {
  position: relative; display: flex; flex-direction: column; align-items: flex-start;
  justify-content: center; gap: 3px; min-height: 64px; padding: 12px 36px 12px 12px;
  font: 600 14px/20px var(--sp-font-ui); list-style: none; cursor: pointer;
}
#editor-workspace-root[data-origin='explore'] .sp-quick-group > summary { flex-direction: row; }
#editor-workspace-root[data-origin='explore'] .sp-quick-group[open] > summary { min-height: 44px; }
#editor-workspace-root[data-origin='explore'] .sp-quick-group[open] > summary .sp-quick-summary { display: none; }
#editor-workspace-root[data-origin='explore'] .sp-quick-body { padding: 0 12px 12px; }
#editor-workspace-root[data-origin='explore'] .sp-quick-body :is(input,textarea) { font-size: 12px; }
#editor-workspace-root[data-origin='explore'] .sp-quick-body .sp-quick-group { border: 0; background: transparent; border-radius: 0; margin: 0; }
#editor-workspace-root[data-origin='explore'] .sp-quick-body .sp-quick-group > summary { padding: 0; min-height: 36px; }
#editor-workspace-root[data-origin='explore'] .sp-quick-body .sp-quick-group > .sp-quick-body { padding: 0; }
#compare-shell.sp-data-shell .cmp-filters-button { display: none; }
.cmp-roster-button { display: none; }
@media (min-width: 768px), (min-width: 600px) and (min-aspect-ratio: 10/13) {
  #compare-shell.sp-data-shell[data-panel-page='comparison'][data-source-form=''] .sp-data-grid { grid-template-columns: 272px minmax(0,1fr); }
  #compare-shell.sp-data-shell[data-panel-page='comparison'][data-source-form=''][data-filters-dock='rail'] .sp-data-grid { grid-template-columns: 48px minmax(0,1fr); }
  /* The header is a band from edge to edge, as in Create post, and Filters start under it (owner 2026-11-28: without
     the band, Filters looked out of line). It reaches over the main column's padding (20 / 24) and over the Filters
     column (its width is measured by assets/explore_workspace.js; Filters' own offset is in zzz_editor_data_panel.css).
     Create post from 1100 has its own band rule in zzzzzzzzzzzzzzzzzzz_editor_desktop_header.css. */
  #compare-shell.sp-data-shell[data-panel-page='comparison'][data-source-form=''] .cmp-head {
    box-sizing: border-box; min-height: calc(56px + var(--cmp-head-air,0px));
    padding: calc(2px + var(--cmp-head-air,0px) / 2) 16px calc(1px + var(--cmp-head-air,0px) / 2);
    margin: -20px -24px 32px calc(-1 * var(--sp-data-head-shift,0px) - 24px);
    background-color: var(--sp-chrome); border-bottom: 1px solid var(--sp-border);
  }
}
/* Beside the desktop sidebar (from 1025, assets/zz_site_chrome.css) the band is taller, so its first row stands on the
   logo's line (owner 2026-11-29: the 56 px band read cramped next to the logo). The logo's centre is 46 px from the
   top (sidebar padding 24 + link padding 5 + half of the 34 px brand group) and the row's centre was at 28, so the row
   gets 18 px more air above it and 18 below. --cmp-head-air is their sum. The Create post band
   (zzzzzzzzzzzzzzzzzzz_editor_desktop_header.css) reads it too, and so does everything sized from the window height
   (the ranking in this sheet, the loading skeleton in zz_editor_preview_loading.css), so nothing is pushed under the
   bottom edge. */
@media (min-width: 1025px) {
  #compare-shell.sp-data-shell[data-panel-page='comparison'][data-source-form=''] { --cmp-head-air: 36px; }
}
/* Create post on desktop (layout 2 "Lišta u kraje", owner 2026-11-24): every region docks to an edge. The header
   band (zzzzzzzzzzzzzzzzzzz_editor_desktop_header.css) and the inspector column run flush, the transport is a bar
   across the whole canvas column, and the canvas keeps 24 px of air at its sides (12 above and below are the scale
   script's own budget), so the preview grows into the freed room by itself (assets/studio_preview_scale.js). */
@media (min-width: 1100px) {
  body:where([data-sp-has~="editor-explore-design"]):not(#sp-s):not(.sp-s):not(.sp-s) #compare-shell.sp-data-shell .sp-data-main { padding: 0; }
  /* Flush to the bottom edge: the placement script leaves 20 px under the host. */
  #editor-workspace-root[data-mode="design"][data-chrome="explore"].is-placed { height: calc(var(--editor-host-height) + 20px); }
  #editor-workspace-root[data-mode="design"][data-chrome="explore"] .sp-editor-columns { gap: 0; }
  #editor-workspace-root[data-mode="design"][data-chrome="explore"] #editor-canvas-column { gap: 0; }
  #editor-workspace-root[data-mode="design"][data-chrome="explore"] #editor-figure-card .sp-preview-workbench { box-sizing: border-box; padding-inline: 24px; }
  #editor-workspace-root[data-mode="design"][data-chrome="explore"] #editor-retail-graph-stage { outline: 1px solid var(--hl-line, var(--sp-border)); outline-offset: 0; }
  #editor-workspace-root[data-mode="design"][data-chrome="explore"] #editor-canvas-column .sp-transport-bar {
    box-sizing: border-box; width: auto; max-width: none; height: 52px; min-height: 52px; margin: 0; padding: 0 16px; gap: 12px;
    border: 0; border-top: 1px solid var(--hl-rim, var(--sp-border)); border-radius: 0; background: var(--hl-paper, var(--sp-chrome));
  }
}
@media (max-width: 1379px) {
  #compare-shell.sp-data-shell .cmp-head { grid-template-columns: 24px minmax(0,1fr) auto; }
  /* Save and Export sit beside the title: the chart-kind row below needs the whole width (it overlapped them). */
  #compare-shell.sp-data-shell .cmp-view-wrap { grid-column: 1 / -1; grid-row: 3; justify-self: start; margin-top: 14px; }
  #compare-shell.sp-data-shell .cmp-workspace-actions { grid-column: 3; grid-row: 1 / 3; align-self: center; margin-top: 0; }
  #compare-shell.sp-data-shell .cmp-preview--ranking :is(.cmp-views,#cmp-visual) { min-height: calc(100dvh - 248px - var(--cmp-head-air,0px)); }
  #compare-shell.sp-data-shell .cmp-ranking[data-ranking-post] { width: min(100%, calc((100dvh - 296px - var(--cmp-head-air,0px)) * .8)); }
}
@media (max-width: 599px), (max-width: 767px) and (max-aspect-ratio: 10/13) {
  #compare-shell.sp-data-shell .sp-data-main { padding: 16px; }
  #compare-shell.sp-data-shell .cmp-head { grid-template-columns: 44px 44px minmax(0,1fr) auto; column-gap: 4px; margin-bottom: 24px; }
  #compare-shell.sp-data-shell .cmp-workspace-heading { grid-column: 1 / -1; padding-inline: 36px 0; }
  #compare-shell.sp-data-shell .cmp-back { z-index: 1; }
  #compare-shell.sp-data-shell .cmp-workspace-title { font-size: 22px; }
  /* Keep the subtitle aligned in both loading and retained-editor layouts. */
  #compare-shell.sp-data-shell #cmp-filter-summary { grid-column: 1 / -1 !important; padding-left: 36px; }
  /* The roster, chart, format, calculation and actions share one touch-friendly row. */
  #compare-shell.sp-data-shell .cmp-view-wrap { grid-column: 3; grid-row: 3; width: 100%; justify-content: flex-start; flex-wrap: nowrap; gap: 4px; }
  #compare-shell.sp-data-shell .cmp-workspace-actions { grid-column: 4; grid-row: 3; margin-top: 14px; gap: 4px; }
  #compare-shell.sp-data-shell .cmp-workspace-actions button { flex-direction: row; gap: 4px; height: 44px; min-height: 44px; min-width: 0; width: 60px; padding: 0 4px; font-size: 10px; white-space: nowrap; }
  #compare-shell.sp-data-shell #cmp-workspace-save { width: 52px; }
  #compare-shell.sp-data-shell :is(.cmp-view-options,.cmp-format-name) { display: none; }
  #compare-shell.sp-data-shell :is(.cmp-view-menu,.cmp-format-control) { flex: none; }
  #compare-shell.sp-data-shell :is(#cmp-view-trigger,#cmp-format-trigger) {
    box-sizing: border-box; width: 44px; min-width: 44px; height: 44px; padding: 0; gap: 3px;
    border: 1px solid var(--sp-border); background: var(--sp-chrome);
  }
  #compare-shell.sp-data-shell #cmp-view-trigger::before { display: none; }
  #compare-shell.sp-data-shell #cmp-view-trigger > * { display: inline-flex; }
  #compare-shell.sp-data-shell .cmp-menu-chevron { width: 5px; height: 5px; margin-inline: 0; flex-shrink: 0; }
  #compare-shell.sp-data-shell #cmp-aggregate-help { flex: 0 1 60px; min-width: 44px; }
  #compare-shell.sp-data-shell .cmp-total-menu > summary { box-sizing: border-box; min-height: 44px; min-width: 44px; padding: 0 6px; gap: 4px; }
  #compare-shell.sp-data-shell .cmp-total-menu > summary::after { flex-shrink: 0; }
  #compare-shell.sp-data-shell #cmp-total-current { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #compare-shell.sp-data-shell .cmp-filters-button,
  #compare-shell.sp-data-shell:has(#editor-preview-loading:is([data-state='loading'],[data-state='error'])) .cmp-filters-button {
    display: inline-flex; grid-column: 2; grid-row: 3; justify-self: start; margin-top: 14px;
    box-sizing: border-box; width: 44px; min-width: 44px; height: 44px; padding: 0;
    align-items: center; justify-content: center;
    border: 1px solid var(--sp-border); border-radius: 7px; background: var(--sp-chrome);
  }
  #compare-shell.sp-data-shell :is(.cmp-filters-button,.cmp-roster-button) .cmp-chart-icon { width: 20px; height: 20px; }
  #compare-shell.sp-data-shell .cmp-roster-button:not([hidden]) {
    display: inline-flex; grid-column: 1; grid-row: 3; justify-self: start; margin-top: 14px;
    align-items: center; justify-content: center; color: var(--sp-text); cursor: pointer;
    box-sizing: border-box; width: 44px; height: 44px; padding: 0;
    border: 1px solid var(--sp-border); border-radius: 7px; background: var(--sp-chrome);
  }
  #compare-shell.sp-data-shell .cmp-roster-button:focus-visible { outline: 2px solid var(--sp-accent); outline-offset: 3px; }
  #compare-shell.sp-data-shell .cmp-preview--ranking:not(.cmp-preview--table) { grid-template-columns: minmax(0,1fr); gap: 16px; }
  #compare-shell.sp-data-shell .cmp-preview--ranking :is(.cmp-views,#cmp-visual) { min-height: 0; padding: 0; }
  #compare-shell.sp-data-shell .cmp-ranking[data-ranking-post] { width: 100%; max-width: 480px; }
  #compare-shell.sp-data-shell .cmp-publish-actions { grid-column: 1; grid-row: 2; }
}
@media (max-width: 387px) {
  #compare-shell.sp-data-shell .sp-data-main { padding-inline: 12px; }
  #compare-shell.sp-data-shell .cmp-head { column-gap: 2px; }
  #compare-shell.sp-data-shell :is(.cmp-view-wrap,.cmp-workspace-actions) { gap: 2px; }
  #compare-shell.sp-data-shell .cmp-view-wrap { grid-column: 3 / -1; }
  #compare-shell.sp-data-shell .cmp-workspace-actions { grid-column: 1 / -1; grid-row: 4; justify-self: end; margin-top: 4px; }
  #compare-shell.sp-data-shell .cmp-total-menu > summary { padding-inline: 2px; gap: 2px; }
}
