/* =========================================================
   Kollázs desktop chrome — naptár-stílusú UI + egységes modalok
   ========================================================= */

:root {
  --kol-tab-w: 84px; /* 76px + ~10% */
  --kol-panel-w: 320px;
  --kol-rail-w: 252px;
  --kol-rail-space: 308px;
  --kol-primary: #ff6600;
  --kol-modal-bg: rgba(17, 20, 28, 0.48);
}

.kol-tab-menu,
.kol-desktop-panel,
.kol-desktop-right-rail {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.kol-cart-busy {
  cursor: wait !important;
}
body.kol-cart-busy #overlay {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* ========== EGYSÉGES STÚDIÓ MODALOK (naptár mintára) ========== */

.cart-preview-modal,
.auto-arrange-modal,
.saved-products-modal,
.size-change-modal,
.modal_vagas,
#sablonConfirmModal,
#kolTextEditModal,
#uploadOverlay,
#previewGenerationOverlay {
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
}

.cart-preview-overlay,
.sablon-confirm-overlay,
.size-change-modal-overlay,
.upload-modal-overlay,
.preview-modal-overlay,
.loading-modal-overlay,
#sablonConfirmModal .sablon-confirm-overlay {
  background: var(--kol-modal-bg) !important;
  background-image: none !important;
  backdrop-filter: blur(10px) !important;
}

.cart-preview-modal {
  padding: 20px;
  box-sizing: border-box;
  background: transparent;
  animation: none;
}

.cart-preview-content,
.auto-arrange-modal-content,
.saved-products-modal-content,
.size-change-modal-content,
.modal-content_vagas,
.sablon-confirm-card,
.kol-tem-content,
.upload-modal-content,
.preview-modal-content,
#overlay .loading-modal-content {
  background: #fff !important;
  background-image: none !important;
  border-radius: 18px !important;
  border: 1px solid #e8eaed;
  box-shadow: 0 28px 80px rgba(15, 18, 28, 0.28) !important;
  backdrop-filter: none !important;
  animation: kolStudioModalIn 0.36s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

@keyframes kolStudioModalIn {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}

.cart-preview-content {
  padding: 24px 26px 22px !important;
  max-width: min(92vw, 920px) !important;
  width: 100%;
}

.cart-preview-close,
.close-crop-modal,
.saved-products-close-button,
.kol-tem-close {
  width: 32px !important;
  height: 32px !important;
  border-radius: 10px !important;
  background: #f3f4f6 !important;
  color: #6b7280 !important;
  border: none !important;
  box-shadow: none !important;
  font-size: 16px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease !important;
  transform: none !important;
}

.cart-preview-close:hover,
.close-crop-modal:hover,
.saved-products-close-button:hover,
.kol-tem-close:hover {
  background: #eceff3 !important;
  color: #111827 !important;
  transform: none !important;
  box-shadow: none !important;
}

.cart-preview-header {
  border-bottom: 1px solid #f0f1f3 !important;
  margin-bottom: 16px !important;
  padding-bottom: 14px !important;
  gap: 10px !important;
}

.cart-preview-icon {
  font-size: 22px !important;
  animation: none !important;
  color: var(--kol-primary) !important;
}

.cart-preview-title,
.auto-arrange-modal-content h2,
.saved-products-modal-content h2,
.size-change-modal-header h3,
.sablon-confirm-title,
.kol-tem-title,
.crop-modal-title {
  font-size: 16px !important;
  font-weight: 650 !important;
  letter-spacing: -0.02em !important;
  color: #111827 !important;
  margin: 0 !important;
}

.cart-preview-message,
.auto-arrange-modal-content p,
.sablon-confirm-message,
.size-change-modal-body p {
  font-size: 14px !important;
  color: #4b5563 !important;
  line-height: 1.55 !important;
}

.cart-preview-image-wrapper {
  border-radius: 14px !important;
  box-shadow: 0 8px 24px rgba(15, 18, 28, 0.08) !important;
  border: 1px solid #eef0f3;
}

.cart-preview-image-badge {
  background: rgba(17, 24, 39, 0.72) !important;
  border-radius: 999px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  padding: 5px 10px !important;
}

.cart-preview-frame-section {
  background: #f8f9fa !important;
  border: 1px solid #eceef0 !important;
  border-radius: 14px !important;
  padding: 14px !important;
}

.frame-option {
  border-radius: 12px !important;
  border: 1px solid #e5e7eb !important;
  background: #fff !important;
}

.frame-option:has(input:checked),
.frame-option.active {
  border-color: #fed7aa !important;
  background: #fff7ed !important;
}

.cart-preview-actions,
.modal-buttons,
.sablon-confirm-actions,
.size-change-modal-footer,
.kol-tem-footer {
  display: flex !important;
  gap: 10px !important;
  justify-content: flex-end !important;
  margin-top: 18px !important;
  padding-top: 14px !important;
  border-top: 1px solid #f0f1f3;
}

.cart-preview-btn,
.modal-buttons .btn,
.sablon-confirm-btn,
.size-change-modal-footer .btn,
.kol-tem-action,
.confirm-crop-btn {
  min-height: 42px !important;
  padding: 10px 16px !important;
  border-radius: 12px !important;
  font-size: 13px !important;
  font-weight: 650 !important;
  border: 1px solid #e5e7eb !important;
  box-shadow: none !important;
  transform: none !important;
  margin: 0 !important;
}

.cart-preview-btn-cancel,
.sablon-confirm-cancel,
.kol-tem-cancel,
.modal-buttons .btn-secondary {
  background: #fff !important;
  color: #4b5563 !important;
}

.cart-preview-btn-confirm,
.sablon-confirm-ok,
.kol-tem-ok,
.confirm-crop-btn,
.modal-buttons .btn-primary,
.size-change-modal-footer .btn-primary {
  background: linear-gradient(180deg, #ff7a1a 0%, #f05600 100%) !important;
  border-color: transparent !important;
  color: #fff !important;
  box-shadow: 0 10px 24px rgba(255, 102, 0, 0.28) !important;
}

.cart-preview-btn-confirm:hover,
.sablon-confirm-ok:hover,
.kol-tem-ok:hover,
.confirm-crop-btn:hover,
.modal-buttons .btn-primary:hover {
  filter: brightness(1.03);
  transform: translateY(-1px) !important;
}

#sablonConfirmModal {
  position: fixed;
  inset: 0;
  z-index: 30000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#sablonConfirmModal[style*="flex"],
#sablonConfirmModal.is-open {
  display: flex !important;
}
.sablon-confirm-card {
  position: relative;
  z-index: 2;
  width: min(420px, 100%);
  padding: 24px 26px 20px;
  text-align: center;
}
.sablon-confirm-icon {
  font-size: 28px;
  margin-bottom: 8px;
}

.auto-arrange-modal-content {
  max-width: 460px;
  width: 92%;
  padding: 24px 26px 20px !important;
  text-align: left;
}

.saved-products-modal {
  background: var(--kol-modal-bg) !important;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.saved-products-modal-content {
  max-width: 860px;
  width: 94%;
  padding: 24px 26px !important;
  max-height: 86vh;
  overflow: auto;
}

.size-change-modal-content {
  max-width: 480px;
  width: 92%;
  padding: 0 !important;
  overflow: hidden;
}
.size-change-modal-header {
  padding: 18px 22px 14px !important;
  border-bottom: 1px solid #f0f1f3 !important;
  background: #fff !important;
}
.size-change-modal-body {
  padding: 18px 22px !important;
}
.size-change-modal-footer {
  padding: 14px 22px 18px !important;
  margin: 0 !important;
  border-top: 1px solid #f0f1f3;
}

.modal_vagas {
  background: var(--kol-modal-bg) !important;
}
.modal-content_vagas {
  padding: 20px 22px !important;
  max-width: 720px;
  width: 94%;
}

#kolTextEditModal {
  background: var(--kol-modal-bg) !important;
}
.kol-tem-content {
  max-width: 520px;
  width: 94%;
  padding: 0 !important;
  overflow: hidden;
}
.kol-tem-header {
  padding: 16px 18px !important;
  border-bottom: 1px solid #f0f1f3 !important;
  background: #fff !important;
}
.kol-tem-body {
  padding: 16px 18px !important;
}
.kol-tem-footer {
  padding: 14px 18px 16px !important;
  margin: 0 !important;
}

#overlay .loading-modal-content,
.upload-modal-content,
.preview-modal-content {
  padding: 28px 30px !important;
  max-width: 360px;
  text-align: center;
}
.loading-title,
.upload-title,
.preview-title {
  font-size: 16px !important;
  font-weight: 650 !important;
  color: #111827 !important;
}
.loading-subtitle,
.upload-subtitle,
.preview-subtitle {
  font-size: 13px !important;
  color: #6b7280 !important;
}

@media (min-width: 769px) {
  body.kol-desktop {
    overflow: hidden;
    background: #e8eaed;
    --kol-panel-w: min(360px, 24vw);
    --kol-tab-w: 84px;
    --kol-rail-w: 252px;
    --kol-rail-space: 308px;
  }

  body.kol-desktop .header,
  body.kol-desktop .mobile-action-bar,
  body.kol-desktop .mobile-bottom-bar,
  body.kol-desktop .mobile-nav-bar,
  body.kol-desktop .desktop-right-nav,
  body.kol-desktop .desktop-right-scrim {
    display: none !important;
  }

  body.kol-desktop #leftSidebar,
  body.kol-desktop #rightSidebar {
    position: fixed !important;
    left: -9999px !important;
    top: 0 !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transform: none !important;
    z-index: -1 !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  body.kol-desktop .main-container {
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
  }

  body.kol-desktop .app-layout {
    display: block !important;
    position: relative !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
    width: auto !important;
    height: 100vh !important;
    max-height: 100vh !important;
    overflow: hidden !important;
    grid-template-columns: none !important;
    gap: 0 !important;
    /* Vászon a bal menü mellett – naptár margin-left logika */
    margin-left: var(--kol-tab-w) !important;
    margin-right: var(--kol-rail-space) !important;
    transition: margin-left 0.36s cubic-bezier(0.22, 1, 0.36, 1);
    background: transparent !important;
  }

  body.kol-desktop.kol-panel-open .app-layout {
    margin-left: calc(var(--kol-tab-w) + var(--kol-panel-w)) !important;
  }

  body.kol-desktop .canvas-area {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: 100% !important;
    height: 100vh !important;
    max-height: none !important;
    padding: 12px 12px 88px !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    z-index: 1;
    box-sizing: border-box;
    transition: none;
  }

  body.kol-desktop.kol-panel-open .canvas-area {
    left: auto !important;
  }

  body.kol-desktop .selected-size-display,
  body.kol-desktop .auto-arrange-bar,
  body.kol-desktop #infoBox,
  body.kol-desktop #mugMessage,
  body.kol-desktop #templateInfoSection {
    display: none !important;
  }

  body.kol-desktop .canvas-wrapper {
    flex: 1 1 auto !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    padding: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  body.kol-desktop .canvas-container,
  body.kol-desktop .canvas-wrapper canvas {
    max-width: 100% !important;
    max-height: 100% !important;
  }

  body.kol-desktop .canvas-toolbar-bottom {
    position: fixed !important;
    left: 50%;
    bottom: 18px !important;
    transform: translateX(-50%);
    z-index: 30;
    background: #fff !important;
    border: 1px solid #e8eaed !important;
    border-radius: 14px !important;
    box-shadow: 0 10px 28px rgba(15, 18, 28, 0.1) !important;
    padding: 8px 10px !important;
    gap: 4px !important;
  }

  body.kol-desktop.kol-panel-open .canvas-toolbar-bottom {
    left: calc((100vw + var(--kol-tab-w) + var(--kol-panel-w) - var(--kol-rail-space)) / 2);
  }

  body.kol-desktop .canvas-toolbar-bottom .tool-btn {
    width: 34px !important;
    height: 34px !important;
    border-radius: 10px !important;
    background: transparent !important;
    border: 1px solid transparent !important;
    color: #4b5563 !important;
  }
  body.kol-desktop .canvas-toolbar-bottom .tool-btn:hover {
    background: #f9fafb !important;
    border-color: #e5e7eb !important;
    color: #111827 !important;
  }
  body.kol-desktop .canvas-toolbar-bottom .auto-arrange-btn {
    background: linear-gradient(180deg, #ff7a1a 0%, #f05600 100%) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 10px !important;
    padding: 0 12px !important;
    min-height: 34px !important;
    font-weight: 650 !important;
    box-shadow: 0 8px 18px rgba(255, 102, 0, 0.28) !important;
  }
  body.kol-desktop .canvas-toolbar-bottom .auto-arrange-label {
    font-size: 12px !important;
  }

  /* —— Bal ikonsáv: pontosan a viewport bal szélén —— */
  body.kol-desktop .kol-tab-menu {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: auto !important;
    bottom: 0 !important;
    width: var(--kol-tab-w) !important;
    height: 100vh !important;
    z-index: 1200 !important;
    flex-direction: column;
    background: #f4f5f7;
    border-right: 1px solid #e4e6e8;
    border-radius: 0;
    box-shadow: none;
    overflow: visible !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.kol-desktop .kol-tab-items {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 6px;
    padding: 14px 8px 20px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: visible;
    box-sizing: border-box;
  }

  body.kol-desktop .kol-tabItem {
    flex: 0 0 auto;
    width: 100%;
    min-height: 52px;
    padding: 8px 2px 7px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.15;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    box-sizing: border-box;
    background: transparent;
    color: #6b7280;
    border: 1px solid transparent;
    cursor: pointer;
    margin: 0;
    position: relative;
    transition: background 0.22s ease, color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  }

  body.kol-desktop .kol-tabItem i {
    font-size: 17px;
    color: inherit;
  }

  body.kol-desktop .kol-tabItem:hover {
    background: #fff;
    color: #111827;
    border-color: #eceef0;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(15, 18, 28, 0.06);
  }

  body.kol-desktop .kol-tabItem.is-active {
    background: #fff;
    color: #111827;
    border-color: #eceef0;
    box-shadow: 0 6px 16px rgba(15, 18, 28, 0.07);
  }

  body.kol-desktop .kol-tabItem.is-active::before {
    content: "";
    position: absolute;
    left: -8px;
    top: 12px;
    bottom: 12px;
    width: 3px;
    border-radius: 3px;
    background: var(--kol-primary);
  }

  /* —— Oldalsó panel: közvetlenül a menühöz ragasztva (mint #tabContent) —— */
  body.kol-desktop .kol-desktop-panel {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    left: var(--kol-tab-w) !important;
    right: auto !important;
    bottom: 0 !important;
    width: var(--kol-panel-w) !important;
    height: 100vh !important;
    max-height: none !important;
    z-index: 1190 !important;
    flex-direction: column;
    background: #fff;
    border-top: none;
    border-right: 1px solid #e4e6e8;
    border-radius: 0;
    box-shadow: 8px 0 32px rgba(15, 18, 28, 0.06);
    box-sizing: border-box;
    margin: 0 !important;
    padding: 0 !important;
    transform: translateX(-18px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
    overflow: hidden;
  }

  body.kol-desktop.kol-panel-open .kol-desktop-panel {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }

  body.kol-desktop .kol-desktop-panel-header {
    position: relative;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 18px 14px;
    background: #fff;
    border-bottom: 1px solid #f0f1f3;
    margin: 0;
  }

  body.kol-desktop .kol-desktop-panel-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 650;
    letter-spacing: -0.02em;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  body.kol-desktop .kol-desktop-panel-header h4 i {
    color: var(--kol-primary);
    font-size: 15px;
  }

  body.kol-desktop .kol-desktop-panel-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 10px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    flex: 0 0 auto;
  }

  body.kol-desktop .kol-desktop-panel-close:hover {
    background: #eceff3;
    color: #111827;
  }

  body.kol-desktop .kol-desktop-panel-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 18px 28px;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
  }

  body.kol-desktop .kol-desktop-panel-body .sidebar-section,
  body.kol-desktop .kol-desktop-panel-body .panel-content,
  body.kol-desktop .kol-desktop-panel-body .kol-upload-section {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    max-height: none !important;
    overflow: visible !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  body.kol-desktop .kol-desktop-panel-body .section-title,
  body.kol-desktop .kol-desktop-panel-body .images-actions {
    display: none !important;
  }

  /* Feltöltés dropzone – naptár mintára */
  body.kol-desktop .kol-upload-dropzone {
    display: flex !important;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 16px;
    border: 1.5px dashed #d7dbe0;
    border-radius: 14px;
    background: linear-gradient(180deg, #fbfbfc, #f6f7f8);
    cursor: pointer;
    box-sizing: border-box;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  }

  body.kol-desktop .kol-upload-dropzone:hover,
  body.kol-desktop .kol-upload-dropzone.is-dragover {
    border-color: #ffb070;
    background: #fff7ed;
    box-shadow: 0 8px 20px rgba(255, 102, 0, 0.08);
  }

  body.kol-desktop .kol-upload-dropzone .upload-btn-placeholder {
    flex: 0 0 auto;
    width: 48px !important;
    height: 48px !important;
    margin: 0 !important;
    order: 0 !important;
  }

  body.kol-desktop .kol-upload-dropzone .upload-btn-in-row {
    width: 48px !important;
    height: 48px !important;
    min-height: 48px !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 14px !important;
    background: linear-gradient(180deg, #ff7a1a, #f05600) !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 8px 18px rgba(255, 102, 0, 0.28) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  body.kol-desktop .kol-upload-dropzone .upload-btn-in-row span {
    display: none !important;
  }

  body.kol-desktop .kol-upload-dropzone .upload-btn-in-row i {
    font-size: 18px !important;
    margin: 0 !important;
    color: #fff !important;
  }

  body.kol-desktop .kol-upload-dropzone-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
  }

  body.kol-desktop .kol-upload-dropzone-copy strong {
    font-size: 14px;
    font-weight: 650;
    color: #111827;
  }

  body.kol-desktop .kol-upload-hint {
    font-size: 12px;
    line-height: 1.4;
    color: #6b7280;
  }

  body.kol-desktop .kol-thumbs-topbar {
    display: flex !important;
    align-items: center;
    gap: 8px;
    width: 100%;
  }

  body.kol-desktop .kol-thumbs-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    flex: 0 0 auto;
  }

  body.kol-desktop .kol-thumbs-topbar .sort-dropdown {
    flex: 1 1 auto;
    min-width: 0;
    height: 36px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #fff;
    font-size: 12px;
    padding: 0 10px;
    margin: 0 !important;
  }

  body.kol-desktop .kol-thumbs-add-btn,
  body.kol-desktop .kol-thumbs-trash-btn {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 10px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid #e5e7eb !important;
    background: #fff !important;
    color: #6b7280 !important;
    box-shadow: none !important;
    font-size: 13px !important;
  }

  body.kol-desktop .kol-thumbs-add-btn.mobile-only,
  body.kol-desktop .kol-desktop-panel-body .add-selected-images-btn {
    display: inline-flex !important;
  }

  body.kol-desktop .kol-thumbs-trash-btn {
    color: #dc2626 !important;
    border-color: #fecaca !important;
  }

  body.kol-desktop .kol-thumbs-add-btn span,
  body.kol-desktop .kol-thumbs-trash-btn span {
    display: none !important;
  }

  body.kol-desktop .kol-desktop-panel-body .images-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    padding: 2px 0 8px !important;
  }

  body.kol-desktop .kol-desktop-panel-body .images-grid .image-container {
    width: 100% !important;
    height: 0 !important;
    padding-bottom: 100% !important;
    position: relative !important;
    border-radius: 10px !important;
    overflow: hidden !important;
  }

  body.kol-desktop .kol-desktop-panel-body .images-grid .uploaded-image {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }

  body.kol-desktop .kol-desktop-panel-body .templates-grid,
  body.kol-desktop .kol-desktop-panel-body .cliparts-grid,
  body.kol-desktop .kol-desktop-panel-body .backgrounds-grid,
  body.kol-desktop .kol-desktop-panel-body .templates-cards-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    overflow: visible !important;
    flex-wrap: unset !important;
    width: 100% !important;
    padding: 0 !important;
  }

  /* Hátterek: 2 thumbnail egy sorban (felülírja a #backgroundsList flex nowrap szabályt) */
  body.kol-desktop .kol-desktop-panel-body #backgroundsList,
  body.kol-desktop .kol-desktop-panel-body #backgroundsList.backgrounds-grid,
  body.kol-desktop #backgroundsList {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    overflow: visible !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
    flex-wrap: unset !important;
    max-height: none !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 0 12px !important;
  }

  body.kol-desktop .kol-desktop-panel-body #backgroundsList img,
  body.kol-desktop .kol-desktop-panel-body #backgroundsList .kol-bg-thumb,
  body.kol-desktop #backgroundsList img {
    flex: unset !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: 4 / 3 !important;
    object-fit: cover !important;
    border-radius: 12px !important;
    border: 1px solid #eef0f3 !important;
    display: block !important;
    box-sizing: border-box !important;
    padding: 0 !important;
  }

  /* Sablon kategóriák – wrap chip grid, ne vízszintes scrollbar */
  body.kol-desktop .kol-desktop-panel-body .template-categories {
    width: 100%;
  }

  body.kol-desktop .kol-desktop-panel-body .template-cat-scroll {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    overflow: visible !important;
    padding: 0 !important;
    margin: 0 0 12px !important;
  }

  body.kol-desktop .kol-desktop-panel-body .template-cat-scroll::-webkit-scrollbar {
    display: none !important;
  }

  body.kol-desktop .kol-desktop-panel-body .template-cat-pill {
    flex: 0 0 auto !important;
    max-width: 100%;
    padding: 8px 12px !important;
    border-radius: 999px !important;
    font-size: 12px !important;
    font-weight: 650 !important;
    background: #fff7ed !important;
    color: #c2410c !important;
    border: 1px solid #fed7aa !important;
    box-shadow: none !important;
  }

  body.kol-desktop .kol-desktop-panel-body .template-cat-pill:hover {
    background: #ffedd5 !important;
    border-color: #fdba74 !important;
  }

  body.kol-desktop .kol-desktop-panel-body .template-cat-pill .cat-count {
    background: #ff6600 !important;
    color: #fff !important;
    border-radius: 999px !important;
    min-width: 22px;
    height: 22px;
    padding: 0 6px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-size: 11px !important;
  }

  body.kol-desktop .kol-desktop-panel-body .template-back-btn {
    width: 100% !important;
    margin: 0 0 12px !important;
    border-radius: 12px !important;
    border: 1px solid #e5e7eb !important;
    background: #f8fafc !important;
    color: #374151 !important;
    min-height: 40px;
  }

  body.kol-desktop .kol-desktop-panel-body .template-view-title {
    font-size: 14px;
    font-weight: 650;
    color: #111827;
    margin: 0 0 10px;
  }

  body.kol-desktop .kol-desktop-panel-body .template-card {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    border-radius: 12px !important;
    border: 1px solid #e8eaed !important;
    overflow: hidden;
    background: #fff;
  }

  body.kol-desktop .kol-desktop-panel-body .template-card-image {
    aspect-ratio: 3 / 4;
    background: #f8fafc;
  }

  body.kol-desktop .kol-desktop-panel-body .template-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  /* Clipart + Háttér: 2 oszlop, kitöltve */
  body.kol-desktop .kol-desktop-panel-body .cliparts-grid img,
  body.kol-desktop .kol-desktop-panel-body .backgrounds-grid img,
  body.kol-desktop .kol-desktop-panel-body .backgrounds-list img {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: 1 / 1 !important;
    object-fit: contain !important;
    background: #f8fafc;
    border: 1px solid #eef0f3;
    border-radius: 12px !important;
    padding: 8px !important;
    box-sizing: border-box !important;
    flex: unset !important;
    display: block !important;
  }

  body.kol-desktop .kol-desktop-panel-body .backgrounds-grid img {
    object-fit: cover !important;
    padding: 0 !important;
  }

  body.kol-desktop .kol-desktop-panel-body .bg-color-row,
  body.kol-desktop .kol-desktop-panel-body .background-color-control,
  body.kol-desktop .kol-desktop-panel-body .background-color-picker,
  body.kol-desktop .kol-desktop-panel-body label[for="backgroundColorPicker"] {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
  }

  body.kol-desktop .kol-desktop-panel-body .background-color-picker label {
    margin: 0;
  }

  body.kol-desktop .kol-desktop-panel-body #backgroundColorPicker {
    width: 42px;
    height: 36px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 2px;
    background: #fff;
    cursor: pointer;
  }

  body.kol-desktop .kol-desktop-panel-body #removeBackgroundButton,
  body.kol-desktop .kol-desktop-panel-body .remove-background-btn {
    width: 100% !important;
    margin-top: 12px !important;
    border-radius: 12px !important;
    border: 1px solid #bfdbfe !important;
    background: #eff6ff !important;
    color: #1d4ed8 !important;
    min-height: 42px;
    font-weight: 650 !important;
  }

  body.kol-desktop .kol-desktop-panel-body .print-mode-selector,
  body.kol-desktop .kol-desktop-panel-body .mode-card,
  body.kol-desktop .kol-desktop-panel-body .size-card {
    border-radius: 12px !important;
  }

  body.kol-desktop .kol-desktop-panel-body .panel-header {
    display: none !important;
  }

  /* Méret választás – függőleges panel logika (ne vízszintes carousel) */
  body.kol-desktop .kol-desktop-panel-body .print-mode-selector {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    margin: 0 0 14px !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  body.kol-desktop .kol-desktop-panel-body .mode-card {
    flex: 0 0 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    padding: 12px 14px !important;
    gap: 10px !important;
    background: #f8f9fa !important;
    border: 1.5px solid #e5e7eb !important;
    border-radius: 12px !important;
    box-shadow: none !important;
    margin: 0 !important;
  }

  body.kol-desktop .kol-desktop-panel-body .mode-card.selected {
    border-color: #ff6600 !important;
    background: #fff7ed !important;
    box-shadow: 0 0 0 1px rgba(255, 102, 0, 0.15) !important;
  }

  body.kol-desktop .kol-desktop-panel-body .mode-card i {
    font-size: 16px !important;
    width: 28px;
    text-align: center;
  }

  body.kol-desktop .kol-desktop-panel-body .mode-card .mode-text strong {
    font-size: 13px !important;
  }

  body.kol-desktop .kol-desktop-panel-body .mode-card .mode-text span {
    font-size: 11px !important;
    color: #6b7280 !important;
  }

  body.kol-desktop .kol-desktop-panel-body .sizes-scroll-container {
    max-height: none !important;
    overflow: visible !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.kol-desktop .kol-desktop-panel-body .sizes-scroll-container::-webkit-scrollbar {
    display: none !important;
  }

  body.kol-desktop .kol-desktop-panel-body .horizontal-size-scroll {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    padding: 0 !important;
    flex-wrap: unset !important;
    overflow: visible !important;
    width: 100% !important;
  }

  body.kol-desktop .kol-desktop-panel-body .horizontal-size-scroll .size-card,
  body.kol-desktop .kol-desktop-panel-body .size-option,
  body.kol-desktop .kol-desktop-panel-body .size-option-card {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    flex: unset !important;
    padding: 12px 10px !important;
    border-radius: 12px !important;
    background: #fff !important;
    border: 1.5px solid #e5e7eb !important;
    box-sizing: border-box !important;
  }

  body.kol-desktop .kol-desktop-panel-body .horizontal-size-scroll .size-card.selected,
  body.kol-desktop .kol-desktop-panel-body .size-option.selected,
  body.kol-desktop .kol-desktop-panel-body .size-option-card.selected {
    border-color: #ff6600 !important;
    background: #fff7ed !important;
    box-shadow: 0 8px 20px rgba(255, 102, 0, 0.12) !important;
    transform: none !important;
  }

  body.kol-desktop .kol-desktop-panel-body .template-selector-product {
    margin-top: 8px;
  }

  /* Egyéb panelek tartalma is töltsék a dokkolt panelt */
  body.kol-desktop .kol-desktop-panel-body .number-template-content,
  body.kol-desktop .kol-desktop-panel-body .letter-template-content,
  body.kol-desktop .kol-desktop-panel-body .text-controls,
  body.kol-desktop .kol-desktop-panel-body .cliparts-section {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* —— Jobb sáv —— */
  body.kol-desktop .kol-desktop-right-rail {
    display: flex !important;
    position: fixed !important;
    top: 16px !important;
    right: 16px !important;
    width: var(--kol-rail-w) !important;
    z-index: 50 !important;
    flex-direction: column;
    gap: 0;
    padding: 16px 16px 14px;
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(15, 18, 28, 0.08);
    box-sizing: border-box;
    margin: 0 !important;
  }

  body.kol-desktop .kol-rail-back-wrap {
    width: 100%;
    margin: 0 0 10px;
    padding: 0 0 10px;
    border-bottom: 1px solid #eceef0;
  }

  body.kol-desktop .kol-rail-back {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    text-align: left;
    text-decoration: none !important;
    color: #fff !important;
    background: var(--kol-primary);
    box-shadow: 0 6px 14px rgba(255, 102, 0, 0.2);
    box-sizing: border-box;
  }

  body.kol-desktop .kol-rail-back:hover {
    filter: brightness(1.05);
    color: #fff !important;
  }

  body.kol-desktop .kol-rail-back i {
    font-size: 14px;
    flex: 0 0 auto;
  }

  body.kol-desktop .kol-rail-zoom-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    padding: 0;
  }

  body.kol-desktop .kol-zoom-icon-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: #6b7280;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
  }
  body.kol-desktop .kol-zoom-icon-btn:hover {
    background: #f3f4f6;
    color: #111827;
  }

  body.kol-desktop .kol-zoom-slider {
    flex: 1 1 auto;
    min-width: 0;
    height: 4px;
    appearance: none;
    background: #e5e7eb;
    border-radius: 999px;
    outline: none;
  }
  body.kol-desktop .kol-zoom-slider::-webkit-slider-thumb {
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--kol-primary);
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(15, 18, 28, 0.2);
    cursor: pointer;
  }

  body.kol-desktop .kol-zoom-value {
    min-width: 40px;
    text-align: right;
    font-size: 12px;
    font-weight: 650;
    color: #374151;
  }

  body.kol-desktop .kol-rail-product {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 0 12px;
  }

  body.kol-desktop .kol-rail-size {
    font-size: 13px;
    font-weight: 650;
    color: #111827;
    line-height: 1.4;
    letter-spacing: -0.01em;
  }

  body.kol-desktop .kol-rail-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  body.kol-desktop .kol-rail-type {
    display: inline-flex !important;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  body.kol-desktop .kol-rail-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--kol-primary);
  }

  body.kol-desktop .kol-rail-cart-btn {
    display: flex !important;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 0 2px;
    padding: 12px 14px;
    min-height: 44px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 12px;
    border: none;
    background: linear-gradient(180deg, #ff7a1a 0%, #f05600 100%);
    color: #fff;
    box-shadow: 0 10px 24px rgba(255, 102, 0, 0.32);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }

  body.kol-desktop .kol-rail-cart-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(255, 102, 0, 0.4);
  }

  body.kol-desktop .kol-rail-secondary {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 6px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eceef0;
  }

  body.kol-desktop .kol-rail-sec-btn {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 7px 4px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
    background: #fff;
    color: #4b5563;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    margin: 0;
  }

  body.kol-desktop .kol-rail-sec-btn:hover {
    background: #f9fafb;
    color: #111827;
    border-color: #d1d5db;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 18, 28, 0.06);
  }

  body.kol-desktop .kol-rail-sec-btn#kolRailSaveBtn {
    background: #fff7ed;
    color: #c2410c;
    border-color: #fed7aa;
  }

  body.kol-desktop .text-options-modern {
    left: calc(var(--kol-tab-w) + 24px) !important;
    right: auto !important;
    bottom: 90px !important;
    border-radius: 14px !important;
    border: 1px solid #e8eaed !important;
    box-shadow: 0 12px 32px rgba(15, 18, 28, 0.1) !important;
  }

  body.kol-desktop.kol-panel-open .text-options-modern {
    left: calc(var(--kol-tab-w) + var(--kol-panel-w) + 24px) !important;
  }

  body.kol-desktop .canvas-empty-card {
    border-radius: 16px !important;
    border: 1px solid #e8eaed !important;
    box-shadow: 0 12px 32px rgba(15, 18, 28, 0.08) !important;
  }

  /* Mobil hide of new upload chrome when somehow shown */
  body.kol-desktop .kol-upload-dropzone,
  body.kol-desktop .kol-thumbs-topbar {
    display: flex !important;
  }
}

/* Mobilon a naptár-szerű dropzone is látszódjon a sheetben */
@media (max-width: 768px) {
  .kol-tab-menu,
  .kol-desktop-panel,
  .kol-desktop-right-rail {
    display: none !important;
  }

  .kol-upload-dropzone {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px;
    border: 1.5px dashed #d7dbe0;
    border-radius: 14px;
    background: linear-gradient(180deg, #fbfbfc, #f6f7f8);
    box-sizing: border-box;
    margin-bottom: 10px;
  }
  .kol-upload-dropzone .upload-btn-in-row {
    width: 44px !important;
    height: 44px !important;
    border-radius: 12px !important;
    background: linear-gradient(180deg, #ff7a1a, #f05600) !important;
    color: #fff !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
  }
  .kol-upload-dropzone .upload-btn-in-row span { display: none !important; }
  .kol-upload-dropzone-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .kol-upload-dropzone-copy strong { font-size: 13px; color: #111827; }
  .kol-upload-hint { font-size: 11px; color: #6b7280; }

  .kol-thumbs-topbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
  }
  .kol-thumbs-label { font-size: 12px; color: #6b7280; font-weight: 600; }
  .kol-thumbs-topbar .sort-dropdown { flex: 1; min-width: 0; }
  .kol-thumbs-trash-btn,
  .kol-thumbs-add-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
  }
  .images-actions { display: none !important; }
}
