:root {
  --wb-bg: #f7f7f8;
  --wb-surface: #ffffff;
  --wb-surface-muted: #f3f3f5;
  --wb-surface-hover: #ededf0;
  --wb-control: #f7f7f9;
  --wb-control-hover: #f0f0f4;
  --wb-control-disabled: #f8f8fa;
  --wb-line: #e4e4eb;
  --wb-line-strong: #d2d2dc;
  --wb-text: #242328;
  --wb-text-secondary: #78777f;
  --wb-text-muted: #aaa9b1;
  --wb-purple: #7256e9;
  --wb-purple-strong: #6041dc;
  --wb-purple-soft: #f2f0ff;
  --wb-green: #15803d;
  --wb-green-soft: #effbf3;
  --wb-amber: #b45309;
  --wb-amber-soft: #fff8e8;
  --wb-red: #dc2626;
  --wb-red-soft: #fff3f2;
  --wb-radius: 10px;
  --wb-radius-sm: 7px;
  --wb-sidebar: 216px;
  --wb-header: 60px;
  --wb-inspector: 440px;
  --wb-shadow-popover: 0 16px 38px rgb(30 29 35 / 11%), 0 3px 10px rgb(30 29 35 / 5%);
  --wb-font: Inter, "Noto Sans SC", "Noto Sans JP", system-ui, sans-serif;
}

#app-shell,
#app-shell * {
  font-family: var(--wb-font);
}

#app-shell:not(.hidden) {
  color: var(--wb-text);
  background: var(--wb-bg);
}

#app-shell .app-layout {
  display: grid;
  min-height: 100dvh;
  grid-template-columns: var(--wb-sidebar) minmax(0, 1fr);
  background: var(--wb-bg);
}

#app-shell .app-main {
  min-width: 0;
  min-height: 100dvh;
  background: var(--wb-bg);
}

/* Lightweight persistent navigation. */
#app-shell .square-navigation {
  display: flex;
  min-height: 100dvh;
  flex-direction: column;
  padding: 16px 12px;
  color: var(--wb-text-secondary);
  background: #fbfbfc;
  border-right: 1px solid #eeeef1;
  box-shadow: none;
}

#app-shell .square-navigation-header {
  display: flex;
  align-items: center;
  min-height: 40px;
  margin: 2px 4px 19px;
}

#app-shell .square-workspace-switcher {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  gap: 9px;
  padding: 5px 4px;
  border-radius: var(--wb-radius-sm);
}

#app-shell .square-workspace-switcher:hover {
  background: var(--wb-surface-muted);
}

#app-shell .square-workspace-switcher .brand-mark {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  place-items: center;
  border: 0;
  border-radius: 7px;
  color: #fff;
  background: var(--wb-purple);
  font-size: 12px;
  font-weight: 700;
}

#app-shell .square-workspace-switcher-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

#app-shell .square-workspace-switcher-copy strong {
  overflow: hidden;
  color: var(--wb-text);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#app-shell .square-workspace-switcher-copy small {
  color: var(--wb-text-secondary);
  font-size: 11px;
  line-height: 1.1;
}

#app-shell .square-workspace-switcher-chevron {
  display: grid;
  width: 16px;
  height: 16px;
  margin-left: auto;
  place-items: center;
  color: var(--wb-text-muted);
}

#app-shell .square-workspace-switcher-chevron .ui-icon {
  width: 14px;
  height: 14px;
}

#app-shell .square-navigation-list {
  display: grid;
  gap: 24px;
  padding: 0;
}

#app-shell .square-navigation-section {
  display: grid;
  gap: 3px;
}

#app-shell .square-navigation-section-label {
  padding: 0 9px 6px;
  color: #b4b3ba;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  line-height: 1;
  text-transform: uppercase;
}

#app-shell .square-navigation-item {
  display: flex;
  width: 100%;
  min-width: 0;
  height: 36px;
  align-items: center;
  gap: 9px;
  padding: 0 9px;
  border: 0;
  border-radius: 7px;
  color: #77767e;
  background: transparent;
  box-shadow: none;
  font-size: 13px;
  font-weight: 520;
  text-align: left;
}

#app-shell .square-navigation-item .ui-icon {
  width: 16px;
  height: 16px;
  color: currentcolor;
  stroke-width: 1.8;
}

#app-shell .square-navigation-item:hover {
  color: #47464d;
  background: #f4f4f6;
}

#app-shell .square-navigation-item.active,
#app-shell .square-navigation-item[aria-current="page"] {
  color: #6549d8;
  background: #f3f1ff;
  font-weight: 560;
}

#app-shell .square-navigation-item.active .ui-icon,
#app-shell .square-navigation-item[aria-current="page"] .ui-icon {
  color: var(--wb-purple);
}

#app-shell .square-navigation-status {
  margin-top: auto;
  padding: 18px 5px 2px;
  border-top: 0;
}

#app-shell .square-navigation-status-row {
  display: grid;
  gap: 5px;
}

#app-shell .square-status-line {
  display: flex;
  width: 100%;
  min-height: 20px;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--wb-text-muted);
  background: transparent;
  box-shadow: none;
  font-size: 11px;
  text-align: left;
}

#app-shell .square-status-line > .ui-icon {
  display: none;
}

#app-shell .square-status-line .license-dot,
#app-shell .square-status-line .health-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 999px;
  background: var(--wb-line-strong);
}

#app-shell .square-status-line[data-state="connected"] .health-dot,
#app-shell .square-status-line[data-state="active"] .health-dot,
#app-shell .square-status-line[data-state="ready"] .license-dot,
#app-shell .square-status-line[data-state="online"] .license-dot {
  background: var(--wb-green);
}

#app-shell .square-status-line[data-state="checking"] .health-dot,
#app-shell .square-status-line[data-state="checking"] .license-dot,
#app-shell .square-status-line[data-state="warning"] .license-dot {
  background: var(--wb-amber);
}

#app-shell .square-status-line[data-state="failed"] .health-dot,
#app-shell .square-status-line[data-state="error"] .license-dot,
#app-shell .square-status-line[data-state="offline"] .license-dot {
  background: var(--wb-red);
}

/* The global bar is intentionally limited to account and synchronization context. */
#app-shell .square-page-bar {
  position: sticky;
  z-index: 50;
  top: 0;
  display: flex;
  min-width: 0;
  height: var(--wb-header);
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 20px;
  background: rgb(255 255 255 / 94%);
  border-bottom: 0;
  backdrop-filter: blur(14px);
  box-shadow: none;
}

#app-shell .square-page-bar-title,
#app-shell .square-page-bar-controls {
  display: flex;
  min-width: 0;
  align-items: center;
}

#app-shell .square-page-bar-title {
  gap: 9px;
  align-items: center;
}

#app-shell .square-page-bar-icon {
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  place-items: center;
  border-radius: 7px;
  color: #fff;
  background: var(--wb-purple);
}

#app-shell .square-page-bar-icon .ui-icon {
  width: 15px;
  height: 15px;
}

#app-shell .square-page-bar-title > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

#app-shell .square-page-bar-title h1 {
  margin: 0;
  color: var(--wb-text);
  font-size: 16px;
  font-weight: 620;
  letter-spacing: -.018em;
  line-height: 1.15;
  white-space: nowrap;
}

#app-shell .square-page-bar-title span:last-child {
  overflow: hidden;
  color: var(--wb-text-secondary);
  font-size: 11px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#app-shell .square-page-bar-controls {
  justify-content: flex-end;
  gap: 8px;
  white-space: nowrap;
}

#app-shell .square-device-control {
  display: flex;
  width: clamp(156px, 12vw, 208px);
  height: 34px;
  align-items: center;
}

#app-shell .square-device-control select,
.workspace-v6 select,
.workspace-v6 input:not([type="checkbox"]),
.workspace-v6 textarea {
  border: 1px solid var(--wb-line);
  border-radius: var(--wb-radius-sm);
  color: var(--wb-text);
  background-color: var(--wb-control);
  box-shadow: none;
  font-size: 13px;
  outline: none;
}

#app-shell .square-device-control select {
  width: 100%;
  height: 34px;
  padding: 0 27px 0 9px;
  appearance: none;
  color: var(--wb-text-secondary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m3 4.5 3 3 3-3' fill='none' stroke='%2371717a' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.4'/%3E%3C/svg%3E");
  background-position: right 9px center;
  background-repeat: no-repeat;
  background-size: 13px;
  font-size: 12px;
}

#app-shell .square-device-control select:hover,
.workspace-v6 select:hover,
.workspace-v6 input:not([type="checkbox"]):hover,
.workspace-v6 textarea:hover {
  border-color: var(--wb-line-strong);
  background-color: var(--wb-control-hover);
}

#app-shell .square-device-control select:focus,
.workspace-v6 select:focus,
.workspace-v6 input:not([type="checkbox"]):focus,
.workspace-v6 textarea:focus {
  border-color: var(--wb-purple);
  background-color: var(--wb-surface);
  box-shadow: 0 0 0 3px rgb(114 86 233 / 13%);
}

#app-shell #sync-products,
.workspace-v6 #apply-draft {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 11px;
  border: 0;
  border-radius: var(--wb-radius-sm);
  color: #fff;
  background: #27272a;
  box-shadow: none;
  font-size: 12px;
  font-weight: 600;
}

#app-shell #sync-products:hover,
.workspace-v6 #apply-draft:hover {
  background: #18181b;
}

#app-shell #sync-products:focus-visible,
.workspace-v6 #apply-draft:focus-visible {
  outline: 3px solid rgb(109 61 245 / 24%);
  outline-offset: 2px;
}

#app-shell .square-page-bar button:disabled,
.workspace-v6 button:disabled,
.workspace-v6 select:disabled,
.workspace-v6 input:disabled,
.workspace-v6 textarea:disabled {
  border-color: #ededf1;
  color: #b9b8c0;
  background: var(--wb-control-disabled);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 1;
}

#app-shell .square-sync-state .sync-strip {
  min-height: 30px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid var(--wb-line);
  border-radius: 999px;
  background: #fafafc;
}

#app-shell .square-sync-state {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
}

#app-shell .square-sync-state .sync-strip {
  display: flex;
  align-items: center;
  gap: 5px;
}

#app-shell .square-sync-state .sync-status-dot {
  display: none;
}

#app-shell .square-sync-state .status-badge,
#app-shell .square-sync-state .state-chip {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  color: var(--wb-text-secondary);
  background: transparent;
  font-size: 11px;
  font-weight: 560;
}

#app-shell .square-sync-state .status-badge .ui-icon,
#app-shell .square-sync-state .state-chip .ui-icon {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
}

#app-shell .square-sync-state .sync-strip[data-state="succeeded"] {
  border-color: #d6ebdd;
  background: #f2fbf5;
}

#app-shell .square-sync-state .sync-strip[data-state="succeeded"] .state-chip {
  color: #237343;
}

#app-shell .square-sync-state .sync-strip[data-state="failed"] {
  border-color: #f0d6d4;
  background: #fff7f6;
}

#app-shell .square-sync-state .sync-strip[data-state="failed"] .state-chip {
  color: #b42318;
}

#app-shell .square-sync-state .sync-detail-inline {
  display: none;
}

#app-shell .square-page-bar-icon-button {
  display: grid;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--wb-line);
  border-radius: var(--wb-radius-sm);
  color: var(--wb-text-secondary);
  background: var(--wb-control);
  box-shadow: none;
}

#app-shell .square-page-bar-icon-button:hover {
  color: var(--wb-text);
  border-color: var(--wb-line-strong);
  background: var(--wb-control-hover);
}

#app-shell .square-page-bar-icon-button .ui-icon {
  width: 16px;
  height: 16px;
}

#app-shell .square-account-menu {
  position: relative;
}

#app-shell .square-account-menu summary {
  display: flex;
  min-width: 32px;
  height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border-radius: var(--wb-radius-sm);
  cursor: pointer;
  list-style: none;
}

#app-shell .square-account-menu summary::-webkit-details-marker {
  display: none;
}

#app-shell .square-account-menu summary:hover {
  background: var(--wb-surface-muted);
}

#app-shell .square-account-menu .account-menu-avatar {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 50%;
  color: #5d31dc;
  background: var(--wb-purple-soft);
  font-size: 11px;
  font-weight: 700;
}

#app-shell .square-account-menu .account-identity,
#app-shell .square-account-menu .account-menu-chevron {
  display: none;
}

#app-shell .square-account-menu .account-menu-popover {
  position: absolute;
  z-index: 90;
  top: calc(100% + 7px);
  right: 0;
  display: grid;
  width: 196px;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--wb-line);
  border-radius: var(--wb-radius);
  background: var(--wb-surface);
  box-shadow: var(--wb-shadow-popover);
}

#app-shell .square-account-menu:not([open]) .account-menu-popover {
  display: none;
}

#app-shell .square-account-menu .account-menu-check,
#app-shell .square-account-menu .account-menu-item {
  display: flex;
  min-height: 32px;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  border: 0;
  border-radius: 5px;
  color: var(--wb-text-secondary);
  background: transparent;
  font-size: 12px;
  text-align: left;
}

#app-shell .square-account-menu .account-menu-check:hover,
#app-shell .square-account-menu .account-menu-item:hover {
  color: var(--wb-text);
  background: var(--wb-surface-muted);
}

/* Workspace is an app surface, not a page-sized card. */
#app-shell[data-active-view="workspace"] {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}

#app-shell[data-active-view="workspace"] .app-layout {
  height: 100%;
}

#app-shell[data-active-view="workspace"] .app-main {
  display: grid;
  height: 100%;
  grid-template-rows: var(--wb-header) minmax(0, 1fr);
  overflow: hidden;
}

#app-shell[data-active-view="workspace"] .app-content,
#app-shell[data-active-view="workspace"] .content-grid {
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--wb-bg);
}

#app-shell[data-active-view="workspace"] .content-grid {
  display: block;
}

#app-shell[data-active-view="workspace"] .getting-started-bar {
  display: none !important;
}

.workspace-v6 {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 0;
  flex-direction: column;
  color: var(--wb-text);
  background: var(--wb-bg);
}

.workspace-v6-body {
  position: relative;
  display: grid;
  min-height: 0;
  flex: 1 1 auto;
  grid-template-columns: minmax(0, 1fr) var(--inspector-width, var(--wb-inspector));
  overflow: hidden;
  background: var(--wb-bg);
  transition: grid-template-columns 180ms ease;
}

#app-shell[data-editor-open="false"] .workspace-v6-body {
  grid-template-columns: minmax(0, 1fr) 0;
}

.workspace-v6-leads {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto auto minmax(0, 1fr);
  background: var(--wb-surface);
  border-right: 0;
}

.workspace-v6-filterbar {
  position: relative;
  z-index: 15;
  display: flex;
  min-height: 58px;
  align-items: center;
  gap: 8px;
  padding: 12px 16px 10px;
  background: #fbfbfc;
  border-bottom: 0;
}

.workspace-v6-search-composer {
  display: flex;
  height: 36px;
  min-width: 260px;
  flex: 1 1 340px;
  overflow: hidden;
  border: 1px solid var(--wb-line);
  border-radius: 8px;
  background: var(--wb-control);
}

.workspace-v6-search-composer:focus-within {
  border-color: var(--wb-purple);
  background: var(--wb-surface);
  box-shadow: 0 0 0 3px rgb(114 86 233 / 14%);
}

.workspace-v6-search-mode {
  display: flex;
  width: 100px;
  flex: 0 0 100px;
  border-right: 1px solid var(--wb-line);
  background: #f1f1f4;
}

.workspace-v6-search-mode select {
  width: 100%;
  border: 0;
  border-radius: 0;
  color: var(--wb-text-secondary);
  background: transparent;
  font-size: 12px;
}

.workspace-v6-query-field {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
}

.workspace-v6-query-field .workspace-query-icon {
  display: grid;
  flex: 0 0 auto;
  color: var(--wb-text-muted);
}

.workspace-v6-query-field .workspace-query-icon .ui-icon {
  width: 15px;
  height: 15px;
}

.workspace-v6-query-field input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.workspace-v6-query-field input:focus {
  box-shadow: none;
}

.workspace-v6-query-field input::placeholder {
  color: var(--wb-text-muted);
}

.workspace-v6-search-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}

.workspace-v6-active-filter,
.workspace-v6-change-filter {
  display: flex;
  height: 34px;
  align-items: center;
  border: 1px solid var(--wb-line);
  border-radius: var(--wb-radius-sm);
  color: var(--wb-text-secondary);
  background: var(--wb-control);
  font-size: 12px;
  white-space: nowrap;
}

.workspace-v6-active-filter {
  gap: 6px;
  padding: 0 9px;
}

.workspace-v6-active-filter:hover,
.workspace-v6-change-filter:hover {
  border-color: var(--wb-line-strong);
  background: var(--wb-control-hover);
}

.workspace-v6-active-filter:has(input:checked) {
  border-color: #dcd6ff;
  color: #5f43d4;
  background: var(--wb-purple-soft);
}

.workspace-v6-change-filter select {
  height: 32px;
  min-width: 88px;
  padding: 0 25px 0 8px;
  border: 0;
  color: var(--wb-text-secondary);
  background-color: transparent;
  background-position: right 8px center;
  background-size: 12px;
  font-size: 12px;
}

.workspace-v6 input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
  appearance: none;
  border: 1px solid #c9c9d0;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
}

.workspace-v6 input[type="checkbox"]:checked {
  border-color: var(--wb-purple);
  background: var(--wb-purple);
  box-shadow: inset 0 0 0 2px #fff;
}

.workspace-v6 .product-table input[data-product-check],
.workspace-v6 #select-page {
  position: relative;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
}

.workspace-v6 .product-table input[data-product-check]::before,
.workspace-v6 #select-page::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  box-sizing: border-box;
  border: 1px solid #c9c9d0;
  border-radius: 4px;
  background: #fff;
  content: "";
  transform: translate(-50%, -50%);
}

.workspace-v6 .product-table input[data-product-check]:hover::before,
.workspace-v6 #select-page:hover::before {
  border-color: #aaa9b2;
}

.workspace-v6 .product-table input[data-product-check]:checked,
.workspace-v6 #select-page:checked {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.workspace-v6 .product-table input[data-product-check]:checked::before,
.workspace-v6 #select-page:checked::before {
  border-color: var(--wb-purple);
  background: var(--wb-purple);
  box-shadow: inset 0 0 0 2px #fff;
}

.workspace-v6 .product-table input[data-product-check]:focus-visible,
.workspace-v6 #select-page:focus-visible {
  outline: 0;
}

.workspace-v6 .product-table input[data-product-check]:focus-visible::before,
.workspace-v6 #select-page:focus-visible::before {
  box-shadow: 0 0 0 3px rgb(109 61 245 / 20%);
}

.workspace-v6 .product-table input[data-product-check]:checked:focus-visible::before,
.workspace-v6 #select-page:checked:focus-visible::before {
  box-shadow:
    inset 0 0 0 2px #fff,
    0 0 0 3px rgb(109 61 245 / 20%);
}

.workspace-v6 .button.secondary,
.workspace-v6 .button.compact,
.workspace-v6 .icon-button,
.workspace-v6 .link-button {
  box-shadow: none;
}

.workspace-v6 .button.secondary {
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid var(--wb-line);
  border-radius: var(--wb-radius-sm);
  color: var(--wb-text-secondary);
  background: var(--wb-control);
  font-size: 12px;
  font-weight: 550;
}

.workspace-v6 .button.secondary:hover {
  border-color: var(--wb-line-strong);
  color: var(--wb-text);
  background: var(--wb-control-hover);
}

.workspace-v6 .button.secondary:focus-visible,
.workspace-v6 .link-button:focus-visible,
.workspace-v6 .icon-button:focus-visible,
.workspace-v6 .segmented-control button:focus-visible,
.workspace-v6 .edit-tab:focus-visible {
  outline: 3px solid rgb(109 61 245 / 20%);
  outline-offset: -1px;
}

.workspace-v6 #generate-preview,
.workspace-v6 #create-batch {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 11px;
  border: 1px solid #6244dc;
  border-radius: var(--wb-radius-sm);
  color: #fff;
  background: var(--wb-purple);
  box-shadow: none;
  font-size: 12px;
  font-weight: 600;
}

.workspace-v6 #generate-preview:hover,
.workspace-v6 #create-batch:hover {
  border-color: var(--wb-purple-strong);
  background: var(--wb-purple-strong);
}

.workspace-v6 #generate-preview:focus-visible,
.workspace-v6 #create-batch:focus-visible {
  outline: 3px solid rgb(114 86 233 / 24%);
  outline-offset: 2px;
}

.workspace-v6 #generate-preview:disabled,
.workspace-v6 #create-batch:disabled,
#app-shell #sync-products:disabled,
.workspace-v6 #apply-draft:disabled {
  border-color: #ededf1;
  color: #b9b8c0;
  background: var(--wb-control-disabled);
  box-shadow: none;
}

.workspace-v6:has(#pending-apply-bar:not(.hidden)) #generate-preview {
  border-color: var(--wb-line);
  color: var(--wb-text-secondary);
  background: var(--wb-control);
}

.workspace-v6:has(#pending-apply-bar:not(.hidden)) #generate-preview:hover {
  border-color: var(--wb-line-strong);
  color: var(--wb-text);
  background: var(--wb-control-hover);
}

#app-shell:has(.workspace-v6 #pending-apply-bar:not(.hidden)) #sync-products {
  border: 1px solid var(--wb-line);
  color: var(--wb-text-secondary);
  background: var(--wb-control);
}

#app-shell:has(.workspace-v6 #pending-apply-bar:not(.hidden)) #sync-products:hover {
  border-color: var(--wb-line-strong);
  color: var(--wb-text);
  background: var(--wb-control-hover);
}

.workspace-v6 .button.secondary .ui-icon {
  width: 14px;
  height: 14px;
}

.workspace-v6 .workspace-v6-search-button {
  min-width: 62px;
}

.workspace-v6 .link-button {
  min-height: 30px;
  padding: 0 4px;
  border: 0;
  border-radius: 4px;
  color: var(--wb-text-secondary);
  background: transparent;
  font-size: 12px;
  font-weight: 550;
}

.workspace-v6 .link-button:hover {
  color: var(--wb-purple);
  background: var(--wb-purple-soft);
}

.workspace-v6-filter-popover {
  position: absolute;
  z-index: 60;
  top: calc(100% - 5px);
  right: 16px;
  display: grid;
  width: min(440px, calc(100vw - 48px));
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--wb-line);
  border-radius: 9px;
  background: var(--wb-surface);
  box-shadow: var(--wb-shadow-popover);
}

.workspace-v6-filter-popover.hidden {
  display: none;
}

.workspace-v6-filter-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.workspace-v6-filter-header h2 {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 650;
}

.workspace-v6-filter-header p,
.workspace-v6-filter-popover .product-search-summary {
  margin: 0;
  color: var(--wb-text-secondary);
  font-size: 11px;
  line-height: 1.5;
}

.workspace-v6-filter-popover .icon-button {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 5px;
  color: var(--wb-text-secondary);
  background: transparent;
}

.workspace-v6-filter-popover .icon-button:hover {
  color: var(--wb-text);
  background: var(--wb-surface-muted);
}

.workspace-v6-filter-popover .product-condition-rows {
  display: grid;
  gap: 7px;
}

.workspace-v6-filter-popover .product-condition-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 28px;
  gap: 7px;
  align-items: center;
}

.workspace-v6-filter-popover .product-condition-label {
  color: var(--wb-text-secondary);
  font-size: 11px;
}

.workspace-v6-filter-popover .product-condition-input {
  width: 100%;
  height: 32px;
  padding: 0 8px;
}

.workspace-v6-filter-popover .product-condition-remove {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 5px;
  color: var(--wb-text-muted);
  background: transparent;
}

.workspace-v6-filter-popover .product-condition-remove:hover {
  color: var(--wb-red);
  background: var(--wb-red-soft);
}

.workspace-v6-filter-popover .product-condition-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.workspace-v6-login-strip {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 16px;
  color: var(--wb-text-secondary);
  background: #fffdf9;
  border-bottom: 0;
}

.workspace-v6-login-strip[data-state="connected"] {
  display: none;
}

.workspace-v6-login-strip[data-state="failed"],
.workspace-v6-login-strip[data-state="disconnected"],
.workspace-v6-login-strip[data-state="unavailable"] {
  background: #fffafa;
}

.workspace-v6-login-strip .workspace-login-copy,
.workspace-v6-login-strip .workspace-login-copy > div,
.workspace-v6-login-strip .workspace-login-actions {
  display: flex;
  min-width: 0;
  align-items: center;
}

.workspace-v6-login-strip .workspace-login-copy {
  gap: 7px;
}

.workspace-v6-login-strip .workspace-login-copy > div {
  gap: 5px;
}

.workspace-v6-login-strip .workspace-login-copy strong {
  color: var(--wb-text-secondary);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.workspace-v6-login-strip .workspace-login-copy span:not(.workspace-login-indicator) {
  overflow: hidden;
  color: var(--wb-text-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-v6-login-strip .workspace-login-indicator {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: var(--wb-amber);
}

.workspace-v6-login-strip[data-state="connected"] .workspace-login-indicator {
  background: var(--wb-green);
}

.workspace-v6-login-strip[data-state="failed"] .workspace-login-indicator,
.workspace-v6-login-strip[data-state="disconnected"] .workspace-login-indicator,
.workspace-v6-login-strip[data-state="unavailable"] .workspace-login-indicator {
  background: var(--wb-red);
}

.workspace-v6-login-strip .workspace-login-actions {
  gap: 5px;
}

.workspace-v6-login-strip .workspace-login-actions .button {
  min-height: 26px;
  padding: 0 7px;
  border: 0;
  color: var(--wb-text-secondary);
  background: transparent;
  font-size: 11px;
}

.workspace-v6-login-strip .workspace-login-actions .button.primary {
  color: var(--wb-purple);
}

.workspace-v6-table-area {
  display: grid;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--wb-surface);
}

.workspace-v6-table-head {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px 8px;
  background: var(--wb-surface);
  border-bottom: 0;
}

.workspace-v6-table-title,
.workspace-v6-selection-controls {
  display: flex;
  min-width: 0;
  align-items: center;
}

.workspace-v6-table-title {
  gap: 9px;
}

.workspace-v6-table-title h2 {
  margin: 0;
  color: var(--wb-text);
  font-size: 13px;
  font-weight: 580;
}

.workspace-v6-table-title > span,
.workspace-v6-selection-controls #selection-count {
  color: var(--wb-text-secondary);
  font-size: 11px;
  white-space: nowrap;
}

.workspace-v6-table-title .workspace-v6-active-product {
  max-width: min(280px, 25vw);
  overflow: hidden;
  padding-left: 0;
  border-left: 0;
  color: var(--wb-text-muted);
  text-overflow: ellipsis;
}

.workspace-v6-selection-controls {
  gap: 8px;
}

.workspace-v6-selection-controls .check-row {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--wb-text-secondary);
  font-size: 11px;
  white-space: nowrap;
}

.workspace-v6-selection-controls .table-editor-toggle {
  min-width: 74px;
}

.workspace-v6 .product-panel {
  display: grid;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) 44px;
  border: 0;
  border-radius: 0;
  background: var(--wb-surface);
}

.workspace-v6 .table-wrap {
  min-height: 0;
  overflow: auto;
  background: var(--wb-surface);
}

.workspace-v6 .product-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
  background: var(--wb-surface);
}

.workspace-v6 .product-table th,
.workspace-v6 .product-table td {
  border-bottom: 0;
}

.workspace-v6 .product-table th {
  position: sticky;
  z-index: 3;
  top: 0;
  height: 38px;
  padding: 0 10px;
  color: #96959e;
  background: var(--wb-surface);
  font-size: 10px;
  font-weight: 560;
  letter-spacing: .025em;
  text-align: left;
}

.workspace-v6 .product-table th:nth-child(1) { width: 42px; }
.workspace-v6 .product-table th:nth-child(2) { width: 46%; }
.workspace-v6 .product-table th:nth-child(3) { width: 15%; }
.workspace-v6 .product-table th:nth-child(4) { width: 12%; }
.workspace-v6 .product-table th:nth-child(5) { width: 12%; }
.workspace-v6 .product-table th:nth-child(6) { width: 15%; }

.workspace-v6 .product-table tbody tr {
  height: 68px;
  color: var(--wb-text);
  background: var(--wb-surface);
  cursor: pointer;
  outline: 0;
  transition: background-color 140ms ease, box-shadow 140ms ease;
}

.workspace-v6 .product-table tbody tr:hover {
  background: #f8f8fa;
}

.workspace-v6 .product-table tbody tr:focus-visible {
  outline: 2px solid rgb(109 61 245 / 35%);
  outline-offset: -2px;
}

.workspace-v6 .product-table tbody tr.square-record-current {
  background: #f4f1ff;
  box-shadow: inset 2px 0 0 #8064ec;
}

.workspace-v6 .product-table tbody tr.square-record-selected:not(.square-record-current) {
  background: #faf9ff;
}

.workspace-v6 .product-table tbody tr.square-record-editing:not(.square-record-current),
.workspace-v6 .product-table tbody tr.square-record-pending:not(.square-record-current) {
  background: var(--wb-surface);
}

.workspace-v6 .product-table td {
  overflow: hidden;
  padding: 9px 10px;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.workspace-v6 .product-table .check-cell {
  padding-right: 5px;
  padding-left: 5px;
}

.workspace-v6 .square-product-cell {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.workspace-v6 .product-thumb {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  overflow: hidden;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: #f5f5f7;
}

.workspace-v6 .product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.workspace-v6 .product-thumb-placeholder {
  display: grid;
  place-items: center;
  color: var(--wb-text-muted);
}

.workspace-v6 .product-thumb-placeholder .ui-icon {
  width: 16px;
  height: 16px;
}

.workspace-v6 .product-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.workspace-v6 .product-title-line {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 5px;
}

.workspace-v6 .product-copy strong {
  display: -webkit-box;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  color: var(--wb-text);
  font-size: 13px;
  font-weight: 580;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.workspace-v6 .product-detail-trigger {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  margin-top: -5px;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #aaa9b1;
  background: transparent;
  opacity: .62;
}

.workspace-v6 .product-detail-trigger:hover {
  border-color: var(--wb-line);
  color: var(--wb-text);
  background: #f4f4f7;
  opacity: 1;
}

.workspace-v6 .product-detail-trigger:focus-visible {
  border-color: #8f72f4;
  outline: 2px solid rgb(109 61 245 / 18%);
  color: var(--wb-purple);
  background: #f7f4ff;
  opacity: 1;
}

.workspace-v6 .product-detail-trigger .ui-icon {
  width: 14px;
  height: 14px;
}

.workspace-v6 .product-meta {
  display: flex;
  overflow: hidden;
  align-items: center;
  gap: 5px;
  color: #9897a1;
  font-family: var(--wb-font);
  font-size: 12px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-v6 .product-meta b {
  font-weight: 500;
}

.workspace-v6 .product-meta i {
  font-style: normal;
}

.workspace-v6 .product-price-cell,
.workspace-v6 .product-status-cell,
.workspace-v6 .square-record-change-cell,
.workspace-v6 .product-time-cell {
  color: var(--wb-text-secondary);
}

.workspace-v6 .product-price-cell strong {
  display: block;
  overflow: hidden;
  color: var(--wb-text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-v6 .product-table td small,
.workspace-v6 .product-status-detail {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: var(--wb-text-muted);
  font-size: 11px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-v6 .product-price-cell small {
  text-align: right;
}

.workspace-v6 .square-table-status {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 5px;
  color: var(--wb-text-secondary);
  font-size: 12px;
  line-height: 1.15;
  white-space: nowrap;
}

.workspace-v6 .square-table-status i {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: var(--wb-line-strong);
}

.workspace-v6 .square-table-status.is-active i,
.workspace-v6 .square-table-status.change-preview i {
  background: var(--wb-green);
}

.workspace-v6 .square-table-status.is-paused i,
.workspace-v6 .square-table-status.change-draft i {
  background: var(--wb-amber);
}

.workspace-v6 .square-table-status.change-selected i {
  background: var(--wb-purple);
}

.workspace-v6 .pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  color: var(--wb-text-secondary);
  background: #fbfbfc;
  font-size: 11px;
}

.workspace-v6 .pagination .button-row {
  display: flex;
  gap: 5px;
}

.workspace-v6 .pagination .button {
  min-height: 28px;
  padding: 0 8px;
}

/* Persistent inspector. It is a grid column on desktop, never a drawer. */
.editor-resize-handle {
  position: absolute;
  z-index: 30;
  top: 0;
  right: calc(var(--inspector-width, var(--wb-inspector)) - 4px);
  bottom: 0;
  width: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: col-resize;
}

.editor-resize-handle::after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 3px;
  width: 1px;
  background: transparent;
  content: "";
}

.editor-resize-handle:hover::after,
body[data-resizing-inspector="true"] .editor-resize-handle::after {
  background: #b8a4ff;
}

#app-shell[data-editor-open="false"] .editor-resize-handle {
  display: none;
}

.workspace-v6-detail {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto auto minmax(0, 1fr);
  background: #fff;
  border-left: 1px solid #ececf0;
  opacity: 1;
  transform: translateX(0);
  transition: opacity 180ms ease, transform 180ms ease;
}

#app-shell[data-editor-open="false"] .workspace-v6-detail {
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateX(8px);
}

.workspace-v6-detail-header {
  display: flex;
  min-height: 68px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px 10px;
  border-bottom: 0;
}

.workspace-v6-detail-heading {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.workspace-v6-detail-eyebrow {
  color: var(--wb-purple);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  line-height: 1;
  text-transform: uppercase;
}

.workspace-v6-detail-heading h2 {
  margin: 0;
  color: var(--wb-text);
  font-size: 16px;
  font-weight: 610;
  letter-spacing: -.015em;
  line-height: 1.2;
}

.workspace-v6-detail-heading #inspector-active-product {
  overflow: hidden;
  color: var(--wb-text-secondary);
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-v6-inspector-scope {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  color: var(--wb-text-secondary);
  font-size: 11px;
  line-height: 1.25;
}

.workspace-v6-inspector-scope strong {
  overflow: hidden;
  color: #6450bd;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-v6-inspector-scope span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-v6-inspector-scope span::before {
  margin-right: 6px;
  color: #c4c2ca;
  content: "·";
}

.workspace-v6-detail-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 3px;
}

.workspace-v6-detail-header .icon-button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 5px;
  color: var(--wb-text-secondary);
  background: transparent;
}

.workspace-v6-detail-header .icon-button:hover {
  color: var(--wb-text);
  background: var(--wb-surface-muted);
}

.workspace-v6-detail-header .icon-button .ui-icon {
  width: 15px;
  height: 15px;
}

.workspace-v6-edit-tabs {
  position: relative;
  display: flex;
  min-width: 0;
  overflow-x: auto;
  padding: 0 10px;
  background: var(--wb-surface);
  border-bottom: 0;
  scrollbar-width: none;
  scroll-padding-right: 28px;
}

.workspace-v6-edit-tabs::-webkit-scrollbar {
  display: none;
}

.workspace-v6-edit-tabs[data-overflow]::after {
  position: sticky;
  right: 0;
  width: 24px;
  flex: 0 0 24px;
  align-self: stretch;
  margin-left: -24px;
  pointer-events: none;
  background: linear-gradient(90deg, rgb(255 255 255 / 0%), var(--wb-surface) 78%);
  content: "";
}

.workspace-v6-edit-tabs .tab-active-indicator {
  display: none;
}

.workspace-v6-edit-tabs .edit-tab {
  position: relative;
  height: 40px;
  flex: 0 0 auto;
  padding: 0 12px;
  border: 0;
  color: var(--wb-text-secondary);
  background: transparent;
  font-size: 12px;
  font-weight: 520;
  white-space: nowrap;
}

.workspace-v6-edit-tabs .edit-tab:focus {
  outline: 0;
}

.workspace-v6-edit-tabs .edit-tab:focus-visible {
  outline: 2px solid rgb(109 61 245 / 34%);
  outline-offset: -3px;
  border-radius: 5px;
}

.workspace-v6-edit-tabs .edit-tab:hover {
  color: var(--wb-text);
  background: #f8f8fa;
}

.workspace-v6-edit-tabs .edit-tab.active {
  color: var(--wb-purple);
  font-weight: 650;
}

.workspace-v6-edit-tabs .edit-tab.active::after {
  position: absolute;
  right: 9px;
  bottom: 0;
  left: 9px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--wb-purple);
  content: "";
}

.workspace-v6-rule-panel {
  display: grid;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) auto;
  border: 0;
  border-radius: 0;
  background: var(--wb-surface);
}

.workspace-v6-rule-scroll {
  min-height: 0;
  overflow: auto;
  padding: 14px 20px 24px;
  overscroll-behavior: contain;
}

.workspace-v6-rule-intro {
  margin-bottom: 14px;
}

.workspace-v6-rule-intro h3 {
  margin: 0 0 5px;
  color: var(--wb-text);
  font-size: 15px;
  font-weight: 610;
}

.workspace-v6-rule-intro .help {
  margin: 0;
  color: var(--wb-text-secondary);
  font-size: 12px;
  line-height: 1.4;
}

.workspace-v6 .form-grid.one-column {
  display: grid;
  gap: 18px;
}

.workspace-v6-field-group {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.workspace-v6-field-group-heading {
  display: grid;
  gap: 3px;
  margin-bottom: 9px;
}

.workspace-v6-field-group-heading .rule-field-group-title {
  color: #504f57;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .02em;
}

.workspace-v6-field-group-heading > span:last-child {
  color: var(--wb-text-secondary);
  font-size: 11px;
}

.workspace-v6 .rule-field-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 11px;
}

.workspace-v6 #text-rule-fields .workspace-v6-field-group .rule-field-pair {
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.workspace-v6 .field {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.workspace-v6 .field > span {
  color: #5f5e66;
  font-size: 11px;
  font-weight: 580;
  line-height: 1.2;
}

.workspace-v6 .field select,
.workspace-v6 .field input {
  width: 100%;
  height: 38px;
  padding: 0 29px 0 10px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m3 4.5 3 3 3-3' fill='none' stroke='%2371717a' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.4'/%3E%3C/svg%3E");
  background-position: right 9px center;
  background-repeat: no-repeat;
  background-size: 12px;
}

.workspace-v6 .field input:not([type="number"]):not([type="url"]) {
  background-image: none;
}

.workspace-v6 .field input[type="number"],
.workspace-v6 .field input[type="url"] {
  padding-right: 9px;
  background-image: none;
}

.workspace-v6 .field textarea {
  width: 100%;
  min-height: 128px;
  padding: 11px 12px;
  resize: vertical;
  line-height: 1.5;
}

.workspace-v6 .field .native-control {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
}

.workspace-v6 .segmented-control {
  display: grid;
  min-height: 42px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--wb-line);
  border-radius: 8px;
  background: #fafafd;
}

.workspace-v6 .segmented-control-position {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.workspace-v6 .segmented-control button {
  min-width: 0;
  min-height: 34px;
  padding: 0 6px;
  border: 0;
  border-right: 0;
  border-radius: 5px;
  color: var(--wb-text-secondary);
  background: transparent;
  font-size: 11px;
  font-weight: 550;
  white-space: nowrap;
}

.workspace-v6 .segmented-control button:last-child {
  border-right: 0;
}

.workspace-v6 .segmented-control button:hover {
  color: var(--wb-text);
  background: #f1f0f4;
}

.workspace-v6 .segmented-control button.active {
  color: #6041d4;
  background: var(--wb-purple-soft);
  font-weight: 650;
  box-shadow: inset 0 0 0 1px #ded8ff;
}

.workspace-v6 .field-counter {
  color: var(--wb-text-muted);
  font-size: 11px;
  text-align: right;
}

.workspace-v6 .field-counter.hidden {
  display: none;
}

.workspace-v6-rule-footer {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 20px;
  background: #fcfcfd;
  border-top: 0;
  box-shadow: 0 -10px 24px rgb(32 31 38 / 4%);
}

.workspace-v6-rule-footer .message,
.inspector-preview .message {
  min-width: 0;
  flex: 1 1 auto;
  margin: 0;
  color: var(--wb-text-secondary);
  font-size: 11px;
  line-height: 1.35;
}

.workspace-v6-rule-footer .message[data-state="error"],
.inspector-preview .message[data-state="error"] {
  color: var(--wb-red);
}

.workspace-v6-rule-footer .rule-footer-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.workspace-v6-rule-footer .rule-footer-actions #generate-preview {
  min-width: 132px;
}

/* Inline preview keeps the before/after review in the editing context. */
.inspector-preview {
  display: grid;
  gap: 14px;
  margin-top: 30px;
  padding-top: 0;
  border-top: 0;
}

/* Read-only product snapshot dialog. */
.product-detail-dialog {
  width: min(1040px, 90vw);
  max-width: 1040px;
  height: min(86dvh, 900px);
  max-height: 86dvh;
  padding: 0;
  overflow: hidden;
  border: 1px solid #dfdfe5;
  border-radius: 12px;
  color: var(--wb-text);
  background: #fff;
  box-shadow: 0 24px 70px rgb(24 23 30 / 22%);
}

.product-detail-dialog::backdrop {
  background: rgb(25 24 30 / 38%);
}

.product-detail-shell {
  position: relative;
  display: grid;
  height: 100%;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr) 52px;
  background: #fff;
}

.product-detail-header {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px 15px;
  border-bottom: 1px solid #eeeeF2;
}

.product-detail-heading {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.product-detail-eyebrow {
  color: var(--wb-purple);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.product-detail-heading h2,
.product-detail-heading p {
  margin: 0;
}

.product-detail-heading h2 {
  font-size: 17px;
  font-weight: 640;
  letter-spacing: -.015em;
}

.product-detail-heading p {
  display: -webkit-box;
  max-width: 780px;
  overflow: hidden;
  color: var(--wb-text-secondary);
  font-size: 13px;
  font-weight: 550;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 2px;
  color: var(--wb-text-muted);
  font-size: 11px;
}

.product-detail-meta span + span {
  position: relative;
}

.product-detail-meta span + span::before {
  position: absolute;
  left: -8px;
  color: #d0cfd5;
  content: "·";
}

.product-detail-close {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--wb-text-secondary);
  background: transparent;
}

.product-detail-close:hover {
  border-color: var(--wb-line);
  color: var(--wb-text);
  background: #f5f5f7;
}

.product-detail-loading {
  display: grid;
  min-height: 0;
  grid-template-columns: 260px minmax(0, 1fr);
}

.product-detail-overview-skeleton,
.product-detail-content-skeleton {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 22px;
}

.product-detail-overview-skeleton {
  border-right: 1px solid #eeeeF2;
}

.product-detail-image-skeleton {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 9px;
}

.product-detail-block-skeleton {
  width: 100%;
  height: 300px;
  border-radius: 9px;
}

.product-detail-error {
  display: grid;
  min-height: 0;
  place-content: center;
  justify-items: center;
  padding: 28px;
  text-align: center;
}

.product-detail-error > .ui-icon {
  width: 28px;
  height: 28px;
  margin-bottom: 10px;
  color: var(--wb-red);
}

.product-detail-error strong {
  font-size: 14px;
}

.product-detail-error p {
  max-width: 460px;
  margin: 6px 0 16px;
  color: var(--wb-text-secondary);
  font-size: 12px;
}

.product-detail-body {
  display: grid;
  min-height: 0;
  grid-template-columns: 260px minmax(0, 1fr);
  overflow: hidden;
}

.product-detail-overview {
  min-height: 0;
  overflow: auto;
  padding: 18px;
  border-right: 1px solid #eeeeF2;
  background: #fbfbfc;
  overscroll-behavior: contain;
}

.product-detail-primary-image {
  position: relative;
  display: grid;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  place-items: center;
  padding: 0;
  border: 1px solid #e7e7eb;
  border-radius: 9px;
  color: var(--wb-text-muted);
  background: #f3f3f5;
}

.product-detail-primary-image img,
.product-detail-thumbnail img,
.product-detail-image-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.product-detail-primary-image.is-missing {
  gap: 7px;
}

.product-detail-primary-image.is-missing .ui-icon {
  width: 24px;
  height: 24px;
}

.product-detail-primary-image.is-missing small {
  font-size: 11px;
}

.product-detail-thumbnails {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.product-detail-thumbnail {
  position: relative;
  display: grid;
  aspect-ratio: 1;
  overflow: hidden;
  place-items: center;
  padding: 0;
  border: 1px solid #e5e5e9;
  border-radius: 6px;
  color: var(--wb-text-muted);
  background: #f5f5f7;
}

.product-detail-thumbnail:hover,
.product-detail-primary-image:not(:disabled):hover {
  border-color: #ad9aef;
}

.product-detail-thumbnail .ui-icon {
  width: 15px;
  height: 15px;
}

.product-detail-image-fallback {
  display: none;
}

.image-failed > img {
  display: none;
}

.image-failed > .product-detail-image-fallback {
  display: grid;
  place-items: center;
  gap: 4px;
  color: var(--wb-text-muted);
  font-size: 10px;
}

.product-detail-overview-list {
  display: grid;
  gap: 0;
  margin: 18px 0 0;
}

.product-detail-overview-list > div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
  padding: 7px 0;
}

.product-detail-overview-list dt,
.product-detail-overview-list dd {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
}

.product-detail-overview-list dt {
  color: var(--wb-text-muted);
}

.product-detail-overview-list dd {
  overflow-wrap: anywhere;
  color: var(--wb-text-secondary);
  font-weight: 540;
}

.product-detail-main {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: 45px minmax(0, 1fr);
}

.product-detail-tabs {
  display: flex;
  min-width: 0;
  overflow-x: auto;
  padding: 0 13px;
  border-bottom: 1px solid #eeeeF2;
  scrollbar-width: none;
}

.product-detail-tabs::-webkit-scrollbar {
  display: none;
}

.product-detail-tab {
  position: relative;
  height: 44px;
  flex: 0 0 auto;
  padding: 0 11px;
  border: 0;
  color: var(--wb-text-secondary);
  background: transparent;
  font-size: 12px;
  font-weight: 520;
  white-space: nowrap;
}

.product-detail-tab:hover {
  color: var(--wb-text);
  background: #f8f8fa;
}

.product-detail-tab.active {
  color: var(--wb-purple);
  font-weight: 640;
}

.product-detail-tab.active::after {
  position: absolute;
  right: 9px;
  bottom: 0;
  left: 9px;
  height: 2px;
  background: var(--wb-purple);
  content: "";
}

.product-detail-tab:focus {
  outline: 0;
}

.product-detail-tab:focus-visible {
  outline: 2px solid rgb(109 61 245 / 34%);
  outline-offset: -3px;
  border-radius: 5px;
}

.product-detail-panel {
  min-height: 0;
  overflow: auto;
  padding: 20px 22px 28px;
  outline: none;
  overscroll-behavior: contain;
}

.product-detail-section {
  min-width: 0;
}

.product-detail-section > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.product-detail-section > header span,
.product-detail-section > header h3 {
  display: block;
  margin: 0;
}

.product-detail-section > header span {
  color: var(--wb-text-muted);
  font-size: 10px;
}

.product-detail-section > header h3 {
  margin-top: 3px;
  font-size: 14px;
  font-weight: 620;
}

.product-detail-section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.product-detail-view-toggle {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--wb-line);
  border-radius: 7px;
  background: #f7f7f9;
}

.product-detail-view-toggle button {
  height: 28px;
  padding: 0 9px;
  border: 0;
  border-radius: 5px;
  color: var(--wb-text-secondary);
  background: transparent;
  font-size: 11px;
}

.product-detail-view-toggle button.active {
  color: var(--wb-purple);
  background: #fff;
  box-shadow: 0 1px 2px rgb(25 24 30 / 8%);
}

.product-detail-definition-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border-radius: 8px;
  background: #ececf0;
}

.product-detail-definition-grid > div {
  min-width: 0;
  padding: 12px 13px;
  background: #fafafd;
}

.product-detail-definition-grid dt,
.product-detail-definition-grid dd {
  margin: 0;
}

.product-detail-definition-grid dt {
  color: var(--wb-text-muted);
  font-size: 10px;
}

.product-detail-definition-grid dd {
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: var(--wb-text-secondary);
  font-size: 12px;
  font-weight: 540;
  line-height: 1.45;
}

.product-detail-variants {
  margin-top: 22px;
}

.product-detail-variants h4 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 620;
}

.product-detail-variant-table {
  display: grid;
  overflow: hidden;
  border: 1px solid #ececf0;
  border-radius: 8px;
}

.product-detail-variant-table > div {
  display: grid;
  grid-template-columns: minmax(100px, .8fr) minmax(120px, 1.2fr) auto;
  gap: 12px;
  padding: 9px 11px;
  border-bottom: 1px solid #eeeeF2;
  font-size: 11px;
}

.product-detail-variant-table > div:last-child {
  border-bottom: 0;
}

.product-detail-variant-table span {
  color: var(--wb-text-secondary);
}

.product-detail-variant-table b {
  font-weight: 600;
}

.product-detail-plain-text,
.product-detail-source {
  min-height: 220px;
  margin: 0;
  padding: 15px;
  overflow: auto;
  border: 1px solid #e7e7eb;
  border-radius: 8px;
  color: var(--wb-text);
  background: #fbfbfc;
  font: 12px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.product-detail-html-preview {
  width: 100%;
  min-height: 360px;
  border: 1px solid #e7e7eb;
  border-radius: 8px;
  background: #fff;
}

.product-detail-empty {
  display: grid;
  min-height: 320px;
  place-content: center;
  justify-items: center;
  color: var(--wb-text-secondary);
  text-align: center;
}

.product-detail-empty > .ui-icon {
  width: 28px;
  height: 28px;
  margin-bottom: 10px;
  color: #aaa9b1;
}

.product-detail-empty strong {
  font-size: 13px;
}

.product-detail-empty p {
  margin: 5px 0 0;
  color: var(--wb-text-muted);
  font-size: 11px;
}

.product-detail-image-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.product-detail-image-card {
  position: relative;
  display: grid;
  min-width: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid #e7e7eb;
  border-radius: 8px;
  color: var(--wb-text);
  background: #fafafd;
  text-align: left;
}

.product-detail-image-card img,
.product-detail-image-card > .product-detail-image-fallback,
.product-detail-image-card > .ui-icon {
  width: 100%;
  height: clamp(120px, 15vw, 176px);
  object-fit: contain;
  place-items: center;
  background: #fff;
}

.product-detail-image-card:hover:not(:disabled) {
  border-color: #ad9aef;
}

.product-detail-image-card strong {
  position: absolute;
  top: 7px;
  left: 7px;
  display: grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 5px;
  color: #fff;
  background: rgb(29 28 34 / 72%);
  font-size: 10px;
}

.product-detail-image-card small {
  overflow: hidden;
  padding: 8px 9px;
  color: var(--wb-text-muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-detail-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 20px;
  border-top: 1px solid #eeeeF2;
  color: var(--wb-text-muted);
  background: #fcfcfd;
  font-size: 11px;
}

.product-image-viewer {
  position: absolute;
  z-index: 5;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 36px;
}

.product-image-viewer-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgb(20 19 24 / 82%);
}

.product-image-viewer figure {
  position: relative;
  z-index: 1;
  display: grid;
  max-width: 92%;
  max-height: 92%;
  justify-items: center;
  margin: 0;
}

.product-image-viewer img {
  display: block;
  max-width: 100%;
  max-height: calc(86dvh - 150px);
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
}

.product-image-viewer figcaption {
  max-width: 720px;
  margin-top: 10px;
  overflow: hidden;
  color: #fff;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-image-viewer figure .icon-button {
  position: absolute;
  top: -34px;
  right: -34px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 28%);
  border-radius: 7px;
  color: #fff;
  background: rgb(255 255 255 / 12%);
}

.product-detail-dialog .hidden,
.product-image-viewer.hidden {
  display: none;
}

.inspector-preview.hidden {
  display: none;
}

.inspector-preview-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.inspector-preview-heading > div {
  display: grid;
  gap: 3px;
}

.inspector-preview-heading span {
  color: var(--wb-purple);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  line-height: 1;
  text-transform: uppercase;
}

.inspector-preview-heading strong {
  color: var(--wb-text);
  font-size: 13px;
  font-weight: 650;
}

.inspector-preview .preview-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.inspector-preview .preview-summary article {
  display: grid;
  gap: 3px;
  padding: 10px;
  border-right: 0;
  border-radius: 7px;
  background: #f6f5f8;
}

.inspector-preview .preview-summary article:last-child {
  border-right: 0;
}

.inspector-preview .preview-summary span {
  color: var(--wb-text-secondary);
  font-size: 10px;
}

.inspector-preview .preview-summary strong {
  color: var(--wb-text);
  font-size: 16px;
  font-weight: 650;
}

.inspector-preview-list {
  display: grid;
  gap: 10px;
}

.inspector-preview .preview-item {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 0;
  border-radius: 8px;
  background: #f8f8fa;
}

.inspector-preview .preview-item.blocked {
  background: #fffafa;
}

.inspector-preview .preview-item.risk-blocked {
  background: #fffafa;
}

.inspector-preview .preview-item.risk-warning {
  background: #fff9f0;
}

.inspector-preview .preview-item.risk-unchanged {
  background: #f8f8fa;
}

.inspector-preview .preview-item-heading {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.inspector-preview .preview-item-heading > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.inspector-preview .preview-item-heading strong,
.inspector-preview .preview-item-heading span:not(.state-chip) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inspector-preview .preview-item-heading strong {
  color: var(--wb-text);
  font-size: 12px;
  font-weight: 600;
}

.inspector-preview .preview-item-heading span:not(.state-chip) {
  color: var(--wb-text-muted);
  font-size: 10px;
}

.inspector-preview .state-chip {
  display: inline-flex;
  max-width: 46%;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  padding: 3px 5px;
  border-radius: 4px;
  color: var(--wb-green);
  background: var(--wb-green-soft);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inspector-preview .state-chip.failed {
  color: var(--wb-red);
  background: var(--wb-red-soft);
}

.inspector-preview .state-chip.blocked {
  color: var(--wb-red);
  background: var(--wb-red-soft);
}

.inspector-preview .state-chip.warning {
  color: #a15c00;
  background: #fff0d6;
}

.inspector-preview .state-chip.unchanged {
  color: var(--wb-text-secondary);
  background: #ececf1;
}

.inspector-preview .risk-detail {
  margin: 0;
  color: var(--wb-text-secondary);
  font-size: 11px;
  line-height: 1.5;
}

.inspector-preview .state-chip .ui-icon {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
}

.inspector-preview .diff-grid {
  display: grid;
  gap: 7px;
}

.inspector-preview .diff-before,
.inspector-preview .diff-after {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.inspector-preview .diff-before > span,
.inspector-preview .diff-after > span {
  color: var(--wb-text-muted);
  font-size: 10px;
  font-weight: 600;
}

.inspector-preview .diff-value {
  width: 100%;
  max-height: 116px;
  margin: 0;
  overflow: auto;
  padding: 8px;
  border: 0;
  border-radius: 6px;
  color: var(--wb-text-secondary);
  background: #eeeef2;
  font-family: var(--wb-font);
  font-size: 11px;
  line-height: 1.42;
  white-space: pre-wrap;
  word-break: break-word;
}

.inspector-preview .diff-after.is-changed .diff-value {
  color: #4e2db9;
  background: #f1efff;
}

.inspector-preview textarea.diff-value {
  min-height: 72px;
  resize: vertical;
}

.inspector-preview .draft-save-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px;
  border-left: 2px solid #b9a7ff;
  color: var(--wb-text-secondary);
  background: #faf9ff;
}

.inspector-preview .draft-save-note-icon {
  display: grid;
  flex: 0 0 16px;
  place-items: center;
  color: var(--wb-purple);
}

.inspector-preview .draft-save-note-icon .ui-icon {
  width: 14px;
  height: 14px;
}

.inspector-preview .draft-save-note strong {
  display: block;
  margin-bottom: 2px;
  color: var(--wb-text);
  font-size: 11px;
}

.inspector-preview .draft-save-note p {
  margin: 0;
  font-size: 10px;
  line-height: 1.45;
}

.inspector-preview-actions {
  display: flex;
  justify-content: flex-end;
}

.inspector-preview-actions #create-batch {
  min-width: 116px;
}

/* Contextual actions stay visible without reducing the table until an action exists. */
.workspace-v6-bottom-stack {
  display: grid;
  flex: 0 0 auto;
  background: var(--wb-surface);
}

.workspace-v6-bottom-stack > .hidden {
  display: none !important;
}

.workspace-v6-bottom-stack .selection-action-bar,
.workspace-v6-bottom-stack .pending-apply-bar {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 16px;
  background: #fbfaff;
  border-top: 0;
  box-shadow: 0 -8px 22px rgb(32 31 38 / 4%);
}

.workspace-v6-bottom-stack .selection-action-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.workspace-v6-bottom-stack .selection-action-copy strong {
  overflow: hidden;
  color: var(--wb-text);
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-v6-bottom-stack .selection-action-copy span {
  overflow: hidden;
  color: var(--wb-text-secondary);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-v6-bottom-stack .pending-apply-copy,
.workspace-v6-bottom-stack .pending-apply-controls,
.workspace-v6-bottom-stack .pending-apply-actions {
  display: flex;
  min-width: 0;
  align-items: center;
}

.workspace-v6-bottom-stack .pending-apply-copy {
  gap: 9px;
}

.workspace-v6-bottom-stack .pending-apply-copy strong {
  display: block;
  overflow: hidden;
  color: var(--wb-text);
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-v6-bottom-stack .pending-apply-copy p {
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--wb-text-secondary);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-v6-bottom-stack .pending-apply-icon {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  place-items: center;
  border-radius: 6px;
  color: #5d31dc;
  background: var(--wb-purple-soft);
}

.workspace-v6-bottom-stack .pending-apply-icon .ui-icon {
  width: 14px;
  height: 14px;
}

.workspace-v6-bottom-stack .pending-apply-controls,
.workspace-v6-bottom-stack .pending-apply-actions {
  gap: 7px;
}

.workspace-v6-bottom-stack .compact-field {
  display: flex;
  align-items: center;
  gap: 6px;
}

.workspace-v6-bottom-stack .compact-field > span {
  color: var(--wb-text-secondary);
  font-size: 11px;
  white-space: nowrap;
}

.workspace-v6-bottom-stack .compact-field select,
.workspace-v6-bottom-stack .compact-field input {
  width: auto;
  min-width: 90px;
  height: 32px;
  padding: 0 25px 0 8px;
  font-size: 12px;
}

#app-shell .toast {
  border: 1px solid var(--wb-line);
  border-radius: var(--wb-radius);
  background: var(--wb-surface);
  box-shadow: var(--wb-shadow-popover);
}

#app-shell .toast-success { border-left: 3px solid var(--wb-green); }
#app-shell .toast-warning { border-left: 3px solid var(--wb-amber); }
#app-shell .toast-error { border-left: 3px solid var(--wb-red); }

@media (max-width: 1480px) {
  :root {
    --wb-sidebar: 200px;
  }

  #app-shell .square-page-bar {
    padding-right: 16px;
    padding-left: 16px;
  }

  .workspace-v6-filterbar,
  .workspace-v6-table-head {
    padding-right: 14px;
    padding-left: 14px;
  }

  .workspace-v6-search-composer {
    min-width: 240px;
    flex-basis: 300px;
  }

  .workspace-v6-active-filter {
    padding-right: 7px;
    padding-left: 7px;
  }
}

@media (max-width: 1180px) {
  #app-shell .square-navigation {
    padding-right: 10px;
    padding-left: 10px;
  }

  #app-shell .square-page-bar-title span:last-child,
  #app-shell .square-sync-state {
    display: none;
  }

  .workspace-v6-filterbar {
    flex-wrap: wrap;
  }

  .workspace-v6-search-composer {
    flex: 1 1 390px;
  }
}

@media (max-width: 1024px) {
  #app-shell .app-layout {
    grid-template-columns: 196px minmax(0, 1fr);
  }

  .workspace-v6-body {
    display: block;
  }

  .workspace-v6-detail {
    position: fixed;
    z-index: 100;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(var(--inspector-width, var(--wb-inspector)), calc(100vw - 36px));
    box-shadow: var(--wb-shadow-popover);
  }

  #app-shell[data-editor-open="false"] .workspace-v6-detail {
    transform: translateX(100%);
  }

  .editor-resize-handle {
    display: none;
  }

  .editor-scrim {
    position: fixed;
    z-index: 90;
    inset: 0;
    display: block;
    border: 0;
    background: rgb(24 24 27 / 22%);
    opacity: 1;
    transition: opacity 160ms ease;
  }

  #app-shell[data-editor-open="false"] .editor-scrim {
    opacity: 0;
    pointer-events: none;
  }

  body.editor-drawer-open .toast-region {
    z-index: 110;
  }

  .product-detail-dialog {
    width: calc(100vw - 32px);
    max-width: none;
  }
}

@media (max-width: 760px) {
  #app-shell .app-layout {
    display: block;
  }

  #app-shell .square-navigation {
    position: fixed;
    z-index: 80;
    right: 0;
    bottom: 0;
    left: 0;
    display: block;
    min-height: 58px;
    height: 58px;
    padding: 4px 7px;
    background: #fcfcfd;
    border-top: 1px solid var(--wb-line);
    border-right: 0;
  }

  #app-shell .square-navigation-header,
  #app-shell .square-navigation-status,
  #app-shell .square-navigation-section-label {
    display: none;
  }

  #app-shell .square-navigation-list {
    display: grid;
    height: 100%;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2px;
  }

  #app-shell .square-navigation-section {
    display: contents;
  }

  #app-shell .square-navigation-item {
    height: 50px;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 0 3px;
    font-size: 10px;
  }

  #app-shell .square-navigation-item .ui-icon {
    width: 15px;
    height: 15px;
  }

  #app-shell .app-main {
    min-height: calc(100dvh - 58px);
    padding-bottom: 58px;
  }

  #app-shell[data-active-view="workspace"] .app-main {
    height: calc(100dvh - 58px);
  }

  #app-shell .square-page-bar {
    height: 54px;
    padding: 0 11px;
  }

  #app-shell .square-page-bar-title h1 {
    font-size: 14px;
  }

  #app-shell .square-device-control {
    width: min(205px, 45vw);
  }

  #app-shell #sync-products {
    min-height: 32px;
    padding: 0 8px;
    font-size: 11px;
  }

  .workspace-v6-filterbar {
    gap: 7px;
    padding: 8px 12px;
  }

  .workspace-v6-search-composer {
    width: 100%;
    min-width: 0;
    flex-basis: 100%;
  }

  .workspace-v6-search-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .workspace-v6-login-strip {
    flex-wrap: wrap;
    padding: 7px 12px;
  }

  .workspace-v6-login-strip .workspace-login-copy > div {
    display: grid;
    gap: 2px;
  }

  .workspace-v6-login-strip .workspace-login-copy span:not(.workspace-login-indicator) {
    white-space: normal;
  }

  .workspace-v6-login-strip .workspace-login-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .workspace-v6-table-head {
    align-items: flex-start;
    padding: 9px 12px;
  }

  .workspace-v6-table-title .workspace-v6-active-product,
  .workspace-v6-selection-controls .check-row,
  .workspace-v6-selection-controls #clear-selection {
    display: none;
  }

  .workspace-v6 .product-table {
    min-width: 680px;
  }

  .workspace-v6-bottom-stack .pending-apply-bar {
    padding: 8px 12px;
  }

  .workspace-v6-bottom-stack .pending-apply-copy p,
  .workspace-v6-bottom-stack .compact-field {
    display: none;
  }

  .product-detail-dialog {
    width: calc(100vw - 16px);
    height: calc(100dvh - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 10px;
  }

  .product-detail-header {
    padding: 14px 14px 12px;
  }

  .product-detail-heading p {
    font-size: 12px;
  }

  .product-detail-body,
  .product-detail-loading {
    display: block;
    overflow: auto;
  }

  .product-detail-overview,
  .product-detail-overview-skeleton {
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid #eeeeF2;
  }

  .product-detail-overview {
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
  }

  .product-detail-thumbnails {
    grid-column: 1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 0;
  }

  .product-detail-overview-list {
    grid-column: 2;
    grid-row: 1 / span 2;
    margin-top: 0;
  }

  .product-detail-main {
    min-height: 480px;
  }

  .product-detail-panel {
    padding: 16px 14px 24px;
  }

  .product-detail-section > header {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .product-detail-section-actions {
    justify-content: space-between;
  }

  .product-detail-definition-grid {
    grid-template-columns: 1fr;
  }

  .product-detail-image-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-detail-footer {
    padding: 0 14px;
  }

  .product-detail-footer > span {
    display: none;
  }

  .product-detail-footer {
    justify-content: flex-end;
  }

  .product-image-viewer {
    padding: 20px;
  }

  .product-image-viewer figure .icon-button {
    top: -34px;
    right: 0;
  }
}

@media (max-width: 480px) {
  #app-shell .square-page-bar-title {
    gap: 7px;
  }

  #app-shell .square-page-bar-icon {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
  }

  #app-shell .square-device-control {
    width: 136px;
  }

  #app-shell .square-device-control select {
    font-size: 11px;
  }

  #app-shell #sync-products .ui-icon {
    display: none;
  }

  .workspace-v6-detail {
    width: 100vw;
  }

  .workspace-v6-detail-header {
    min-height: 69px;
  }

  .workspace-v6-rule-scroll,
  .workspace-v6-rule-footer {
    padding-right: 12px;
    padding-left: 12px;
  }

  .workspace-v6 .rule-field-pair {
    grid-template-columns: 1fr;
  }

  .workspace-v6-bottom-stack .pending-apply-bar {
    min-height: 52px;
  }

  .workspace-v6-bottom-stack .pending-apply-actions .button {
    min-width: 32px;
    padding: 0 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .workspace-v6-body,
  .workspace-v6-detail,
  .editor-scrim,
  .workspace-v6 .product-table tbody tr {
    transition: none;
  }
}
