* {
    box-sizing: border-box;
  }

  body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f5f5f5;
    color: #111;
  }

  .page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px;
  }
        
  .header {
    margin-bottom: 24px;
  }
    
  .brand-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
  }
    
  .brand-logo {
    display: block;
    width: auto;
    height: 42px;
    flex: 0 0 auto;
  }
    
  .brand-tagline {
    margin: 0;
    max-width: 520px;
    color: #334155;
    line-height: 1.5;
    font-size: 15px;
    text-align: right;
  }
    
  @media (max-width: 640px) {
    .brand-bar {
      align-items: flex-start;
      flex-direction: column;
      gap: 10px;
    }
  
    .brand-logo {
      height: 34px;
    }
  
    .brand-tagline {
      max-width: none;
      text-align: left;
      font-size: 14px;
    }
  }

  .grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .card {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
  }

  .controls-card {
    min-width: 0;
  }

  .card h2 {
    margin-top: 0;
    font-size: 20px;
  }

  .preview-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
  }

  .preview-card-header h2 {
    margin: 0;
  }

  .preview-helper {
    display: none;
    margin: 6px 0 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.4;
  }

  .mobile-controls-header,
  .controls-close-btn,
  .mobile-action-dock,
  .controls-backdrop {
    display: none;
  }

  label {
    display: block;
    margin: 14px 0 6px;
    font-weight: bold;
  }

  select,
  input[type="file"],
  input[type="text"],
  input[type="tel"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: #fff;
  }

  .native-select-fallback {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    height: 1px;
  }
   
  .choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
  }
    
  .choice-grid.choice-grid-color {
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  }
    
  .choice-btn {
    width: 100%;
    margin: 0;
    padding: 11px 10px;
    border: 1px solid #ddd;
    border-radius: 12px;
    background: #fff;
    color: #111;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }
  
  .choice-btn:hover {
    border-color: #111;
  }
  
  .choice-btn.is-active {
    background: #111;
    color: #fff;
    border-color: #111;
  }

  .choice-btn.is-out-of-stock,
  .choice-btn:disabled.is-out-of-stock {
    position: relative;
    opacity: .46;
    cursor: not-allowed;
    filter: grayscale(.25);
  }

  .choice-btn.is-out-of-stock::after {
    content: "";
    position: absolute;
    left: 12%;
    right: 12%;
    top: 50%;
    border-top: 2px solid currentColor;
    opacity: .8;
    transform: rotate(-8deg);
    pointer-events: none;
  }

  .stock-warning {
    display: none;
    margin: -8px 0 18px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fff1f2;
    color: #9f1239;
    font-size: 13px;
    line-height: 1.4;
  }

  .stock-warning.is-visible {
    display: block;
  }
    
  .color-dot {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, .18);
    flex: 0 0 auto;
  }
   
  .choice-btn.is-active .color-dot {
    border-color: rgba(255, 255, 255, .65);
  }
    
  .choice-grid-color .choice-btn {
    background: var(--swatch-bg, #fff);
    color: var(--swatch-text, #111);
    border-color: var(--swatch-border, #ddd);
  }
    
  .choice-grid-color .choice-btn:hover {
    filter: brightness(0.97);
    transform: translateY(-1px);
  }
        
  .choice-grid-color .choice-btn.is-active {
    background: var(--swatch-bg, #111);
    color: var(--swatch-text, #fff);
    border-color: #111;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, .16);
    transform: translateY(-1px);
  }
    
  button {
    width: 100%;
    margin-top: 16px;
    padding: 14px;
    border: 0;
    border-radius: 10px;
    background: #111;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
  }

  button:disabled {
    background: #999;
    cursor: not-allowed;
  }

  .preview-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 520px;
    background: #eee;
    border-radius: 16px;
    overflow: hidden;
  }

  .mockup-preview {
    position: relative;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
  }

  .shirt-base {
    display: block;
    width: 100%;
    height: auto;
  }

  .design-overlay {
    position: absolute;
    left: var(--design-left, 50%);
    top: var(--design-top, 43%);
    max-width: var(--design-width, 28%);
    max-height: var(--design-max-height, 28%);
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: contain;
    pointer-events: none;
    z-index: 2;
    display: none;
  }

  .placeholder {
    padding: 12px;
    text-align: center;
    color: #777;
    font-size: 14px;
  }

  .preview-placeholder {
    position: absolute;
    left: 50%;
    top: 43%;
    width: 136px;
    min-height: 136px;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #0f172a;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.25;
    z-index: 12;
    pointer-events: none;
    padding: 14px;
    border: 1.5px dashed rgba(15, 23, 42, .30);
    border-radius: 18px;
    background: rgba(255, 255, 255, .46);
    box-shadow: 0 10px 26px rgba(15, 23, 42, .10);
    backdrop-filter: blur(6px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .preview-placeholder::before {
    content: "＋";
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin: 0 auto 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .96);
    color: #fff;
    font-size: 24px;
    line-height: 1;
  }

  .info,
  .warning,
  .success,
  .storefront-warning {
    margin-top: 14px;
    padding: 12px;
    border-radius: 10px;
    line-height: 1.45;
    font-size: 14px;
  }

  .info {
    background: #eef3ff;
    color: #19376d;
  }

  .warning {
    background: #fff4db;
    color: #6b4300;
    display: none;
  }

  .storefront-warning {
    background: #fff4db;
    color: #6b4300;
    margin-bottom: 18px;
  }

  .success {
    background: #eaf8ef;
    color: #14532d;
    display: none;
  }

  .approval {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    line-height: 1.4;
    color: #333;
    font-size: 14px;
  }

  .approval input {
    margin-top: 3px;
  }

  .phone-row {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 10px;
  }
    
  .phone-row select,
  .phone-row input {
    margin: 0;
  }
  
  .choice-grid-position {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
    
  .choice-grid-position .choice-btn {
    padding: 10px 6px;
    font-size: 13px;
  }  
  
  .card label {
    margin-top: 18px;
    margin-bottom: 8px;
  }
    
  .card h2 + label {
    margin-top: 0;
  }
    
  .choice-grid-position {
    gap: 10px;
    margin-bottom: 24px;
  }
  
  .choice-grid-position .choice-btn {
    min-height: 40px;
    line-height: 1.2;
  }  

  .order-step {
    border: 1px solid #eee;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
    background: #fff;
  }
  
  .order-step.is-hidden {
    display: none;
  }
    
  .order-step.is-collapsed {
    background: #fafafa;
  }
    
  .order-step.is-collapsed .step-body {
    display: none;
  }
    
  .order-step.is-collapsed .step-summary {
    display: block;
  }
    
  .order-step.is-locked {
    opacity: .72;
  }
    
  .order-step.is-locked h2 {
    color: #777;
  }
    
  .order-step.is-locked .step-edit-btn {
    display: none;
  }
    
  .order-step h2 {
    margin: 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
      gap: 12px;
  }
    
  .step-body {
    margin-top: 16px;
  }
    
  .step-summary {
    display: none;
    margin-top: 8px;
    color: #555;
    font-size: 14px;
    line-height: 1.45;
  }
    
  .step-edit-btn {
    display: none;
    width: auto;
    margin: 0;
    padding: 7px 10px;
    border-radius: 999px;
    background: #eee;
    color: #111;
    font-size: 12px;
  }
    
  .order-step.is-collapsed .step-edit-btn {
    display: inline-flex;
  }
    
  .step-next-btn {
    margin-top: 8px;
  }

  [data-control-section] {
    scroll-margin-top: 88px;
  }


  .upload-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    height: 1px;
  }
    
  .upload-box {
    width: 100%;
    margin-top: 8px;
    padding: 22px 16px;
    border: 2px dashed #d4d4d4;
    border-radius: 16px;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    cursor: pointer;
    transition: .16s ease;
  }
    
  .upload-box:hover {
    border-color: #111;
    background: #fff;
  }
  
  .upload-icon {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: #111;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    line-height: 1;
  }
    
  .upload-title {
    font-size: 15px;
    font-weight: 800;
    color: #111;
  }
    
  .upload-text {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
  }
    
  #uploadForm.is-uploading .upload-box {
    opacity: .6;
    pointer-events: none;
  }
    
  .mockup-preview {
    position: relative;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
  }

  .mockup-preview::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 10;
    background: transparent;
  }

  .mockup-preview:hover .preview-placeholder {
    color: #111827;
  }

  .mockup-preview.is-uploading {
    cursor: progress;
  }

  .upload-progress-overlay {
    position: absolute;
    inset: 0;
    z-index: 38;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(255, 255, 255, .68);
    backdrop-filter: blur(8px);
    pointer-events: auto;
  }

  .mockup-preview.is-uploading .upload-progress-overlay {
    display: flex;
  }

  .upload-progress-card {
    width: min(260px, 82%);
    padding: 14px;
    border: 1px solid rgba(226, 232, 240, .95);
    border-radius: 18px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 18px 46px rgba(15, 23, 42, .16);
    text-align: center;
  }

  .upload-progress-title {
    color: #0f172a;
    font-size: 13px;
    font-weight: 900;
    line-height: 1.25;
  }

  .upload-progress-text {
    margin-top: 5px;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.35;
  }

  .upload-progress-track {
    width: 100%;
    height: 8px;
    margin-top: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
  }

  .upload-progress-fill {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: #0f172a;
    transition: width .18s ease;
  }

  .upload-progress-percent {
    margin-top: 7px;
    color: #0f172a;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
  }

  .mockup-preview.has-design {
    cursor: default;
  }

  .remove-design-btn {
    position: absolute;
    right: 12px;
    top: 12px;
    z-index: 25;
    display: none;
    width: auto;
    margin: 0;
    padding: 8px 11px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .88);
    color: #fff;
    font-size: 12px;
    line-height: 1;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .22);
  }

  .mockup-preview.has-design .remove-design-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
  }
    
  .shirt-base,
  .design-overlay {
    -webkit-user-drag: none;
    user-drag: none;
    user-select: none;
    pointer-events: none;
  }

  .mobile-color-popover,
  .mobile-size-popover,
  .mobile-print-popover,
  .mobile-position-popover,
  .mobile-data-popover {
    display: none;
  }

  @media (max-width: 820px) {
    .mobile-color-popover,
      .mobile-size-popover,
    .mobile-print-popover,
    .mobile-position-popover,
    .mobile-data-popover {
      position: fixed;
      left: 14px;
      right: 14px;
      bottom: 92px;
      z-index: 65;
      display: block;
      max-width: 430px;
      margin: 0 auto;
      padding: 14px;
      border: 1px solid rgba(226, 232, 240, .95);
      border-radius: 24px;
      background: rgba(255, 255, 255, .94);
      box-shadow: 0 18px 46px rgba(15, 23, 42, .22);
      backdrop-filter: blur(16px);
      opacity: 0;
      transform: translateY(12px) scale(.98);
      transform-origin: bottom center;
      pointer-events: none;
      transition: opacity .18s ease, transform .18s ease;
    }

    .mobile-data-popover {
      max-height: calc(100svh - 128px);
      overflow-y: auto;
      overscroll-behavior: contain;
    }

    .mobile-color-popover {
      --popover-arrow-left: 38px;
    }


    .mobile-size-popover {
      --popover-arrow-left: 166px;
    }

    .mobile-print-popover {
      --popover-arrow-left: 230px;
    }

    .mobile-position-popover {
      --popover-arrow-left: 294px;
    }

    .mobile-data-popover {
      --popover-arrow-left: 294px;
    }

    body.is-color-popover-open .mobile-color-popover,
    body.is-size-popover-open .mobile-size-popover,
    body.is-print-popover-open .mobile-print-popover,
    body.is-position-popover-open .mobile-position-popover,
    body.is-data-popover-open .mobile-data-popover {
      opacity: 1;
      transform: translateY(0) scale(1);
      pointer-events: auto;
    }

    .mobile-color-popover::after,
    .mobile-size-popover::after,
    .mobile-print-popover::after,
    .mobile-position-popover::after,
    .mobile-data-popover::after {
      content: "";
      position: absolute;
      left: min(var(--popover-arrow-left, 38px), calc(100% - 38px));
      bottom: -8px;
      width: 16px;
      height: 16px;
      background: rgba(255, 255, 255, .94);
      border-right: 1px solid rgba(226, 232, 240, .95);
      border-bottom: 1px solid rgba(226, 232, 240, .95);
      transform: rotate(45deg);
    }

    .mobile-popover-title {
      margin: 0 0 10px;
      color: #0f172a;
      font-size: 13px;
      font-weight: 800;
    }

    .mobile-popover-options {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
      gap: 8px;
    }

    .mobile-color-options {
      grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
    }

    .mobile-size-options {
      grid-template-columns: repeat(auto-fit, minmax(54px, 1fr));
    }

    .mobile-print-options {
      grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .mobile-position-options {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .mobile-popover-option {
      width: auto;
      margin: 0;
      padding: 9px 10px;
      border: 1px solid rgba(226, 232, 240, .95);
      border-radius: 999px;
      background: rgba(248, 250, 252, .88);
      color: #0f172a;
      box-shadow: none;
      font-size: 12px;
      font-weight: 800;
      line-height: 1;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 7px;
    }

    .mobile-position-option {
      min-height: 44px;
      padding: 8px 6px;
      border-radius: 16px;
      line-height: 1.15;
      flex-direction: column;
      gap: 4px;
    }

    .mobile-color-option {
      justify-content: flex-start;
    }

    .mobile-popover-option.is-active {
      border-color: #0f172a;
      background: #0f172a;
      color: #fff;
    }

    .mobile-popover-option.is-out-of-stock,
    .mobile-popover-option:disabled {
      opacity: .42;
      cursor: not-allowed;
      filter: grayscale(.25);
    }

    .mobile-color-swatch {
      width: 18px;
      height: 18px;
      border-radius: 999px;
      border: 1px solid rgba(15, 23, 42, .18);
      background: var(--swatch-bg, #fff);
      flex: 0 0 auto;
    }

    .mobile-popover-option.is-active .mobile-color-swatch {
      border-color: rgba(255, 255, 255, .7);
    }

    .mobile-choice-symbol {
      width: 22px;
      height: 22px;
      border-radius: 999px;
      background: rgba(15, 23, 42, .08);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 13px;
      flex: 0 0 auto;
    }

    .mobile-position-option .mobile-choice-symbol {
      width: 24px;
      height: 24px;
      font-size: 14px;
    }

    .mobile-popover-option.is-active .mobile-choice-symbol {
      background: rgba(255, 255, 255, .18);
    }

    .mobile-data-fields {
      display: grid;
      gap: 10px;
    }

    .mobile-field-label {
      margin: 0;
      color: #0f172a;
      font-size: 12px;
      font-weight: 800;
    }

    .mobile-data-fields input[type="text"],
    .mobile-data-fields input[type="tel"],
    .mobile-data-fields select {
      width: 100%;
      margin: 0;
      padding: 12px;
      border: 1px solid rgba(226, 232, 240, .95);
      border-radius: 14px;
      background: rgba(248, 250, 252, .9);
      font-size: 14px;
    }

    .mobile-data-fields .phone-row {
      grid-template-columns: 112px 1fr;
    }

    .mobile-approval {
      display: flex;
      gap: 9px;
      margin: 2px 0 0;
      color: #334155;
      font-size: 12px;
      line-height: 1.35;
      font-weight: 700;
    }

    .mobile-approval input {
      margin-top: 2px;
      flex: 0 0 auto;
    }

    .mobile-checkout-btn {
      width: 100%;
      margin: 2px 0 0;
      padding: 13px;
      border-radius: 16px;
      background: #0f172a;
      color: #fff;
      font-size: 14px;
      font-weight: 800;
    }

    .mobile-checkout-btn:disabled {
      background: #94a3b8;
    }
  }

    @media (min-width: 821px) {
      .grid {
        align-items: start;
      }
    
      .preview-card {
        position: sticky;
        top: 24px;
        align-self: start;
        height: fit-content;
      }
    
      .preview-wrap {
        min-height: min(520px, calc(100vh - 150px));
      }
    }
    
  @media (max-width: 480px) {
    .phone-row {
      grid-template-columns: 1fr;
    }
  }

  @media (max-width: 820px) {
    body.has-mobile-action-dock {
      padding-bottom: 96px;
    }

    body.is-controls-open {
      overflow: hidden;
    }

    .page {
      width: 100%;
      max-width: 100%;
      padding: 14px;
      overflow-x: hidden;
    }

    .header {
      margin-bottom: 12px;
    }

    .brand-bar {
      gap: 8px;
    }

    .grid {
      grid-template-columns: 1fr;
      gap: 14px;
    }

    .preview-card {
      order: 1;
      padding: 14px;
      border-radius: 18px;
    }

    .preview-card-header {
      margin-bottom: 10px;
    }

    .preview-helper {
      display: block;
    }

    .preview-wrap {
      min-height: min(66svh, 520px);
      border-radius: 18px;
      background: #f8fafc;
    }

    .mockup-preview {
      max-width: min(88vw, 370px);
    }

    .preview-placeholder {
      width: 126px;
      min-height: 126px;
      padding: 12px;
      font-size: 11.5px;
      border-radius: 16px;
    }

    .preview-placeholder::before {
      width: 32px;
      height: 32px;
      font-size: 22px;
    }

    .controls-card {
      position: fixed;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: 80;
      max-height: 88svh;
      overflow-y: auto;
      border-radius: 24px 24px 0 0;
      padding: 16px;
      box-shadow: 0 -18px 48px rgba(15, 23, 42, .22);
      transform: translateY(calc(100% + 24px));
      opacity: 0;
      pointer-events: none;
      transition: transform .22s ease, opacity .22s ease;
      overscroll-behavior: contain;
    }

    body.is-controls-open .controls-card {
      transform: translateY(0);
      opacity: 1;
      pointer-events: auto;
    }

    .mobile-controls-header {
      position: sticky;
      top: -16px;
      z-index: 2;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin: -16px -16px 14px;
      padding: 14px 16px;
      background: rgba(255, 255, 255, .96);
      border-bottom: 1px solid #eef2f7;
      backdrop-filter: blur(10px);
    }

    .mobile-controls-header strong {
      display: block;
      font-size: 15px;
    }

    .mobile-controls-header p {
      margin: 3px 0 0;
      color: #64748b;
      font-size: 12px;
      line-height: 1.35;
    }

    .controls-close-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 38px;
      height: 38px;
      margin: 0;
      padding: 0;
      border-radius: 999px;
      background: #f1f5f9;
      color: #111827;
      font-size: 24px;
      line-height: 1;
      flex: 0 0 auto;
    }

    .controls-backdrop {
      display: block;
      position: fixed;
      inset: 0;
      z-index: 70;
      background: rgba(15, 23, 42, .48);
      opacity: 0;
      pointer-events: none;
      transition: opacity .18s ease;
    }

    body.is-controls-open .controls-backdrop {
      opacity: 1;
      pointer-events: auto;
    }

    .mobile-action-dock {
      position: fixed;
      left: 12px;
      right: 12px;
      bottom: 12px;
      z-index: 60;
      align-items: center;
      gap: 6px;
      width: auto;
      margin: 0;
      padding: 8px;
      border: 1px solid rgba(226, 232, 240, .95);
      border-radius: 24px;
      background: rgba(255, 255, 255, .96);
      box-shadow: 0 14px 36px rgba(15, 23, 42, .20);
      overflow-x: auto;
      overscroll-behavior-x: contain;
      scrollbar-width: none;
      -webkit-overflow-scrolling: touch;
    }

    .mobile-action-dock::-webkit-scrollbar {
      display: none;
    }

    body.has-mobile-action-dock .mobile-action-dock {
      display: flex;
    }

    .mobile-action-btn {
      flex: 0 0 58px;
      width: 58px;
      min-height: 58px;
      margin: 0;
      padding: 7px 4px;
      border-radius: 18px;
      background: transparent;
      color: #334155;
      box-shadow: none;
      font-size: 11px;
      line-height: 1.1;
      display: inline-flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 4px;
      white-space: nowrap;
    }

    .mobile-action-btn.is-active {
      background: #0f172a;
      color: #fff;
    }

    .mobile-action-icon {
      display: block;
      font-size: 19px;
      line-height: 1;
    }
  }
  

  /* Desktop editor mode: main preview + left floating tool dock */
  @media (min-width: 821px) {
    body {
      background: #f8fafc;
      overflow-x: hidden;
    }

    .page {
      width: 100%;
      max-width: none;
      min-height: 100vh;
      padding: 22px 32px 32px 112px;
    }

    .header {
      max-width: 1040px;
      margin: 0 auto 18px;
    }

    .brand-bar {
      justify-content: center;
    }

    .brand-tagline {
      display: none;
    }

    .grid {
      display: block;
    }

    .controls-card {
      position: fixed;
      left: -9999px;
      top: 0;
      width: 1px;
      height: 1px;
      overflow: hidden;
      opacity: 0;
      pointer-events: none;
    }

    .preview-card {
      position: relative;
      top: auto;
      width: min(980px, calc(100vw - 168px));
      min-height: calc(100vh - 96px);
      margin: 0 auto;
      padding: 22px;
      border-radius: 28px;
      box-shadow: 0 20px 60px rgba(15, 23, 42, .10);
    }

    .preview-card-header {
      justify-content: center;
      margin-bottom: 14px;
      text-align: center;
    }

    .preview-helper {
      display: block;
    }

    .preview-wrap {
      min-height: calc(100vh - 184px);
      border-radius: 24px;
      background: #f1f5f9;
    }

    .mockup-preview {
      max-width: min(520px, 58vh, calc(100vw - 260px));
    }

    .mobile-action-dock {
      position: fixed;
      left: 22px;
      top: 50%;
      right: auto;
      bottom: auto;
      z-index: 60;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 7px;
      width: 72px;
      margin: 0;
      padding: 10px;
      border: 1px solid rgba(226, 232, 240, .95);
      border-radius: 28px;
      background: rgba(255, 255, 255, .96);
      box-shadow: 0 18px 46px rgba(15, 23, 42, .18);
      overflow: visible;
      transform: translateY(-50%);
      backdrop-filter: blur(16px);
    }

    .mobile-action-btn {
      flex: 0 0 auto;
      width: 52px;
      min-height: 54px;
      margin: 0;
      padding: 7px 4px;
      border-radius: 18px;
      background: transparent;
      color: #334155;
      box-shadow: none;
      font-size: 10.5px;
      line-height: 1.1;
      display: inline-flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 4px;
      white-space: nowrap;
    }

    .mobile-action-btn:hover {
      background: #f1f5f9;
      color: #0f172a;
    }

    .mobile-action-btn.is-active {
      background: #0f172a;
      color: #fff;
    }

    .mobile-action-icon {
      display: block;
      font-size: 18px;
      line-height: 1;
    }

    .mobile-color-popover,
      .mobile-size-popover,
    .mobile-print-popover,
    .mobile-position-popover,
    .mobile-data-popover {
      position: fixed;
      left: 108px;
      right: auto;
      top: 50%;
      bottom: auto;
      z-index: 65;
      display: block;
      width: min(420px, calc(100vw - 140px));
      max-width: 420px;
      margin: 0;
      padding: 14px;
      border: 1px solid rgba(226, 232, 240, .95);
      border-radius: 24px;
      background: rgba(255, 255, 255, .94);
      box-shadow: 0 18px 46px rgba(15, 23, 42, .20);
      backdrop-filter: blur(16px);
      opacity: 0;
      transform: translateY(-50%) translateX(-10px) scale(.98);
      transform-origin: left center;
      pointer-events: none;
      transition: opacity .18s ease, transform .18s ease;
    }

    .mobile-data-popover {
      width: min(420px, calc(100vw - 140px));
      max-height: calc(100vh - 44px);
      overflow-y: auto;
      overscroll-behavior: contain;
    }

    body.is-color-popover-open .mobile-color-popover,
    body.is-size-popover-open .mobile-size-popover,
    body.is-print-popover-open .mobile-print-popover,
    body.is-position-popover-open .mobile-position-popover,
    body.is-data-popover-open .mobile-data-popover {
      opacity: 1;
      transform: translateY(-50%) translateX(0) scale(1);
      pointer-events: auto;
    }

    .mobile-color-popover::after,
    .mobile-size-popover::after,
    .mobile-print-popover::after,
    .mobile-position-popover::after,
    .mobile-data-popover::after {
      content: "";
      position: absolute;
      left: -8px;
      top: 50%;
      bottom: auto;
      width: 16px;
      height: 16px;
      background: rgba(255, 255, 255, .94);
      border-left: 1px solid rgba(226, 232, 240, .95);
      border-bottom: 1px solid rgba(226, 232, 240, .95);
      transform: translateY(-50%) rotate(45deg);
    }

    .mobile-popover-title {
      margin: 0 0 10px;
      color: #0f172a;
      font-size: 13px;
      font-weight: 800;
    }

    .mobile-popover-options {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
      gap: 8px;
    }

    .mobile-color-options {
      grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
    }

    .mobile-size-options {
      grid-template-columns: repeat(auto-fit, minmax(54px, 1fr));
    }

    .mobile-print-options {
      grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .mobile-position-options {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .mobile-popover-option {
      width: auto;
      margin: 0;
      padding: 9px 10px;
      border: 1px solid rgba(226, 232, 240, .95);
      border-radius: 999px;
      background: rgba(248, 250, 252, .88);
      color: #0f172a;
      box-shadow: none;
      font-size: 12px;
      font-weight: 800;
      line-height: 1;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 7px;
    }

    .mobile-popover-option:hover {
      background: #eef2f7;
    }

    .mobile-color-option {
      justify-content: flex-start;
    }

    .mobile-position-option {
      min-height: 44px;
      padding: 8px 6px;
      border-radius: 16px;
      line-height: 1.15;
      flex-direction: column;
      gap: 4px;
    }

    .mobile-popover-option.is-active {
      border-color: #0f172a;
      background: #0f172a;
      color: #fff;
    }

    .mobile-popover-option.is-out-of-stock,
    .mobile-popover-option:disabled {
      opacity: .42;
      cursor: not-allowed;
      filter: grayscale(.25);
    }

    .mobile-color-swatch {
      width: 18px;
      height: 18px;
      border-radius: 999px;
      border: 1px solid rgba(15, 23, 42, .18);
      background: var(--swatch-bg, #fff);
      flex: 0 0 auto;
    }

    .mobile-popover-option.is-active .mobile-color-swatch {
      border-color: rgba(255, 255, 255, .7);
    }

    .mobile-choice-symbol {
      width: 22px;
      height: 22px;
      border-radius: 999px;
      background: rgba(15, 23, 42, .08);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 13px;
      flex: 0 0 auto;
    }

    .mobile-position-option .mobile-choice-symbol {
      width: 24px;
      height: 24px;
      font-size: 14px;
    }

    .mobile-popover-option.is-active .mobile-choice-symbol {
      background: rgba(255, 255, 255, .18);
    }

    .mobile-data-fields {
      display: grid;
      gap: 10px;
    }

    .mobile-field-label {
      margin: 0;
      color: #0f172a;
      font-size: 12px;
      font-weight: 800;
    }

    .mobile-data-fields input[type="text"],
    .mobile-data-fields input[type="tel"],
    .mobile-data-fields select {
      width: 100%;
      margin: 0;
      padding: 12px;
      border: 1px solid rgba(226, 232, 240, .95);
      border-radius: 14px;
      background: rgba(248, 250, 252, .9);
      font-size: 14px;
    }

    .mobile-data-fields .phone-row {
      grid-template-columns: 112px 1fr;
    }

    .mobile-approval {
      display: flex;
      gap: 9px;
      margin: 2px 0 0;
      color: #334155;
      font-size: 12px;
      line-height: 1.35;
      font-weight: 700;
    }

    .mobile-approval input {
      margin-top: 2px;
      flex: 0 0 auto;
    }

    .mobile-checkout-btn {
      width: 100%;
      margin: 2px 0 0;
      padding: 13px;
      border-radius: 16px;
      background: #0f172a;
      color: #fff;
      font-size: 14px;
      font-weight: 800;
    }

    .mobile-checkout-btn:disabled {
      background: #94a3b8;
    }
  }


  /* Seamless white editor cleanup */
  .brand-tagline,
  .preview-card-header {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .page {
    background: #fff;
  }

  .card,
  .preview-card {
    background: #fff;
    box-shadow: none;
  }

  .preview-wrap {
    background: #fff;
  }

  @media (max-width: 820px) {
    .header {
      margin-bottom: 4px;
    }

    .preview-card {
      padding: 8px 0 14px;
      border-radius: 0;
      box-shadow: none;
    }

    .preview-wrap {
      min-height: min(70svh, 540px);
      border-radius: 0;
      background: #fff;
    }
  }

  @media (min-width: 821px) {
    body {
      background: #fff;
    }

    .page {
      padding-top: 18px;
      background: #fff;
    }

    .header {
      margin-bottom: 8px;
    }

    .preview-card {
      min-height: calc(100vh - 72px);
      padding: 0 22px 22px;
      border-radius: 0;
      background: #fff;
      box-shadow: none;
    }

    .preview-wrap {
      min-height: calc(100vh - 108px);
      border-radius: 0;
      background: #fff;
    }
  }



  /* Minor alignment patch: centered dock icons, left brand, desktop fit-to-screen */
  @media (max-width: 820px) {
    .brand-bar {
      align-items: flex-start;
      justify-content: flex-start;
    }

    .brand-logo {
      margin-left: 0;
    }

    .mobile-action-dock {
      justify-content: flex-start;
    }

    .mobile-action-dock .mobile-action-btn:first-child {
      margin-left: auto;
    }

    .mobile-action-dock .mobile-action-btn:last-child {
      margin-right: auto;
    }
  }

  @media (min-width: 821px) {
    html,
    body {
      width: 100%;
      height: 100%;
      overflow: hidden;
    }

    .page {
      display: flex;
      flex-direction: column;
      width: 100%;
      height: 100vh;
      min-height: 0;
      max-height: 100vh;
      padding: 18px 32px 18px 112px;
      overflow: hidden;
    }

    .header {
      position: fixed;
      top: 18px;
      left: 32px;
      z-index: 55;
      width: auto;
      max-width: none;
      margin: 0;
    }

    .brand-bar {
      align-items: center;
      justify-content: flex-start;
    }

    .brand-logo {
      height: 42px;
      margin-left: 0;
    }

    .grid {
      flex: 1 1 auto;
      display: block;
      min-height: 0;
      height: 100%;
    }

    .preview-card {
      display: flex;
      flex-direction: column;
      width: min(980px, calc(100vw - 168px));
      height: 100%;
      min-height: 0;
      margin: 0 auto;
      padding: 0 22px;
    }

    .preview-wrap {
      flex: 1 1 auto;
      width: 100%;
      height: 100%;
      min-height: 0;
      max-height: 100%;
    }

    .mockup-preview {
      max-width: min(500px, 56vh, calc(100vw - 260px));
    }

    .mobile-action-dock {
      align-items: center;
    }
  }


  /* Clean editor state: keep logic-only fields off-canvas, remove legacy step panel UI */
  .editor-state {
    position: fixed !important;
    left: -10000px !important;
    top: 0 !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }


  /* Position nudge controls: four arrows around uploaded design */
  .position-nudge-controls {
    position: absolute;
    inset: 0;
    z-index: 34;
    display: none;
    pointer-events: none;
  }

  .mockup-preview.has-design .position-nudge-controls {
    display: block;
  }

  .position-nudge-btn {
    position: absolute;
    z-index: 35;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: transparent;
    box-shadow: none;
    font-size: 0;
    line-height: 1;
    pointer-events: auto;
    cursor: pointer;
    opacity: .78;
    transition: transform .14s ease, opacity .14s ease;
  }

  .position-nudge-btn::before {
    content: "";
    display: block;
    width: 17px;
    height: 17px;
    background: rgba(51, 65, 85, .82);
    filter: drop-shadow(0 5px 10px rgba(15, 23, 42, .18));
    transition: background .14s ease, filter .14s ease, transform .14s ease;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.35c.78 0 1.5.43 1.86 1.12l8.35 15.9c.72 1.37-.27 3.01-1.81 3.01H3.6c-1.54 0-2.53-1.64-1.81-3.01l8.35-15.9A2.1 2.1 0 0 1 12 2.35Z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.35c.78 0 1.5.43 1.86 1.12l8.35 15.9c.72 1.37-.27 3.01-1.81 3.01H3.6c-1.54 0-2.53-1.64-1.81-3.01l8.35-15.9A2.1 2.1 0 0 1 12 2.35Z'/%3E%3C/svg%3E") center / contain no-repeat;
  }

  .position-nudge-up::before {
    transform: rotate(0deg);
  }

  .position-nudge-down::before {
    transform: rotate(180deg);
  }

  .position-nudge-left::before {
    transform: rotate(-90deg);
  }

  .position-nudge-right::before {
    transform: rotate(90deg);
  }

  .position-nudge-btn:hover {
    background: transparent;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.08);
  }

  .position-nudge-btn:hover::before {
    background: rgba(30, 41, 59, .94);
    filter: drop-shadow(0 7px 14px rgba(15, 23, 42, .24));
  }

  .position-nudge-btn.is-hidden,
  .mobile-position-nudge-option.is-hidden {
    display: none !important;
  }

  .position-nudge-up {
    left: var(--position-control-center-x, 50%);
    top: calc(var(--position-control-top-y, 43%) - 30px);
    transform: translate(-50%, -50%);
  }

  .position-nudge-down {
    left: var(--position-control-center-x, 50%);
    top: calc(var(--position-control-bottom-y, 58%) + 30px);
    transform: translate(-50%, -50%);
  }

  .position-nudge-left {
    left: calc(var(--position-control-left-x, 42%) - 30px);
    top: var(--position-control-center-y, 50%);
    transform: translate(-50%, -50%);
  }

  .position-nudge-right {
    left: calc(var(--position-control-right-x, 58%) + 30px);
    top: var(--position-control-center-y, 50%);
    transform: translate(-50%, -50%);
  }

  .mobile-position-nudge-options {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .mobile-position-nudge-option {
    min-height: 44px;
    padding: 8px 6px;
    border-radius: 16px;
    line-height: 1.15;
    flex-direction: column;
    gap: 4px;
  }

  @media (max-width: 520px) {
    .position-nudge-btn {
      width: 26px;
      height: 26px;
    }

    .position-nudge-btn::before {
      width: 15px;
      height: 15px;
    }

    .position-nudge-up {
      top: calc(var(--position-control-top-y, 43%) - 28px);
    }

    .position-nudge-down {
      top: calc(var(--position-control-bottom-y, 58%) + 28px);
    }

    .position-nudge-left {
      left: calc(var(--position-control-left-x, 42%) - 28px);
    }

    .position-nudge-right {
      left: calc(var(--position-control-right-x, 58%) + 28px);
    }
  }


  /* Floating total panel: compact bag + clickable order summary */
  .price-floating-panel {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 95;
    width: max-content;
    max-width: calc(100vw - 28px);
    pointer-events: auto;
  }

  .price-floating-toggle {
    width: auto;
    min-width: 138px;
    margin: 0;
    padding: 9px 12px;
    border: 1px solid rgba(226, 232, 240, .95);
    border-radius: 18px;
    background: rgba(255, 255, 255, .94);
    color: #0f172a;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .14);
    backdrop-filter: blur(14px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    line-height: 1;
  }

  .price-floating-toggle:hover {
    background: #fff;
    box-shadow: 0 16px 38px rgba(15, 23, 42, .18);
  }

  .price-floating-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: #0f172a;
    color: #fff;
    font-size: 15px;
    flex: 0 0 auto;
  }

  .price-floating-value {
    display: block;
    color: #0f172a;
    font-size: 16px;
    font-weight: 900;
    line-height: 1.05;
    white-space: nowrap;
  }

  .price-floating-panel.is-out-of-stock .price-floating-toggle {
    border-color: rgba(220, 38, 38, .28);
  }

  .price-floating-panel.is-out-of-stock .price-floating-value {
    color: #dc2626;
  }

  .price-floating-summary {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: min(320px, calc(100vw - 28px));
    padding: 15px;
    border: 1px solid rgba(226, 232, 240, .95);
    border-radius: 22px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 20px 54px rgba(15, 23, 42, .20);
    backdrop-filter: blur(16px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(.98);
    transform-origin: top right;
    pointer-events: none;
    transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
  }

  .price-floating-panel.is-summary-open .price-floating-summary {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
  }

  .price-summary-title {
    margin: 0 0 12px;
    color: #0f172a;
    font-size: 14px;
    font-weight: 900;
  }

  .price-summary-group {
    padding: 11px 0;
    border-top: 1px solid rgba(226, 232, 240, .95);
  }

  .price-summary-heading {
    margin-bottom: 7px;
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
  }

  .price-summary-subheading {
    margin: 11px 0 6px;
    color: #0f172a;
    font-size: 12px;
    font-weight: 900;
  }

  .price-summary-qty-block {
    margin-top: 11px;
    padding-top: 10px;
    border-top: 1px solid rgba(226, 232, 240, .95);
  }

  .price-summary-package-note {
    margin-top: 6px;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.35;
  }

  .price-summary-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-top: 6px;
    color: #475569;
    font-size: 13px;
    line-height: 1.3;
  }

  .price-summary-row strong {
    color: #0f172a;
    font-weight: 900;
    text-align: right;
  }

  .price-summary-qty-row {
    align-items: center;
  }

  .price-qty-control {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
  }

  .price-qty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(226, 232, 240, .95);
    border-radius: 999px;
    background: #f8fafc;
    color: #0f172a;
    box-shadow: none;
    font-size: 17px;
    font-weight: 900;
    line-height: 1;
  }

  .price-qty-btn:hover {
    background: #eef2f7;
  }

  .price-qty-btn:disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
  }

  .price-qty-input {
    width: 44px !important;
    height: 28px;
    margin: 0;
    padding: 0 4px !important;
    border: 1px solid rgba(226, 232, 240, .95) !important;
    border-radius: 10px !important;
    background: #fff !important;
    color: #0f172a;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    text-align: center;
    -moz-appearance: textfield;
  }

  .price-qty-input::-webkit-outer-spin-button,
  .price-qty-input::-webkit-inner-spin-button {
    margin: 0;
    -webkit-appearance: none;
  }

  .price-summary-note {
    display: none;
    margin-top: 6px;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.25;
    text-align: right;
  }

  .price-summary-note.is-visible {
    display: block;
  }

  .price-summary-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 2px;
    padding-top: 13px;
    border-top: 1px solid rgba(15, 23, 42, .12);
    color: #0f172a;
    font-size: 14px;
    font-weight: 900;
  }

  .price-summary-total strong {
    font-size: 18px;
    white-space: nowrap;
  }

  @media (max-width: 820px) {
    .price-floating-panel {
      top: 14px;
      right: 14px;
    }

    .price-floating-toggle {
      min-width: 128px;
      padding: 8px 10px;
      border-radius: 16px;
      gap: 8px;
    }

    .price-floating-icon {
      width: 26px;
      height: 26px;
      font-size: 14px;
    }

    .price-floating-value {
      font-size: 15px;
    }

    .price-floating-summary {
      width: min(306px, calc(100vw - 28px));
      padding: 14px;
      border-radius: 20px;
    }
  }



  /* Multi-item cart summary */
  .cart-items-group[hidden] {
    display: none !important;
  }

  .cart-item-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: start;
    padding: 9px 0;
    border-top: 1px solid rgba(226, 232, 240, .75);
  }

  .cart-item-row:first-child {
    border-top: 0;
    padding-top: 0;
  }

  .cart-item-title {
    display: block;
    color: #0f172a;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.3;
  }

  .cart-item-meta {
    display: block;
    margin-top: 3px;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.35;
  }

  .cart-item-price {
    display: block;
    margin-top: 4px;
    color: #0f172a;
    font-size: 12px;
    font-weight: 900;
  }

  .cart-item-print-breakdown {
    display: block;
    margin-top: 5px;
    padding: 6px 8px;
    border-radius: 12px;
    background: #f8fafc;
    color: #475569;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.45;
  }

  .cart-item-qty {
    display: block;
    margin-top: 5px;
    color: #475569;
    font-size: 11px;
    font-weight: 900;
    line-height: 1.35;
  }

  .price-summary-breakdown {
    margin-top: 8px;
    padding: 8px 9px;
    border-radius: 14px;
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.45;
  }

  .print-breakdown-row,
  .print-breakdown-total {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
  }

  .print-breakdown-row + .print-breakdown-row,
  .print-breakdown-total {
    margin-top: 4px;
  }

  .print-breakdown-total {
    padding-top: 6px;
    border-top: 1px solid rgba(226, 232, 240, .95);
    color: #0f172a;
    font-weight: 900;
  }

  .print-breakdown-price {
    color: #0f172a;
    font-weight: 900;
    white-space: nowrap;
  }

  .cart-item-remove {
    width: auto;
    min-width: 28px;
    height: 28px;
    margin: 0;
    padding: 0 8px;
    border: 1px solid rgba(226, 232, 240, .95);
    border-radius: 999px;
    background: #f8fafc;
    color: #0f172a;
    box-shadow: none;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
  }

  .cart-item-remove:hover {
    background: #fee2e2;
    color: #991b1b;
  }

  .cart-summary-actions {
    display: grid;
    gap: 8px;
    margin-top: 12px;
  }

  .cart-add-btn,
  .cart-clear-btn {
    width: 100%;
    margin: 0;
    padding: 10px 12px;
    border-radius: 14px;
    box-shadow: none;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.1;
  }

  .cart-add-btn {
    background: #0f172a;
    color: #fff;
  }

  .cart-clear-btn {
    display: none;
    background: #f8fafc;
    color: #0f172a;
    border: 1px solid rgba(226, 232, 240, .95);
  }

  .cart-clear-btn.is-visible {
    display: block;
  }

  .cart-summary-note {
    display: none;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.35;
  }

  .cart-summary-note.is-visible {
    display: block;
  }

  .active-item-empty[hidden],
  .active-detail-group[hidden] {
    display: none !important;
  }

  .active-item-empty-text {
    margin: 0;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.45;
  }

  .order-summary-list {
    display: grid;
    gap: 0;
  }

  .cart-items-group[hidden],
  .active-item-empty[hidden],
  .active-detail-group[hidden] {
    display: none !important;
  }

  .summary-order-card {
    padding: 11px 0;
    border-top: 1px solid rgba(226, 232, 240, .95);
  }

  .cart-items-group .summary-order-card:first-child {
    padding-top: 11px;
  }

  .summary-order-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 9px;
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
  }

  .summary-order-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-top: 6px;
    color: #475569;
    font-size: 13px;
    line-height: 1.3;
  }

  .summary-order-row strong {
    color: #0f172a;
    font-weight: 900;
    text-align: right;
    white-space: nowrap;
  }

  .summary-order-section-label {
    margin: 11px 0 5px;
    color: #0f172a;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .summary-order-print-list {
    display: grid;
    gap: 5px;
  }

  .summary-order-print-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    color: #475569;
    font-size: 13px;
    line-height: 1.3;
  }

  .summary-order-print-row strong {
    color: #0f172a;
    font-weight: 900;
    white-space: nowrap;
    text-align: right;
  }

  .summary-order-qty-row {
    align-items: center;
    margin-top: 11px;
    padding-top: 10px;
    border-top: 1px solid rgba(226, 232, 240, .95);
  }

  .summary-order-subtotal {
    margin-top: 10px;
    padding-top: 9px;
    border-top: 1px solid rgba(15, 23, 42, .10);
    color: #0f172a;
    font-weight: 900;
    text-transform: uppercase;
  }

  .summary-order-footer {
    padding: 10px 0 0;
    border-top: 1px solid rgba(226, 232, 240, .95);
  }

  .summary-order-remove {
    width: 26px;
    min-width: 26px;
    height: 26px;
    margin: -5px 0 0;
    padding: 0;
    border: 1px solid rgba(226, 232, 240, .95);
    border-radius: 999px;
    background: #f8fafc;
    color: #0f172a;
    box-shadow: none;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
  }

  .summary-order-remove:hover {
    background: #fee2e2;
    color: #991b1b;
  }


  .ui-icon {
    display: block;
    width: 1em;
    height: 1em;
    flex: 0 0 auto;
  }

  .price-floating-icon .ui-icon {
    width: 16px;
    height: 16px;
  }

  .mobile-action-icon .ui-icon {
    width: 20px;
    height: 20px;
  }

  .side-toggle-action-btn.is-back-side [data-side-switch-current]::after {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-left: 4px;
    border-radius: 999px;
    background: currentColor;
    vertical-align: middle;
    opacity: .78;
  }

  .side-toggle-action-btn.is-side-switching {
    cursor: wait;
    opacity: .72;
  }

  .mobile-action-btn:disabled:not(.is-active) {
    background: transparent;
    color: #94a3b8;
    cursor: wait;
    opacity: .62;
  }

  .mobile-action-btn.is-active:disabled {
    background: #0f172a;
    color: #fff;
    cursor: wait;
    opacity: .72;
  }

  .editor-hidden-title {
    display: none !important;
  }
    


  .mobile-account-manage-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    border-radius: 999px;
    background: #f8fafc;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    font-size: 13px;
    font-weight: 900;
  }

  .mobile-address-note {
    margin: 6px 0 10px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.4;
  }

  .mobile-address-manage-row {
    margin-top: 8px;
  }

  /* Account menu upgrade: Google login/history ready, checkout data kept intact */
  .mobile-account-card {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(226, 232, 240, .95);
    border-radius: 18px;
    background: rgba(248, 250, 252, .92);
  }

  .mobile-account-copy {
    margin: 0;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.45;
  }

  .mobile-google-login-btn,
  .mobile-account-history-link,
  .mobile-account-logout-link {
    width: 100%;
    min-height: 42px;
    margin: 0;
    padding: 11px 12px;
    border-radius: 14px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  .mobile-google-login-btn {
    border: 1px solid rgba(15, 23, 42, .14);
    background: #fff;
    color: #0f172a;
  }

  .mobile-google-login-btn:hover {
    background: #f8fafc;
  }

  .mobile-account-history-link {
    background: #0f172a;
    color: #fff;
  }

  .mobile-account-logout-link {
    border: 1px solid rgba(226, 232, 240, .95);
    background: #fff;
    color: #475569;
  }

  .mobile-account-profile {
    display: grid;
    grid-template-columns: 38px 1fr;
    gap: 10px;
    align-items: center;
  }

  .mobile-account-avatar,
  .mobile-account-initial {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: #0f172a;
    color: #fff;
    object-fit: cover;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .mobile-account-name {
    display: block;
    color: #0f172a;
    font-size: 13px;
    font-weight: 900;
    line-height: 1.25;
  }

  .mobile-account-email {
    display: block;
    margin-top: 2px;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
    word-break: break-all;
  }

  .mobile-account-divider {
    margin: 2px 0 -2px;
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
  }

  .mobile-account-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }


  /* Shipping summary + modal picker */
  .mobile-shipping-panel {
    display: grid;
    gap: 9px;
    padding: 12px;
    border: 1px solid rgba(226, 232, 240, .95);
    border-radius: 18px;
    background: rgba(248, 250, 252, .92);
  }

  .mobile-shipping-panel[hidden],
  .mobile-shipping-current[hidden] {
    display: none !important;
  }

  .mobile-shipping-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #0f172a;
    font-size: 12px;
    font-weight: 900;
  }

  .mobile-shipping-status {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
  }

  .mobile-shipping-status.is-error {
    color: #b91c1c;
  }

  .mobile-shipping-current {
    display: grid;
    gap: 3px;
    padding: 10px 11px;
    border: 1px solid rgba(15, 23, 42, .12);
    border-radius: 14px;
    background: #fff;
    color: #0f172a;
    font-size: 12px;
    line-height: 1.35;
  }

  .mobile-shipping-current strong {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    font-weight: 900;
  }

  .mobile-shipping-current strong span:last-child {
    white-space: nowrap;
  }

  .mobile-shipping-current > span {
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
  }

  .mobile-shipping-change-btn {
    width: 100%;
    min-height: 40px;
    margin: 0;
    padding: 11px 12px;
    border: 1px solid rgba(15, 23, 42, .14);
    border-radius: 14px;
    background: #0f172a;
    color: #fff;
    box-shadow: none;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
  }

  .mobile-shipping-change-btn:hover {
    background: #111827;
  }

  .mobile-shipping-change-btn:disabled {
    border-color: rgba(226, 232, 240, .95);
    background: #e2e8f0;
    color: #64748b;
    cursor: not-allowed;
  }

  .shipping-option-modal {
    position: fixed;
    inset: 0;
    z-index: 140;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .18s ease, visibility .18s ease;
  }

  body.is-shipping-modal-open .shipping-option-modal {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .shipping-option-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .46);
    backdrop-filter: blur(8px);
  }

  .shipping-option-dialog {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    width: min(430px, calc(100vw - 28px));
    max-height: min(680px, calc(100svh - 48px));
    padding: 14px;
    border: 1px solid rgba(226, 232, 240, .95);
    border-radius: 24px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
    backdrop-filter: blur(16px);
    transform: translateY(12px) scale(.98);
    transition: transform .18s ease;
    overflow: hidden;
  }

  body.is-shipping-modal-open .shipping-option-dialog {
    transform: translateY(0) scale(1);
  }

  .shipping-option-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
  }

  .shipping-option-head strong {
    display: block;
    color: #0f172a;
    font-size: 15px;
    font-weight: 900;
    line-height: 1.2;
  }

  .shipping-option-head span {
    display: block;
    margin-top: 3px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
  }

  .shipping-option-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    border-radius: 999px;
    background: #f1f5f9;
    color: #0f172a;
    box-shadow: none;
    font-size: 24px;
    line-height: 1;
    flex: 0 0 auto;
  }

  .shipping-option-close-btn:hover {
    background: #e2e8f0;
  }

  .mobile-shipping-options {
    display: grid;
    gap: 7px;
  }

  .shipping-modal-options {
    min-height: 0;
    max-height: calc(100svh - 148px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 2px;
  }

  .mobile-shipping-option {
    width: 100%;
    margin: 0;
    padding: 10px 11px;
    border: 1px solid rgba(226, 232, 240, .95);
    border-radius: 14px;
    background: #fff;
    color: #0f172a;
    box-shadow: none;
    text-align: left;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.35;
    display: grid;
    gap: 2px;
  }

  .mobile-shipping-option:hover {
    background: #f8fafc;
    border-color: rgba(15, 23, 42, .2);
  }

  .mobile-shipping-option.is-active {
    border-color: #0f172a;
    background: #0f172a;
    color: #fff;
  }

  .mobile-shipping-option strong {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
  }

  .mobile-shipping-option span {
    color: inherit;
    opacity: .82;
    font-size: 11px;
    font-weight: 700;
  }



  /* Print quality guard: floating toast, auto-hide, closeable */
  .print-quality-warning {
    position: fixed;
    left: 50%;
    top: 22px;
    bottom: auto;
    z-index: 130;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: flex-start;
    gap: 10px;
    width: min(460px, calc(100vw - 28px));
    margin: 0;
    padding: 12px 12px 12px 14px;
    border-radius: 18px;
    background: rgba(255, 247, 237, .97);
    color: #9a3412;
    border: 1px solid #fed7aa;
    box-shadow: 0 18px 48px rgba(15, 23, 42, .18);
    backdrop-filter: blur(14px);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.45;
    text-align: left;
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -12px) scale(.98);
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
  }

  .print-quality-warning.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0) scale(1);
    pointer-events: auto;
  }

  .print-quality-warning.is-blocking {
    background: rgba(254, 242, 242, .97);
    color: #991b1b;
    border-color: #fecaca;
  }

  .print-quality-warning-text {
    min-width: 0;
  }

  .print-quality-warning-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin: -4px -4px 0 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(154, 52, 18, .10);
    color: currentColor;
    box-shadow: none;
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
  }

  .print-quality-warning-close:hover {
    background: rgba(154, 52, 18, .16);
  }

  .print-quality-warning.is-blocking .print-quality-warning-close {
    background: rgba(153, 27, 27, .10);
  }

  .print-quality-warning.is-blocking .print-quality-warning-close:hover {
    background: rgba(153, 27, 27, .16);
  }

  @media (max-width: 820px) {
    .print-quality-warning {
      top: 64px;
      bottom: auto;
      width: min(390px, calc(100vw - 28px));
    }
  }

  .mobile-popover-option.is-quality-blocked,
  .mobile-popover-option:disabled.is-quality-blocked {
    opacity: .42;
    cursor: not-allowed;
    filter: grayscale(.2);
  }

  .cart-item-quality-warning {
    display: block;
    margin-top: 5px;
    padding: 6px 8px;
    border-radius: 12px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.35;
  }

  /* Preview side switch: front/back lives under the shirt preview */
  .preview-wrap {
    perspective: 1000px;
  }

  .mockup-preview.is-side-flipping {
    animation: kloteeSideFlip .23s ease-in-out both;
    pointer-events: none;
    transform-style: preserve-3d;
  }

  .mockup-preview.is-side-switching {
    cursor: wait;
    pointer-events: none;
  }

  .mockup-preview.is-side-switching .shirt-base {
    filter: none;
    opacity: 1;
  }

  .mockup-preview.is-side-switching .design-overlay {
    opacity: 0;
    transition: opacity .12s ease;
  }

  .mockup-preview.is-side-switching .preview-placeholder,
  .mockup-preview.is-side-switching .position-nudge-controls,
  .mockup-preview.is-side-switching .remove-design-btn {
    opacity: 0;
    pointer-events: none;
  }

  .mockup-preview.is-side-switching::before {
    content: "";
    position: absolute;
    left: var(--design-left, 50%);
    top: var(--design-top, 43%);
    z-index: 42;
    width: min(168px, 34%);
    min-height: 104px;
    border: 1.5px dashed rgba(15, 23, 42, .24);
    border-radius: 20px;
    background:
      linear-gradient(110deg, rgba(255, 255, 255, .58), rgba(248, 250, 252, .96), rgba(255, 255, 255, .58));
    background-size: 220% 100%;
    box-shadow:
      0 18px 38px rgba(15, 23, 42, .16),
      inset 0 1px 0 rgba(255, 255, 255, .86);
    transform: translate(-50%, -50%);
    animation: kloteeSideLoadingPulse 1.05s ease-in-out infinite, kloteeSideLoadingShimmer 1.25s linear infinite;
    pointer-events: auto;
  }

  .mockup-preview.is-side-switching::after {
    content: "Menyiapkan\A preview...";
    position: absolute;
    left: var(--design-left, 50%);
    top: var(--design-top, 43%);
    z-index: 43;
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(168px, 34%);
    min-height: 104px;
    padding: 0 14px;
    box-sizing: border-box;
    color: #0f172a;
    font-size: 11.5px;
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: .01em;
    text-align: center;
    white-space: pre-line;
    transform: translate(-50%, -50%);
    animation: kloteeSideLoadingText .95s ease-in-out infinite;
    pointer-events: none;
  }

  @keyframes kloteeSideLoadingPulse {
    0%, 100% {
      opacity: .82;
      transform: translate(-50%, -50%) scale(.985);
    }

    50% {
      opacity: 1;
      transform: translate(-50%, -50%) scale(1);
    }
  }

  @keyframes kloteeSideLoadingText {
    0%, 100% {
      opacity: .72;
    }

    50% {
      opacity: 1;
    }
  }

  @keyframes kloteeSideLoadingShimmer {
    0% {
      background-position: 120% 0;
    }

    100% {
      background-position: -120% 0;
    }
  }

  @media (max-width: 520px) {
    .mockup-preview.is-side-switching::before,
    .mockup-preview.is-side-switching::after {
      width: min(148px, 38%);
    }

    .mockup-preview.is-side-switching::before {
      min-height: 94px;
      border-radius: 18px;
    }

    .mockup-preview.is-side-switching::after {
      min-height: 94px;
      padding: 0 12px;
      font-size: 11px;
    }
  }


  @keyframes kloteeSideFlip {
    0% {
      transform: rotateY(0deg) scale(1);
      opacity: 1;
    }

    48% {
      transform: rotateY(88deg) scale(.985);
      opacity: .78;
    }

    52% {
      transform: rotateY(-88deg) scale(.985);
      opacity: .78;
    }

    100% {
      transform: rotateY(0deg) scale(1);
      opacity: 1;
    }
  }

  .side-switch-panel {
    position: relative;
    z-index: 45;
    width: min(360px, calc(100% - 28px));
    margin: 10px auto 0;
    display: grid;
    gap: 7px;
    justify-items: center;
  }

  .side-switch-title {
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .06em;
    line-height: 1;
    text-transform: uppercase;
  }

  .side-switch-control {
    width: 100%;
    padding: 5px;
    border: 1px solid rgba(226, 232, 240, .95);
    border-radius: 999px;
    background: rgba(248, 250, 252, .94);
    box-shadow: 0 12px 30px rgba(15, 23, 42, .10);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    backdrop-filter: blur(14px);
  }

  .side-switch-btn {
    width: 100%;
    min-height: 42px;
    margin: 0;
    padding: 10px 12px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #334155;
    box-shadow: none;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  .side-switch-btn:hover {
    background: rgba(226, 232, 240, .70);
    color: #0f172a;
  }

  .side-switch-btn.is-active {
    background: #0f172a;
    color: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .22);
  }

  .side-switch-btn:disabled {
    background: transparent;
    color: #94a3b8;
    cursor: wait;
  }

  .side-switch-status {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .08);
    color: inherit;
    font-size: 13px;
    font-weight: 900;
    line-height: 22px;
    text-align: center;
  }

  .side-switch-btn.is-active .side-switch-status {
    background: rgba(255, 255, 255, .18);
  }

  .side-switch-btn.has-design:not(.is-active) .side-switch-status {
    background: rgba(22, 163, 74, .12);
    color: #15803d;
  }

  @media (max-width: 820px) {
    .side-switch-panel {
      margin-top: 4px;
      width: min(330px, calc(100% - 32px));
    }

    .side-switch-control {
      padding: 4px;
      box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
    }

    .side-switch-btn {
      min-height: 39px;
      padding: 9px 10px;
      font-size: 12.5px;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    .mockup-preview.is-side-flipping,
    .mockup-preview.is-side-switching::before,
    .mockup-preview.is-side-switching::after {
      animation: none;
    }
  }
