/* Approved V11 light palette is local to the pilot; dark uses Portal tokens. */
html:not([data-theme="dark"]) #app-shell[data-summary-pilot="v11"] {--portal-surface:#fff;--portal-soft:#f8fafb;--portal-line:#e2e7ec;--portal-text:#1f2d3d;--portal-muted:#6b7789;--portal-accent:#236458;--portal-active:#e7f2ef;--summary-total:#eaf3f1;background:#f4f6f8;}
#app-shell[data-summary-pilot="v11"] { --summary-sku-height:52px; --summary-group-height:40px; padding:10px var(--portal-page-gutter) 36px; }
#app-shell[data-summary-pilot="v11"] .table-card {padding:0; border:1px solid var(--portal-line); border-radius:10px 10px 0 0; overflow:visible;}
#app-shell[data-summary-pilot="v11"] .s2-context {display:flex;gap:16px;align-items:center;flex-wrap:wrap;margin:8px 2px;}
#app-shell[data-summary-pilot="v11"] .s2-context .table-heading-title {display:flex;align-items:center;gap:8px;}
#app-shell[data-summary-pilot="v11"] #table-title {position:static;width:auto;height:auto;overflow:visible;clip-path:none;white-space:nowrap;font-size:20px;}
#app-shell[data-summary-pilot="v11"] #summary-pilot-toggle {width:auto;min-width:100px;white-space:nowrap;}
#app-shell[data-summary-pilot="v11"] .s2-context .table-heading-title {flex:0 1 auto;}
#app-shell[data-summary-pilot="v11"] .summary-period-controls :is(#date-range-button,#comparison-range-button) {width:auto;flex:0 1 auto;min-height:36px;padding:4px 10px;}
#app-shell[data-summary-pilot="v11"] .summary-period-controls {display:flex;flex-wrap:nowrap;gap:8px;margin:0;min-width:0;}
#app-shell[data-summary-pilot="v11"] .summary-period-controls .date-range-button :is(span,small) {font-size:10px;line-height:1.1;}
#app-shell[data-summary-pilot="v11"] .summary-period-controls .date-range-button strong {font-size:12px;line-height:1.15;}
#app-shell[data-summary-pilot="v11"] .date-range-copy {gap:0;}
#app-shell[data-summary-pilot="v11"] .table-heading {display:block;padding:7px 8px;margin:0;border-bottom:1px solid var(--portal-line);}
#app-shell[data-summary-pilot="v11"] .table-heading-actions {display:flex;gap:7px;flex-wrap:nowrap;width:100%;align-items:center;}
#app-shell[data-summary-pilot="v11"] .table-search-field {display:block!important;flex:1 1 320px;max-width:520px;margin-right:auto;min-width:100px;}
#app-shell[data-summary-pilot="v11"] #search-filter {width:100%;min-height:36px;}
#app-shell[data-summary-pilot="v11"] :is(#summary-search-toggle,#summary-density-setting) {display:none!important;}
#app-shell[data-summary-pilot="v11"] .s2-views {display:flex;align-items:center;overflow-x:auto;gap:4px;padding:6px 8px;border-bottom:1px solid var(--portal-line);min-height:44px;box-sizing:border-box;}
#app-shell[data-summary-pilot="v11"] .s2-views {overflow-y:hidden;scrollbar-width:none;overscroll-behavior-x:contain;}
#app-shell[data-summary-pilot="v11"] .s2-views::-webkit-scrollbar {display:none;}
#app-shell[data-summary-pilot="v11"] .s2-view {border:0;background:var(--portal-surface);color:var(--portal-text);white-space:nowrap;padding:4px 10px;border-radius:6px;cursor:pointer;}
#app-shell[data-summary-pilot="v11"] .s2-views button {height:30px;min-height:30px;font-size:12px;}
#app-shell[data-summary-pilot="v11"] .s2-view-meta {margin-left:auto;padding-right:4px;font-size:11px;color:var(--portal-muted);white-space:nowrap;}
#app-shell[data-summary-pilot="v11"] .s2-views:has(.s2-view-details) {flex-wrap:wrap;}
#app-shell[data-summary-pilot="v11"] .s2-view-details {order:1;flex:1 0 100%;font-size:11px;color:var(--portal-muted);white-space:normal;}
@media(max-width:767px) {#app-shell[data-summary-pilot="v11"] .s2-views {flex-wrap:wrap;} #app-shell[data-summary-pilot="v11"] .s2-view-meta {flex:1 0 100%;white-space:normal;padding:4px 0;}}
#app-shell[data-summary-pilot="v11"] .s2-more {position:relative;flex:none;}
#app-shell[data-summary-pilot="v11"] .s2-more summary {cursor:pointer;border:1px solid var(--portal-line);padding:8px;border-radius:7px;height:36px;box-sizing:border-box;line-height:18px;display:flex;align-items:center;}
#app-shell[data-summary-pilot="v11"] .s2-more-panel {display:flex;gap:6px;}
#app-shell[data-summary-pilot="v11"] .s2-more:not([open]) .s2-more-panel {display:none;}
#app-shell[data-summary-pilot="v11"] .s2-more[open] .s2-more-panel {position:absolute;right:0;top:100%;z-index:90;padding:10px;max-width:calc(100vw - 28px);flex-wrap:wrap;background:var(--portal-surface);border:1px solid var(--portal-line);box-shadow:0 6px 20px #0002;}
#app-shell[data-summary-pilot="v11"] :is(#stock-table,#sticky-stock-table) {border-collapse:separate;border-spacing:0;table-layout:fixed;font-size:12px;}
#app-shell[data-summary-pilot="v11"] :is(#stock-table,#sticky-stock-table) :is(th,td) {box-sizing:border-box;font-variant-numeric:tabular-nums;border-bottom:1px solid var(--portal-line);background:var(--portal-surface);padding:4px 8px;}
#app-shell[data-summary-pilot="v11"] :is(#stock-table-header,#sticky-stock-table-header) {height:45px;}
#app-shell[data-summary-pilot="v11"] :is(#stock-table-header,#sticky-stock-table-header) th {height:45px;font-size:11px;white-space:normal;background:var(--portal-soft);}
#app-shell[data-summary-pilot="v11"] :is(#stock-table-header,#sticky-stock-table-header) :is(.column-menu-trigger,.column-sort) {min-height:34px;padding-top:0;padding-bottom:0;}
#app-shell[data-summary-pilot="v11"] :is(#stock-table,#sticky-stock-table) .s2-band th {height:29px;padding:4px 8px;font-size:10px;text-transform:uppercase;color:var(--portal-muted);border-right:1px solid var(--portal-line);background:var(--portal-soft);}
#app-shell[data-summary-pilot="v11"] #stock-table tbody tr[data-summary-row] {height:52px;}
#app-shell[data-summary-pilot="v11"] #stock-table tbody tr[data-summary-row] td {height:52px;padding:4px 8px;font-size:12px;line-height:1.2;vertical-align:middle;}
#app-shell[data-summary-pilot="v11"] #stock-table .cell-text {max-width:100%;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
#app-shell[data-summary-pilot="v11"] :is(#stock-table,#sticky-stock-table) :is(.group-row,.table-total-row) td {height:40px;padding:4px 8px;font-size:12px;line-height:1.2;background:var(--portal-soft);}
#app-shell[data-summary-pilot="v11"] :is(#stock-table,#sticky-stock-table) .table-total-row td {font-weight:700;border-bottom:2px solid var(--portal-line);}
#app-shell[data-summary-pilot="v11"] :is(.sticky-product,.group-label-cell,.table-total-label-cell) {position:sticky!important;left:0!important;z-index:3;isolation:isolate;background:var(--portal-surface)!important;border-right:1px solid var(--portal-line);}
#app-shell[data-summary-pilot="v11"] :is(#stock-table,#sticky-stock-table) thead th {z-index:10;}
#app-shell[data-summary-pilot="v11"] :is(#stock-table,#sticky-stock-table) thead .sticky-product {z-index:14;}
#app-shell[data-summary-pilot="v11"] :is(#stock-table,#sticky-stock-table) thead .sticky-product {background:var(--portal-soft)!important;}
#app-shell[data-summary-pilot="v11"] .group-label-cell {background:var(--portal-soft)!important;}
#app-shell[data-summary-pilot="v11"] .group-label-cell .group-header-content {max-width:100%;overflow:hidden;}
#app-shell[data-summary-pilot="v11"] :is(#stock-table,#sticky-stock-table) .group-level-1 .group-label-cell {padding-left:26px;}
#app-shell[data-summary-pilot="v11"] :is(#stock-table,#sticky-stock-table) .group-level-2 .group-label-cell {padding-left:44px;}
#app-shell[data-summary-pilot="v11"] :is(#stock-table,#sticky-stock-table) .group-row td {font-weight:650;}
html:not([data-theme="dark"]) #app-shell[data-summary-pilot="v11"] :is(#stock-table,#sticky-stock-table) .group-level-0 td {background:#f7faf9;color:#3d5561;}
html:not([data-theme="dark"]) #app-shell[data-summary-pilot="v11"] :is(#stock-table,#sticky-stock-table) .group-level-2 td {background:#fbfcfc;color:#3d5561;}
html:not([data-theme="dark"]) #app-shell[data-summary-pilot="v11"] .group-level-0 .group-label-cell {background:#f7faf9!important;}
html:not([data-theme="dark"]) #app-shell[data-summary-pilot="v11"] .group-level-2 .group-label-cell {background:#fbfcfc!important;}
#app-shell[data-summary-pilot="v11"] .group-label {overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
#app-shell[data-summary-pilot="v11"] #sticky-table-header {border:0;z-index:40;background:var(--portal-surface);}
#app-shell[data-summary-pilot="v11"] .s2-product-cell {display:flex;align-items:center;gap:8px;min-width:0;}
#app-shell[data-summary-pilot="v11"] .s2-product-cell :is(.product-photo,.photo-placeholder) {width:34px;height:40px;object-fit:contain;flex:none;}
#app-shell[data-summary-pilot="v11"] .s2-product-text {min-width:0;flex:1;}
#app-shell[data-summary-pilot="v11"] .s2-name {display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border:0;background:none;color:var(--portal-text);font-family:inherit;font-weight:600;font-size:12px;line-height:1.4;text-align:left;padding:0;cursor:pointer;}
#app-shell[data-summary-pilot="v11"] .s2-meta {display:flex;gap:6px;font-size:10px;color:var(--portal-muted);min-width:0;}
#app-shell[data-summary-pilot="v11"] .s2-meta span {overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--portal-accent);font-weight:650;}
#app-shell[data-summary-pilot="v11"] .s2-meta a {color:inherit;white-space:nowrap;}
#app-shell[data-summary-pilot="v11"] .column-header-label {font-size:11px;line-height:1.2;}
#app-shell[data-summary-pilot="v11"] .column-header-label small {font-size:10px;display:block;}
@media(max-width:460px) {
 #app-shell[data-summary-pilot="v11"] .s2-product-cell :is(.product-photo,.photo-placeholder) {width:32px;}
 #app-shell[data-summary-pilot="v11"] #table-title {font-size:18px;line-height:1.2;}
 #app-shell[data-summary-pilot="v11"] .s2-context {margin-top:0;margin-bottom:6px;}
 #app-shell[data-summary-pilot="v11"] .s2-views {min-height:40px;padding-top:4px;padding-bottom:4px;}
 #app-shell[data-summary-pilot="v11"] #stock-table tbody tr[data-summary-row] td {padding-top:3px;padding-bottom:3px;}
}
#app-shell[data-summary-pilot="v11"] #grouping-level-controls {max-width:100%;}
@media(max-width:767px) {
 #app-shell[data-summary-pilot="v11"] {padding:6px var(--portal-page-gutter) 32px;}
 #app-shell[data-summary-pilot="v11"] .s2-context {gap:6px;}
 #app-shell[data-summary-pilot="v11"] .s2-context .table-heading-title {flex-wrap:wrap;}
 #app-shell[data-summary-pilot="v11"] .summary-period-controls {width:100%;}
 #app-shell[data-summary-pilot="v11"] .summary-period-controls {min-width:0;}
 #app-shell[data-summary-pilot="v11"] .summary-period-controls>button {flex:1;min-width:0;}
 #app-shell[data-summary-pilot="v11"] .summary-period-controls :is(#date-range-button,#comparison-range-button) {flex:1;min-width:0;width:0;}
 #app-shell[data-summary-pilot="v11"] .table-heading-actions {flex-wrap:wrap;justify-content:flex-end;}
 #app-shell[data-summary-pilot="v11"] .table-search-field {flex:1 0 100%;max-width:none;}
 #app-shell[data-summary-pilot="v11"] .s2-meta {flex-wrap:wrap;gap:0 4px;}
 #app-shell[data-summary-pilot="v11"] #summary-expand {display:none;}
 #app-shell[data-summary-pilot="v11"] .s2-product-cell {gap:5px;}
}
#app-shell[data-summary-pilot="v11"] :is(#stock-table,#sticky-stock-table) .s2-band {height:29px;}
#app-shell[data-summary-pilot="v11"] :is(#stock-table,#sticky-stock-table) .table-total-row {height:40px;}
#app-shell[data-summary-pilot="v11"] :is(#stock-table,#sticky-stock-table) :is(.group-row,.table-total-row) .order-comparison-cell {display:inline-block;padding:2px 4px;}
#app-shell[data-summary-pilot="v11"] :is(#stock-table,#sticky-stock-table) .table-total-row td {white-space:nowrap;color:var(--portal-text);}
#app-shell[data-summary-pilot="v11"] #advertising-queue-button {display:none;}#app-shell[data-summary-pilot="v11"] :is(#stock-table,#sticky-stock-table) .group-row {height:40px;}
#app-shell[data-summary-pilot="v11"] .s2-more-panel {min-width:200px;}
#app-shell[data-summary-pilot="v11"] .table-heading-actions .s2-more-panel {flex-direction:column;align-items:stretch;}
#app-shell[data-summary-pilot="v11"] .table-heading-actions .s2-more-panel > :is(button,a) {width:100%;min-width:0;flex:0 0 auto;justify-content:flex-start;min-height:36px;padding:8px 10px;white-space:normal;text-align:left;}
#app-shell[data-summary-pilot="v11"] .table-heading-actions .s2-more-panel .portal-action-label {display:inline;white-space:normal;}
#app-shell[data-summary-pilot="v11"] .s2-more-panel [hidden] {display:none!important;}
#app-shell[data-summary-pilot="v11"] .s2-more-panel>button {width:100%;min-width:0;flex:1 0 100%;white-space:nowrap;}
#app-shell[data-summary-pilot="v11"] #table-horizontal-scrollbar {scrollbar-gutter:auto;border-left:0;border-right:0;overscroll-behavior-x:contain;}
#app-shell[data-summary-pilot="v11"] .table-scroll {position:relative;overscroll-behavior-x:contain;}
#app-shell[data-summary-pilot="v11"] .column-resize-handle {right:0;z-index:20;}

#app-shell[data-summary-pilot="v11"] .table-heading-actions .table-search-field {flex:1 1 320px;max-width:520px;margin-right:auto;}
#app-shell[data-summary-pilot="v11"] .table-heading-actions [data-s2-grouping] {width:auto;white-space:nowrap;}
#app-shell[data-summary-pilot="v11"] .s2-view[aria-pressed="true"] {background:var(--portal-active);font-weight:700;}
@media(max-width:920px) {
 #app-shell[data-summary-pilot="v11"] .table-heading-actions {flex-wrap:wrap;justify-content:flex-end;}
 #app-shell[data-summary-pilot="v11"] .table-heading-actions .table-search-field {flex:1 0 100%;max-width:none;width:100%;min-width:0;}
 #app-shell[data-summary-pilot="v11"] .table-heading-actions .column-settings-button {flex:0 0 auto;}
 #app-shell[data-summary-pilot="v11"] .table-heading-actions #filters-button {margin-left:auto;}
 #app-shell[data-summary-pilot="v11"] .table-heading-actions #summary-expand {margin-left:0;}
}
#app-shell[data-summary-pilot="v11"] :is(#stock-table,#sticky-stock-table) .table-total-row td {background:var(--summary-total,var(--portal-active));}
#app-shell[data-summary-pilot="v11"] .table-total-label-cell {background:var(--summary-total,var(--portal-active))!important;}
@media(max-width:767px){
 #app-shell[data-summary-pilot="v11"] .table-heading-actions .table-search-field {flex:1 0 100%;width:100%;min-width:0;max-width:none;}
 #app-shell[data-summary-pilot="v11"] .table-heading-actions {justify-content:flex-end;}
 #app-shell[data-summary-pilot="v11"] .table-heading-actions .column-settings-button {height:36px;min-height:36px;}
 #app-shell[data-summary-pilot="v11"] .s2-more-panel [data-s2-grouping] {width:100%;}
 #app-shell[data-summary-pilot="v11"] .table-heading-actions :is(#filters-button,#column-settings-button) {width:auto;flex:0 0 auto;padding:7px 9px;}
 #app-shell[data-summary-pilot="v11"] .table-heading-actions :is(#filters-button,#column-settings-button) .portal-action-label {display:inline;}
 #app-shell[data-summary-pilot="v11"] .table-heading-actions :is(#filters-button,#column-settings-button) > span:has(svg) {display:none;}
 #app-shell[data-summary-pilot="v11"] #filters-button #applied-filters-count {position:static;transform:none;align-self:center;margin:0;min-width:16px;height:16px;line-height:16px;border-radius:8px;font-size:10px;background:var(--portal-active);color:var(--portal-text);}
}

/* V11 toolbar geometry; only direct actions, never popup contents or ordinary mode. */
.summary-chip-v11 {display:none;}
#app-shell[data-summary-pilot="v11"] .summary-chip-legacy {display:none;}
#app-shell[data-summary-pilot="v11"] .summary-chip-v11 {display:inline-flex;align-items:center;gap:6px;flex-wrap:wrap;}
#app-shell[data-summary-pilot="v11"] #applied-filters-card {min-height:34px;box-sizing:border-box;margin:0;padding:5px 8px;border-bottom:1px solid var(--portal-line);background:var(--portal-surface);gap:6px;}
#app-shell[data-summary-pilot="v11"] #applied-filters-card .applied-filter-tag {min-height:24px;box-sizing:border-box;margin:0;padding:0 8px;border:0;border-radius:12px;background:var(--portal-soft);color:var(--portal-muted);font-size:11px!important;line-height:1.4;font-weight:400;gap:6px;box-shadow:none;}
#app-shell[data-summary-pilot="v11"] .applied-filter-tag strong {font-weight:700;color:var(--portal-text);}
#app-shell[data-summary-pilot="v11"] .applied-filter-tag .filter-remove-icon {font-size:13px;color:var(--portal-muted);}
#app-shell[data-summary-pilot="v11"] #compact-clear-filters {font-size:11px;color:var(--portal-muted);padding:4px 7px;}
html:not([data-theme="dark"]) #app-shell[data-summary-pilot="v11"] #applied-filters-card {background:#fcfdfd;}
html:not([data-theme="dark"]) #app-shell[data-summary-pilot="v11"] #applied-filters-card .applied-filter-tag {background:#eff3f5;color:#536272;}
html:not([data-theme="dark"]) #app-shell[data-summary-pilot="v11"] .applied-filter-tag strong {color:#344554;}
html:not([data-theme="dark"]) #app-shell[data-summary-pilot="v11"] .applied-filter-tag .filter-remove-icon {color:#8793a1;}
#app-shell[data-summary-pilot="v11"] .table-heading-actions > .column-settings-button,
#app-shell[data-summary-pilot="v11"] .s2-more > summary {height:34px;min-height:34px;min-width:34px;width:auto;flex:0 0 auto;align-self:center;display:inline-flex;align-items:center;justify-content:center;gap:7px;padding:0 10px;border:1px solid var(--portal-line);border-radius:7px;background:var(--portal-surface);color:var(--portal-text);font-family:inherit;font-size:12px;font-weight:400;line-height:1.2;box-shadow:none;white-space:nowrap;}
#app-shell[data-summary-pilot="v11"] .table-heading-actions > .column-settings-button svg,
#app-shell[data-summary-pilot="v11"] .s2-more > summary svg {width:15px;height:15px;flex:none;}
#app-shell[data-summary-pilot="v11"] .table-heading-actions > .column-settings-button > span:has(svg) {width:15px;height:15px;display:inline-flex;}
#app-shell[data-summary-pilot="v11"] .table-heading-actions > #filters-button > span:has(svg),
#app-shell[data-summary-pilot="v11"] .table-heading-actions > #column-settings-button > .settings-icon,
#app-shell[data-summary-pilot="v11"] #column-order-lock .portal-action-label {display:none;}
#app-shell[data-summary-pilot="v11"] .table-heading-actions > :is(#column-order-lock,#summary-expand),
#app-shell[data-summary-pilot="v11"] .s2-more > summary {width:34px;min-width:34px;height:34px;min-height:34px;flex:0 0 34px;padding:0;margin-left:0;}
#app-shell[data-summary-pilot="v11"] .s2-more > summary::before,
#app-shell[data-summary-pilot="v11"] .s2-more > summary::after {content:none;}
#app-shell[data-summary-pilot="v11"] .s2-more > summary::-webkit-details-marker {display:none;}
#app-shell[data-summary-pilot="v11"] .s2-more > summary::marker {content:'';}
#app-shell[data-summary-pilot="v11"] .table-heading-actions > .column-settings-button[hidden] {display:none!important;}
#app-shell[data-summary-pilot="v11"] #filters-button #applied-filters-count {position:static;transform:none;display:inline-grid;place-items:center;align-self:center;margin:0;min-width:19px;height:18px;padding:0 5px;box-sizing:border-box;border-radius:9px;background:var(--portal-accent);color:var(--portal-surface)!important;font-size:10px;line-height:18px;}
#app-shell[data-summary-pilot="v11"] #filters-button #applied-filters-count[hidden] {display:none;}
#app-shell[data-summary-pilot="v11"] #filters-button:has(#applied-filters-count:not([hidden]):not(:empty)) {background:var(--portal-active);color:var(--portal-accent);}
@media(max-width:767px) {
 #app-shell[data-summary-pilot="v11"] .table-heading-actions > #summary-expand {display:none;}
 #app-shell[data-summary-pilot="v11"] .table-heading-actions > :is(#filters-button,#column-settings-button) {padding:0 8px;}
 #app-shell[data-summary-pilot="v11"] .table-heading-actions > :is(#filters-button,#column-settings-button) .portal-action-label {display:none;}
}

#app-shell[data-summary-pilot="v11"] .summary-column-commands {display:inline-flex;gap:2px;margin-left:3px;}
#app-shell[data-summary-pilot="v11"] .summary-column-commands:not(:has(button:not(:disabled))) {display:none;}
#app-shell[data-summary-pilot="v11"] .summary-column-commands button {font-size:10px;padding:1px 3px;border:1px solid var(--portal-line);color:var(--portal-text);background:var(--portal-surface);border-radius:3px;}
#summary-comparison-setting:not([hidden]) {display:flex;gap:8px;align-items:center;padding:10px 0;}

/* V11 already exposes loading progress in the views toolbar. */
#app-shell[data-summary-pilot="v11"] .s2-context #summary-count { display: none; }
