/* Mobile landscape classic: left rail + full workspace + left drawer sheets */
@media (orientation: landscape) and (pointer: coarse) {
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) {
    --ds-land-rail-w: 92px;
    --ds-land-gap: 8px;
    --ds-land-sheet-w: min(340px, calc(100vw - var(--ds-land-rail-w) - 36px));
    --ds-land-topbar-h: 44px;
    --ds-land-top-gap: 2px;
    --ds-land-row-gap: 2px;
    overflow: hidden !important;
  }

  /* Disable desktop top bars in landscape classic (keep mobile topbar visible) */
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-topbar,
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-dc-topbar,
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-topbar-back,
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-topbar-exit {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  /* Landscape topbar (same component as portrait) */
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-topbar,
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) [data-role="mobile-topbar"] {
    position: fixed !important;
    top: calc(env(safe-area-inset-top, 0px) + var(--ds-land-top-gap)) !important;
    left: 6px !important;
    right: 8px !important;
    width: auto !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 4px !important;
    padding: 2px 6px !important;
    height: var(--ds-land-topbar-h) !important;
    min-height: var(--ds-land-topbar-h) !important;
    max-height: var(--ds-land-topbar-h) !important;
    overflow: hidden !important;
    border-radius: 12px !important;
    border: 1px solid rgba(10, 37, 66, 0.14) !important;
    background: rgba(255, 255, 255, 0.92) !important;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    z-index: 520 !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-topbar-center {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 4px !important;
    overflow: hidden !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-topbar-center > * {
    flex: 0 1 auto !important;
    min-width: 0 !important;
    max-width: none !important;
    width: auto !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-topbar .ds-tools-top,
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-topbar .ds-group {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 4px !important;
    min-width: 0 !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-topbar-center,
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-topbar-center > *,
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-topbar [data-mobile-action] {
    visibility: visible !important;
    opacity: 1 !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-topbar-back,
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-topbar-btn,
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-topbar-icon-btn,
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-topbar-btn-primary {
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 8px !important;
    border-radius: 9px !important;
    font-size: 11px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    flex: 0 1 auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #0f172a !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(10, 37, 66, 0.16) !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-topbar-back {
    flex: 0 0 34px !important;
    width: 34px !important;
    min-width: 34px !important;
    max-width: 34px !important;
    padding: 0 !important;
    font-size: 0 !important;
    line-height: 0 !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-topbar-back > * {
    display: none !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-topbar-back::before {
    content: "\00d7" !important;
    display: inline-block !important;
    font-size: 19px !important;
    line-height: 1 !important;
    font-weight: 700 !important;
    color: currentColor !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-topbar-icon-btn {
    width: 34px !important;
    min-width: 34px !important;
    padding: 0 !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-topbar-icon-label {
    display: none !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-topbar-btn-primary {
    width: 38px !important;
    min-width: 38px !important;
    padding: 0 !important;
    color: #ffffff !important;
    border-color: color-mix(in srgb, var(--accent, #0a7f73) 72%, #ffffff 28%) !important;
    background: linear-gradient(
      180deg,
      color-mix(in srgb, var(--accent, #0a7f73) 88%, #ffffff 12%) 0%,
      var(--accent, #0a7f73) 100%
    ) !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-topbar-btn-primary > span:last-child {
    display: none !important;
  }

  /* Final hard lock: landscape topbar row order and fixed X square */
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern)[data-vp-mobile="1"][data-vp-orient="landscape"] .ds-mobile-topbar {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 4px !important;
    overflow: hidden !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern)[data-vp-mobile="1"][data-vp-orient="landscape"] .ds-mobile-topbar-back {
    order: 0 !important;
    flex: 0 0 34px !important;
    width: 34px !important;
    min-width: 34px !important;
    max-width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    padding: 0 !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    align-self: center !important;
    overflow: hidden !important;
    font-size: 0 !important;
    line-height: 0 !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern)[data-vp-mobile="1"][data-vp-orient="landscape"] .ds-mobile-topbar-center {
    order: 1 !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: none !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 4px !important;
    overflow: hidden !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern)[data-vp-mobile="1"][data-vp-orient="landscape"] .ds-mobile-topbar-btn-primary {
    order: 2 !important;
    flex: 0 0 38px !important;
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Active canvas picker + mockup icon in landscape topbar */
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern)[data-vp-mobile="1"][data-vp-orient="landscape"] .ds-active-zone-select {
    order: 1 !important;
    display: grid !important;
    grid-template-columns: 28px minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
    column-gap: 6px !important;
    row-gap: 1px !important;
    align-items: center !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern)[data-vp-mobile="1"][data-vp-orient="landscape"] .ds-active-zone-icon-btn {
    grid-column: 1 !important;
    grid-row: 1 / span 2 !important;
    width: 28px !important;
    min-width: 28px !important;
    height: 28px !important;
    min-height: 28px !important;
    border-radius: 8px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern)[data-vp-mobile="1"][data-vp-orient="landscape"] .ds-active-zone-icon {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern)[data-vp-mobile="1"][data-vp-orient="landscape"] .ds-active-zone-help {
    grid-column: 2 !important;
    grid-row: 1 !important;
    font-size: 10px !important;
    line-height: 1 !important;
    font-weight: 700 !important;
    letter-spacing: .04em !important;
    text-transform: uppercase !important;
    color: #5f738a !important;
    margin: 0 !important;
    white-space: nowrap !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern)[data-vp-mobile="1"][data-vp-orient="landscape"] .ds-active-zone-row {
    grid-column: 2 !important;
    grid-row: 2 !important;
    min-width: 0 !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern)[data-vp-mobile="1"][data-vp-orient="landscape"] .ds-active-zone-row select,
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern)[data-vp-mobile="1"][data-vp-orient="landscape"] [data-role="active-zone-select"] {
    width: 100% !important;
    min-width: 110px !important;
    max-width: 170px !important;
    height: 20px !important;
    min-height: 20px !important;
    border-radius: 6px !important;
    font-size: 11px !important;
    line-height: 1 !important;
    padding: 0 18px 0 6px !important;
  }

  /* Hard startup/no-template override: keep full compact topbar in landscape */
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern).ds-no-template .ds-mobile-topbar,
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern).ds-startup-gated .ds-mobile-topbar {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    height: var(--ds-land-topbar-h) !important;
    min-height: var(--ds-land-topbar-h) !important;
    max-height: var(--ds-land-topbar-h) !important;
    overflow: hidden !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern).ds-no-template .ds-mobile-topbar-back,
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern).ds-startup-gated .ds-mobile-topbar-back {
    flex: 0 0 34px !important;
    width: 34px !important;
    min-width: 34px !important;
    max-width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 !important;
    font-size: 0 !important;
    line-height: 0 !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern).ds-no-template .ds-mobile-topbar-back > *,
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern).ds-startup-gated .ds-mobile-topbar-back > * {
    display: none !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern).ds-no-template .ds-mobile-topbar-back::before,
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern).ds-startup-gated .ds-mobile-topbar-back::before {
    content: "\00d7" !important;
    display: inline-block !important;
    font-size: 19px !important;
    line-height: 1 !important;
    font-weight: 700 !important;
    color: currentColor !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern).ds-no-template .ds-mobile-topbar-center,
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern).ds-startup-gated .ds-mobile-topbar-center {
    display: flex !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: none !important;
    overflow: hidden !important;
    gap: 4px !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern).ds-no-template .ds-mobile-topbar-icon-btn,
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern).ds-startup-gated .ds-mobile-topbar-icon-btn {
    display: inline-flex !important;
    flex: 0 0 34px !important;
    width: 34px !important;
    min-width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern).ds-no-template .ds-mobile-topbar-btn-primary,
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern).ds-startup-gated .ds-mobile-topbar-btn-primary {
    display: inline-flex !important;
    flex: 0 0 38px !important;
    width: 38px !important;
    min-width: 38px !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-topbar-icon-btn .dashicons,
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-topbar-btn .dashicons,
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-topbar-back .dashicons,
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-topbar-btn-primary .dashicons {
    font-size: 15px !important;
    width: 15px !important;
    height: 15px !important;
  }

  /* Disable portrait landscape lock overlay */
  .ds-studio .ds-mobile-landscape-lock {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  /* Keep only rail + workspace + tool sheets */
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-status,
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-apply-cta,
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-toolbar,
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-context-toolbar,
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-object-quick-dock {
    display: none !important;
  }

  /* Left rail (former bottom nav) */
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-bottom-nav {
    position: fixed !important;
    left: 0 !important;
    top: calc(env(safe-area-inset-top, 0px) + var(--ds-land-top-gap) + var(--ds-land-topbar-h) + var(--ds-land-row-gap)) !important;
    bottom: 0 !important;
    width: var(--ds-land-rail-w) !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 8px 6px !important;
    border-radius: 0 !important;
    z-index: 320 !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-auto-rows: minmax(0, 1fr) !important;
    gap: 8px !important;
    overflow: hidden !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-bottom-nav button {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 56px !important;
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
  }

  /* Workspace fills all remaining space */
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-workspace {
    position: fixed !important;
    left: var(--ds-land-rail-w) !important;
    top: calc(env(safe-area-inset-top, 0px) + var(--ds-land-top-gap) + var(--ds-land-topbar-h) + var(--ds-land-row-gap)) !important;
    right: 0 !important;
    bottom: 0 !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    display: block !important;
    z-index: 318 !important;
    transition: left 180ms cubic-bezier(.2,.8,.2,1) !important;
  }

  /* Keep workspace fixed; sheet overlays above canvas (no push) */
  .ds-studio[data-ds-ui-variant="classic"].ds-mobile-sheet-open:not(.ds-ui-modern) .ds-workspace {
    left: var(--ds-land-rail-w) !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-workspace-grid,
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-dc-right-host,
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-center-stage,
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-canvas-shell,
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-canvas-wrap,
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-canvas-viewport {
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: hidden !important;
  }

  /* Left drawer tool sheets */
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-sheet-backdrop {
    position: fixed !important;
    inset: 0 !important;
    display: block !important;
    z-index: 330 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 180ms ease !important;
  }

  .ds-studio[data-ds-ui-variant="classic"].ds-mobile-sheet-open:not(.ds-ui-modern) .ds-mobile-sheet-backdrop {
    opacity: 0 !important;
    pointer-events: none !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-sheets {
    position: fixed !important;
    top: calc(env(safe-area-inset-top, 0px) + var(--ds-land-top-gap) + var(--ds-land-topbar-h) + var(--ds-land-row-gap)) !important;
    left: calc(var(--ds-land-rail-w) + var(--ds-land-gap)) !important;
    right: auto !important;
    bottom: 8px !important;
    width: var(--ds-land-sheet-w) !important;
    max-width: var(--ds-land-sheet-w) !important;
    height: auto !important;
    max-height: none !important;
    border-radius: 14px !important;
    overflow: hidden !important;
    transform: translateX(-12px) !important;
    opacity: 0 !important;
    pointer-events: none !important;
    display: block !important;
    z-index: 331 !important;
    transition: transform 190ms cubic-bezier(.2,.8,.2,1), opacity 170ms ease !important;
  }

  .ds-studio[data-ds-ui-variant="classic"].ds-mobile-sheet-open:not(.ds-ui-modern) .ds-mobile-sheets {
    transform: translateX(0) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-sheets .ds-mobile-sheet {
    display: none !important;
    height: 100% !important;
    max-height: 100% !important;
    overflow: auto !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern)[data-mobile-sheet-open="insert"] .ds-mobile-sheets .ds-mobile-sheet[data-mobile-sheet="insert"],
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern)[data-mobile-sheet-open="canvas"] .ds-mobile-sheets .ds-mobile-sheet[data-mobile-sheet="canvas"],
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern)[data-mobile-sheet-open="library"] .ds-mobile-sheets .ds-mobile-sheet[data-mobile-sheet="library"],
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern)[data-mobile-sheet-open="preview"] .ds-mobile-sheets .ds-mobile-sheet[data-mobile-sheet="preview"],
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern)[data-mobile-sheet-open="edit"] .ds-mobile-sheets .ds-mobile-sheet[data-mobile-sheet="edit"],
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern)[data-mobile-sheet-open="style"] .ds-mobile-sheets .ds-mobile-sheet[data-mobile-sheet="style"],
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern)[data-mobile-sheet-open="arrange"] .ds-mobile-sheets .ds-mobile-sheet[data-mobile-sheet="arrange"],
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern)[data-mobile-sheet-open="more"] .ds-mobile-sheets .ds-mobile-sheet[data-mobile-sheet="more"],
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-sheets .ds-mobile-sheet.is-active,
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-sheets .ds-mobile-sheet[aria-hidden="false"] {
    display: block !important;
  }

  /* Landscape sheet content grouping (same structure as other views) */
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-sheet[data-mobile-sheet="canvas"] .ds-mobile-canvas-btn-full {
    display: none !important;
    width: 100% !important;
    min-height: 46px !important;
    margin-bottom: 10px !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-sheet[data-mobile-sheet="canvas"] .ds-mobile-canvas-row-two {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
    margin-top: 0 !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-sheet[data-mobile-sheet="canvas"] .ds-mobile-canvas-row-two > button {
    min-height: 46px !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-sheet[data-mobile-sheet="canvas"] .ds-mobile-sheet-zoom {
    margin-top: 10px !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-sheet[data-mobile-sheet="canvas"] .ds-mobile-inline-toggles.ds-mobile-canvas-helpers {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-sheet[data-mobile-sheet="canvas"] .ds-mobile-inline-toggles.ds-mobile-canvas-helpers button[aria-pressed="true"],
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-sheet[data-mobile-sheet="canvas"] .ds-mobile-inline-toggles.ds-mobile-canvas-helpers button.is-active {
    border-color: color-mix(in srgb, var(--accent, #0a7f73) 72%, #ffffff 28%) !important;
    background: linear-gradient(
      180deg,
      color-mix(in srgb, var(--accent, #0a7f73) 86%, #ffffff 14%) 0%,
      var(--accent, #0a7f73) 100%
    ) !important;
    color: #ffffff !important;
    box-shadow: 0 8px 16px color-mix(in srgb, var(--accent, #0a7f73) 35%, transparent 65%) !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-sheet-section.ds-mobile-save-product {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    align-items: stretch !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-sheet-section.ds-mobile-save-product > h5 {
    grid-column: 1 / -1 !important;
    margin-bottom: 4px !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-sheet-section.ds-mobile-save-product .ds-mobile-save-product-btn {
    grid-column: auto !important;
    width: 100% !important;
    justify-self: stretch !important;
    aspect-ratio: 1 / 1 !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 6px 6px !important;
    border-radius: 10px !important;
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    font-size: 11px !important;
    line-height: 1.1 !important;
    text-align: center !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-sheet-section.ds-mobile-save-product .ds-mobile-save-product-btn .ds-mobile-btn-ic {
    width: 20px !important;
    height: 20px !important;
    flex: 0 0 20px !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-sheet-section.ds-mobile-save-product .ds-mobile-save-product-btn > span:last-child {
    display: block !important;
    text-align: center !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-sheet-section.ds-mobile-save-product .ds-mobile-save-product-btn-save {
    order: 1 !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-sheet-section.ds-mobile-save-product .ds-mobile-save-product-btn-apply {
    order: 2 !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-sheet-section.ds-mobile-save-product .ds-mobile-save-product-btn-save {
    border: 1px solid rgba(10, 37, 66, 0.18) !important;
    background: linear-gradient(180deg, #ffffff 0%, #eef4ff 100%) !important;
    color: #0a2542 !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.10) !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-sheet-section.ds-mobile-save-product .ds-mobile-save-product-btn-apply {
    border: 1px solid color-mix(in srgb, var(--accent, #0a7f73) 72%, #ffffff 28%) !important;
    background: linear-gradient(
      180deg,
      color-mix(in srgb, var(--accent, #0a7f73) 88%, #ffffff 12%) 0%,
      var(--accent, #0a7f73) 100%
    ) !important;
    color: #ffffff !important;
    box-shadow: 0 8px 16px color-mix(in srgb, var(--accent, #0a7f73) 35%, transparent 65%) !important;
  }

  /* Canvas sheet: force clear vertical groups (VIEW then HELPERS) */
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-sheet[data-mobile-sheet="canvas"] .ds-mobile-sheet-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-sheet[data-mobile-sheet="canvas"] .ds-mobile-sheet-section {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 8px !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-sheet[data-mobile-sheet="canvas"] .ds-mobile-sheet-section h5 {
    display: block !important;
    margin: 0 0 2px 0 !important;
    text-transform: uppercase !important;
    letter-spacing: .08em !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    color: #0f2b4a !important;
  }

  /* Library sheet: keep only Template dropdown + My Designs in Design Library group */
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-sheet[data-mobile-sheet="library"] .ds-mobile-sheet-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-sheet[data-mobile-sheet="library"] .ds-mobile-sheet-section h5 {
    text-transform: uppercase !important;
    letter-spacing: .08em !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    color: #0f2b4a !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-sheet[data-mobile-sheet="library"] [data-role="mobile-design-id"],
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-sheet[data-mobile-sheet="library"] button[data-mobile-sheet-action="load-design"],
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-sheet[data-mobile-sheet="library"] button[data-mobile-sheet-action="template-apply"] {
    display: none !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-sheet[data-mobile-sheet="library"] button[data-mobile-sheet-action="my-designs"] {
    width: 100% !important;
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-sheet-head h4,
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-sheet-section h5,
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-sheet-section p,
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-template-picker label,
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-sheet .ds-mobile-sheet-zoom > span,
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-sheet .ds-mobile-sheet-zoom strong {
    color: #ffffff !important;
    opacity: 1 !important;
    text-shadow: none !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-sheet[data-mobile-sheet="library"] .ds-mobile-sheet-section h5,
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-sheet[data-mobile-sheet="library"] .ds-mobile-sheet-head h4 {
    color: #ffffff !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-sheet[data-mobile-sheet="library"] .ds-mobile-template-picker select,
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-sheet[data-mobile-sheet="library"] [data-role="mobile-template-select"] {
    color: #0a2542 !important;
    background: #ffffff !important;
    border: 1px solid rgba(10, 37, 66, 0.18) !important;
  }

  /* Landscape text editing: keep editor visible above keyboard */
  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-text-edit-modal {
    z-index: 10040 !important;
    align-items: flex-start !important;
    justify-content: center !important;
    padding: calc(env(safe-area-inset-top, 0px) + 4px) 8px 8px 8px !important;
    background: rgba(8, 14, 24, 0.12) !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-text-edit-card {
    width: min(560px, 100%) !important;
    max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 12px) !important;
    overflow: auto !important;
  }

  .ds-studio[data-ds-ui-variant="classic"]:not(.ds-ui-modern) .ds-mobile-text-edit-card textarea[data-role="mte-input"] {
    min-height: 64px !important;
    max-height: 28dvh !important;
  }

  /* Landscape start flow: sync with stable portrait behavior */
  .ds-studio[data-ds-ui-variant="classic"][data-vp-mobile="1"][data-vp-orient="landscape"]:not(.ds-ui-modern).ds-no-template:not(.ds-startup-gated) .ds-no-template-start {
    position: fixed !important;
    top: calc(env(safe-area-inset-top, 0px) + var(--ds-land-top-gap) + var(--ds-land-topbar-h) + var(--ds-land-row-gap) + 4px) !important;
    left: calc(var(--ds-land-rail-w) + var(--ds-land-gap)) !important;
    right: 8px !important;
    bottom: 8px !important;
    inset: auto !important;
    z-index: 460 !important;
    margin: 0 !important;
    padding: 8px !important;
    display: flex !important;
    align-items: stretch !important;
    justify-content: center !important;
    overflow: hidden !important;
    background: #f3f8ff !important;
    border-radius: 12px !important;
  }

  .ds-studio[data-ds-ui-variant="classic"][data-vp-mobile="1"][data-vp-orient="landscape"]:not(.ds-ui-modern).ds-no-template:not(.ds-startup-gated) .ds-no-template-start-card {
    width: min(980px, 100%) !important;
    max-width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    margin: 0 auto !important;
    display: grid !important;
    grid-template-rows: auto auto auto minmax(0, 1fr) auto !important;
    gap: 8px !important;
    overflow: hidden !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .ds-studio[data-ds-ui-variant="classic"][data-vp-mobile="1"][data-vp-orient="landscape"]:not(.ds-ui-modern).ds-no-template:not(.ds-startup-gated) .ds-no-template-grid {
    min-height: 0 !important;
    margin: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    align-content: start !important;
    padding-right: 2px !important;
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)) !important;
    gap: 10px !important;
  }

  .ds-studio[data-ds-ui-variant="classic"][data-vp-mobile="1"][data-vp-orient="landscape"]:not(.ds-ui-modern).ds-no-template:not(.ds-startup-gated) .ds-no-template-card {
    display: grid !important;
    grid-template-rows: auto auto !important;
    gap: 8px !important;
    align-content: start !important;
  }

  .ds-studio[data-ds-ui-variant="classic"][data-vp-mobile="1"][data-vp-orient="landscape"]:not(.ds-ui-modern).ds-no-template:not(.ds-startup-gated) .ds-no-template-card-thumb {
    aspect-ratio: 1 / 1 !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  .ds-studio[data-ds-ui-variant="classic"][data-vp-mobile="1"][data-vp-orient="landscape"]:not(.ds-ui-modern).ds-no-template:not(.ds-startup-gated) .ds-no-template-start-actions {
    margin: 0 !important;
    padding-top: 6px !important;
    position: sticky !important;
    bottom: 0 !important;
    z-index: 2 !important;
    background: linear-gradient(180deg, rgba(248, 251, 255, 0) 0%, rgba(248, 251, 255, 0.95) 28%, #f8fbff 100%) !important;
  }

  .ds-studio .ds-mobile-sheet-section.ds-mobile-layer-section {
    grid-template-columns: 1fr !important;
  }

  .ds-studio .ds-mobile-sheet-section.ds-mobile-layer-section .ds-layer-list-inline {
    grid-column: 1 / -1 !important;
    width: 100% !important;
  }

  .ds-studio .ds-mobile-sheet-grid .ds-layer-actions .ds-layer-move {
    width: 24px !important;
    min-width: 24px !important;
    max-width: 24px !important;
    height: 24px !important;
    min-height: 24px !important;
    padding: 0 !important;
    border-radius: 6px !important;
    line-height: 1 !important;
  }
}

/* FINAL EOF OVERRIDE v10 - Apply/Save Design color contract (mobile landscape, true EOF lock) */
@media (orientation: landscape) and (pointer: coarse) {
  .ds-studio:not(.ds-ui-modern) [data-action="apply-product"],
  .ds-studio:not(.ds-ui-modern) [data-action="post-save-apply"],
  .ds-studio:not(.ds-ui-modern) [data-action="exit-apply"],
  .ds-studio:not(.ds-ui-modern) [data-role="mobile-apply-cta"],
  .ds-studio:not(.ds-ui-modern) [data-mobile-action="apply"],
  .ds-studio:not(.ds-ui-modern) [data-mobile-sheet-action="apply"],
  .ds-studio:not(.ds-ui-modern) .ds-mobile-save-product-btn-apply {
    background: linear-gradient(
      180deg,
      color-mix(in srgb, var(--ds-accent, #f89f25) 86%, #ffffff 14%) 0%,
      var(--ds-accent, #f89f25) 100%
    ) !important;
    background-color: var(--ds-accent, #f89f25) !important;
    border-color: color-mix(in srgb, var(--ds-accent, #f89f25) 62%, #ffffff 38%) !important;
    color: #ffffff !important;
    box-shadow: 0 10px 22px color-mix(in srgb, var(--ds-accent, #f89f25) 34%, transparent 66%) !important;
  }

  .ds-studio:not(.ds-ui-modern) [data-action="final-save"],
  .ds-studio:not(.ds-ui-modern) [data-action="exit-save"],
  .ds-studio:not(.ds-ui-modern) [data-mobile-action="final-save"],
  .ds-studio:not(.ds-ui-modern) [data-mobile-sheet-action="final-save"],
  .ds-studio:not(.ds-ui-modern) .ds-mobile-save-product-btn-save,
  .ds-studio:not(.ds-ui-modern) .ds-topbar-action-btn-primary[data-mobile-action="final-save"],
  .ds-studio:not(.ds-ui-modern) .ds-mobile-topbar-btn-primary[data-mobile-action="final-save"] {
    background: linear-gradient(
      180deg,
      color-mix(in srgb, var(--ds-accent-secondary, #2f80ed) 86%, #ffffff 14%) 0%,
      var(--ds-accent-secondary, #2f80ed) 100%
    ) !important;
    background-color: var(--ds-accent-secondary, #2f80ed) !important;
    border-color: color-mix(in srgb, var(--ds-accent-secondary, #2f80ed) 62%, #ffffff 38%) !important;
    color: #ffffff !important;
    box-shadow: 0 10px 22px color-mix(in srgb, var(--ds-accent-secondary, #2f80ed) 34%, transparent 66%) !important;
  }
}

/* FINAL EOF OVERRIDE v10.2 - Landscape menu icon/text follows Designer Text Color */
@media (orientation: landscape) and (pointer: coarse) {
  .ds-studio:not(.ds-ui-modern) .ds-mobile-bottom-nav button:not(.is-active) {
    color: var(--text, #122033) !important;
  }

  .ds-studio:not(.ds-ui-modern) .ds-mobile-bottom-nav button:not(.is-active)::before,
  .ds-studio:not(.ds-ui-modern) .ds-mobile-bottom-nav button:not(.is-active)::after {
    color: var(--text, #122033) !important;
  }

  .ds-studio:not(.ds-ui-modern) .ds-mobile-topbar-icon-btn,
  .ds-studio:not(.ds-ui-modern) .ds-mobile-topbar-icon-btn .dashicons,
  .ds-studio:not(.ds-ui-modern) .ds-mobile-topbar-icon-btn .ds-ui-icon,
  .ds-studio:not(.ds-ui-modern) .ds-mobile-topbar-icon-btn .ds-mobile-topbar-icon-label {
    color: var(--text, #122033) !important;
  }
}

/* FINAL EOF OVERRIDE v10.3 - Mobile landscape menu/sheets inherit Panel Surface Color */
@media (orientation: landscape) and (pointer: coarse) {
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) {
    --ds-menu-surface: var(--ds-button-surface, var(--panel, #ffffff));
    --ds-menu-fg: var(--text, #122033);
    --ds-menu-line: color-mix(in srgb, var(--line, #d3dde8) 82%, transparent 18%);
  }

  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-topbar,
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-bottom-nav,
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-sheet,
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-sheet-head {
    background: color-mix(in srgb, var(--ds-menu-surface) 94%, #ffffff 6%) !important;
    border-color: var(--ds-menu-line) !important;
  }

  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-topbar-back,
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-topbar-btn:not(.ds-mobile-topbar-btn-primary),
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-topbar-icon-btn,
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-bottom-nav button:not(.is-active),
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-sheet-grid button:not(.ds-mobile-btn-primary):not(.ds-mobile-save-product-btn-apply):not(.ds-mobile-save-product-btn-save),
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-sheet .ds-mobile-inline-toggles button:not(.is-active):not([aria-pressed="true"]) {
    background: color-mix(in srgb, var(--ds-menu-surface) 92%, #ffffff 8%) !important;
    color: var(--ds-menu-fg) !important;
    border-color: var(--ds-menu-line) !important;
  }

  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-topbar-title,
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-sheet-head h4,
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-sheet-section h5 {
    color: var(--ds-menu-fg) !important;
  }

  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-bottom-nav button:not(.is-active)::before,
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-bottom-nav button:not(.is-active)::after,
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-topbar-back::before,
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-topbar-icon-btn .dashicons,
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-topbar-icon-btn .ds-ui-icon,
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-topbar-icon-btn .ds-mobile-topbar-icon-label {
    color: var(--ds-menu-fg) !important;
  }
}

/* FINAL EOF OVERRIDE v10.4 - Landscape: hard lock text/icon color consistency in mobile sheets */
@media (orientation: landscape) and (pointer: coarse) {
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-sheet,
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-sheet-grid,
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-sheet-section,
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-sheet-head,
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-inline-toggles {
    color: var(--ds-menu-fg, var(--text, #122033)) !important;
  }

  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-sheet h4,
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-sheet h5,
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-sheet p,
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-sheet span,
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-sheet label,
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-sheet strong,
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-sheet small,
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-sheet select,
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-sheet input,
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-sheet textarea,
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-sheet option,
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-sheet .dashicons,
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-sheet .ds-ui-icon,
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-sheet .ds-ui-icon svg,
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-sheet-grid button::before,
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-sheet-grid button::after,
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-inline-toggles button::before,
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-inline-toggles button::after {
    color: var(--ds-menu-fg, var(--text, #122033)) !important;
  }

  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-sheet-grid button:not(.ds-mobile-btn-primary):not(.ds-mobile-save-product-btn-apply):not(.ds-mobile-save-product-btn-save),
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-inline-toggles button:not(.is-active):not([aria-pressed="true"]),
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-icon-tile {
    color: var(--ds-menu-fg, var(--text, #122033)) !important;
  }
}

/* FINAL EOF OVERRIDE v11 - Landscape mobile sheet readability + icon dedupe + my-designs modal fit */
@media (orientation: landscape) and (pointer: coarse) {
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-sheet[data-mobile-sheet="canvas"] .ds-mobile-canvas-row-two {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 8px !important;
  }

  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-sheet[data-mobile-sheet="canvas"] .ds-mobile-canvas-row-two > button {
    width: 100% !important;
    min-height: 46px !important;
    height: auto !important;
    padding: 10px 8px !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
    white-space: normal !important;
    text-align: center !important;
  }

  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-sheet-zoom,
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-style-field {
    background: color-mix(in srgb, var(--ds-button-surface, var(--panel, #ffffff)) 94%, #ffffff 6%) !important;
    border-color: color-mix(in srgb, var(--line, #d3dde8) 82%, transparent 18%) !important;
    color: var(--text, #122033) !important;
  }

  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-style-field input,
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-style-field select,
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-template-picker select,
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) [data-role="mobile-template-select"] {
    background: #ffffff !important;
    border-color: color-mix(in srgb, var(--line, #d3dde8) 82%, transparent 18%) !important;
    color: var(--text, #122033) !important;
  }

  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-sheet-grid button[data-mobile-sheet-action].ds-ui-iconized::before {
    content: none !important;
  }

  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) [data-role="my-designs-modal"].ds-my-designs-modal {
    align-items: flex-start !important;
    justify-content: center !important;
    padding: calc(env(safe-area-inset-top, 0px) + 8px) 10px calc(env(safe-area-inset-bottom, 0px) + 8px) !important;
  }

  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) [data-role="my-designs-modal"] .ds-my-designs-dialog {
    width: min(760px, 100%) !important;
    max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 16px) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) [data-role="my-designs-modal"] .ds-props-dialog-head {
    position: sticky !important;
    top: 0 !important;
    z-index: 6 !important;
    background: inherit !important;
    margin: 0 !important;
    padding: 0 0 8px 0 !important;
    border-bottom: 1px solid color-mix(in srgb, var(--line, #d3dde8) 78%, transparent 22%) !important;
  }

  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) [data-role="my-designs-modal"] .ds-layer-help {
    margin: 8px 0 !important;
  }

  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) [data-role="my-designs-modal"] .ds-my-designs-list {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding-right: 2px !important;
  }
}

/* FINAL EOF OVERRIDE v12 - Insert/Library button hierarchy (landscape) */
@media (orientation: landscape) and (pointer: coarse) {
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-sheet[data-mobile-sheet="insert"] .ds-mobile-insert-btn[data-mobile-sheet-action="upload-image"] {
    background: linear-gradient(
      180deg,
      color-mix(in srgb, var(--ds-accent, #f89f25) 86%, #ffffff 14%) 0%,
      var(--ds-accent, #f89f25) 100%
    ) !important;
    border-color: color-mix(in srgb, var(--ds-accent, #f89f25) 62%, #ffffff 38%) !important;
    color: #ffffff !important;
    box-shadow: 0 10px 22px color-mix(in srgb, var(--ds-accent, #f89f25) 34%, transparent 66%) !important;
  }

  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-sheet[data-mobile-sheet="insert"] .ds-mobile-insert-btn[data-mobile-sheet-action="add-text"] {
    background: linear-gradient(
      180deg,
      color-mix(in srgb, var(--ds-accent-secondary, #2f80ed) 86%, #ffffff 14%) 0%,
      var(--ds-accent-secondary, #2f80ed) 100%
    ) !important;
    border-color: color-mix(in srgb, var(--ds-accent-secondary, #2f80ed) 62%, #ffffff 38%) !important;
    color: #ffffff !important;
    box-shadow: 0 10px 22px color-mix(in srgb, var(--ds-accent-secondary, #2f80ed) 34%, transparent 66%) !important;
  }

  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-sheet[data-mobile-sheet="insert"] .ds-mobile-insert-btn[data-mobile-sheet-action]:not([data-mobile-sheet-action="upload-image"]):not([data-mobile-sheet-action="add-text"]) {
    background: color-mix(in srgb, var(--ds-button-surface, var(--panel, #ffffff)) 92%, #ffffff 8%) !important;
    border-color: color-mix(in srgb, var(--line, #d3dde8) 82%, transparent 18%) !important;
    color: var(--text, #122033) !important;
    box-shadow: 0 4px 10px rgba(9, 30, 66, 0.10) !important;
  }

  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-sheet[data-mobile-sheet="library"] .ds-mobile-save-product-btn-apply {
    background: linear-gradient(
      180deg,
      color-mix(in srgb, var(--ds-accent, #f89f25) 86%, #ffffff 14%) 0%,
      var(--ds-accent, #f89f25) 100%
    ) !important;
    border-color: color-mix(in srgb, var(--ds-accent, #f89f25) 62%, #ffffff 38%) !important;
    color: #ffffff !important;
  }

  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-sheet[data-mobile-sheet="library"] .ds-mobile-save-product-btn-save {
    background: linear-gradient(
      180deg,
      color-mix(in srgb, var(--ds-accent-secondary, #2f80ed) 86%, #ffffff 14%) 0%,
      var(--ds-accent-secondary, #2f80ed) 100%
    ) !important;
    border-color: color-mix(in srgb, var(--ds-accent-secondary, #2f80ed) 62%, #ffffff 38%) !important;
    color: #ffffff !important;
  }
}

/* FINAL EOF OVERRIDE v10.3 - Landscape font picker + Arrange left align */
@media (orientation: landscape) and (pointer: coarse) {
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-font-picker-modal .ds-font-picker-dialog {
    background: #ffffff !important;
    border: 1px solid color-mix(in srgb, var(--line, #d3dde8) 82%, transparent 18%) !important;
  }

  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-font-picker-modal .ds-font-picker-top {
    background: #ffffff !important;
  }

  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-font-picker-modal .ds-font-picker-top h3 {
    color: var(--text, #122033) !important;
  }

  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-font-picker-modal .ds-font-picker-top button {
    background: #ffffff !important;
    background-image: none !important;
    border: 1px solid color-mix(in srgb, var(--line, #d3dde8) 82%, transparent 18%) !important;
    color: var(--text, #122033) !important;
  }

  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-font-picker-modal .ds-font-picker-item {
    background: #ffffff !important;
    background-image: none !important;
    border: 1px solid color-mix(in srgb, var(--line, #d3dde8) 82%, transparent 18%) !important;
    color: var(--text, #122033) !important;
  }

  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-sheet[data-mobile-sheet="arrange"] .ds-mobile-sheet-grid button[data-mobile-sheet-action] {
    justify-content: flex-start !important;
    text-align: left !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern) .ds-mobile-sheet[data-mobile-sheet="preview"] .ds-mobile-sheet-grid button[data-mobile-sheet-action] {
    justify-content: flex-start !important;
    text-align: left !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
}

/* FINAL EOF OVERRIDE v13 - Landscape: canvas row + helper readability + unified 1:1 asset tiles */
@media (orientation: landscape) and (pointer: coarse) {
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern)
  .ds-mobile-sheet[data-mobile-sheet="canvas"] .ds-mobile-canvas-row-two {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern)
  .ds-mobile-sheet[data-mobile-sheet="canvas"] .ds-mobile-canvas-row-two > button {
    width: 100% !important;
    min-height: 44px !important;
    padding: 0 10px !important;
    font-size: 11px !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    text-align: center !important;
  }

  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern)
  .ds-mobile-sheet[data-mobile-sheet="canvas"] .ds-mobile-inline-toggles.ds-mobile-canvas-helpers {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern)
  .ds-mobile-sheet[data-mobile-sheet="canvas"] .ds-mobile-inline-toggles.ds-mobile-canvas-helpers > button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    min-height: 44px !important;
    padding: 0 24px 0 9px !important;
    font-size: 11px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    position: relative !important;
  }

  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern)
  .ds-mobile-sheet[data-mobile-sheet="canvas"] .ds-mobile-inline-toggles.ds-mobile-canvas-helpers > button .ds-ui-icon {
    width: 14px !important;
    height: 14px !important;
    flex: 0 0 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern)
  .ds-mobile-sheet[data-mobile-sheet="canvas"] .ds-mobile-inline-toggles.ds-mobile-canvas-helpers > button .ds-ui-icon svg {
    width: 14px !important;
    height: 14px !important;
  }

  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern)
  .ds-mobile-sheet[data-mobile-sheet="canvas"] .ds-mobile-inline-toggles.ds-mobile-canvas-helpers > button::after {
    right: 8px !important;
    width: 8px !important;
    height: 8px !important;
    margin-top: -4px !important;
  }

  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern)
  .ds-my-designs-modal[data-role="asset-library-modal"] .ds-asset-library-grid[data-asset-kind="textures"],
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern)
  .ds-my-designs-modal[data-role="asset-library-modal"] .ds-asset-library-grid[data-asset-kind="frames"],
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern)
  .ds-my-designs-modal[data-role="asset-library-modal"] .ds-asset-library-grid[data-asset-kind="shapes"],
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern)
  .ds-my-designs-modal[data-role="asset-library-modal"] .ds-asset-library-grid[data-asset-kind="icons"],
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern)
  .ds-my-designs-modal[data-role="asset-library-modal"] .ds-asset-library-grid[data-asset-kind="emoticons"] {
    grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)) !important;
    gap: 8px !important;
  }

  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern)
  .ds-my-designs-modal[data-role="asset-library-modal"] .ds-asset-library-grid[data-asset-kind="textures"] .ds-asset-thumb,
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern)
  .ds-my-designs-modal[data-role="asset-library-modal"] .ds-asset-library-grid[data-asset-kind="frames"] .ds-asset-thumb,
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern)
  .ds-my-designs-modal[data-role="asset-library-modal"] .ds-asset-library-grid[data-asset-kind="shapes"] .ds-asset-thumb {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
  }

  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern)
  .ds-my-designs-modal[data-role="asset-library-modal"] .ds-asset-library-grid[data-asset-kind="textures"] .ds-asset-meta,
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern)
  .ds-my-designs-modal[data-role="asset-library-modal"] .ds-asset-library-grid[data-asset-kind="frames"] .ds-asset-meta,
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern)
  .ds-my-designs-modal[data-role="asset-library-modal"] .ds-asset-library-grid[data-asset-kind="shapes"] .ds-asset-meta {
    font-size: 11px !important;
    line-height: 1.2 !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
}

/* FINAL EOF OVERRIDE v15 - Landscape hard lock for full-width Fit | Zoom row */
@media (orientation: landscape) and (pointer: coarse) {
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern)
  .ds-mobile-sheet[data-mobile-sheet="canvas"] .ds-mobile-sheet-grid > .ds-mobile-sheet-section:first-child > .ds-mobile-canvas-row-two,
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern)
  .ds-mobile-sheet[data-mobile-sheet="canvas"] .ds-mobile-canvas-row-two {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    max-width: 100% !important;
    align-self: stretch !important;
    justify-self: stretch !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern)
  .ds-mobile-sheet[data-mobile-sheet="canvas"] .ds-mobile-sheet-grid > .ds-mobile-sheet-section:first-child > .ds-mobile-canvas-row-two > button,
  .ds-studio[data-vp-mobile="1"]:not(.ds-ui-modern)
  .ds-mobile-sheet[data-mobile-sheet="canvas"] .ds-mobile-canvas-row-two > button {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    justify-self: stretch !important;
    flex: 1 1 0 !important;
  }
}

/* FINAL EOF OVERRIDE v16 - Landscape popup safe frame under WP admin bar */
@media (orientation: landscape) and (pointer: coarse) {
  .ds-studio {
    --ds-modal-safe-top: max(8px, env(safe-area-inset-top, 0px));
    --ds-modal-safe-bottom: max(8px, env(safe-area-inset-bottom, 0px));
    --ds-modal-admin-top: 0px;
  }

  body.admin-bar .ds-studio {
    --ds-modal-admin-top: var(--wp-admin--admin-bar--height, 32px);
  }

  .ds-studio .ds-font-picker-modal,
  .ds-studio .ds-exit-confirm-modal,
  .ds-studio .ds-refresh-confirm-modal,
  .ds-studio .ds-post-save-modal,
  .ds-studio .ds-empty-zones-modal,
  .ds-studio .ds-zone-picker-modal,
  .ds-studio .ds-mug-modal,
  .ds-studio .ds-props-modal,
  .ds-studio .ds-my-designs-modal,
  .ds-studio .ds-apply-product-modal,
  .ds-studio .ds-asset-library-modal {
    align-items: flex-start !important;
    justify-content: center !important;
    padding-top: calc(var(--ds-modal-safe-top) + var(--ds-modal-admin-top)) !important;
    padding-bottom: var(--ds-modal-safe-bottom) !important;
    overflow: auto !important;
  }

  .ds-studio .ds-font-picker-dialog,
  .ds-studio .ds-exit-confirm-dialog,
  .ds-studio .ds-refresh-confirm-dialog,
  .ds-studio .ds-post-save-dialog,
  .ds-studio .ds-empty-zones-dialog,
  .ds-studio .ds-zone-picker-dialog,
  .ds-studio .ds-mug-dialog,
  .ds-studio .ds-props-dialog,
  .ds-studio .ds-my-designs-dialog,
  .ds-studio .ds-apply-product-dialog,
  .ds-studio .ds-asset-library-dialog {
    max-height: calc(100dvh - var(--ds-modal-safe-top) - var(--ds-modal-safe-bottom) - var(--ds-modal-admin-top)) !important;
  }
}

/* FINAL EOF OVERRIDE v17 - Mobile modal/Woo button readability */
@media (orientation: landscape) and (pointer: coarse) {
  .ds-studio[data-vp-mobile="1"] .ds-product-preview-modal .ds-woo-btn:not(.ds-woo-btn-primary),
  .ds-studio[data-vp-mobile="1"] .ds-zone-picker-modal .ds-woo-btn:not(.ds-woo-btn-primary),
  .ds-studio[data-vp-mobile="1"] .ds-apply-product-modal button:not([data-action="apply-product"]):not(.ds-woo-btn-primary),
  .ds-studio[data-vp-mobile="1"] .ds-my-designs-modal button:not(.ds-woo-btn-primary),
  .ds-studio[data-vp-mobile="1"] .ds-post-save-actions button:not([data-action="post-save-continue"]):not([data-action="post-save-template"]):not([data-action="post-save-apply"]),
  .ds-studio[data-vp-mobile="1"] .ds-save-before-apply-actions button:not([data-action="save-before-apply-save"]),
  .ds-studio[data-vp-mobile="1"] .ds-empty-zones-actions button:not([data-action="empty-zones-continue"]),
  .ds-studio[data-vp-mobile="1"] .ds-refresh-confirm-actions button:not([data-action="refresh-ok"]):not([data-action="refresh-save"]),
  .ds-studio[data-vp-mobile="1"] .ds-exit-confirm-actions button:not([data-action="exit-save"]):not([data-action="exit-apply"]) {
    background: #ffffff !important;
    background-image: none !important;
    border-color: color-mix(in srgb, var(--line, #c5d1df) 88%, transparent 12%) !important;
    color: var(--text, #122033) !important;
  }
}
