/* Canvas visibility pass. Loaded last so the workbench has one final geometry. */

.customer-app .canvas-shell {
  scrollbar-color: rgba(40, 215, 229, 0.72) rgba(255, 255, 255, 0.05);
  scrollbar-width: thin;
}

/* This panel only belongs to the touch layout. Keep it out of the desktop
   workbench even if an older editor stylesheet gives sections a display. */
.customer-app .mobile-editor-controls {
  display: none;
}

.customer-app .canvas-rail-focus,
.customer-app .mobile-editor-view-button {
  min-height: 44px;
  border: 1px solid rgba(40, 215, 229, 0.42);
  border-radius: var(--radius, 12px);
  color: #f2f5ef;
  background: rgba(40, 215, 229, 0.08);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.customer-app .canvas-rail-focus:hover,
.customer-app .canvas-rail-focus:focus-visible,
.customer-app .mobile-editor-view-button:hover,
.customer-app .mobile-editor-view-button:focus-visible {
  border-color: #b8ff3d;
  color: #071008;
  background: #b8ff3d;
  outline: none;
}

.customer-app .canvas-layer-panel {
  width: min(390px, calc(100% - 48px));
}

.customer-app .canvas-layer-panel .layer-row {
  display: grid;
  grid-template-columns: 54px minmax(104px, 1fr) 34px 34px;
  grid-template-rows: 54px auto;
  gap: 7px;
  min-height: 102px;
  padding: 8px;
}

.customer-app .canvas-layer-panel .layer-thumbnail {
  grid-column: 1;
  grid-row: 1;
  width: 54px;
  height: 54px;
}

.customer-app .canvas-layer-panel .layer-name {
  display: grid;
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  min-height: 44px;
  align-content: center;
  gap: 4px;
  padding: 4px 6px;
  border: 0;
  color: #f2f5ef;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.customer-app .canvas-layer-panel .layer-name strong,
.customer-app .canvas-layer-panel .layer-name small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-app .canvas-layer-panel .layer-name strong { font-size: 14px; }
.customer-app .canvas-layer-panel .layer-name small { color: rgba(242, 245, 239, 0.56); font-size: 12px; }

.customer-app .canvas-layer-panel .visibility-button,
.customer-app .canvas-layer-panel .layer-lock-button {
  width: 34px;
  height: 44px;
  min-height: 44px;
}

.customer-app .canvas-layer-panel .layer-row-actions {
  display: grid;
  grid-column: 1 / -1;
  grid-row: 2;
  grid-template-columns: repeat(4, minmax(44px, 1fr));
  gap: 6px;
}

.customer-app .canvas-layer-panel .layer-row-actions .mini-button {
  width: 100%;
  min-width: 44px;
  height: 36px;
  min-height: 36px;
}

.customer-app .canvas-layer-panel.collapsed { width: 54px; }

@media (min-width: 821px) {
  .customer-app .studio {
    grid-template-columns: 86px minmax(260px, 306px) minmax(0, 1fr);
    gap: 10px;
  }

  .customer-app .studio > .toolbox-jump {
    width: 86px;
    min-width: 86px;
  }
  .customer-app .studio > .stage-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    padding: 8px;
    overflow: hidden;
  }
  .customer-app .stage-header { min-height: 40px; margin-bottom: 6px; }
  .customer-app .canvas-workbar { margin-bottom: 6px; }

  .customer-app .mobile-editor-controls,
  .customer-app .editor-mobile-dock {
    display: none !important;
  }

  .customer-app .canvas-shell {
    flex: 1 1 0;
    min-height: 0;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 8px 94px 8px 8px;
    overflow: auto;
    overscroll-behavior: contain;
  }

  .customer-app .editor-action-dock {
    display: grid !important;
    flex: 0 0 auto;
    grid-template-columns:
      minmax(120px, .9fr)
      repeat(4, minmax(88px, 1fr))
      minmax(150px, 1.2fr);
    margin-top: 6px;
  }

  .customer-app .editor-action-dock #editorDockFlipHorizontalBtn,
  .customer-app .editor-action-dock #editorDockCropBtn,
  .customer-app .editor-action-dock #editorDockSketchBtn,
  .customer-app .editor-action-dock #editorDockSaveBtn,
  .customer-app .editor-action-dock #editorDockOrderBtn {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  .customer-app .editor-action-dock #editorDockPreviewBtn {
    display: none !important;
  }

  .customer-app #designCanvas {
    flex: 0 0 auto;
    margin: auto;
  }

  .customer-app .canvas-command-rail { width: 76px; }
  .customer-app .canvas-rail-focus { width: 100%; padding: 5px; }

  .customer-app .canvas-layer-panel {
    top: 10px;
    left: 10px;
    max-height: calc(100% - 20px);
  }

  .customer-app .canvas-layer-panel .layer-list {
    max-height: min(470px, calc(100dvh - 290px));
  }
}

/* Narrow desktop still uses the vertical tool rail. Give its labels a real
   text column instead of letting the stage grid squeeze it to 54px. */
@media (min-width: 821px) and (max-width: 1120px) {
  .customer-app .studio {
    grid-template-columns: 84px minmax(240px, 290px) minmax(0, 1fr);
  }

  .customer-app .studio > .toolbox-jump {
    width: 84px;
    min-width: 84px;
  }
}

@media (max-width: 820px) {
  .customer-app .editor-shell {
    --mobile-editor-primary-dock-height: 64px;
    --mobile-editor-tool-dock-height: 64px;
    padding-bottom: calc(
      var(--mobile-editor-primary-dock-height) +
      var(--mobile-editor-tool-dock-height) +
      env(safe-area-inset-bottom)
    );
  }

  .customer-app .editor-progress { display: none; }
  .customer-app .studio > .stage-panel { padding: 4px; }
  .customer-app .stage-header > div:first-child { display: none; }

  .customer-app .stage-header {
    grid-template-columns: minmax(0, 1fr) 112px;
    gap: 6px;
    margin-bottom: 6px;
  }

  .customer-app .print-area-toolbar {
    grid-column: 1;
    grid-row: 1;
    min-height: 48px;
  }

  .customer-app .stage-actions {
    grid-column: 2;
    grid-row: 1;
    width: 112px;
    max-width: 112px;
  }

  .customer-app .canvas-onboarding {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "title action";
    min-height: 56px;
    margin: 6px 0;
    padding: 7px 46px 7px 12px;
    align-items: center;
    gap: 8px;
  }

  .customer-app .canvas-onboarding-kicker,
  .customer-app .canvas-onboarding p { display: none; }

  .customer-app .canvas-onboarding h2 {
    grid-area: title;
    margin: 0;
    font-size: 16px;
    line-height: 1.25;
  }

  .customer-app .canvas-onboarding-actions {
    grid-area: action;
    margin: 0;
  }

  .customer-app .canvas-onboarding-actions .button {
    width: auto;
    min-width: 116px;
    min-height: 44px;
    padding-inline: 12px;
  }

  .customer-app .canvas-shell {
    display: flex;
    width: 100%;
    height: min(68svh, 680px) !important;
    min-height: min(92vw, 520px);
    aspect-ratio: auto;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 4px;
    overflow: auto;
    overscroll-behavior: contain;
    scroll-behavior: smooth;
  }

  .customer-app #designCanvas {
    flex: 0 0 auto;
    width: auto;
    max-width: none;
    height: auto;
    max-height: none;
    margin: auto;
  }

  .customer-app .mobile-canvas-coach { display: none; }

  .customer-app .canvas-layer-panel {
    position: static;
    z-index: auto;
    width: 100%;
    max-height: min(46svh, 420px);
    margin: 6px 0 0;
    padding: 9px;
    border-color: rgba(40, 215, 229, 0.5);
    background: rgba(6, 11, 12, 0.97);
    overflow: hidden;
  }

  .customer-app .canvas-layer-panel.collapsed {
    width: 100%;
    height: 50px;
    padding: 4px 8px;
  }

  .customer-app .canvas-layer-panel.collapsed .canvas-layer-head {
    justify-content: space-between;
  }

  .customer-app .canvas-layer-panel.collapsed .canvas-layer-head > div {
    display: grid;
  }

  .customer-app .canvas-layer-panel.collapsed .canvas-layer-head .icon-button {
    width: 40px;
    min-width: 40px;
    height: 40px;
  }

  .customer-app .canvas-layer-panel .layer-list {
    max-height: min(34svh, 300px);
    overflow-y: auto;
  }

  .customer-app .canvas-layer-panel .layer-row {
    grid-template-columns: 58px minmax(100px, 1fr) 44px 44px;
  }

  .customer-app .canvas-layer-panel .visibility-button,
  .customer-app .canvas-layer-panel .layer-lock-button { width: 44px; }

  .customer-app .mobile-editor-controls {
    display: grid;
    gap: 6px;
    margin: 6px 0 8px;
    padding: 8px;
    border: 1px solid rgba(242, 245, 239, 0.13);
    border-radius: var(--radius, 12px);
    background: #0a0e0e;
  }

  .customer-app .mobile-editor-controls-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
  }

  .customer-app .mobile-editor-controls-head strong { font-size: 14px; }
  .customer-app .mobile-editor-controls-head span { color: rgba(242, 245, 239, 0.54); font-size: 12px; }

  .customer-app .mobile-canvas-view-row,
  .customer-app .mobile-editor-control-row {
    display: grid;
    grid-template-columns: 62px 44px minmax(88px, 1fr) 52px;
    align-items: center;
    gap: 6px;
    min-height: 44px;
  }

  .customer-app .mobile-editor-control-row {
    grid-template-columns: 62px 44px 52px 44px minmax(58px, 1fr);
  }

  .customer-app .mobile-editor-step,
  .customer-app .mobile-editor-reset,
  .customer-app .mobile-editor-view-button {
    min-width: 44px;
    min-height: 44px;
  }

  .customer-app .mobile-editor-view-button.is-primary {
    color: #071008;
    background: #b8ff3d;
    border-color: #b8ff3d;
  }

  .customer-app .mobile-canvas-view-row output,
  .customer-app .mobile-editor-control-row output {
    color: #b8ff3d;
    font-size: 12px;
    font-weight: 850;
    text-align: center;
  }

  .customer-app .mobile-canvas-zoom-control {
    display: grid;
    grid-column: 2 / -1;
    min-width: 0;
    min-height: 44px;
    align-items: center;
    padding-inline: 2px;
  }

  .customer-app .mobile-canvas-zoom-control input {
    width: 100%;
    min-width: 0;
    height: 44px;
    margin: 0;
    accent-color: #b8ff3d;
    cursor: pointer;
    touch-action: pan-x;
  }

  .customer-app .mobile-canvas-zoom-control input:focus-visible {
    outline: 2px solid #b8ff3d;
    outline-offset: 2px;
  }

  /* Keep canvas tools scrollable, while the four completion actions stay
     visible as a dedicated thumb-reachable row below them. */
  .customer-app .editor-shell .editor-mobile-dock {
    display: flex !important;
    position: fixed !important;
    right: 0 !important;
    bottom: calc(var(--mobile-editor-primary-dock-height) + env(safe-area-inset-bottom));
    left: 0 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: var(--mobile-editor-tool-dock-height);
    margin: 0 !important;
    padding: 5px 6px;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    border-radius: 0;
  }

  .customer-app .editor-mobile-dock #editorMobileCropBtn,
  .customer-app .editor-mobile-dock #editorMobileFlipHorizontalBtn,
  .customer-app .editor-mobile-dock #editorMobileSketchBtn,
  .customer-app .editor-mobile-dock .editor-mobile-legacy-action {
    display: none !important;
  }

  .customer-app .editor-shell .editor-mobile-dock .editor-mobile-ai-action,
  .customer-app .editor-shell .editor-mobile-dock .editor-mobile-share-action {
    display: flex !important;
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 94px !important;
    min-height: 48px;
    padding-inline: 10px;
  }

  .customer-app .editor-shell .editor-mobile-dock .editor-mobile-ai-action strong,
  .customer-app .editor-shell .editor-mobile-dock .editor-mobile-share-action strong {
    overflow: visible;
    white-space: nowrap;
  }

  .customer-app .editor-shell .editor-mobile-dock .editor-mobile-share-action {
    color: #071008;
    background: #b8ff3d;
    border-color: #b8ff3d;
  }

  .customer-app .editor-shell .editor-mobile-dock button:disabled {
    cursor: wait;
    opacity: 0.58;
  }

  .customer-app .editor-shell .editor-action-dock {
    display: grid !important;
    position: fixed !important;
    right: 0 !important;
    bottom: 0;
    left: 0 !important;
    z-index: 922 !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: calc(var(--mobile-editor-primary-dock-height) + env(safe-area-inset-bottom));
    margin: 0;
    padding: 6px 6px max(6px, env(safe-area-inset-bottom));
    gap: 5px;
    overflow: hidden !important;
    border-radius: 0;
  }

  .customer-app .editor-shell .editor-dock-summary,
  .customer-app .editor-shell .editor-action-dock #editorDockFlipHorizontalBtn,
  .customer-app .editor-shell .editor-action-dock #editorDockPreviewBtn {
    display: none !important;
  }

  .customer-app .editor-shell .editor-action-dock #editorDockFlipHorizontalBtn,
  .customer-app .editor-shell .editor-action-dock #editorDockCropBtn,
  .customer-app .editor-shell .editor-action-dock #editorDockSketchBtn,
  .customer-app .editor-shell .editor-action-dock #editorDockSaveBtn,
  .customer-app .editor-shell .editor-action-dock #editorDockOrderBtn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-width: 0 !important;
    min-height: 48px;
    padding: 5px 4px;
    font-size: 11px;
    white-space: nowrap;
  }

  .customer-app .studio.editor-order-open .editor-mobile-dock,
  .customer-app .studio.editor-order-open .editor-action-dock {
    display: none !important;
  }
}

@media (max-width: 420px) {
  .customer-app .canvas-shell {
    height: min(62svh, 600px) !important;
    min-height: calc(100vw - 16px);
  }

  .customer-app .mobile-editor-controls-head span { display: none; }

  .customer-app .mobile-canvas-view-row,
  .customer-app .mobile-editor-control-row {
    grid-template-columns: 56px 44px minmax(78px, 1fr) 48px;
  }

  .customer-app .mobile-editor-control-row {
    grid-template-columns: 56px 44px 48px 44px minmax(52px, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .customer-app .canvas-shell { scroll-behavior: auto; }
}

/* Final mobile flow override: the visibility layer loads after the studio
   stylesheet, so its fixed docks must also yield to the document flow. */
@media (max-width: 820px) {
  .customer-app .editor-shell .editor-mobile-dock,
  .customer-app .editor-shell .editor-action-dock {
    position: static !important;
    inset: auto !important;
    width: 100% !important;
    max-width: none !important;
    margin: 10px 0 0 !important;
    min-height: 64px;
    border-radius: 12px;
  }

  .customer-app .editor-shell .editor-action-dock {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    min-height: 70px;
    margin-top: 8px !important;
    padding-bottom: max(7px, env(safe-area-inset-bottom));
  }

  .customer-app .editor-shell {
    padding-bottom: max(18px, env(safe-area-inset-bottom)) !important;
  }

  .customer-app .editor-shell .editor-mobile-dock #editorMobileFlipHorizontalBtn:disabled {
    cursor: not-allowed;
    opacity: .42;
  }
}

/* The creator artwork shelf is a browsing surface on touch screens. Two
   compact cards keep the artwork visible while leaving the action reachable. */
@media (max-width: 820px) {
  .customer-app .creator-artwork-panel .creator-artwork-library {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .customer-app .creator-artwork-panel .creator-artwork-card {
    display: flex;
    min-width: 0;
    padding: 8px;
    flex-direction: column;
    gap: 8px;
    border-radius: 8px;
  }

  .customer-app .creator-artwork-panel .creator-artwork-image {
    flex: 0 0 auto;
    width: 100%;
    grid-row: auto;
    aspect-ratio: 1;
    border-radius: 6px;
  }

  .customer-app .creator-artwork-panel .creator-artwork-image img {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    object-fit: contain;
  }

  .customer-app .creator-artwork-panel .creator-artwork-image span {
    left: 5px;
    right: 5px;
    bottom: 5px;
    min-width: 0;
    padding: 4px 5px;
    overflow: hidden;
    font-size: 9px;
    line-height: 1.2;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .customer-app .creator-artwork-panel .creator-artwork-copy {
    position: static;
    inset: auto;
    z-index: auto;
    display: grid;
    min-height: 42px;
    padding: 0;
    gap: 4px;
    opacity: 1;
    background: none;
    pointer-events: auto;
    transform: none;
    transition: none;
  }

  .customer-app .creator-artwork-panel .creator-artwork-author > .avatar-shell {
    display: block;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
  }

  .customer-app .creator-artwork-panel .creator-artwork-author > span:last-child {
    display: grid;
    min-width: 0;
    gap: 1px;
  }

  .customer-app .creator-artwork-panel .creator-artwork-author {
    gap: 6px;
  }

  .customer-app .creator-artwork-panel .creator-artwork-author .avatar,
  .customer-app .creator-artwork-panel .creator-artwork-author .avatar-fallback {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
  }

  .customer-app .creator-artwork-panel .creator-artwork-author strong,
  .customer-app .creator-artwork-panel .creator-artwork-copy > strong {
    font-size: 11px;
    line-height: 1.25;
  }

  .customer-app .creator-artwork-panel .creator-artwork-author small {
    font-size: 9px;
    line-height: 1.2;
  }

  .customer-app .creator-artwork-panel .creator-artwork-card > .button {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    margin-top: auto;
    padding-inline: 5px;
    font-size: 11px;
    line-height: 1.15;
    white-space: nowrap;
  }

  .customer-app .creator-artwork-panel .editor-library-more {
    grid-column: 1 / -1;
  }
}

@media (max-width: 360px) {
  .customer-app .creator-artwork-panel .creator-artwork-card {
    padding: 7px;
    gap: 7px;
  }

  .customer-app .creator-artwork-panel .creator-artwork-card > .button {
    font-size: 10px;
  }
}

/* Mobile P1: five thumb-reachable tools, in-place print-area editing, and an
   order surface that sits above every global header. Desktop rules stay in
   the existing min-width: 821px blocks. */
.customer-app .print-area-edit {
  display: none;
}

@media (max-width: 820px) {
  .customer-app .editor-shell {
    padding-bottom: calc(82px + env(safe-area-inset-bottom)) !important;
  }

  .customer-app .editor-shell .editor-mobile-dock {
    display: grid !important;
    position: fixed !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    z-index: 930 !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    width: 100% !important;
    min-height: calc(64px + env(safe-area-inset-bottom)) !important;
    margin: 0 !important;
    padding: 5px max(6px, env(safe-area-inset-right)) max(5px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left)) !important;
    gap: 3px !important;
    overflow: hidden !important;
    contain: none !important;
    isolation: auto !important;
    border: 0 !important;
    border-top: 1px solid rgba(242, 245, 239, 0.16) !important;
    border-radius: 0 !important;
    background: rgba(8, 12, 13, 0.98) !important;
    box-shadow: 0 -14px 36px rgba(0, 0, 0, 0.36) !important;
  }

  .customer-app .editor-shell .editor-mobile-dock > button {
    display: grid !important;
    grid-template-rows: 24px 16px;
    align-content: center;
    justify-items: center;
    width: 100% !important;
    min-width: 44px !important;
    min-height: 54px !important;
    padding: 4px 2px !important;
    gap: 3px;
    border-radius: 8px !important;
  }

  .customer-app .editor-shell .editor-mobile-dock > button > span,
  .customer-app .editor-shell .editor-mobile-dock > button > span > svg {
    display: block;
    width: 22px;
    height: 22px;
  }

  .customer-app .editor-shell .editor-mobile-dock > button > span > svg {
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
  }

  .customer-app .editor-shell .editor-mobile-dock > button > strong {
    overflow: visible;
    font-size: 11px;
    line-height: 1.15;
    white-space: nowrap;
  }

  .customer-app .editor-mobile-tools {
    right: max(8px, env(safe-area-inset-right)) !important;
    bottom: calc(72px + env(safe-area-inset-bottom)) !important;
    left: max(8px, env(safe-area-inset-left)) !important;
    z-index: 940 !important;
    max-height: min(68dvh, 560px);
    overflow-y: auto;
    border-radius: 8px;
  }

  .customer-app .editor-mobile-tools [data-mobile-tools-panel][hidden] {
    display: none !important;
  }

  .customer-app .editor-mobile-tools-head > div > span,
  .customer-app .print-area-toolbar-head > div:first-child > span,
  .customer-app .print-area-toolbar-head > div:first-child > small {
    display: none;
  }

  .customer-app .editor-mobile-tools .editor-mobile-tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .customer-app .editor-mobile-tools .editor-mobile-more-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .customer-app .editor-mobile-tools .editor-mobile-more-grid > button {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    min-height: 52px;
    padding: 9px 12px;
  }

  .customer-app .editor-mobile-tools .editor-mobile-more-grid > button > span {
    text-align: right;
  }

  .customer-app .editor-mobile-share-panel {
    display: block;
  }

  .customer-app .editor-mobile-share-action {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 22px;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 78px;
    padding: 10px 12px;
    border: 0;
    border-radius: 8px;
    color: #071008;
    background: var(--green);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.3);
    font: inherit;
    text-align: left;
  }

  .customer-app .editor-mobile-share-action:focus-visible {
    outline: 3px solid var(--cyan);
    outline-offset: 2px;
  }

  .customer-app .editor-mobile-share-icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 50%;
    color: var(--green);
    background: #071008;
  }

  .customer-app .editor-mobile-share-icon svg,
  .customer-app .editor-mobile-share-arrow svg {
    display: block;
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
  }

  .customer-app .editor-mobile-share-copy {
    display: grid;
    min-width: 0;
    gap: 3px;
  }

  .customer-app .editor-mobile-share-copy strong {
    font-size: 14px;
    line-height: 1.25;
  }

  .customer-app .editor-mobile-share-copy small {
    color: rgba(7, 16, 8, 0.72);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.35;
  }

  .customer-app .editor-mobile-share-arrow {
    display: grid;
    place-items: center;
  }

  .customer-app .editor-mobile-tool-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .customer-app .editor-mobile-tool-actions .button {
    min-width: 0;
    padding-inline: 6px;
    font-size: 11px;
  }

  .customer-app .print-area-popover {
    align-content: start;
    grid-auto-rows: max-content;
    gap: 10px;
  }

  .customer-app .print-area-popover .print-area-list {
    align-content: start;
    align-items: start;
    grid-auto-rows: max-content;
    max-height: min(32dvh, 228px);
  }

  .customer-app .print-area-popover .print-area-chip {
    grid-template-columns: minmax(0, 1fr) 48px 48px 44px;
    align-self: start;
    min-height: 76px;
    height: auto;
  }

  .customer-app .print-area-popover .print-area-select {
    min-height: 76px;
    padding: 9px 6px 9px 10px;
  }

  .customer-app .print-area-popover .print-area-select strong {
    font-size: 13px;
  }

  .customer-app .print-area-popover .print-area-select small {
    display: -webkit-box;
    overflow: hidden;
    color: rgba(247, 247, 239, 0.62);
    font-size: 10px;
    line-height: 1.35;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .customer-app .print-area-popover .print-area-price {
    align-self: center;
    font-size: 14px;
  }

  .customer-app .print-area-edit {
    display: block;
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    align-self: center;
    justify-self: center;
    padding: 0 5px;
    border: 1px solid rgba(40, 215, 229, 0.28);
    border-radius: 8px;
    color: var(--cyan);
    background: rgba(40, 215, 229, 0.06);
    font: inherit;
    font-size: 12px;
    font-weight: 800;
  }

  .customer-app .print-area-remove {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    align-self: center;
    border: 1px solid rgba(242, 245, 239, 0.1);
    border-radius: 8px;
    font-size: 18px;
  }

  .customer-app #editorView.editor-order-open {
    position: relative;
    z-index: 9500 !important;
  }

  .customer-app #editorView.editor-order-open .studio.editor-order-open > .edit-panel {
    z-index: 9510 !important;
    padding-top: max(8px, env(safe-area-inset-top)) !important;
  }

  .customer-app #editorView.editor-order-open .order-panel-head {
    padding-top: max(12px, env(safe-area-inset-top)) !important;
  }

  .customer-app #editorView.editor-order-open .order-panel-close {
    width: 44px;
    min-width: 44px;
    height: 44px;
  }

  .customer-app .studio.editor-order-open .editor-mobile-dock,
  .customer-app #editorView.editor-order-open .editor-mobile-dock,
  .customer-app #editorView.editor-order-open .editor-mobile-tools {
    display: none !important;
  }
}

/* Desktop artwork shelf: the editor side rail is narrower than the page,
   so two vertical cards preserve image legibility and keep the action in the
   same scan path. This breakpoint is intentionally isolated from the mobile
   card rules above. */
@media (min-width: 821px) {
  .customer-app .creator-artwork-panel .creator-artwork-library {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .customer-app .creator-artwork-panel .creator-artwork-card {
    display: flex;
    min-width: 0;
    padding: 10px;
    flex-direction: column;
    gap: 8px;
  }

  .customer-app .creator-artwork-panel .creator-artwork-image {
    flex: 0 0 auto;
    width: 100%;
    grid-row: auto;
    aspect-ratio: 1;
  }

  .customer-app .creator-artwork-panel .creator-artwork-image img {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    object-fit: contain;
  }

  .customer-app .creator-artwork-panel .creator-artwork-copy {
    position: static;
    inset: auto;
    z-index: auto;
    display: grid;
    min-height: 42px;
    padding: 0;
    gap: 5px;
    opacity: 1;
    background: none;
    pointer-events: auto;
    transform: none;
    transition: none;
  }

  .customer-app .creator-artwork-panel .creator-artwork-author > .avatar-shell {
    display: block;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
  }

  .customer-app .creator-artwork-panel .creator-artwork-author > span:last-child {
    display: grid;
    min-width: 0;
    gap: 1px;
  }

  .customer-app .creator-artwork-panel .creator-artwork-author {
    gap: 7px;
  }

  .customer-app .creator-artwork-panel .creator-artwork-author .avatar,
  .customer-app .creator-artwork-panel .creator-artwork-author .avatar-fallback {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
  }

  .customer-app .creator-artwork-panel .creator-artwork-author strong,
  .customer-app .creator-artwork-panel .creator-artwork-copy > strong {
    font-size: 11px;
    line-height: 1.25;
  }

  .customer-app .creator-artwork-panel .creator-artwork-author small {
    font-size: 9px;
    line-height: 1.2;
  }

  .customer-app .creator-artwork-panel .creator-artwork-card > .button {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    margin-top: auto;
    padding-inline: 8px;
    font-size: 12px;
    line-height: 1.15;
    white-space: nowrap;
  }
}

/* PC tool rail: a quiet vertical icon rail keeps navigation scannable while
   leaving the cyan focus state for the currently selected workspace. */
@media (min-width: 821px) {
  .customer-app .studio > .toolbox-jump {
    display: flex;
    width: 100%;
    min-width: 0;
    height: 100%;
    padding: 7px 6px;
    flex-direction: column;
    gap: 5px;
    border: 1px solid rgba(242, 245, 239, 0.14);
    border-radius: 12px;
    background: linear-gradient(180deg, #171d1e 0%, #0d1112 52%, #090c0d 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 16px 34px rgba(0, 0, 0, 0.2);
  }

  .customer-app .studio > .toolbox-jump > button {
    display: grid !important;
    grid-template-rows: 22px minmax(0, 1fr);
    align-items: center;
    justify-items: center;
    flex: 0 0 64px;
    width: 100%;
    min-width: 0 !important;
    min-height: 64px !important;
    padding: 7px 3px !important;
    gap: 5px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: rgba(242, 245, 239, 0.62);
    background: rgba(255, 255, 255, 0.018);
    font-size: 11px;
    font-weight: 760;
    line-height: 1.15 !important;
    text-align: center;
    white-space: normal !important;
    transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
  }

  .customer-app .studio > .toolbox-jump > .toolbox-order-action {
    height: 64px !important;
    min-height: 64px !important;
    flex-basis: 64px !important;
  }

  .customer-app .studio > .toolbox-jump > button > span {
    display: block;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .customer-app .studio > .toolbox-jump .toolbox-jump-icon {
    display: block;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
  }

  .customer-app .studio > .toolbox-jump > button:hover,
  .customer-app .studio > .toolbox-jump > button:focus-visible {
    border-color: rgba(40, 215, 229, 0.58);
    color: #f2f5ef;
    background: rgba(40, 215, 229, 0.1);
    outline: none;
  }

  .customer-app .studio > .toolbox-jump > button.active {
    border-color: var(--cyan) !important;
    color: #061012 !important;
    background: var(--cyan) !important;
    box-shadow: 0 8px 20px rgba(40, 215, 229, 0.18);
  }

  .customer-app .studio > .toolbox-jump > .toolbox-order-action:not(.active) {
    border-color: transparent !important;
    color: rgba(242, 245, 239, 0.62) !important;
    background: rgba(255, 255, 255, 0.018) !important;
  }

  .customer-app .studio > .toolbox-jump > .toolbox-order-action:not(.active):hover,
  .customer-app .studio > .toolbox-jump > .toolbox-order-action:not(.active):focus-visible {
    border-color: rgba(40, 215, 229, 0.58) !important;
    color: #f2f5ef !important;
    background: rgba(40, 215, 229, 0.1) !important;
  }
}

@media (min-width: 821px) and (max-width: 960px) {
  .customer-app .studio > .toolbox-jump > button {
    flex-basis: 60px;
    min-height: 60px !important;
    grid-template-rows: 20px minmax(0, 1fr);
    gap: 4px;
    font-size: 10px;
  }

  .customer-app .studio > .toolbox-jump > .toolbox-order-action {
    height: 60px !important;
    min-height: 60px !important;
    flex-basis: 60px !important;
  }

  .customer-app .studio > .toolbox-jump .toolbox-jump-icon {
    width: 18px;
    height: 18px;
  }
}

/* Mobile tool feedback: cyan marks the open workspace, while acid green stays
   reserved for the share action. This final layer also survives WeChat's
   delayed tap highlight and the earlier dock color overrides. */
@media (max-width: 820px) {
  .customer-app .editor-shell .editor-mobile-dock button {
    -webkit-tap-highlight-color: transparent;
    transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 100ms ease, box-shadow 140ms ease;
  }

  .customer-app .editor-shell .editor-mobile-dock button[data-mobile-editor-target].active,
  .customer-app .editor-shell .editor-mobile-dock button[data-mobile-editor-target][aria-pressed="true"] {
    border-color: var(--cyan) !important;
    color: #061012 !important;
    background: var(--cyan) !important;
    box-shadow: 0 8px 20px rgba(40, 215, 229, 0.18);
  }

  .customer-app .editor-shell .editor-mobile-dock button[data-mobile-editor-target].active > span,
  .customer-app .editor-shell .editor-mobile-dock button[data-mobile-editor-target].active > strong,
  .customer-app .editor-shell .editor-mobile-dock button[data-mobile-editor-target][aria-pressed="true"] > span,
  .customer-app .editor-shell .editor-mobile-dock button[data-mobile-editor-target][aria-pressed="true"] > strong {
    color: #061012 !important;
  }

  .customer-app .editor-shell .editor-mobile-dock .editor-mobile-share-action,
  .customer-app .editor-shell .editor-mobile-dock .editor-mobile-share-action > span,
  .customer-app .editor-shell .editor-mobile-dock .editor-mobile-share-action > strong {
    border-color: var(--green) !important;
    color: #071008 !important;
    background: var(--green) !important;
    text-shadow: none;
  }

  .customer-app .editor-shell .editor-mobile-dock button:not(:disabled):active {
    border-color: var(--cyan) !important;
    color: #f2f5ef !important;
    background: rgba(40, 215, 229, 0.2) !important;
    transform: translateY(1px) scale(0.98);
  }

  .customer-app .editor-shell .editor-mobile-dock button:not(:disabled):active > span,
  .customer-app .editor-shell .editor-mobile-dock button:not(:disabled):active > strong {
    color: #f2f5ef !important;
  }

  .customer-app .editor-shell .editor-mobile-dock .editor-mobile-share-action:not(:disabled):active,
  .customer-app .editor-shell .editor-mobile-dock .editor-mobile-share-action:not(:disabled):active > span,
  .customer-app .editor-shell .editor-mobile-dock .editor-mobile-share-action:not(:disabled):active > strong {
    border-color: var(--cyan) !important;
    color: #071008 !important;
    background: var(--cyan) !important;
  }

  .customer-app .editor-shell .editor-mobile-dock button:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .customer-app .editor-shell .editor-mobile-dock button {
    transition: none;
  }
}

/* Mobile canvas space: gesture editing already owns product and layer sizing,
   so the duplicate stepper rows stay available to desktop code but leave the
   phone layout. Design and 3D become one explicit surface switch; preview
   remains independent because it still controls guides and selection chrome. */
.customer-app .design-3d-switch {
  display: contents;
}

@media (max-width: 820px) {
  .customer-app .mobile-editor-controls .mobile-editor-control-row {
    display: none !important;
  }

  .customer-app .mobile-editor-controls {
    margin-bottom: 6px;
    padding-bottom: 7px;
  }

  .customer-app .stage-header {
    grid-template-columns: minmax(0, 1fr) min(210px, 50vw) !important;
  }

  .customer-app .stage-actions {
    display: grid;
    grid-template-columns: minmax(128px, 1fr) 58px !important;
    width: min(100%, 210px) !important;
    max-width: 210px !important;
    align-items: center;
    gap: 6px;
  }

  .customer-app .design-3d-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
    min-height: 46px;
    padding: 3px;
    gap: 2px;
    border: 1px solid rgba(242, 245, 239, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
  }

  .customer-app .stage-actions .design-3d-switch .mode-button {
    width: 100%;
    min-width: 0 !important;
    min-height: 38px;
    padding: 0 8px !important;
    border: 0;
    border-radius: 999px;
    color: rgba(242, 245, 239, 0.68);
    background: transparent;
    box-shadow: none;
    font-size: 12px;
  }

  .customer-app .stage-actions .design-3d-switch #designModeBtn.active {
    color: #071008;
    background: var(--green);
  }

  .customer-app .stage-actions .design-3d-switch #webglToggleBtn[data-active="true"] {
    color: #061012;
    background: var(--cyan);
    box-shadow: none;
  }

  .customer-app .stage-actions .design-3d-switch #webglToggleBtn:disabled {
    color: rgba(242, 245, 239, 0.34);
    background: transparent;
  }

  .customer-app .stage-actions .preview-mode-button {
    width: 58px;
    min-width: 58px;
    min-height: 46px;
    padding-inline: 6px;
    border-radius: 999px;
    font-size: 12px;
  }

  .customer-app .stage-actions .preview-mode-button.active {
    border-color: var(--green);
    color: var(--green);
    background: rgba(184, 255, 61, 0.1);
  }
}

@media (max-width: 360px) {
  .customer-app .stage-header {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .customer-app .stage-actions {
    grid-column: 1;
    grid-row: auto;
    grid-template-columns: minmax(0, 1fr) 68px !important;
    width: 100% !important;
    max-width: none !important;
  }

  .customer-app .stage-actions .preview-mode-button {
    width: 68px;
    min-width: 68px;
  }
}
