:root {
  --primary-color: #ff6600;
  --secondary-color: #db5800;
  --accent-color: #888888;       
  --light-color: #ffffff;        
  --dark-color: #333333;         
  --bg-color: #f5f5f5;           
  --success-color: #4CAF50;      
  --warning-color: #ff9800;      
  --primary-dark: #db5800;
  --border-radius: 8px;
  --box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

:root {
  --spiral-offset-havi: 55px;
  --spiral-offset-asztali: 70px;
  --spiral-offset-havi-mobile: 30px;
  --spiral-offset-asztali-mobile: 40px;
}

#naptarContainer {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#naptarCanvasStage {
  display: contents;
}

.naptar-stage-cluster {
  display: contents;
}

body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  background-color: var(--bg-color);
  color: var(--dark-color);
  padding-bottom: 80px; 
}

.container {
  width: calc(100% - 40px);
  max-width: 1400px;
  margin: 20px auto;
  padding: 0;
}

#productSelectionContainer {
  background-color: var(--light-color);
  border-radius: 18px;
  padding: 28px 28px 24px;
  box-shadow: var(--box-shadow);
  margin-bottom: 25px;
  animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

#productSelectionContainer h3 {
  color: var(--primary-color);
  margin-bottom: 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

#productSelectionContainer h3::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 3px;
  background-color: var(--primary-color);
  border-radius: 3px;
}

.product-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
    padding: 4px 0 8px;
    overflow: visible;
    align-items: stretch;
}

.product-container > div {
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
}

.product-container > div:hover {
    transform: translateY(-3px);
    background-color: #fff;
}

@media (max-width: 768px) {
    .product-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        overflow: visible;
    }
}

.product-container::-webkit-scrollbar {
  height: 6px;
}

.product-container::-webkit-scrollbar-track {
  background: transparent;
}

.product-container::-webkit-scrollbar-thumb {
  background-color: rgba(0,0,0,0.3);
  border-radius: 6px;
}

.product-thumbnail {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 0;
  position: relative;
  overflow: hidden;
  background: #fff;
  border: 1px solid #eceef0;
  border-radius: 16px;
  padding: 12px 12px 14px;
  box-sizing: border-box;
}

.product-image-container {
  width: 100%;
  height: 168px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  background-color: #f6f7f8;
  border-radius: 12px;
  position: relative;
}

.product-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  max-height: 100%;
  transition: transform 0.3s ease;
  padding: 5px;
}

.product-title {
  font-weight: 600;
  font-size: 14px;
  margin: 4px 0 8px;
  color: var(--dark-color);
  text-align: left;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  height: auto;
  min-height: 38px;
  line-height: 1.3;
}

  .product-price {
    font-size: 14px;
  }

  .product-picker-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .product-picker-sub {
    font-size: 13px;
  }

.product-price .old-price {
  text-decoration: line-through !important;
  color: #999;
  font-weight: 400;
  font-size: 14px;
  display: block;
}

.product-price .discounted-price {
  color: var(--primary-color);
  font-weight: 800;
  font-size: 18px;
  display: block;
}

.product-picker-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.product-picker-copy h3 {
  margin-bottom: 8px;
}

.product-picker-sub {
  margin: 10px 0 0;
  color: #6b7280;
  font-size: 14px;
  line-height: 1.45;
}

.product-picker-count {
  flex: 0 0 auto;
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.product-picker-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.product-filter {
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #4b5563;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.product-filter.is-active,
.product-filter:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}

.product-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: calc(100% - 44px);
}

.product-badge {
  background: rgba(17, 24, 39, 0.78);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 999px;
  padding: 3px 8px;
}

.product-badge-size {
  background: rgba(255, 102, 0, 0.92);
}

.product-choose {
  display: block;
  margin-top: 10px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-color);
}

.product-thumbnail.selected .product-choose {
  color: #9a3412;
}

/* Kiválasztott termék információs sáv */
.selected-product-info {
  display: none; /* JS mutatja meg kiválasztás után */
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background-color: var(--light-color);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  margin: 8px 0 12px;
  justify-content: space-between;
}

.selected-product-info .spi-name {
  font-weight: 600;
  color: var(--dark-color);
}

.selected-product-info .spi-price {
  font-weight: 700;
  color: var(--primary-color);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.selected-product-info .spi-price .old-price {
  text-decoration: line-through !important;
  color: #999;
  font-weight: 400;
  font-size: 11px;
}

.selected-product-info .spi-price .discounted-price {
  color: var(--primary-color);
  font-weight: 700;
  font-size: 14px;
}

/* Kompakt megjelenés a kosár alatt a bottom bar-ban */
#tabMenu .selected-product-info {
  margin: 6px 10px 8px;
}

.selected-product-info.compact {
  padding: 4px 8px;
  gap: 6px;
  font-size: 12px;
  background-color: #ffffff;
  border: 1px solid #eeeeee;
  border-radius: 6px;
  box-shadow: none;
  opacity: 0.95;
  justify-content: center;
}

.selected-product-info.compact .spi-name {
  font-weight: 500;
  color: #555;
  flex: 1 1 auto;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.selected-product-info.compact .spi-price {
  font-weight: 600;
  font-size: 12px;
  color: var(--primary-color);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}

.selected-product-info.compact .spi-price .old-price {
  text-decoration: line-through !important;
  color: #999;
  font-weight: 400;
  font-size: 10px;
}

.selected-product-info.compact .spi-price .discounted-price {
  color: var(--primary-color);
  font-weight: 600;
  font-size: 12px;
}

/* Darabszám-választó a kiválasztott termék sávban (alsó menü) */
.spi-qty-price-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.spi-quantity-control {
  display: inline-flex;
  align-items: center;
  background-color: #f7f7f7;
  border-radius: 999px;
  padding: 2px 6px;
  border: 1px solid #e0e0e0;
}

.spi-quantity-control .qty-btn {
  border: none;
  background: transparent;
  color: #555;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.spi-quantity-control .qty-btn:hover {
  color: var(--primary-color);
}

.spi-quantity-control .qty-input {
  width: 38px;
  text-align: center;
  border: none;
  background: transparent;
  font-size: 13px;
  color: #333;
  appearance: textfield;
  -moz-appearance: textfield;
}

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

@media (max-width: 768px) {
  .selected-product-info.compact {
    flex-wrap: nowrap;
  }
  .spi-qty-price-wrapper {
    gap: 6px;
  }
  .spi-quantity-control {
    padding: 1px 4px;
  }
  .spi-quantity-control .qty-input {
    width: 32px;
    font-size: 12px;
  }
}

.product-thumbnail .info-icon {
  top: 8px;
  right: 8px;
  z-index: 2;
}

.product-thumbnail.selected {
  background-color: #fff7ed;
  border: 2px solid var(--primary-color);
  box-shadow: 0 10px 24px rgba(255, 102, 0, 0.16);
}

@media (max-width: 768px) {
  .product-thumbnail {
    width: auto;
    min-width: 0;
    height: auto;
    padding: 8px;
  }

  .product-image-container {
    height: 132px;
  }

  .product-title {
    font-size: 12px;
    min-height: 32px;
    height: auto;
  }

  .product-price {
    font-size: 14px;
  }

  .product-picker-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .product-picker-sub {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .product-thumbnail {
    width: auto;
    min-width: 0;
    height: auto;
  }

  .product-image-container {
    height: 120px;
  }

  .product-title {
    font-size: 12px;
    height: auto;
    min-height: 32px;
  }

  .product-price {
    font-size: 14px;
  }
}

.info-icon {
  position: absolute;
  top: 10px;
  right: 10px;
  color: var(--accent-color);
  cursor: pointer;
  background: rgba(255,255,255,0.9);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.info-icon:hover {
  color: var(--primary-color);
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(255, 102, 0, 0.3);
}

.month-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.month-nav {
  display: none;
}

#monthBar {
  display: flex;
  align-items: center;
  gap: 0px;
  overflow-x: auto;
  white-space: nowrap;
  padding: 15px;
  background-color: var(--light-color);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  margin-bottom: 3px;
  scrollbar-width: thin;
  position: sticky;
  top: 0px;
  z-index: 90;
  flex-wrap: wrap;
  justify-content: center;
}

#monthBar::-webkit-scrollbar {
  height: 6px;
}

#monthBar::-webkit-scrollbar-thumb {
  background: var(--accent-color);
  border-radius: 10px;
}

#monthBar .month {
  flex: 0 0 auto;
  cursor: pointer;
  padding: 10px 22px 10px 18px;
  border-radius: 30px;
  transition: var(--transition);
  white-space: nowrap;
  font-weight: 500;
  background: var(--light-color);
  color: var(--accent-color);
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  border: 1px solid #eaeaea;
  overflow: visible;
  position: relative;
}

#monthBar .month:hover {
  background-color: #f0f0f0;
  color: var(--primary-color);
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

#monthBar .month.active {
  background-color: var(--primary-color);
  color: var(--light-color);
  font-weight: 600;
  box-shadow: 0 3px 10px rgba(255, 102, 0, 0.2);
  border-color: var(--primary-color);
}

#monthBar .month i {

  font-size: 15px;
}

.zoom-bar {
  width: var(--canvas-fit-width, var(--canvas-width, 595px));
  margin: 10px auto 12px auto;
}

.zoom-bar-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 3px 14px rgba(0,0,0,0.08);
}

.zoom-bar-inner i {
  color: var(--accent-color);
  font-size: 14px;
}

.zoom-step-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-color);
  cursor: pointer;
  border-radius: 8px;
  flex: 0 0 auto;
}

.zoom-step-btn:hover {
  background: #fff7ed;
  color: var(--primary-color);
}

.zoom-step-btn i {
  font-size: 13px;
}

#zoomSlider {
  flex: 1;
  width: 100%;
}

.zoom-value {
  min-width: 52px;
  text-align: right;
  font-weight: 600;
  color: #333;
}

#canvasContainer {
  position: relative;
  background-color: var(--light-color);
  border-radius: var(--border-radius);
  margin: 0 auto 30px auto;
  box-shadow: 0 5px 25px rgba(0,0,0,0.15);
  width: 595px;
  height: 842px;
  border: 1px solid #dadada;
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

#canvasContainer .canvas-container {
  overflow: hidden;
}

/* Üres canvas: középső Feltöltés gomb (ajándéktárgy mintára) */
.canvas-welcome {
  position: absolute;
  inset: 0;
  z-index: 15;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 12px;
  text-align: center;
  pointer-events: none;
  background: transparent;
}
.canvas-welcome-content {
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  max-width: none;
  padding: 0;
  margin: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.canvas-welcome-fab {
  position: relative;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.28);
  -webkit-backdrop-filter: blur(8px) saturate(1.2);
  backdrop-filter: blur(8px) saturate(1.2);
  box-shadow:
    0 10px 28px rgba(15, 18, 28, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  color: #ea580c;
  cursor: pointer;
  pointer-events: auto;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0;
  margin: 0;
  font-family: inherit;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.canvas-welcome-fab:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: scale(1.04);
  box-shadow:
    0 14px 32px rgba(15, 18, 28, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
}
.canvas-welcome-fab:focus {
  outline: 2px solid rgba(255, 102, 0, 0.65);
  outline-offset: 3px;
}
.canvas-welcome-fab:active {
  transform: scale(0.98);
}
.canvas-welcome-fab i {
  font-size: 28px;
  line-height: 1;
  color: #f05600;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}
.canvas-welcome-fab-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9a3412;
  line-height: 1;
}
.canvas-welcome.canvas-welcome-compact .canvas-welcome-fab {
  width: 74px;
  height: 74px;
}
.canvas-welcome.canvas-welcome-compact .canvas-welcome-fab i {
  font-size: 22px;
}
.canvas-welcome.canvas-welcome-compact .canvas-welcome-fab-label {
  font-size: 9px;
}
@media (max-width: 800px) {
  .canvas-welcome {
    padding: 8px;
  }
  .canvas-welcome-fab {
    width: 84px;
    height: 84px;
  }
  .canvas-welcome-fab i {
    font-size: 24px;
  }
  .canvas-welcome.canvas-welcome-compact .canvas-welcome-fab {
    width: 68px;
    height: 68px;
  }
  .canvas-welcome.canvas-welcome-compact .canvas-welcome-fab i {
    font-size: 20px;
  }
}
.calendar-with-spiral-wrapper #canvasContainer { margin-left: auto !important; margin-right: auto !important; display: inline-block; }

.calendar-with-spiral-wrapper {
  position: relative;
  display: block;
  width: var(--canvas-width, 595px);
  margin-left: auto;
  margin-right: auto;
}

/* Akasztó-él: a canvas tetejére igazítva (wrapperen belüli abszolút pozíció) */
.calendar-with-spiral-wrapper > .hanger-cutout-guide {
  /* a #canvasContainer tetejének közepére; top a canvas aktuális offsetjét követi JS nélkül is,
     ha a canvas a wrapper tetején van (spirál fölötte lóg) */
  top: 0;
}

#calendarSpiralWrapper {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: var(--canvas-width, 595px);
  display: none;
  pointer-events: none;
  z-index: 200;
  transition: var(--transition);
}

#calendarSpiralWrapper.show { display: block; }

#calendarSpiralImage {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
  transform: translateY(calc(-100% + var(--spiral-offset, 26px)));
}

/*
 * Spirálos akasztó: valódi félkörös papírkivágás (clip-path).
 * Úgy néz ki, mintha a papírból ki lenne vágva a rész – csak szerkesztő UI,
 * a nyomtatott fájlba nem kerül bele.
 */
#canvasContainer.hanger-cutout-active {
  clip-path: url(#naptarHangerPaperClip);
  -webkit-clip-path: url(#naptarHangerPaperClip);
  /* A clip-path levágja a box-shadow-t → drop-shadow követi a kivágott alakot */
  box-shadow: none !important;
  filter: drop-shadow(0 5px 18px rgba(0, 0, 0, 0.14));
}

/* A körív-jelölő elrejtve: a clip-path kivágás önmagában elég, a vonal zavaró volt */
.hanger-cutout-guide {
  display: none !important;
}

#calendarSpiralWrapper.type-asztali { top: 0; }
#calendarSpiralWrapper.type-havi { top: 0; }
#calendarSpiralWrapper.type-havi { --spiral-offset: var(--spiral-offset-havi); }
#calendarSpiralWrapper.type-asztali { --spiral-offset: var(--spiral-offset-asztali); }

/* Asztali_havi: a spirálkép ne nyúljon fel a szélesebb canvasra,
   hanem természetes magasságban ismétlődjön vízszintesen (repeat-x) */
#calendarSpiralWrapper.type-asztali-havi {
  top: 0;
  --spiral-offset: var(--spiral-offset-asztali);
  background-image: url('asztali_naptar_spiral.png');
  background-repeat: repeat-x;
  background-position: center bottom;
  background-size: auto 100%;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
  transform: translateX(-50%) translateY(calc(-100% + var(--spiral-offset, 26px)));
}
#calendarSpiralWrapper.type-asztali-havi #calendarSpiralImage {
  display: none;
}

@media (max-width: 768px) {
  #calendarSpiralWrapper.type-havi { --spiral-offset: var(--spiral-offset-havi-mobile); }
  #calendarSpiralWrapper.type-asztali { --spiral-offset: var(--spiral-offset-asztali-mobile); }
  #calendarSpiralWrapper.type-asztali-havi { --spiral-offset: var(--spiral-offset-asztali-mobile); }

  .zoom-bar {
    width: 92vw;
    max-width: var(--canvas-fit-width, var(--canvas-width, 595px));
  }

  .zoom-value {
    min-width: 50px;
  }
}

.canvas-helper {
  position: absolute;
  bottom: 15px;
  right: 15px;
  background: rgba(255,255,255,0.9);
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 12px;
  color: var(--dark-color);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  pointer-events: none;
}

#tabMenu {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--light-color);
  z-index: 999;
  box-shadow: 0 -5px 25px rgba(0,0,0,0.08);
  transition: var(--transition);
  border-top-left-radius: 15px;
  border-top-right-radius: 15px;
}

#topActionsWrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  padding: 8px 15px;
  border-bottom: 1px solid #f0f0f0;
  background-color: #f8f8f8;
  border-top-left-radius: 15px;
  border-top-right-radius: 15px;
}

/* Mobil képsáv: asztalin mindig rejtve */
#mobilePhotoStrip {
  display: none;
}

.actionButton {
  flex: 0 0 auto;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  padding: 8px 15px;
  background-color: var(--primary-color);
  color: var(--light-color);
  border: none;
  border-radius: 20px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(255, 102, 0, 0.2);
}

.actionButton:hover {
  background-color: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255, 102, 0, 0.3);
}

.actionButton i {
  font-size: 14px;
}

#tabItemsWrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 2px;
  gap: 3px;
}

.tabItem {
  flex: 1;
  text-align: center;
  background: #6b6b6b;
  cursor: pointer;
  transition: var(--transition);
  padding: 4px 0px;
  font-size: 12px;
  /* border: 1px solid #494949; */
  color: #ffffff;
  border-radius: 10px;
  position: relative;
  box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
}

.tabItem:hover {
  color: var(--primary-color);
  background-color: rgba(255, 102, 0, 0.05);
}

.tabItem.active {
  color: var(--primary-color);
  font-weight: 500;
  background: #ffffff;
}

.tabItem.active::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 40%;
  height: 3px;
  background-color: var(--primary-color);
  border-radius: 3px 3px 0 0;
}

.tabItem i {
  display: block;
  font-size: 20px;

}

#tabContent {

  padding: 0;
  max-height: 270px;
  overflow-y: auto;

  background-color: var(--light-color);
  border-top: 1px solid #eaeaea;
}

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

.tabContentHeader {
  padding: 5px;
  background-color: #f8f8f8;
  display: flex;
  align-items: center;
  margin-bottom: 5px;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.tabContentHeader h4 {
  margin: 0;
  color: var(--primary-color);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tabContentBody {
  padding: 0px;
}

#closeTabContent {
  background-color: #ff3b30;
  border: none;
  color: white;
  font-size: 14px;
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 50%;

  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(255, 59, 48, 0.3);
}

#closeTabContent:hover {
  background-color: #d32f2f;
  transform: rotate(90deg);
}

#uploadSection {
  padding: 0;
}

.upload-area {
  border: 2px dashed var(--accent-color);
  border-radius: var(--border-radius);
  padding: 25px;
  text-align: center;
  transition: var(--transition);
  background-color: #f9f9f9;
  margin-bottom: 15px;
  cursor: pointer;
}

.upload-area:hover {
  border-color: var(--primary-color);
  background-color: rgba(255, 102, 0, 0.05);
}

.upload-area i {
  font-size: 40px;
  color: var(--accent-color);
  margin-bottom: 10px;
  transition: var(--transition);
}

.upload-area:hover i {
  color: var(--primary-color);
  transform: translateY(-5px);
}

.upload-area p {
  margin: 0;
  color: var(--accent-color);
  font-size: 14px;
}

.upload-area .upload-text {
  font-weight: 500;
  margin-bottom: 5px;
}

.upload-controls {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

#uploadButton {
  background-color: var(--success-color);
  color: var(--light-color);
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 18px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

#uploadButton:hover {
  background-color: #388E3C;
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

.upload-text {
  font-size: 14px;
  color: var(--accent-color);
}

.clickable-upload-text {
  cursor: pointer;
  color: var(--primary-color);
  text-decoration: underline;
  transition: color 0.3s ease;
}

.clickable-upload-text:hover {
  color: var(--secondary-color);
  text-decoration: none;
}

#thumbnailContainer {
 display: block;
 overflow: hidden;
 white-space: normal;
 margin-top: 5px;
}

/* ===== Fényképek panel – AJT upload studio (asztal + mobil) ===== */
#tabContent .naptar-upload-panel {
  border: 0;
  box-shadow: none;
  background: transparent;
  padding: 0;
  margin: 0;
}
#tabContent .ajt-upload-studio.naptar-upload-studio,
#tabContent .naptar-upload-studio {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}
#tabContent .ajt-upload-dropzone {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1.5px dashed #d7dbe0;
  border-radius: 16px;
  background: linear-gradient(180deg, #fbfbfc, #f6f7f8);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
#tabContent .ajt-upload-dropzone:hover,
#tabContent .ajt-upload-dropzone.is-dragover {
  border-color: #ffb070;
  background: #fff7ed;
  box-shadow: 0 8px 20px rgba(255, 102, 0, 0.08);
}
#tabContent .ajt-upload-main-btn,
#tabContent .ajt-upload-dropzone #uploadButton {
  flex: 0 0 auto;
  width: 52px !important;
  height: 52px !important;
  min-height: 52px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 14px !important;
  background: linear-gradient(180deg, #ff7a1a, #f05600) !important;
  color: #fff !important;
  font-size: 20px !important;
  box-shadow: 0 8px 18px rgba(255, 102, 0, 0.28);
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}
#tabContent .ajt-upload-dropzone-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
#tabContent .ajt-upload-dropzone-copy strong {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
}
#tabContent .ajt-upload-dropzone-copy .clickable-upload-text {
  color: #6b7280;
  text-decoration: none;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 500;
}
#tabContent .ajt-upload-progress,
#tabContent .naptar-upload-progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff7ed;
  border: 1px solid #ffd7b0;
}
#tabContent .ajt-upload-progress[hidden],
#tabContent .naptar-upload-progress[hidden] {
  display: none !important;
}
#tabContent .ajt-upload-progress-track {
  height: 8px;
  border-radius: 999px;
  background: #ffe8d1;
  overflow: hidden;
}
#tabContent .ajt-upload-progress-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff7a1a, #f05600);
  transition: width 0.22s ease;
}
#tabContent .ajt-upload-progress-text {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #9a3412;
}
#tabContent .ajt-thumb-uploading {
  position: relative;
  background: #f3f4f6;
  border: 1px dashed #d1d5db;
  border-radius: 10px;
  width: 104px;
  height: 104px;
  min-width: 104px;
  min-height: 104px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  font-size: 11px;
  font-weight: 600;
  animation: naptarThumbPulse 1.1s ease-in-out infinite;
  box-sizing: border-box;
}
@keyframes naptarThumbPulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}
#tabContent .naptar-thumb-host .thumbnails-wrapper,
#tabContent .naptar-thumb-host #uploadedImagesList,
#tabContent #uploadedImagesList.thumbnails-wrapper,
#tabContent .naptar-upload-studio .thumbnails-wrapper {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, 104px) !important;
  grid-auto-rows: 104px;
  justify-content: start;
  gap: 10px !important;
  padding: 2px 2px 12px;
  align-items: start;
  max-height: none !important;
  overflow: visible !important;
}
#tabContent .naptar-thumb-host .thumbnail-wrapper,
#tabContent #uploadedImagesList .thumbnail-wrapper {
  position: relative !important;
  width: 104px !important;
  height: 104px !important;
  min-width: 104px !important;
  min-height: 104px !important;
  max-width: 104px !important;
  max-height: 104px !important;
  flex: 0 0 104px !important;
  border-radius: 10px !important;
  overflow: hidden !important;
  background: #f4f2f0 !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  box-sizing: border-box;
}
#tabContent .naptar-thumb-host .delete-icon,
#tabContent #uploadedImagesList .delete-icon,
#tabContent .thumbnails-wrapper .delete-icon {
  position: absolute !important;
  top: 6px !important;
  right: 6px !important;
  width: 22px !important;
  height: 22px !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.95) !important;
  color: #d9534f !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 11px !important;
  z-index: 5 !important;
  cursor: pointer !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12) !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}
#tabContent .naptar-thumb-host .thumbnail-controls,
#tabContent .thumbnail-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  padding: 6px 2px;
  background: transparent;
  border: 0;
  flex: 0 0 auto;
}
#tabContent .ajt-thumb-count,
#tabContent .naptar-thumb-count {
  font-size: 12px;
  font-weight: 700;
  color: #6b7280;
  white-space: nowrap;
}
#tabContent .naptar-upload-footer {
  display: block;
  width: 100%;
  margin: 4px 0 0;
  padding: 0 0 8px;
  flex: 0 0 auto;
}
#tabContent .delete-all-button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin: 8px 0 4px;
  min-height: 44px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  color: #b91c1c !important;
  background: #fef2f2 !important;
  border: 1px solid #fecaca !important;
  border-radius: 12px !important;
  cursor: pointer;
  box-sizing: border-box;
  flex: 0 0 auto;
  position: relative;
  z-index: 2;
}
#tabContent .delete-all-button:hover {
  background: #fee2e2 !important;
  border-color: #fca5a5 !important;
}
body.tab-sheet-open > #tabContent .ajt-upload-dropzone {
  background: #fff4eb;
  border: 2px solid #ff6600;
  box-shadow: 0 4px 14px rgba(255, 102, 0, 0.16);
}
body.tab-sheet-open > #tabContent .ajt-upload-dropzone-copy strong {
  color: #e65c00;
}
/* Mobil sheet: egy scroll a body-n, hogy az Összes törlés elérhető legyen */
body.tab-sheet-open > #tabContent #uploadSection {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
}
body.tab-sheet-open > #tabContent #uploadSection .upload-body,
body.tab-sheet-open > #tabContent .tabContentBody.upload-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  padding: 16px 16px calc(28px + env(safe-area-inset-bottom, 0px)) !important;
}
body.tab-sheet-open > #tabContent .naptar-upload-panel,
body.tab-sheet-open > #tabContent .naptar-upload-studio,
body.tab-sheet-open > #tabContent .naptar-thumb-host {
  overflow: visible !important;
  max-height: none !important;
  height: auto !important;
  flex: 0 0 auto !important;
}
body.tab-sheet-open > #tabContent .naptar-thumb-host .thumbnails-wrapper,
body.tab-sheet-open > #tabContent #uploadedImagesList {
  justify-content: center;
  overflow: visible !important;
  max-height: none !important;
}
body.tab-sheet-open > #tabContent .naptar-thumb-host .delete-icon,
body.tab-sheet-open > #tabContent #uploadedImagesList .delete-icon {
  opacity: 1 !important;
  display: flex !important;
}

/* Thumbnails wrapper and items */
.thumbnails-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 2px;
  align-content: flex-start;
  max-height: 280px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.thumbnail-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 110px;
  width: 110px;
  height: 110px;
  min-width: 110px;
  min-height: 110px;
  max-width: 110px;
  max-height: 110px;
  border-radius: 8px;
  background: #f8f8f8;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  overflow: hidden;
  cursor: pointer;
}

/* Ha a kép már el van helyezve valamelyik vásznon */
.thumbnail-wrapper.used {
  opacity: 0.45;
}
.thumbnail-wrapper.used:hover { opacity: 0.6; }
/* Garantált halványítás a képre is */
.thumbnail-wrapper.used .thumbnail-img { opacity: 0.45; }
.thumbnail-wrapper.used:hover .thumbnail-img { opacity: 0.6; }

.thumbnail-wrapper .delete-icon {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  color: #d9534f;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.thumbnail-img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
}

/* Low-res icon flag + tooltip */
.thumb-flag {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e53935;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.85);
  z-index: 2;
  pointer-events: none; /* ne akadályozza a kattintást */
}

.thumb-flag i { line-height: 1; }

.thumb-tooltip {
  position: absolute;
  top: 40%;                 /* a kép tetejétől */
  left: 0%;              /* középre igazítás */
  transform: translate(-50%, calc(-100% - 8px));
  background: rgba(0,0,0,0.85);
  color: #fff;
  padding: 6px 10px;
  font-size: 11px;
  border-radius: 8px;
  white-space: normal;    /* tördelhető */
  max-width: 320px;       /* nagyobb férőhely */
  
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  opacity: 0;
  transition: opacity .15s ease, transform .15s ease;
  pointer-events: none;
  z-index: 10000;
}

.thumbnail-wrapper:hover .thumb-tooltip,
.thumbnail-wrapper:focus-within .thumb-tooltip,
.thumbnail-wrapper:active .thumb-tooltip {
  opacity: 1;
  transform: translateY(0);
}

/* Touch helper: JS ráteszi a show-tip osztályt rövid időre */
.thumbnail-wrapper.show-tip .thumb-tooltip {
  opacity: 1;
  transform: translateY(0);
}

@media (hover: none) {
  /* Mobilon maradjon ikon; tooltip csak aktív érintésre */
  .thumbnail-wrapper:hover .thumb-tooltip { opacity: 0; }
}

.thumb-warning {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  background: rgba(229, 57, 53, 0.92);
  color: #fff;
  padding: 2px 6px;
  font-size: clamp(10px, 1.6vw, 11px);
  line-height: 1.1;
  font-weight: 700;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.85);
  text-shadow: 0 1px 1px rgba(0,0,0,0.35);
  white-space: nowrap;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
  pointer-events: none;
}

@media (max-width: 768px) {
  .thumbnail-wrapper {
    flex: 0 0 104px;
    width: 104px;
    height: 104px;
    min-width: 104px;
    min-height: 104px;
    max-width: 104px;
    max-height: 104px;
  }
  .thumb-warning { top: 5px; left: 5px; padding: 2px 5px; font-size: 10px; }
  .thumb-tooltip { max-width: 220px; font-size: 10px; }
  /* AJT mintára: mobilon is látszik a törlés */
  .thumbnail-wrapper .delete-icon,
  #tabContent .thumbnails-wrapper .delete-icon,
  #tabContent #uploadedImagesList .delete-icon {
    display: flex !important;
    opacity: 1 !important;
  }
}

/* Delete ikon hover kontraszt javítás */
.thumbnail-wrapper .delete-icon:hover {
  background: #ffffff;
  color: #d32f2f;
  border: 1px solid rgba(0,0,0,0.05);
}

/* Feltöltés gomb kattinthatóságának biztosítása */
#uploadSection .upload-controls { position: relative; z-index: 2; }
#uploadButton { pointer-events: auto; }
.clickable-upload-text { pointer-events: auto; }

#thumbnailContainer::-webkit-scrollbar {
  height: 6px;
}

#thumbnailContainer::-webkit-scrollbar-thumb {
  background-color: var(--accent-color);
  border-radius: 3px;
}

#thumbnailContainer::-webkit-scrollbar-track {
  background-color: #f0f0f0;
}

.upload-controls {
  display: flex;
  align-items: center;
  margin-top: 4px;
  position: sticky;
  top: 0;
  background-color: #fff;
  padding: 0px 0;
  z-index: 5;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
}

#uploadOverlay {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: auto;
  background: transparent;
  z-index: 10000;
  align-items: flex-end;
  justify-content: center;
  flex-direction: column;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  pointer-events: none;
}

#uploadOverlay.is-compact .upload-overlay-card,
#uploadOverlay .upload-overlay-card {
  pointer-events: auto;
}

.upload-overlay-card {
  width: min(420px, 94vw);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(15, 18, 28, 0.18);
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  margin: 0 auto;
}

.upload-overlay-card--compact {
  width: min(380px, 96vw);
}

.upload-overlay-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.upload-overlay-texts {
  min-width: 0;
  flex: 1;
}

.upload-overlay-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #222;
}

.spinner--sm {
  width: 22px;
  height: 22px;
  border-width: 3px;
  margin: 0;
  flex-shrink: 0;
}

.upload-preview-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  justify-content: flex-start;
  max-width: 100%;
  overflow-x: auto;
  margin-bottom: 10px;
  -webkit-overflow-scrolling: touch;
}

.upload-preview-item {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  background: #e8eaed;
  border: 2px solid #e5e7eb;
  flex-shrink: 0;
  transition: border-color 0.2s, filter 0.2s;
}

.upload-preview-item.is-pending img,
.upload-preview-item.is-uploading img {
  filter: grayscale(0.85) brightness(0.92);
  opacity: 0.75;
}

.upload-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.upload-preview-badge {
  position: absolute;
  right: 4px;
  bottom: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}

.upload-preview-item.is-uploading {
  border-color: #ff7a1a;
  box-shadow: 0 0 0 2px rgba(255, 122, 26, 0.2);
}

.upload-preview-item.is-done {
  border-color: #22c55e;
}

.upload-preview-item.is-done img {
  filter: none;
  opacity: 1;
}

.upload-preview-item.is-done .upload-preview-badge {
  background: #22c55e;
}

.upload-preview-item.is-error {
  border-color: #ef4444;
}

.upload-preview-item.is-error .upload-preview-badge {
  background: #ef4444;
}

.upload-progress-container {
  width: 100%;
  height: 6px;
  background: #eee;
  border-radius: 999px;
  overflow: hidden;
  margin: 0 0 6px;
}

.upload-progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #ff7a1a, #ff9a4d);
  border-radius: 999px;
  transition: width 0.2s ease;
}

#uploadOverlay #uploadProgressText,
#uploadOverlay #uploadTimeRemaining,
#uploadOverlay .upload-time-remaining {
  margin: 0;
  font-size: 12px;
  color: #666;
}

.mobile-photo-strip-item.is-upload-pending,
.mobile-photo-strip-item.is-uploading,
.thumbnail-wrapper.is-upload-pending {
  position: relative;
  opacity: 0.72;
}

.mobile-photo-strip-item.is-upload-pending img,
.mobile-photo-strip-item.is-uploading img,
.thumbnail-wrapper.is-upload-pending img {
  filter: grayscale(1) brightness(0.9);
}

.mobile-photo-strip-item .upload-pending-badge {
  position: absolute;
  right: 3px;
  bottom: 3px;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
}

.mobile-photo-strip-item.is-upload-done,
.thumbnail-wrapper.is-upload-done {
  opacity: 1;
}

.mobile-photo-strip-item.is-upload-done img {
  filter: none;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 102, 0, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
  margin-bottom: 15px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));

  align-content: stretch;
}

.settings-stack,
.calendar-settings-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-section {
  background: #fafafa;
  border: 1px solid #eceef0;
  border-radius: 10px;
  padding: 12px;
}

.settings-section h5 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7280;
}

.events-tab-copy {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.45;
  color: #4b5563;
}

.settings-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  font-size: 14px;
  color: #111827;
  cursor: pointer;
}

.settings-toggle:last-of-type {
  margin-bottom: 0;
}

.settings-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.settings-pair {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 10px;
  font-size: 13px;
  color: #374151;
}

.settings-field:last-of-type {
  margin-bottom: 0;
}

.settings-field select {
  width: 100%;
  min-height: 40px;
  border: 1px solid #e4e6e8;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  background: #fff;
  box-sizing: border-box;
}

.settings-primary-btn,
.settings-quiet-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.settings-primary-btn {
  background: var(--primary-color);
  color: #fff;
  margin-bottom: 8px;
}

.settings-primary-btn:last-child {
  margin-bottom: 0;
}

.settings-secondary-btn {
  background: #fff;
  color: #111827;
  border-color: #e4e6e8;
}

.settings-section-quiet {
  background: transparent;
  border: none;
  padding: 4px 0 0;
}

.settings-quiet-btn {
  background: transparent;
  color: #6b7280;
  border-color: transparent;
  font-weight: 500;
  min-height: 36px;
}

.settings-quiet-btn:hover {
  color: #111827;
  background: #f3f4f6;
}

.spi-cart-btn {
  display: none;
}

.setting-card {
  background-color: #f9f9f9;
  border-radius: var(--border-radius);
  padding: 15px;
  transition: var(--transition);
}

.setting-card:hover {
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.setting-card h5 {
  margin: 0 0 10px;
  color: var(--dark-color);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.setting-card h5 i {
  color: var(--primary-color);
}

.setting-option {
  margin-bottom: 10px;
}

/* Naptár beállítások kártya: szoros, de nem átfedő elrendezés */
.calendar-options .setting-option { margin-bottom: 6px; }
.calendar-options .calendar-opt-tight { margin-bottom: 4px; }
.calendar-options .calendar-opt-tight label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  line-height: 1.35;
}
.calendar-options .calendar-opt-btn { margin-top: 10px; margin-bottom: 0; }
.calendar-opt-tight input[type="checkbox"] { margin: 0; vertical-align: middle; flex: 0 0 auto; }

.setting-option label {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  color: var(--accent-color);
}

.setting-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e0e0e0;
  border-radius: var(--border-radius);
  font-family: 'Poppins', sans-serif;
  transition: var(--transition);
}

.setting-input:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 102, 0, 0.1);
}

.color-picker {
  -webkit-appearance: none;
  appearance: none; /* standard property for compatibility */
  width: 35px;
  height: 35px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

.color-picker::-webkit-color-swatch-wrapper {
  padding: 0;
  border-radius: 50%;
}

.color-picker::-webkit-color-swatch {
  border: none;
  border-radius: 50%;
}

.backgrounds-grid {
  display: flex;
  overflow-x: auto;
  padding-bottom: 10px;
  gap: 10px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.3) transparent;
  flex-wrap: nowrap;
}

.backgrounds-grid::-webkit-scrollbar {
  height: 4px;
}

.backgrounds-grid::-webkit-scrollbar-track {
  background: transparent;
}

.backgrounds-grid::-webkit-scrollbar-thumb {
  background-color: rgba(0,0,0,0.3);
  border-radius: 4px;
}

.background-thumb {
  position: relative;
  min-width: 100px;
  max-width: 100px;
  height: 100px;
  border-radius: var(--border-radius);
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  transition: var(--transition);
  flex-shrink: 0;
}

.background-thumb.background-upload-thumb {
  background: #f7f7f7;
  border: 2px dashed rgba(0,0,0,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
}

.bg-upload-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px;
  text-align: center;
  height: 100%;
  color: var(--primary-color);
}

.bg-upload-inner i {
  font-size: 20px;
}

.bg-upload-text {
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
}

.background-thumb-custom {
  position: relative;
}

.bg-delete-custom {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: none;
  background: rgba(0,0,0,0.65);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.background-thumb-custom:hover .bg-delete-custom {
  opacity: 1;
}

.bg-delete-custom:hover {
  background: rgba(231, 76, 60, 0.9);
}

.bg-delete-custom i {
  font-size: 12px;
  line-height: 1;
}

@media (max-width: 768px) {
  .bg-delete-custom {
    opacity: 1;
  }
}

.background-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.background-thumb:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.background-thumb.selected {
  box-shadow: 0 0 0 3px var(--primary-color);
}

.background-thumb::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.1);
  opacity: 0;
  transition: var(--transition);
}

.background-thumb:hover::after {
  opacity: 1;
}

.backgrounds-category {
  margin-bottom: 20px;
}

.backgrounds-category h5 {
  font-weight: 600;
  margin: 0 0 10px;
  color: var(--dark-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

.backgrounds-category h5 i {
  color: var(--primary-color);
}

.text-tools {
  display: flex;
  flex-wrap: nowrap;
  gap: 2px;
  margin-bottom: 0px;
  background-color: #f9f9f9;
  padding: -2px;
  border-radius: var(--border-radius);
}

.text-tool {
  padding: 5px 9px;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  background-color: var(--light-color);
  color: var(--dark-color);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.text-tool:hover {
  background-color: #f0f0f0;
  color: var(--primary-color);
}

.text-tool.active {
  background-color: var(--primary-color);
  color: var(--light-color);
}

.text-input-container {
  margin-top: 15px;
}

.text-input-container textarea {
  width: 92%;
  padding: 12px;
  border: 1px solid #e0e0e0;
  border-radius: var(--border-radius);
  font-family: 'Poppins', sans-serif;
  min-height: 100px;
  transition: var(--transition);
  resize: vertical;
}

.text-input-container textarea:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 102, 0, 0.1);
}

.text-add-button {
  background-color: var(--primary-color);
  color: var(--light-color);
  border: none;
  border-radius: var(--border-radius);
  padding: 10px 20px;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  box-shadow: 0 2px 8px rgba(255, 102, 0, 0.2);
}

.text-add-button:hover {
  background-color: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255, 102, 0, 0.3);
}

.tool-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: #374151;
}

.tool-btn:hover,
.tool-btn.active {
  background: #fff7ed;
  color: var(--primary-color);
  border-color: #fed7aa;
}

.preset-colors-compact {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.preset-color {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid #ddd;
}

.modalOverlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(17, 20, 28, 0.48);
  z-index: 20050;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.32s ease;
  padding: 20px;
  box-sizing: border-box;
}

.modalOverlay.is-visible {
  opacity: 1;
}

.modalOverlay.is-closing {
  opacity: 0;
}

.modalContent {
  background-color: var(--light-color);
  border-radius: 18px;
  padding: 24px 26px 22px;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 28px 80px rgba(15, 18, 28, 0.28);
  position: relative;
  transform: translateY(36px);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.32s ease;
}

.modalOverlay.is-visible .modalContent {
  transform: translateY(0);
  opacity: 1;
}

.modalOverlay.is-closing .modalContent {
  transform: translateY(16px);
  opacity: 0;
}

/* Automata kitöltés: pici, középre igazított státusz (nem nagy modal) */
.naptar-autofill-toast {
  position: fixed;
  inset: 0;
  z-index: 26000;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  padding: 20px;
  box-sizing: border-box;
  background: rgba(15, 18, 28, 0.18);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.naptar-autofill-toast[hidden] {
  display: none !important;
}
.naptar-autofill-toast.is-visible {
  opacity: 1;
}
.naptar-autofill-toast .naf-card {
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  max-width: min(320px, 92vw);
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 102, 0, 0.16);
  box-shadow: 0 16px 40px rgba(15, 18, 28, 0.22);
}
.naptar-autofill-toast .naf-spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 102, 0, 0.2);
  border-top-color: var(--primary-color, #ff6600);
  animation: nafSpin 0.75s linear infinite;
  flex: 0 0 auto;
}
.naptar-autofill-toast .naf-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  text-align: left;
}
.naptar-autofill-toast .naf-title {
  font-size: 14px;
  font-weight: 800;
  color: #222;
  line-height: 1.2;
}
.naptar-autofill-toast .naf-status {
  font-size: 12px;
  color: #777;
  line-height: 1.3;
}
@keyframes nafSpin {
  to { transform: rotate(360deg); }
}

/* Automata megerősítés: pici középre igazított dialógus */
.naptar-autofill-confirm {
  position: fixed;
  inset: 0;
  z-index: 26010;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  background: rgba(15, 18, 28, 0.28);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.naptar-autofill-confirm.is-visible {
  opacity: 1;
}
.naptar-autofill-confirm .naf-confirm-card {
  width: min(300px, 92vw);
  padding: 20px 18px 16px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(255, 102, 0, 0.14);
  box-shadow: 0 18px 44px rgba(15, 18, 28, 0.24);
  text-align: center;
}
.naptar-autofill-confirm .naf-confirm-icon {
  width: 42px;
  height: 42px;
  margin: 0 auto 10px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #ff8a3d, #ff6600);
  color: #fff;
  box-shadow: 0 8px 18px rgba(255, 102, 0, 0.3);
}
.naptar-autofill-confirm .naf-confirm-icon i {
  font-size: 16px;
}
.naptar-autofill-confirm .naf-confirm-title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 800;
  color: #222;
  line-height: 1.25;
}
.naptar-autofill-confirm .naf-confirm-msg {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.4;
  color: #666;
}
.naptar-autofill-confirm .naf-confirm-actions {
  display: flex;
  gap: 8px;
}
.naptar-autofill-confirm .naf-confirm-btn {
  flex: 1 1 0;
  min-height: 40px;
  border: none;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.naptar-autofill-confirm .naf-confirm-ok {
  background: var(--primary-color, #ff6600);
  color: #fff;
  box-shadow: 0 6px 14px rgba(255, 102, 0, 0.28);
}
.naptar-autofill-confirm .naf-confirm-cancel {
  background: #f3f3f3;
  color: #555;
}
.naptar-autofill-confirm .naf-confirm-actions:has(.naf-confirm-ok):not(:has(.naf-confirm-cancel)) .naf-confirm-ok {
  flex: 1 1 auto;
}

/* Kilépés megerősítő modal */
.modalOverlay.naptar-leave-overlay .modalContent {
  max-width: 420px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 102, 0, 0.12);
  box-shadow: 0 28px 70px rgba(15, 18, 28, 0.32);
}

.naptar-leave-modal {
  text-align: center;
  padding: 28px 24px 22px;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(255, 102, 0, 0.14), transparent 55%),
    linear-gradient(180deg, #fff 0%, #fafafa 100%);
}

.nlm-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #ff8a3d, #ff6600);
  color: #fff;
  box-shadow: 0 10px 24px rgba(255, 102, 0, 0.35);
}

.nlm-icon i {
  font-size: 26px;
  line-height: 1;
}

.nlm-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 102, 0, 0.12);
  color: #c24e00;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.nlm-title {
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.25;
  color: #222;
  font-weight: 800;
}

.nlm-lead {
  margin: 0 0 10px;
  color: #444;
  font-size: 15px;
  line-height: 1.45;
  font-weight: 600;
}

.nlm-detail {
  margin: 0 0 22px;
  color: #6b6b6b;
  font-size: 13px;
  line-height: 1.5;
}

.nlm-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nlm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  padding: 12px 16px;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.nlm-btn i {
  font-size: 15px;
}

.nlm-btn-stay {
  background: var(--primary-color, #ff6600);
  color: #fff;
  box-shadow: 0 8px 20px rgba(255, 102, 0, 0.28);
}

.nlm-btn-stay:hover,
.nlm-btn-stay:active {
  background: #e85d00;
  transform: translateY(-1px);
}

.nlm-btn-exit {
  background: #fff;
  color: #555;
  border: 1px solid #e4e4e4;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.nlm-btn-exit:hover,
.nlm-btn-exit:active {
  background: #f6f6f6;
  color: #333;
}

@media (max-width: 768px) {
  .modalOverlay.naptar-leave-overlay .modalContent {
    max-width: min(420px, 100%);
    margin: 0 8px;
  }
  .naptar-leave-modal {
    padding: 24px 18px 18px;
  }
  .nlm-title {
    font-size: 20px;
  }
  .nlm-lead {
    font-size: 14px;
  }
}

.preview-grid {
    display: flex;
    grid-template-columns: repeat(1, 1fr);
    grid-gap: 15px;
    max-height: 60vh;
    overflow-y: auto;
    padding: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.preview-thumbnail {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 8px;
    overflow: hidden;
    background: #f9f9f9;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-width: 150px;
    flex: 0 0 auto;
}

.preview-thumbnail:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.preview-thumbnail h4 {
    margin: 0;
    padding: 8px;
    font-size: 12px;
    text-align: center;
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.preview-thumb-wrapper {
    position: relative;
    overflow: hidden;
    background: #f3f4f6;
}

.preview-thumb-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.preview-zoom-icon {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(255, 102, 0, 0.9);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    opacity: 0.85;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Asztali gépen csak hover-re jelenjen meg */
@media (hover: hover) and (pointer: fine) {
    .preview-zoom-icon {
        opacity: 0;
    }
    
    .preview-thumbnail:hover .preview-zoom-icon {
        opacity: 1;
        transform: scale(1.1);
    }
    
    .preview-thumbnail:hover .preview-thumb-img {
        /* Enyhe zoom – ne vágja le a teljes oldalt */
        transform: scale(1.02);
    }
}

@media (min-width: 768px) {
  .preview-grid {
    grid-template-columns: repeat(2, 1fr); 
  }

  .preview-thumbnail {
    max-width: 180px;
  }

  .preview-thumbnail h4 {
    font-size: 13px;
    padding: 10px;
  }

  .modalContent {
    max-width: 700px; 
    max-height: 90vh;
  }
}

@media (min-width: 1200px) {
  .preview-grid {
    grid-template-columns: repeat(3, 1fr); 
  }

  .preview-thumbnail {
    max-width: 220px;
  }

  .preview-thumbnail h4 {
    font-size: 14px;
    padding: 12px;
  }

  .modalContent {
    max-width: 900px; 
  }
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.closeModalBtn {
  position: absolute;
  top: 15px;
  right: 15px;
  cursor: pointer;
  font-size: 24px;
  color: var(--accent-color);
  transition: var(--transition);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.closeModalBtn:hover {
  color: var(--warning-color);
  background-color: #f8f8f8;
}

.text-style-modal {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.text-style-modal h3 {
  margin: 0;
  color: var(--primary-color);
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tsm-preview {
  min-height: 96px;
  max-height: 140px;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 18px;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.55), rgba(255,255,255,0.2)),
    repeating-linear-gradient(0deg, transparent, transparent 27px, rgba(255,102,0,0.07) 28px),
    #f7f3ee;
  border: 1px solid rgba(0,0,0,0.07);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
  word-break: break-word;
  line-height: 1.25;
  text-align: center;
}
.tsm-preview.is-empty {
  color: #aaa !important;
  font-style: italic;
  font-size: 16px !important;
  font-family: Arial, sans-serif !important;
  font-weight: normal !important;
  text-decoration: none !important;
}
.tsm-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0 0 5px;
  color: #555;
}
.tsm-textarea {
  width: 100%;
  min-height: 88px;
  box-sizing: border-box;
  border: 1px solid #e2ddd8;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 16px;
  resize: vertical;
  line-height: 1.4;
  background: #fff;
}
.tsm-textarea:focus,
.tsm-select:focus,
.tsm-row input:focus {
  outline: none;
  border-color: #ff6600;
  box-shadow: 0 0 0 3px rgba(255,102,0,0.15);
}
.tsm-select, .tsm-row input[type="number"] {
  width: 100%;
  min-height: 44px;
  border: 1px solid #e2ddd8;
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 15px;
  box-sizing: border-box;
  background: #fff;
}
.tsm-row input[type="color"] {
  width: 100%;
  height: 44px;
  padding: 4px;
  border: 1px solid #e2ddd8;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}
.tsm-inline {
  display: flex;
  gap: 12px;
}
.tsm-inline > div { flex: 1; min-width: 0; }
.tsm-toggles {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tsm-toggle {
  width: 44px;
  height: 44px;
  border: 1px solid #e2ddd8;
  background: #fff;
  border-radius: 12px;
  cursor: pointer;
  color: #444;
}
.tsm-toggle.active {
  background: #ff6600;
  color: #fff;
  border-color: #ff6600;
}
.tsm-actions {
  margin-top: 4px;
}
.tsm-actions .btn {
  width: 100%;
  padding: 13px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
}
.modalOverlay.tsm-overlay {
  align-items: center;
  padding: 16px;
  box-sizing: border-box;
}
.modalOverlay.tsm-overlay .modalContent {
  max-width: 520px;
  width: 100%;
  padding: 22px 22px 20px;
  border-radius: 20px;
  max-height: 92vh;
  flex: 0 1 auto;
}

.zoom-cart-btn {
  display: none;
}

#templateLoadOverlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 40000;
  background: rgba(20, 16, 12, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}
#templateLoadOverlay.is-visible {
  display: flex;
}
.tlo-card {
  background: #fff;
  border-radius: 20px;
  padding: 28px 26px 24px;
  max-width: 340px;
  width: 100%;
  text-align: center;
  box-shadow: 0 18px 50px rgba(0,0,0,0.28);
}
.tlo-card .spinner {
  margin: 0 auto 16px;
  width: 46px;
  height: 46px;
}
.tlo-card p {
  margin: 0;
  color: #333;
  font-size: 17px;
  font-weight: 700;
}
.tlo-card .tlo-sub {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 400;
  color: #777;
}

@media (max-width: 768px) {
  body {
    padding-bottom: 70px;
  }

  .container {
    width: calc(100% - 20px);
    margin: 10px auto;
  }

  .modalOverlay {
    padding: 6px;
    align-items: stretch;
    box-sizing: border-box;
  }
  .modalContent {
    width: auto;
    max-width: none;
    flex: 1 1 auto;
    max-height: none;
    height: auto;
    margin: 0;
    border-radius: 16px;
    padding: 14px 12px 16px;
    box-sizing: border-box;
  }
  .custom-events-modal {
    max-height: none;
    height: 100%;
  }
  .modalOverlay.tsm-overlay {
    align-items: flex-end;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
  }
  .modalOverlay.tsm-overlay .modalContent {
    width: 100%;
    max-width: none;
    flex: 0 1 auto;
    max-height: 90vh;
    height: auto;
    margin: 0;
    border-radius: 20px 20px 14px 14px;
    padding: 16px 14px 14px;
  }
  .tsm-preview {
    min-height: 80px;
    max-height: 120px;
    padding: 14px 12px;
  }
  .tsm-textarea {
    min-height: 72px;
  }

  #canvasContainer {
    width: 300px;
    height: 424px;
  }

  .product-container {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
  }

  #monthBar {
    padding: 10px;
  }

  #monthBar .month {
    padding: 5px 6px;
    font-size: 10px;
  }

  /* Mobilon a hónapsáv egy sorban, vízszintes görgetéssel */
  #monthBar {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
  }
  #monthBar .month {
    flex: 0 0 auto;
  }

  #topActionsWrapper {
    padding: 8px;
    gap: 5px;
  }

  .actionButton {
    padding: 6px 12px;
    font-size: 13px;
  }

  #tabItemsWrapper {
    padding: 1px 5px;
  }

  .tabItem {
    padding: 5px;
    font-size: 11px;
  }

  .tabItem i {
    font-size: 18px;
    margin-bottom: 3px;
  }

  .tabContentHeader {
    padding: 10px;
  }

  .tabContentBody {
    padding: 8px;
  }

  .tabContentHeader h4 {
    font-size: 16px;
  }

  #uploadButton {
    padding: 8px 15px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {

  .actionButton, .tabItem {
    padding: 5px 10px;
    font-size: 11px;
  }

  .tabItem i {
    font-size: 16px;
  }
}

.month-calendar {
  width: 100%;
  margin-top: 20px;
  border-top: 1px solid #eaeaea;
  padding-top: 20px;
}

.calendar-container {
  width: 100%;
  max-width: 595px;
  margin: 0 auto;
  font-family: 'Poppins', sans-serif;
  box-shadow: 0 1px 10px rgba(0,0,0,0.05);
  border-radius: 8px;
  overflow: hidden;
}

.calendar-header {
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  padding: 12px;
  background-color: var(--primary-color);
  color: white;
}

.calendar-table {
  width: 100%;
  border-collapse: collapse;
  background-color: white;
}

.calendar-days th {
  text-align: center;
  padding: 10px;
  background-color: #f5f5f5;
  color: var(--dark-color);
  font-weight: 500;
  font-size: 12px;
}

.calendar-day {
  text-align: center;
  padding: 5px;
  height: 55px;
  border: 1px solid #eee;
  vertical-align: top;
  transition: background-color 0.2s;
}

.calendar-day:hover {
  background-color: #f9f9f9;
}

.weekend {
  background-color: #f9f9f9;
}

.weekend .day-number {
  color: var(--accent-color);
}

.holiday {
  background-color: #fff8f8;
}

.empty-day {
  border: 1px solid #f5f5f5;
  background-color: #fafafa;
}

.day-number {
  font-size: 14px;
  font-weight: 600;
  text-align: right;
  color: var(--dark-color);
  margin-bottom: 4px;
}

.namedays {
  font-size: 9px;
  color: var(--accent-color);
  margin-top: 2px;
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.holiday-name {
  font-size: 9px;
  color: #e74c3c;
  margin-top: 2px;
  text-align: center;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 768px) {
  .calendar-day {
    height: 40px;
    padding: 2px;
  }

  .day-number {
    font-size: 12px;
  }

  .namedays, .holiday-name {
    font-size: 8px;
  }
}

.object-controller {
  position: absolute;
  z-index: 10000; 
  background-color: #fff;
  border-radius: 30px;
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.2);
  padding: 5px 15px;
  transition: all 0.2s ease;
  transform: translateX(-50%); 
  display: flex;
  align-items: center;
  animation: slideUp 0.3s ease forwards;

  pointer-events: auto; 
  margin-top: -40px; 
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.controller-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  flex-direction: column;
  justify-content: center;
}

.controller-btn-row {
  display: flex;
  gap: -1px;
  flex-wrap: nowrap;
  flex-direction: row;
  justify-content: center;
}

.mask-inner-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 6px 2px 6px;
}

.mask-inner-controls input[type="range"] {
  width: 180px;
}

.mask-inner-btn {
  width: 28px;
  height: 28px;
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 50%;
  color: #27ae60;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.mask-inner-btn:hover {
  background: #eefbf3;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

.controller-btn {
  width: 36px;
  height: 36px;
  background: #fff;
  border: none;
  border-radius: 50%;
  color: #555;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.controller-btn:hover {
  background: #f5f5f5;
  transform: translateY(-2px);
  color: #333;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.controller-btn[data-action="delete"] {
  color: #e74c3c;
}

.controller-btn[data-action="delete"]:hover {
  background: #fee;
}

.controller-btn[data-action="crop"] {
  color: #3498db;
}

.controller-btn[data-action="crop"]:hover {
  background: #eef7fd;
}

.controller-btn[data-action="lock-clipart"] {
  color: #7c3aed;
}

.controller-btn[data-action="lock-clipart"]:hover {
  background: #f3e8ff;
}

body:not(.admin-calendar-mode) .controller-btn[data-action="lock-clipart"] {
  display: none !important;
}

.admin-only-settings { display: none !important; }
body.admin-calendar-mode .admin-only-settings { display: block !important; }
body.admin-calendar-mode .admin-only-settings.hdr-apply-box { display: flex !important; }

.admin-opacity-control {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #444;
  min-width: 210px;
}

.admin-opacity-control span:first-child {
  white-space: nowrap;
  font-weight: 600;
}

.admin-opacity-control input[type="range"] {
  flex: 1;
  min-width: 80px;
}

.admin-opacity-pct {
  min-width: 36px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #666;
}

#adminTemplateToolbar .admin-opacity-control {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 4px 8px;
}

.controller-btn[data-action="rotate-left"],
.controller-btn[data-action="rotate-right"] {
  color: #27ae60;
}

.controller-btn[data-action="rotate-left"]:hover,
.controller-btn[data-action="rotate-right"]:hover {
  background: #eefbf3;
}

.cropper-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.95); 
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;

  pointer-events: auto !important;
  touch-action: auto !important;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

.cropper-container {
  opacity: 1 !important;
  pointer-events: auto !important;
}

.cropper-wrap-box,
.cropper-canvas,
.cropper-drag-box,
.cropper-crop-box,
.cropper-modal {
  opacity: 1 !important;
  pointer-events: auto !important;
}

.cropper-modal {
  background-color: rgba(0, 0, 0, 0.5) !important;
}

.cropper-modal-footer {
  padding: 15px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid #e0e0e0;
  background-color: white;
  z-index: 100000;
  position: relative;
}

.cropper-modal-content {
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.25);
  max-width: 90vw;
  width: 800px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalSlideUp 0.4s ease;
  position: relative;
  z-index: 100000;
}

.cropper-modal-header {
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #f5f5f5;
  border-bottom: 1px solid #e0e0e0;
}

.cropper-modal-header h3 {
  margin: 0;
  font-weight: 500;
  color: #333;
}

.close-cropper-modal {
  background: transparent;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: #555;
  cursor: pointer;
  transition: all 0.2s;
}

.close-cropper-modal:hover {
  color: #e74c3c;
}

.cropper-container {
  flex: 1;
  overflow: hidden;
  position: relative;
  max-height: 70vh;
  margin: 15px;
}

.cropper-modal-footer {
  padding: 15px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid #e0e0e0;
}

.cropper-view-box {
  box-shadow: 0 0 0 1px #39f;
  border-radius: 0;
  outline: 0;
}

.cropper-dashed {
  border-style: dashed;
  border-color: #eee;
}

.cropper-point {
  background-color: #3498db;
  width: 10px;
  height: 10px;
}

.cropper-point.point-n, 
.cropper-point.point-s, 
.cropper-point.point-e, 
.cropper-point.point-w {
  width: 12px;
  height: 12px;
}

.cropper-point.point-ne, 
.cropper-point.point-nw, 
.cropper-point.point-se, 
.cropper-point.point-sw {
  width: 14px;
  height: 14px;
}

.cropper-mobile-hint {
  display: none;
  padding: 8px 16px 0;
  font-size: 13px;
  line-height: 1.35;
  color: #555;
  text-align: center;
}

.cropper-loading-overlay {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 1000001;
  background: #f3f4f6;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  color: #555;
  font-size: 14px;
}

.cropper-loading-overlay .spinner {
  margin: 0;
}

#cropperModal .cropper-container {
  position: relative;
}

#cropperModal.is-cropper-loading #cropperImage {
  opacity: 0 !important;
}

#cropperModal.is-cropper-ready #cropperImage {
  opacity: 1 !important;
}

@media (max-width: 768px) {
  #cropperModal.cropper-modal {
    padding: 0;
    align-items: flex-end;
    justify-content: center;
    background: rgba(17, 20, 28, 0.55) !important;
  }

  #cropperModal .cropper-modal-content {
    width: 100%;
    max-width: 100%;
    /* svh: a böngésző UI alatt is látszik a fejléc/lábléc (S25) */
    height: auto;
    max-height: 100svh;
    max-height: 100dvh;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.25);
    animation: none;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-sizing: border-box;
  }

  #cropperModal .cropper-modal-header {
    padding: 10px 14px;
    flex-shrink: 0;
    min-height: 48px;
  }

  #cropperModal .cropper-modal-header h3 {
    font-size: 16px;
  }

  #cropperModal .cropper-container {
    flex: 1 1 auto;
    margin: 0;
    min-height: 180px;
    max-height: calc(100svh - 150px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    max-height: calc(100dvh - 150px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    touch-action: none;
    background: #111;
  }

  #cropperModal .cropper-mobile-hint {
    display: block;
    flex-shrink: 0;
    background: #fff;
    padding: 6px 14px;
    font-size: 12px;
  }

  #cropperModal .cropper-modal-footer {
    flex-shrink: 0;
    padding: 10px 14px 12px;
    gap: 10px;
    background: #fff;
  }

  #cropperModal .cropper-modal-footer .btn {
    flex: 1;
    min-height: 46px;
    font-size: 16px;
    border-radius: 12px;
  }

  #cropperModal.is-mobile-crop .cropper-point {
    width: 22px !important;
    height: 22px !important;
  }

  #cropperModal.is-mobile-crop .cropper-line {
    width: 3px !important;
    height: 3px !important;
  }

  #cropperModal.is-background-crop .cropper-view-box {
    outline: 2px solid rgba(255, 122, 26, 0.95) !important;
  }
}

.btn {
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn.primary {
  background-color: var(--primary-color, #b31217);
  color: white;
}

.btn.primary:hover {
  background-color: var(--primary-dark, #8f0e12);
  box-shadow: 0 2px 8px rgba(255, 102, 0, 0.3);
}

.btn:not(.primary) {
  background-color: #f5f5f5;
  color: #555;
}

.btn:not(.primary):hover {
  background-color: #e5e5e5;
}

.apply-options {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 15px;
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: #fff;
  padding: 8px 0;
}

.apply-button {
  flex: 1;
  padding: 8px 10px;
  border-radius: 5px;
  border: 1px solid #ddd;
  background-color: #f8f8f8;
  color: #333;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.apply-button i {
  margin-right: 5px;
  font-size: 14px;
}

.apply-button.active {
  background-color: var(--primary-color, #f60);
  color: white;
  border-color: var(--primary-color, #f60);
}

.apply-button:hover:not(.active) {
  background-color: #eee;
}

.backgrounds-category {
  margin-bottom: 15px;
}

.backgrounds-category h5 {
  font-size: 14px;
  margin-bottom: 8px;
  color: #333;
  display: flex;
  align-items: center;
  padding-left: 2px;
}

.backgrounds-category h5 i {
  margin-right: 6px;
  color: var(--primary-color, #f60);
}

.month {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: 28px; 
}

.edited-indicator {
  display: none;
  position: absolute;
  top: 4px;
  right: 4px;
  width: 16px;
  height: 16px;
  background-color: #4CAF50;
  border-radius: 50%;
  color: white;
  font-size: 12px;
  text-align: center;
  line-height: 16px;
  z-index: 5;
  align-items: center;
  justify-content: center;
}

.month.is-edited .edited-indicator {
  display: flex !important;
}

.edited-indicator:before {
  content: '✓';
  font-weight: bold;
}

.actionButton[data-action="autofill"] {
  background-color: #9c27b0; 
}

.actionButton[data-action="autofill"]:hover {
  background-color: #7b1fa2; 
}

.thumbnail-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding: 5px 0;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background-color: #f5f5f5;
  color: #555;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.icon-btn:hover {
  background-color: #e0e0e0;
  transform: translateY(-2px);
}

.icon-btn.danger {
  color: #e74c3c;
}

.icon-btn.danger:hover {
  background-color: #fee;
}

.thumbnail-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  margin-right: 0;
  margin-bottom: 0;
  flex: 0 0 110px;
  width: 110px;
  height: 110px;
  min-width: 110px;
  min-height: 110px;
  max-width: 110px;
  max-height: 110px;
  border: 2px solid transparent;
  transition: all 0.2s;
}

.thumbnail-wrapper:hover {
  transform: scale(1.05);
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
  border-color: var(--primary-color);
}

.thumbnail-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.delete-icon {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  background-color: rgba(231, 76, 60, 0.9);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 10px;
  z-index: 2;
  opacity: 0;
  transition: all 0.2s;
}

.thumbnail-wrapper:hover .delete-icon {
  opacity: 1;
}

.delete-icon:hover {
  background-color: #e74c3c;
  transform: scale(1.2);
}

.thumbnail-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  margin-right: 0;
  margin-bottom: 0;
  flex: 0 0 110px;
  width: 110px;
  height: 110px;
  min-width: 110px;
  min-height: 110px;
  max-width: 110px;
  max-height: 110px;
  border: 2px solid transparent;
  transition: all 0.2s;
}

.thumbnail-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: 4px;
}

.thumbnail-wrapper:hover .delete-icon {
  opacity: 1;
}

.delete-icon:hover {
  background-color: #e74c3c;
  transform: scale(1.2);
}

.sort-modal-content {
  padding: 20px;
  width: 300px;
}

.sort-modal-content h3 {
  margin-top: 0;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--primary-color);
}

.sort-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.sort-option {
  display: flex;
  align-items: center;
  padding: 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.sort-option:hover {
  background-color: #f5f5f5;
}

.sort-option.active {
  background-color: rgba(255, 102, 0, 0.1);
  border-left: 3px solid var(--primary-color);
}

.sort-option i {
  margin-right: 10px;
  color: var(--primary-color);
  width: 16px;
  text-align: center;
}

.thumbnails-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 5px;
  align-content: flex-start;
}

.confirm-modal-content {
  background-color: white;

  padding: 20px;
  border-radius: 8px;
  text-align: center;
}

.confirm-modal-content h3 {
  margin-top: 0;
  color: #e74c3c;
}

.confirm-modal-content p {
  margin-bottom: 20px;
}

.confirm-modal-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.confirm-btn {
  padding: 8px 16px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.confirm-btn-cancel {
  background-color: #f5f5f5;
  color: #333;
}

.confirm-btn-cancel:hover {
  background-color: #e0e0e0;
}

.confirm-btn-delete {
  background-color: #e74c3c;
  color: white;
}

.confirm-btn-delete:hover {
  background-color: #c0392b;
}

.custom-events-modal {

  width: 100%;
}

.events-modal-tabs-legacy {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.events-modal-body {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(280px, 1.2fr);
  gap: 16px;
  min-height: 0;
  align-items: stretch;
}

.events-modal-list-panel,
.events-modal-form-panel,
.events-modal-studio .tab-content.events-modal-list-panel,
.events-modal-studio .tab-content.events-modal-form-panel {
  display: flex !important;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}

.events-modal-list-panel h4,
.events-modal-form-panel h4,
#eventFormTitle {
  margin: 0;
  padding: 12px 14px 8px;
  font-size: 13px;
  font-weight: 700;
  color: #111827;
}

.events-modal-studio .custom-events-list {
  flex: 1 1 auto;
  max-height: none;
  min-height: 180px;
  overflow-y: auto;
  margin: 0 12px 12px;
  padding: 8px;
  background: #fff;
  border: 1px solid #eef0f2;
  border-radius: 10px;
}

.events-modal-studio .custom-events-actions {
  display: flex;
  gap: 8px;
  padding: 0 12px 12px;
}

.events-modal-studio .event-form {
  display: flex !important;
  flex-direction: column;
  gap: 12px;
  padding: 0 14px 14px;
}

.events-modal-studio .form-row-wrapper {
  display: contents;
}

.events-icon-grid,
.events-modal-studio .icon-selection .icons-grid,
.events-modal-studio .icon-selection .icons-grid.compact-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)) !important;
  gap: 6px !important;
  max-height: none !important;
  overflow: visible !important;
  flex-wrap: unset !important;
  margin: 0 !important;
  padding: 8px !important;
  background: #fff;
  border: 1px solid #eef0f2;
  border-radius: 10px;
}

.events-icon-grid .icon-option,
.events-modal-studio .icon-option {
  width: 40px;
  height: 40px;
  min-width: 40px;
  padding: 0;
  margin: 0;
  font-size: 18px;
  color: #4b5563;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
}

.events-icon-grid .icon-option:hover,
.events-modal-studio .icon-option:hover {
  color: var(--primary-color);
  border-color: #fed7aa;
  background: #fff7ed;
  transform: none;
  box-shadow: none;
}

.events-icon-grid .icon-option.active,
.events-modal-studio .icon-option.active {
  color: #fff;
  background: var(--primary-color);
  border-color: var(--primary-color);
  transform: none;
}

/* Egyedi események a bal oldali panelben (nem felugró) */
.events-panel-embed.custom-events-modal {
  box-shadow: none;
  border-radius: 0;
  max-height: none;
  height: auto;
  overflow: visible;
  display: flex;
  flex-direction: column;
  background: transparent;
}

.events-panel-embed .tab-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fafafa;
  border-radius: 10px;
  margin-bottom: 10px;
}

.events-panel-embed .tab-btn {
  font-size: 12px;
  padding: 8px 10px;
}

.events-panel-embed .tab-content {
  padding: 0;
  overflow: visible;
}

.events-panel-embed .custom-events-list {
  max-height: none;
  margin-bottom: 12px;
  padding: 8px;
  background: #f8fafc;
  border: 1px solid #eef0f2;
  border-radius: 10px;
}

.events-panel-embed .custom-events-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.events-panel-embed .custom-events-actions .btn {
  flex: 1 1 auto;
  min-height: 40px;
}

.events-panel-embed .event-form,
.events-panel-embed.custom-events-modal .event-form,
#tabContent .events-panel-embed .event-form {
  display: flex !important;
  flex-direction: column !important;
  grid-template-columns: none !important;
  grid-template-areas: none !important;
  width: 100%;
  gap: 12px;
}

.events-panel-embed #eventFormTitle {
  margin: 0;
  font-size: 14px;
}

.events-panel-embed .form-row,
.events-panel-embed .icon-selection,
.events-panel-embed .date-selection {
  width: 100% !important;
  max-width: 100% !important;
  flex: 0 0 auto !important;
  grid-column: auto !important;
  grid-area: unset !important;
  box-sizing: border-box;
}

.events-panel-embed .icon-selection .icons-grid,
.events-panel-embed .icons-grid.compact-grid,
.events-panel-embed .events-icon-grid,
#tabContent .events-panel-embed .icons-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)) !important;
  gap: 6px !important;
  width: 100% !important;
  max-width: 100% !important;
  max-height: 260px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  flex-wrap: unset !important;
  margin: 6px 0 0 !important;
  padding: 8px !important;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid #eef0f2;
  border-radius: 10px;
}

.events-panel-embed .icon-option,
.events-panel-embed .icons-grid.compact-grid .icon-option {
  width: 100%;
  max-width: none;
  height: 38px;
  min-width: 0;
  padding: 0;
  margin: 0;
  font-size: 16px;
  color: #4b5563;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
}

.events-panel-embed .icons-grid.compact-grid .icon-option i {
  font-size: 16px;
}

.events-panel-embed .icon-option:hover {
  color: var(--primary-color);
  border-color: #fed7aa;
  background: #fff7ed;
  transform: none;
  box-shadow: none;
}

.events-panel-embed .icons-grid .icon-option.active,
.events-panel-embed .icons-grid.compact-grid .icon-option.active,
.events-panel-embed .events-icon-grid .icon-option.active {
  color: #fff !important;
  background: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
  transform: none;
  box-shadow: 0 0 0 2px rgba(255, 102, 0, 0.3);
}

.events-panel-embed .form-actions {
  display: flex;
  gap: 8px;
  position: relative !important;
  padding: 0;
  margin-top: 12px;
  z-index: 5;
}

.events-panel-embed .form-actions .btn {
  flex: 1 1 auto;
  min-height: 40px;
}

.events-panel-embed .no-events {
  margin: 10px 6px;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.45;
  font-style: italic;
}

.events-panel-embed .date-inputs {
  display: flex;
  gap: 8px;
}

.events-panel-embed .date-inputs select {
  flex: 1 1 0;
  min-width: 0;
}

.events-modal-studio .delete-event {
  background: #fee2e2;
  color: #b91c1c;
}

.events-modal-studio .no-events {
  margin: 12px 8px;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.45;
}

.custom-events-list {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 20px;
  padding: 10px;
  background: #f8f8f8;
  border-radius: 5px;
}

.custom-event-item {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  padding: 10px;
  background: white;
  border-radius: 5px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.event-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f1f1;
  border-radius: 50%;
  margin-right: 15px;
  color: #0066cc;
  font-size: 22px;
}

.event-details {
  flex: 1;
}

.event-name {
  font-weight: bold;
  margin-bottom: 5px;
}

.event-date {
  font-size: 12px;
  color: #666;
}

.event-actions {
  display: flex;
  gap: 5px;
}

.event-actions button {
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  border: none;
}

.event-actions .edit-event {
  background: #f0f0f0;
  color: #333;
}

.event-actions .delete-event {
  background: #ffeeee;
  color: #cc0000;
}

.icon-selection .icons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(36px, 1fr));
  gap: 6px;
  margin-top: 8px;
  max-height: 120px;
  overflow-y: auto;
  padding: 6px;
  border-radius: 6px;
  background: #fafafa;
}

.icon-selection .icons-grid {
  justify-items: center;
}

/* Kompakt ikonrács a szoros elhelyezéshez */
.icon-selection .icons-grid.compact-grid {
  gap: 4px;
  margin: 6px 0;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  max-height: 300px;
  overflow-y: auto;
}

.icon-selection .icons-grid.compact-grid .icon-option {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  padding: 0;
  font-size: 28px;
}

.icon-selection .icons-grid.compact-grid .icon-option i {
  font-size: 28px;
}

/* Mini naptár stílus */
.inline-calendar {
  margin-top: 10px;
  padding: 10px;
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 12px;
  display: inline-block;
  width: auto;
}

.cal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-weight: bold;
  font-size: 13px;
}

.cal-nav {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 2px 6px;
  color: #0066cc;
}

.cal-nav:hover {
  color: var(--primary-color);
}

.cal-title {
  flex: 1;
  text-align: center;
}

.cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 4px;
  font-weight: bold;
  text-align: center;
  font-size: 11px;
  color: #666;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.cal-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: 1px solid #eee;
  border-radius: 3px;
  cursor: pointer;
  font-size: 11px;
  transition: all 0.2s;
}

.cal-cell:hover:not(.disabled) {
  background: #e8f4ff;
  border-color: #0066cc;
}

.cal-cell.disabled {
  background: #f5f5f5;
  color: #ccc;
  cursor: default;
}

.cal-cell.selected {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  font-weight: bold;
}

.custom-events-modal {
  width: 100%;
  max-height: 95vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

/* Kétoszlopos elrendezés asztalin */
.form-row-wrapper {
  display: flex;
  gap: 20px;
  margin-bottom: 15px;
}

.form-row-wrapper .form-row {
  flex: 1;
  margin-bottom: 0;
}

.form-row-wrapper .icon-selection {
  order: 1;
}

.form-row-wrapper .date-selection {
  order: 2;
}

@media (max-width: 768px) {
  /* Mobilon: függőleges elrendezés, dátum felül */
  .form-row-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
  }

  .form-row-wrapper .icon-selection {
    order: 2;
  }

  .form-row-wrapper .date-selection {
    order: 1;
  }

  .icon-selection .icons-grid {
    grid-template-columns: repeat(4, 1fr);
    max-height: 90px;
  }

  .custom-events-modal {
    width: 100%;
  }

  .form-actions {
          position: sticky;
        bottom: 0;
        background: white;
        padding: 10px 0;
        margin-top: 10px;
        border-top: 1px solid #eee;
        z-index: 10;
  }
}

@media (min-width: 769px) {
  /* Asztalin: dátum felül, majd ikonok és naptár egymás mellett */
  .form-row-wrapper {
    display: grid;
    grid-template-columns: 2fr 1fr; /* Esemény neve balra keskenyebb, mellette a dátum */
    gap: 16px;
    align-items: start;
  }

  /* Esemény neve blokk bal oldali oszlopban */
  .form-row-wrapper .form-row { grid-column: 1; }

  /* Dátum blokk jobb oldali oszlopban, ugyanabban a sorban */
  .form-row-wrapper .date-selection { grid-column: 2; grid-row: 1; }

  /* Ikonok a két oszlop alatt teljes szélességen */
  .form-row-wrapper .icon-selection { grid-column: 1 / -1; }

  /* Ikonrács szélesebb elosztás a teljes szélességen */
  .custom-events-modal .icon-selection .icons-grid { 
    grid-template-columns: repeat(12, 1fr); 
    gap: 8px;
    max-height: 108px;
  }

  /* Grid elrendezés az egész űrlapra: név + dátum egy sorban, ikonok alatta teljes szélességen */
  .custom-events-modal .event-form {
    display: grid !important;
    grid-template-columns: 1.8fr 1fr;
    grid-template-areas: "name date" "icons icons";
    column-gap: 16px;
    row-gap: 12px;
    width: 100%;
    align-items: start;
  }
  .custom-events-modal .event-form .form-row-wrapper { display: contents !important; }
  .custom-events-modal .event-form > .form-row:first-child { grid-area: name !important; }
  .custom-events-modal .event-form .form-row-wrapper .date-selection { grid-area: date !important; }
  .custom-events-modal .event-form .form-row-wrapper .icon-selection { grid-area: icons !important; }

  /* Asztalin a dátum mezők ne nyúljanak túl */
  .custom-events-modal .event-form .date-selection .date-inputs select { width: auto; min-width: 90px; }
}

.icon-option {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  font-size: 16px;
  color: #666;
}

.icon-option:hover {
  background: #e9ecef;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  color: var(--primary-color);
}

.icon-option.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(255, 102, 0, 0.3);
  transform: translateY(-2px);
}

.date-inputs {
  display: flex;
  gap: 12px;
  align-items: center;
}

.date-inputs select {
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid #e9ecef;
  flex: 1;
  font-size: 13px;
  background: #f8f9fa;
  transition: all 0.2s ease;
  cursor: pointer;
}

.date-inputs select:focus {
  outline: none;
  border-color: var(--primary-color);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.1);
}

.form-row {
  margin-bottom: 12px;
}

.form-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-weight: 600;
  color: #444;
  font-size: 13px;
}

.form-row input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #e9ecef;
  font-size: 14px;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.form-row input[type="text"]:focus {
  outline: none;
  border-color: var(--primary-color);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.1);
}

.form-actions {
  position: absolute;
  bottom: 0;
  width: 100%;
  background: white;
  padding: 10px 0;
  margin-top: 10px;
  border-top: 1px solid #eee;
  z-index: 10;
}

/* Desktop: ragadjon az aljára a modal scrollterében is */
.custom-events-modal .form-actions {
  position: sticky !important;
  bottom: 0;
  background: linear-gradient(to top, #fff 70%, rgba(255,255,255,0.9));
  padding: 12px 0 16px;
  border-top: 1px solid #f0f0f0;
  z-index: 10;
  margin-top: 12px;
  display: flex;
  gap: 10px;
  justify-content: center;
}

.custom-events-modal .form-actions .btn {
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 100px;
  justify-content: center;
}

.custom-events-modal .form-actions .btn.primary {
  background: var(--primary-color);
  color: white;
  box-shadow: 0 4px 12px rgba(255, 102, 0, 0.3);
}

.custom-events-modal .form-actions .btn.primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 102, 0, 0.4);
}

.custom-events-modal .form-actions .btn.secondary {
  background: #f8f9fa;
  color: #666;
  border: 2px solid #e9ecef;
}

.custom-events-modal .form-actions .btn.secondary:hover {
  background: #e9ecef;
  color: #333;
  transform: translateY(-1px);
}

#eventFormContainer {
  border-top: 1px solid #eee;
}

.no-events {
  text-align: center;

  color: #666;
  font-style: italic;
}

#calendarYearSelector {
  width: 100%;
  padding: 8px;
  border-radius: 5px;
  border: 1px solid #ddd;
  background-color: #fff;
  font-size: 14px;
}

#manageCustomEvents {
  width: 100%;
  margin-bottom: 10px;
}

@media (max-width: 768px) {
  .custom-events-modal {
    max-height: 95vh;
    border-radius: 12px 12px 0 0;
  }
  
  .custom-events-modal h3 {
    padding: 10px 12px 6px;
    font-size: 15px;
  }
  
  .tab-content {
    padding: 10px 12px;
  }
  
  .custom-events-modal .icon-selection .icons-grid {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 8px;
    padding: 8px 4px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
  }
  
  .custom-events-modal .icon-selection .icons-grid::-webkit-scrollbar {
    height: 6px;
  }
  
  .custom-events-modal .icon-selection .icons-grid::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 3px;
  }
  
  .custom-events-modal .icon-selection .icons-grid::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
  }
  
  .custom-events-modal .icon-selection .icons-grid::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
  }
  
  /* Firefox scrollbar styling */
  .custom-events-modal .icon-selection .icons-grid {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) #f0f0f0;
  }
  
  .icon-option {
    width: 32px;
    height: 32px;
    font-size: 14px;
    flex-shrink: 0;
  }

  .custom-events-list {
    max-height: 140px;
  }

  .event-icon {
    width: 22px;
    height: 22px;
    font-size: 11px;
  }
  
  .custom-events-modal .event-form {
    display: block !important;
  }
  
  .custom-events-modal .event-form .form-row-wrapper {
    display: block !important;
  }
  
  .form-row {
    margin-bottom: 10px;
  }
  
  .custom-events-modal .form-actions {
    padding: 10px 12px 12px;
    margin-top: 10px;
    flex-direction: row;
    gap: 8px;
  }
  
  .custom-events-modal .form-actions .btn {
    flex: 1;
    min-width: auto;
    padding: 8px 12px;
    font-size: 12px;
  }
}

.enlarged-preview-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.9); 
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999 !important; 
}

.enlarged-preview {
  background: white;
  border-radius: 8px;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

.enlarged-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: #f0f0f0;
  border-bottom: 1px solid #ddd;
}

.enlarged-preview-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: bold;
}

.close-enlarged-preview {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #666;
  padding: 0;
  line-height: 1;
}

.close-enlarged-preview:hover {
  color: #000;
}

.enlarged-preview-content {
  padding: 15px;
  overflow: auto;
  max-height: calc(90vh - 70px);
  text-align: center;
}

.enlarged-preview-img {
  max-width: 100%;
  height: auto;
  display: inline-block;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.preview-loading-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background-color: #f8f8f8;
  border-radius: 8px;
}

.preview-loading-overlay .spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(255, 102, 0, 0.2);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  margin-bottom: 20px;
}

.preview-loading-overlay p {
  font-size: 16px;
  color: #555;
  margin: 5px 0;
}

.calendar-settings-container {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
}

.setting-card {
  flex: 1;
  background-color: #f4f4f4;
  border-radius: 8px;
  padding: 5px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  min-width: 250px;
}

.setting-card h5 {
  margin-top: 0;

  border-bottom: 1px solid #ddd;
  padding-bottom: 0.5rem;
}

@media (max-width: 992px) {
  .calendar-settings-container {
    flex-direction: column;
  }
}

.setting-option {

  display: flex;
  justify-content: space-between;
  align-items: center;
}

.setting-option label {
  margin-right: 0.5rem;
  width: 100%;
}

#calendarYearSelector {
  width: 100%;
  padding: 0.5rem;
  border-radius: 4px;
  border: 1px solid #ddd;
}

input[type="color"] {
  width: 40%;
  height: 38px;
  padding: 0;
  border: none;
  background: none;
}

#calendarHeaderFontFamily {
  max-width: 60%;
  padding: 0.5rem;
  border-radius: 4px;
  border: 1px solid #ddd;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
}

#calendarDayNamesFontFamily,
#calendarMonthNamesFontFamily {
  max-width: 60%;
  padding: 0.4rem;
  border-radius: 4px;
  border: 1px solid #ddd;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
}

.header-font-apply {
  flex-direction: column !important;
  align-items: stretch !important;
}

.header-font-apply-title {
  margin-bottom: 8px !important;
  font-weight: 600;
}

.header-font-apply-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  background: #f8f9fa;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
}

.header-font-apply-box label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 !important;
  width: auto !important;
  font-size: 13px !important;
  color: #333 !important;
  cursor: pointer;
}

.header-font-apply-box input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary-color, #FF6600);
}

.header-font-preview-wrap {
  flex-direction: column !important;
  align-items: stretch !important;
}

#headerFontPreviewBox {
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

#headerFontPreviewCanvas {
  display: block;
  width: 100%;
  height: auto;
}

/* ===== Fejléc dizájn (tipográfia) modal ===== */
.header-design-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 20, 28, 0.48);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.32s ease;
}

.header-design-modal-overlay.is-visible {
  opacity: 1;
}

.header-design-modal-overlay.is-closing {
  opacity: 0;
}

.header-design-modal {
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(10, 14, 25, 0.28);
  width: min(1280px, 96vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(36px);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.32s ease;
}

.header-design-modal-overlay.is-visible .header-design-modal {
  transform: translateY(0);
  opacity: 1;
}

.header-design-modal-overlay.is-closing .header-design-modal {
  transform: translateY(16px);
  opacity: 0;
}

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

.header-design-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid #ececf1;
  background: linear-gradient(180deg, #fafbfd, #f4f5f9);
}

.header-design-modal-header h5 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #23262f;
  display: flex;
  align-items: center;
  gap: 9px;
}

.header-design-close {
  background: transparent;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: #7a8090;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 8px;
  transition: all .15s ease;
}
.header-design-close:hover { background: #f0f1f5; color: #23262f; }

.header-design-modal-body {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 0;
  overflow: hidden;
  flex: 1;
  min-height: 0;
}

.hdr-design-controls {
  padding: 18px 22px;
  overflow-y: auto;
  border-right: 1px solid #ececf1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #fcfcfe;
}

/* Vezérlősor: címke felül, vezérlő alatta teljes szélességben */
.hdr-ctrl { display: flex; flex-direction: column; gap: 6px; }
.hdr-ctrl > label { font-size: 13px; font-weight: 600; color: #444a57; margin: 0; }
.hdr-ctrl-input { display: flex; align-items: center; gap: 10px; }
.hdr-ctrl-input .form-control {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #dcdfe7;
  border-radius: 8px;
  font-size: 13.5px;
  color: #2c3140;
  background: #fff;
  min-height: 38px;
}
.hdr-ctrl-input .form-control:focus { outline: none; border-color: var(--primary-color, #b31217); box-shadow: 0 0 0 3px rgba(179, 18, 23, 0.10); }
.hdr-ctrl-input input[type="color"] {
  width: 52px;
  height: 38px;
  padding: 2px;
  border: 1px solid #dcdfe7;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  flex: 0 0 auto;
}
.hdr-ctrl-input input[type="color"]:disabled { cursor: not-allowed; opacity: 0.55; }
.hdr-ctrl-note { font-size: 11.5px; color: #9096a3; line-height: 1.3; }

/* Szín + automatikus kapcsoló egy sorban */
.hdr-color-row { justify-content: space-between; }
.hdr-color-row .hdr-auto-row { margin: 0; }

.hdr-auto-row {
  display: flex !important;
  align-items: center;
  gap: 7px;
  font-size: 12.5px !important;
  font-weight: 400 !important;
  color: #5a6070 !important;
  cursor: pointer;
  margin-bottom: 6px;
}

.hdr-apply-box {
  border: 1px solid #e6e8ef;
  background: #fff;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hdr-apply-title {
  font-weight: 600 !important;
  color: #33384a !important;
  margin-bottom: 3px !important;
  font-size: 13px !important;
}

.hdr-opacity-box .admin-opacity-control {
  width: 100%;
  min-width: 0;
  font-size: 12.5px;
}

.hdr-opacity-box .admin-opacity-control input[type="range"] {
  min-width: 0;
}

.hdr-apply-box label:not(.hdr-apply-title) {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #4a5060;
  cursor: pointer;
  margin-bottom: 0;
}

/* Napnevek / Hónapnevek csoport */
.hdr-part-group {
  border: 1px solid #e6e8ef;
  background: #fff;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hdr-part-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--primary-color, #b31217);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding-bottom: 6px;
  border-bottom: 1px dashed #e6e8ef;
}

.hdr-part-group .hdr-ctrl { gap: 5px; }

/* Előnézet */
.hdr-design-preview {
  padding: 16px 22px 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hdr-preview-title {
  font-weight: 600;
  color: #33384a;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.hdr-preview-sub { font-weight: 400; font-size: 12px; color: #9096a3; }

.hdr-preview-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border: 1px solid #e6e8ef;
  border-radius: 12px;
  background:
    repeating-conic-gradient(#f4f5f8 0% 25%, #ffffff 0% 50%) 0 0 / 22px 22px;
  padding: 12px;
}

#headerDesignPreviewCanvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 3px 14px rgba(15, 20, 35, 0.12);
  background: #f8f8f8;
}

.header-design-modal-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-top: 1px solid #ececf1;
  background: #fafbfd;
}

.header-design-modal-footer .flex-spacer { flex: 1; }

/* Tablet: vezérlők és előnézet egymás mellett, keskenyebb oldalsávval */
@media (max-width: 1100px) {
  .header-design-modal { width: min(980px, 97vw); }
  .header-design-modal-body { grid-template-columns: 320px 1fr; }
  .hdr-design-controls { padding: 16px; }
  .hdr-design-preview { padding: 14px 16px; }
}

/* Mobil: egy oszlopos elrendezés, teljes képernyős modal */
@media (max-width: 760px) {
  .header-design-modal-overlay { padding: 0; align-items: stretch; }
  .header-design-modal {
    width: 100vw;
    max-width: 100vw;
    max-height: 100vh;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
  }
  .header-design-modal-header { padding: 12px 14px; }
  .header-design-modal-header h5 { font-size: 15px; }
  .header-design-close { font-size: 24px; padding: 2px 8px; }

  .header-design-modal-body {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .hdr-design-controls {
    border-right: none;
    border-bottom: 1px solid #ececf1;
    padding: 14px;
    overflow: visible;
    gap: 14px;
  }
  .hdr-design-preview {
    padding: 12px 14px 16px;
    overflow: visible;
  }
  .hdr-preview-scroll { max-height: none; overflow: visible; }

  .header-design-modal-footer {
    padding: 12px 14px;
    gap: 8px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
  .header-design-modal-footer .btn { flex: 1; padding: 10px 8px; font-size: 14px; }
  .header-design-modal-footer .flex-spacer { display: none; }
}

/* Kicsi mobil (pl. iPhone SE) */
@media (max-width: 380px) {
  .hdr-ctrl-input .form-control { font-size: 13px; }
  .header-design-modal-footer .btn { font-size: 13px; }
}

.actionButton.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  position: relative;
}

.actionButton.disabled:hover::after {
  content: "Kosárba helyezéshez minden hónapot szerkeszteni kell";
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 1000;
}

.refresh-modal {
  text-align: center;
  padding: 10px;
}

.progress-container {
  width: 100%;
  height: 10px;
  background-color: #f5f5f5;
  border-radius: 5px;
  margin: 15px 0;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background-color: var(--primary-color, #b31217);
  border-radius: 5px;
  transition: width 0.3s ease;
}

#refresh-status {
  font-size: 14px;
  color: #666;
}

.fa-spin {
  animation: fa-spin 2s infinite linear;
}

@keyframes fa-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.save-calendar-tabs {
  width: 100%;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
}

.tab-header {
  display: flex;
  border-bottom: 1px solid #f0f0f0;
  margin-bottom: 0;
  background: #fafafa;
  padding: 4px;
  gap: 2px;
}

.tab-btn {
  padding: 8px 16px;
  cursor: pointer;
  border-radius: 6px;
  background-color: transparent;
  border: none;
  color: #666;
  font-weight: 500;
  font-size: 13px;
  transition: all 0.2s ease;
  flex: 1;
  text-align: center;
}

.tab-btn:hover {
  background-color: rgba(255, 102, 0, 0.1);
  color: var(--primary-color);
}

.tab-btn.active {
  background-color: var(--primary-color);
  color: white;
  box-shadow: 0 2px 8px rgba(255, 102, 0, 0.3);
}

/* Kis notebook kijelző optimalizálás (pl. 13" MacBook) */
@media (max-height: 900px) {
  .custom-events-modal { max-height: 90vh; }
  .custom-events-modal .icon-selection .icons-grid { 
    gap: 6px; 
    grid-template-columns: repeat(10, 1fr);
    max-height: 90px;
  }
  .icon-option { width: 32px; height: 32px; font-size: 14px; }
  .custom-events-list { max-height: 160px; }
  .tab-content { padding: 10px 12px; }
  .custom-events-modal h3 { padding: 8px 12px 6px; font-size: 15px; }
  .form-row { margin-bottom: 10px; }
}

.tab-content {
  display: none;
  padding: 12px 16px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.tab-content.active {
  display: block;
}

.saved-calendars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 15px;
  margin-top: 10px;
}

.saved-calendar-item {
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  background-color: #fff;
}

.saved-calendar-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.calendar-preview {
  width: 100%;
  height: 150px;
  overflow: hidden;
  position: relative;
  background-color: #f9f9f9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.no-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background-color: #f0f0f0;
  color: #999;
}

.no-preview i {
  font-size: 48px;
}

.calendar-info {
  padding: 10px;
}

.calendar-info h4 {
  margin: 0 0 5px 0;
  font-size: 16px;
  color: #333;
}

.calendar-date {
  margin: 0;
  font-size: 12px;
  color: #777;
}

.calendar-actions {
  display: flex;
  padding: 0 10px 10px 10px;
  justify-content: space-between;
}

.calendar-actions .btn {
  padding: 5px 10px;
  font-size: 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.load-calendar {
  background-color: #4CAF50;
  color: white;
  flex-grow: 1;
  margin-right: 5px;
}

.load-calendar:hover {
  background-color: #45a049;
}

.delete-calendar {
  background-color: #f44336;
  color: white;
  width: 32px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.delete-calendar:hover {
  background-color: #d32f2f;
}

.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 102, 0, 0.3);
  border-radius: 50%;
  border-top: 4px solid var(--primary-color);
  animation: spin 1s linear infinite;
  margin-bottom: 10px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.btn {
  padding: 8px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s;
}

.btn.primary {
  background-color: var(--primary-color);
  color: white;
}

.btn.primary:hover {
  background-color: var(--primary-dark);
}

.btn.secondary {
  background-color: #f0f0f0;
  color: #333;
}

.btn.secondary:hover {
  background-color: #e0e0e0;
}

.btn.danger {
  background-color: #f44336;
  color: white;
}

.btn.danger:hover {
  background-color: #d32f2f;
}

.modal-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.error-message, .no-saved-calendars {
  padding: 15px;
  background-color: #f8f8f8;
  border-radius: 4px;
  text-align: center;
  color: #666;
}

.error-message {
  border-left: 4px solid #f44336;
}

.error-message i, .no-saved-calendars i {
  margin-right: 5px;
  font-size: 16px;
}

@media (max-width: 768px) {
  .saved-calendars-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  .calendar-preview {
    height: 120px;
  }

  .calendar-info h4 {
    font-size: 14px;
  }

  .calendar-date {
    font-size: 11px;
  }

  .calendar-actions .btn {
    padding: 4px 8px;
    font-size: 11px;
  }
}

.saved-calendar-item {
  animation: fadeIn 0.3s ease-in-out;
}

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

#canvasContainer {
  position: relative;
  transition: box-shadow 0.3s ease;
}

.load-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.load-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.load-progress .fa-spinner {
  font-size: 3rem;
  margin-bottom: 15px;
}

/* ===============================
   Desktop layout improvements
   =============================== */
/* Asztali / tablet: a mobilos rögzített sáv ne módosítsa a hónapsávot. */
@media (min-width: 769px) {
  #naptarStickyChrome {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 100%;
    background: transparent;
    box-shadow: none;
    padding: 0;
    margin: 0;
    position: static;
    flex: 0 0 auto;
  }
}

@media (min-width: 992px) {
  /* Top bar: back link + months in one row */
  #desktopTopBar {
    position: sticky;
    top: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    background: var(--light-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 8px 10px;
    margin-bottom: 6px;
  }

  #desktopTopBar #vissza-link .back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 18px;
    text-decoration: none;
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
  }

  #desktopTopBar #vissza-link .back-link:visited {
    color: #fff;
    text-decoration: none;
  }

  #desktopTopBar #vissza-link .back-link i {
    font-size: 14px;
  }

  /* Make months compact and keep in a single row */
  #desktopTopBar #monthBar {
    flex: 1;
    margin: 0;
    padding: 4px 6px;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
    overflow: visible;
    white-space: nowrap;
    position: static;
  }

  #desktopTopBar #monthBar .month {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    min-width: 52px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    overflow: visible;
  }

  #desktopTopBar #monthBar .month span {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }

  #desktopTopBar #monthBar .month i {
    font-size: 12px;
  }

  #desktopTopBar #monthBar .month.active,
  #desktopTopBar #monthBar .month.active:hover {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
  }

  /* Bottom bar: header with tabs left and actions right */
  #tabHeader {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 8px;
    padding: 6px 10px;
    background-color: #f8f8f8;
    border-bottom: 1px solid #f0f0f0;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
  }

  .header-row-top {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
  }

  /* Push product info to the far right in the top row */
  .header-row-top #selectedProductInfo {
    grid-column: 3;
    justify-self: end;
    margin-left: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    text-align: right;
    gap: 8px;
    max-width: 100%;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .header-row-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  #tabHeader #tabItemsWrapper {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-start;
    padding: 0;
  }

  /* Desktop dock for controller on the left */
  #desktopControllerDock {
    display: none; /* JS mutatja, ha van kijelölés */
    align-items: center;
    gap: 6px;
    grid-column: 2;
    justify-self: center;
  }

  #desktopControllerDock .controller-buttons {
    display: flex ;
            align-items: center;
            background: #a6a6a6;
            padding: 3px 20px;
            border-radius: 21px;
            gap: 6px;
            justify-content: center;
  }

  /* Right side: selected info + actions in one row */
  #rightBlock.desktop-right-block {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
  }

  #rightBlock .selected-product-info {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 320px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #tabHeader #tabItemsWrapper .tabItem {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    font-size: 12px;
    background: #6b6b6b;
    border-radius: 12px;
  }

  #tabHeader #tabItemsWrapper .tabItem br {
    display: none;
  }

  #tabHeader #tabItemsWrapper .tabItem i {
    font-size: 16px;
  }

  #tabHeader .header-separator {
    width: 1px;
    height: 26px;
    background: linear-gradient(180deg, rgba(0,0,0,0.08), rgba(0,0,0,0.02));
    border-radius: 1px;
  }

  #tabHeader #topActionsWrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: 0;
    background: transparent;
  }

  /* Upload tab: controls (left) and thumbnails (right) in one row */
  #tabContent .upload-body .upload-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    align-content: center;
    flex-direction: row;
  }
  #tabContent .upload-body .upload-left {
    flex: 0 0 260px;
    max-width: 340px;
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

  /* Center the upload icon and text */
  #tabContent .upload-body .upload-left .upload-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
  }
  #tabContent .upload-body .upload-left .upload-text {
    text-align: center;
  }
  #tabContent .upload-body .upload-right {
    flex: 1 1 auto;
    min-width: 0;
  }
  #tabContent .upload-body .thumbs-topbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
  }
  /* On desktop, we place thumbnail-controls under upload-left and hide the topbar */
  #thumbsTopbar { display: none; }
  #uploadLeftExtras { display: flex; justify-content: flex-start; gap: 8px; }
}

/* Subtle highlight animation for controller buttons (both mobile and desktop) */
@keyframes controllerHighlight {
  0% { background-color: #2a2a2aa8; }
  100% { background-color: var(--controller-final-bg, transparent); }
}

.controller-buttons.animate-highlight {
  animation: controllerHighlight 1.6s ease-out 1;
  border-radius: 20px;
  overflow: hidden;
  will-change: background-color;
}

/* Desktop: animate individual buttons dark-to-light */
@keyframes controllerBtnHighlight {
  0% { background-color: #a9a9a9; }
  100% { background-color: #fff; }
}
.controller-btn.animate-highlight {
  animation: controllerBtnHighlight 1.6s ease-out 1;
  border-radius: 20px;
}

/* Final bg targets per dock */
#mobileControllerDock .controller-buttons { --controller-final-bg: #f1f1f1; }
#desktopControllerDock .controller-buttons { --controller-final-bg: #f8f8f8; }
  #tabHeader #topActionsWrapper .actionButton {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 16px;
    box-shadow: 0 2px 6px rgba(255, 102, 0, 0.2);
  }

  #tabHeader #topActionsWrapper .actionButton i {
    font-size: 12px;
  }

  /* Make the whole bottom module a bit more compact on desktop */
  #tabMenu {
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
  }

  #tabContent {
    max-height: 220px;
  }

/* ===============================
   Mobile layout fixes (<=768px)
   =============================== */
@media (max-width: 768px) {
  body.naptar-open {
    overflow: hidden;
    padding-bottom: 0;
    height: 100dvh;
  }

  body.naptar-open #naptarContainer {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    padding-bottom: var(--naptar-tabmenu-height, 72px);
    box-sizing: border-box;
  }

  body.naptar-open .calendar-with-spiral-wrapper {
    flex: 1 1 auto;
    min-height: 0;
    width: 100% !important;
    max-width: 100%;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    -webkit-overflow-scrolling: touch;
    padding-top: 6px;
    padding-bottom: 6px;
    box-sizing: border-box;
    touch-action: pan-x pan-y;
    overscroll-behavior: contain;
  }

  #naptarContainer {
    width: 100%;
    align-items: stretch;
  }

  /* Vissza + hónapok + nagyító a naptár FELETT maradnak (nem takarnak). */
  #naptarStickyChrome {
    position: relative;
    top: auto;
    z-index: 20;
    width: 100%;
    flex: 0 0 auto;
    background: var(--light-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
    padding-top: env(safe-area-inset-top, 0px);
  }

  #desktopTopBar {
    position: static;
    top: auto;
    z-index: auto;
    width: 100%;
    align-self: auto;
    background: transparent;
    box-shadow: none;
    padding: 0;
    border-radius: 0;
  }

  #zoomBar.zoom-bar,
  .zoom-bar {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 6px 8px 8px;
    background: var(--light-color);
    box-sizing: border-box;
  }
  .zoom-bar-inner {
    gap: 5px;
    padding: 4px;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }
  /* Mobilon a nagyító helyett az Előnézet / Mentések / Automata gombok. */
  body.naptar-open #zoomBar .zoom-step-btn,
  body.naptar-open #zoomBar #zoomSlider,
  body.naptar-open #zoomBar .zoom-value {
    display: none !important;
  }
  body.naptar-open #zoomBar .zoom-bar-inner {
    display: flex;
    align-items: center;
    justify-content: stretch;
    gap: 5px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }
  body.naptar-open #zoomBar #topActionsWrapper {
    display: flex !important;
    flex: 3 1 0;
    min-width: 0;
    max-width: none;
    width: auto;
    grid-area: auto;
    justify-content: stretch;
    align-items: center;
    gap: 5px;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    border-radius: 0;
    overflow: hidden;
  }
  /* Egységes kinézet: pill + flat ikon, egyedi színek */
  body.naptar-open #zoomBar #topActionsWrapper .actionButton,
  body.naptar-open #zoomBar .zoom-cart-btn,
  body.naptar-open #zoomBar .zoom-cart-btn.actionButton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 0;
    min-width: 0;
    max-width: 100%;
    gap: 3px;
    margin: 0 !important;
    padding: 7px 4px;
    min-height: 33px;
    height: 33px;
    box-sizing: border-box;
    border: none;
    border-radius: 999px;
    color: #fff !important;
    font-weight: 700;
    font-size: 10px;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transform: none !important;
    position: relative;
    z-index: 1;
  }
  body.naptar-open #zoomBar #topActionsWrapper .actionButton[data-action="elonezet"] {
    background: var(--primary-color, #ff6600) !important;
    box-shadow: 0 2px 8px rgba(255, 102, 0, 0.35);
  }
  body.naptar-open #zoomBar #topActionsWrapper .actionButton[data-action="mentes"] {
    background: #e53935 !important;
    box-shadow: 0 2px 8px rgba(229, 57, 53, 0.35);
  }
  body.naptar-open #zoomBar #topActionsWrapper .actionButton[data-action="autofill"] {
    background: #9c27b0 !important;
    box-shadow: 0 2px 8px rgba(156, 39, 176, 0.35);
  }
  body.naptar-open #zoomBar .zoom-cart-btn,
  body.naptar-open #zoomBar .zoom-cart-btn.actionButton {
    flex: 1 1 0;
    margin-left: 0 !important;
    background: #2e7d32 !important;
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.35);
  }
  body.naptar-open #zoomBar #topActionsWrapper .actionButton span,
  body.naptar-open #zoomBar .zoom-cart-btn span {
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }
  body.naptar-open #zoomBar #topActionsWrapper .actionButton[data-action="elonezet"]:hover,
  body.naptar-open #zoomBar #topActionsWrapper .actionButton[data-action="elonezet"]:active {
    background: var(--primary-color, #ff6600) !important;
    color: #fff !important;
    transform: none !important;
  }
  body.naptar-open #zoomBar #topActionsWrapper .actionButton[data-action="mentes"]:hover,
  body.naptar-open #zoomBar #topActionsWrapper .actionButton[data-action="mentes"]:active {
    background: #c62828 !important;
    color: #fff !important;
    transform: none !important;
  }
  body.naptar-open #zoomBar #topActionsWrapper .actionButton[data-action="autofill"]:hover,
  body.naptar-open #zoomBar #topActionsWrapper .actionButton[data-action="autofill"]:active {
    background: #7b1fa2 !important;
    color: #fff !important;
    transform: none !important;
  }
  body.naptar-open #zoomBar .zoom-cart-btn:hover,
  body.naptar-open #zoomBar .zoom-cart-btn:active {
    background: #1b5e20 !important;
    color: #fff !important;
    transform: none !important;
  }
  body.naptar-open #zoomBar #topActionsWrapper .actionButton i,
  body.naptar-open #zoomBar .zoom-cart-btn i,
  body.naptar-open #zoomBar .zoom-cart-btn.actionButton i {
    color: #fff !important;
    font-size: 12px;
    line-height: 1;
    width: 1em;
    flex: 0 0 auto;
    text-align: center;
    font-weight: 900;
    -webkit-font-smoothing: antialiased;
  }
  .zoom-value {
    min-width: 40px;
    font-size: 12px;
  }
  .zoom-cart-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1 1 0;
    min-width: 0;
    margin-left: 0;
    padding: 7px 4px;
    min-height: 33px;
    border: none;
    border-radius: 999px;
    background: #2e7d32;
    color: #fff;
    font-weight: 700;
    font-size: 10px;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.35);
  }
  .zoom-cart-btn i {
    color: #fff !important;
    font-size: 12px;
  }
  body.naptar-open #topActionsWrapper .actionButton[data-action="kosar"],
  #topActionsWrapper .actionButton[data-action="kosar"],
  body.naptar-open #selectedProductInfo .spi-cart-btn,
  #selectedProductInfo .spi-cart-btn {
    display: none !important;
  }

  /* Fotósáv a funkciógombok FÖLÖTT (AJT mintára) */
  #mobilePhotoStrip.mobile-photo-strip {
    grid-area: photos;
    display: none;
    width: 100%;
    box-sizing: border-box;
    align-items: center;
    min-height: 52px;
    margin: 2px 8px 0;
    padding: 6px 8px 8px;
    overflow: hidden;
    border-top: 1px solid #eceef0;
    border-bottom: 1px solid #eceef0;
    background: #fafbfc;
    border-radius: 0;
    gap: 6px;
  }
  body.naptar-open #mobilePhotoStrip.mobile-photo-strip:not(.is-empty):not([hidden]) {
    display: flex !important;
    grid-area: photos !important;
    order: 0;
  }
  /* Sablon módban is legyen látható a mini-thumbnail sáv (DnD a maszkokra) */
  body.naptar-open.naptar-template-active #mobilePhotoStrip.mobile-photo-strip:not(.is-empty):not([hidden]) {
    display: flex !important;
  }
  body.naptar-open #tabItemsWrapper {
    border-top: none;
    padding-top: 6px;
  }
  .mobile-photo-strip-inner {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    padding: 2px 2px 6px;
    scrollbar-width: thin;
  }
  .mobile-photo-strip-inner::-webkit-scrollbar {
    height: 3px;
  }
  .mobile-photo-strip-inner::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 3px;
  }
  .mobile-photo-strip-item {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
    cursor: grab;
    -webkit-user-select: none;
    user-select: none;
    /* pan-x: a vízszintes sáv scrollja menjen; drag csak long-press után */
    touch-action: pan-x;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-photo-strip-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    -webkit-user-drag: none;
  }
  .mobile-photo-strip-item.used {
    border-color: transparent;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
    opacity: 0.45;
  }
  .mobile-photo-strip-item.used img {
    opacity: 0.55;
  }
  .mobile-photo-strip-item:active {
    transform: scale(0.96);
  }
  .mobile-photo-strip-item.is-dragging {
    transform: scale(0.92);
    cursor: grabbing;
    opacity: 0.35;
  }
  body.naptar-thumb-dragging {
    cursor: grabbing !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    touch-action: none !important;
  }
  body.naptar-thumb-dragging .mobile-photo-strip-inner {
    overflow: hidden;
  }
  body.naptar-thumb-dragging .drag-ghost {
    border: 2px solid rgba(34, 197, 94, 0.85);
  }
  .drag-ghost {
    pointer-events: none !important;
  }

  #vissza-link {
    position: static;
    top: auto;
    left: auto;
    right: auto;
    z-index: auto;
    background-color: var(--primary-color);
    text-align: center;
    padding: 10px;
  }

  #vissza-link .back-link {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }

  #vissza-link .back-link:visited {
    color: #fff;
    text-decoration: none;
  }

  #vissza-link .back-link i {
    font-size: 16px;
  }

  /* Hónapok a rögzített felső sávban maradnak; csak vízszintesen lapozhatók. */
  #desktopTopBar #monthBar,
  #monthBar {
    position: static !important;
    top: auto !important;
    margin-top: 0;
    margin-bottom: 0;
    border-radius: 0;
    box-shadow: none;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }

  /* Alsó menü – AJT mobil grid: controller → selected → photos → tabs */
  body.naptar-open #tabMenu,
  #tabMenu {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      'controller'
      'selected'
      'photos'
      'tabs';
    background: #fff;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.08);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    z-index: 30;
  }

  /* Flatten header children to allow reordering */
  #tabHeader,
  #headerRowTop,
  #headerRowBottom {
    display: contents;
  }

  body.naptar-open #topActionsWrapper,
  #topActionsWrapper {
    display: none;
  }
  body.naptar-open #zoomBar #topActionsWrapper {
    display: flex !important;
    grid-area: auto;
    width: auto;
    padding: 0;
  }
  /* Zoom sáv gombjai: felülírás a Kosárral egységesen (pill + flat ikon) */
  body.naptar-open #zoomBar #topActionsWrapper .actionButton,
  body.naptar-open #zoomBar .zoom-cart-btn.actionButton,
  body.naptar-open #zoomBar .zoom-cart-btn {
    flex: 1 1 0;
    min-width: 0;
    margin: 0 !important;
    padding: 7px 4px;
    min-height: 33px;
    height: 33px;
    font-size: 10px;
    font-weight: 700;
    gap: 3px;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(255, 102, 0, 0.35);
    transform: none;
    overflow: hidden;
  }
  body.naptar-open #zoomBar #topActionsWrapper .actionButton i,
  body.naptar-open #zoomBar .zoom-cart-btn.actionButton i,
  body.naptar-open #zoomBar .zoom-cart-btn i {
    font-size: 12px;
    color: #fff !important;
    flex: 0 0 auto;
  }
  body.naptar-open #tabMenu .selected-product-info {
    margin: 0 8px 2px;
  }
  body.naptar-open .selected-product-info.compact {
    padding: 2px 8px;
    font-size: 10px;
  }

  #selectedProductInfo {
    grid-area: selected;
    display: flex;
    justify-content: center;
  }

  /* Objektumgombok (forgatás, sorolás…) – AJT pill */
  #mobileControllerDock {
    grid-area: controller !important;
    min-width: 0;
    display: none;
    padding: 4px 4px 0;
  }
  body.naptar-open #mobileControllerDock[style*="block"],
  body.naptar-open #mobileControllerDock:not([style*="none"]) {
    padding: 4px 4px 0;
  }
  /* A pill a .controller-btn-row – AJT .obj-buttons mintára */
  body.naptar-open #mobileControllerDock .controller-buttons {
    display: block !important;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    gap: 0 !important;
  }
  body.naptar-open #mobileControllerDock .controller-btn-row {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    gap: clamp(2px, 1.2vw, 6px);
    background: #fff !important;
    border: 1px solid #e4e6e8 !important;
    border-radius: 999px !important;
    box-shadow: 0 4px 14px rgba(15, 18, 28, 0.08) !important;
    padding: clamp(4px, 1.4vw, 8px) clamp(6px, 2vw, 12px) !important;
    margin: 0 !important;
  }
  body.naptar-open #mobileControllerDock .controller-btn,
  body.naptar-open #mobileControllerDock .controller-btn-row .controller-btn {
    flex: 1 1 0 !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 52px !important;
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: 1 / 1 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    border-radius: clamp(8px, 2vw, 12px) !important;
    background: transparent !important;
    box-shadow: none !important;
    align-items: center !important;
    justify-content: center !important;
    transform: none !important;
  }
  /* Ne írd felül a display:none-t – különben a rejtett gombok is helyet foglalnak */
  body.naptar-open #mobileControllerDock .controller-btn-row .controller-btn:not([hidden]):not([style*="display: none"]):not([style*="display:none"]) {
    display: inline-flex !important;
  }
  body.naptar-open #mobileControllerDock .controller-btn-row .controller-btn[style*="display: none"],
  body.naptar-open #mobileControllerDock .controller-btn-row .controller-btn[style*="display:none"],
  body.naptar-open #mobileControllerDock .controller-btn-row .controller-btn[hidden] {
    display: none !important;
    flex: 0 0 0 !important;
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
  }
  body.naptar-open #mobileControllerDock .controller-btn i,
  body.naptar-open #mobileControllerDock .controller-btn-row .controller-btn i {
    font-size: clamp(15px, 4.6vw, 22px) !important;
    color: #555 !important;
    margin: 0 !important;
    line-height: 1 !important;
  }
  body.naptar-open #mobileControllerDock .controller-btn[data-action="rotate-left"] i,
  body.naptar-open #mobileControllerDock .controller-btn[data-action="rotate-right"] i {
    color: #27ae60 !important;
  }
  body.naptar-open #mobileControllerDock .controller-btn[data-action="crop"] i {
    color: #3498db !important;
  }
  body.naptar-open #mobileControllerDock .controller-btn[data-action="delete"] i {
    color: #e74c3c !important;
  }
  body.naptar-open #mobileControllerDock .controller-buttons.is-disabled {
    opacity: 0.42 !important;
    filter: grayscale(0.25);
    pointer-events: none !important;
  }

  /* Funkciótabok – vízszintesen scrollozható (ne zsugorodjanak) */
  body.naptar-open #tabItemsWrapper,
  #tabItemsWrapper {
    grid-area: tabs !important;
    display: flex !important;
    padding: 4px 6px calc(8px + env(safe-area-inset-bottom, 0px));
    gap: 6px;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border-top: none;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  body.naptar-open #tabItemsWrapper::-webkit-scrollbar,
  #tabItemsWrapper::-webkit-scrollbar {
    display: none;
  }
  body.naptar-open #tabItemsWrapper .tabItem,
  #tabItemsWrapper .tabItem {
    flex: 0 0 auto !important;
    min-width: 58px !important;
    max-width: 78px !important;
    width: auto !important;
    min-height: 52px;
    padding: 6px 8px 5px;
    gap: 3px;
    border-radius: 11px;
    background: #6b6b6b !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
    font-size: 10px;
    font-weight: 600;
    box-sizing: border-box;
    overflow: hidden;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
  body.naptar-open .tabItem br { display: none; }
  body.naptar-open .tabItem i {
    font-size: 16px;
    color: #fff !important;
    margin: 0;
    flex: 0 0 auto;
    display: block;
    line-height: 1;
  }
  body.naptar-open .tabItem .tab-label {
    color: #fff;
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.15;
  }
  body.naptar-open .tabItem.active {
    background: #fff !important;
    color: var(--primary-color, #ff6600) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  }
  body.naptar-open .tabItem.active i,
  body.naptar-open .tabItem.active .tab-label {
    color: var(--primary-color, #ff6600) !important;
  }
  body.naptar-open .tabItem.active::after,
  body.naptar-open .tabItem.active::before {
    display: none !important;
  }

  .header-separator {
    display: none;
  }

  /* Flatten right side wrapper so its children can be grid areas */
  #rightBlock {
    display: contents;
  }

  /* Hide desktop dock on mobile */
  #desktopControllerDock {
    display: none !important;
  }

  /* Upload tab: a sheet-stílusok kezelik a galériát. */
  #thumbsTopbar { display: none !important; }
  #uploadLeftExtras { display: none; }

  /* Funkciók külön, majdnem teljes képernyős panelben (body-ra emelve). */
  #tabSheetBackdrop {
    position: fixed;
    inset: 0;
    background: rgba(18, 14, 12, 0.62);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10040;
  }
  #tabSheetBackdrop[hidden] {
    display: none !important;
  }

  body.naptar-open #tabContent,
  body.tab-sheet-open > #tabContent {
    position: fixed;
    top: max(6px, env(safe-area-inset-top, 0px));
    left: 6px;
    right: 6px;
    bottom: max(6px, env(safe-area-inset-bottom, 0px));
    width: auto;
    height: auto;
    max-height: none;
    z-index: 10050;
    padding: 0;
    overflow: hidden;
    display: none;
    flex-direction: column;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
    border: 0;
    animation: tabSheetUp 0.26s ease;
    grid-area: unset;
  }
  body.naptar-open.tab-sheet-open #tabContent,
  body.tab-sheet-open > #tabContent {
    display: flex !important;
  }
  body.tab-sheet-open #tabMenu {
    z-index: 10030;
  }

  body.naptar-open #tabContent .tabContentHeader {
    flex: 0 0 auto;
    margin: 0;
    padding: 12px 14px 12px 16px;
    background: #fff;
    border-bottom: 1px solid #f0ebe6;
    position: relative;
    z-index: 2;
  }
  body.naptar-open #tabContent .tabContentHeader::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    border-radius: 99px;
    background: #e0d6ce;
    margin: 0 auto 10px auto;
  }
  body.naptar-open #tabContent .tabContentHeader h4 {
    font-size: 18px;
    letter-spacing: 0.01em;
  }
  body.naptar-open #tabContent .tabContentBody,
  body.naptar-open #tabContent #uploadSection {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 14px 16px;
  }
  body.naptar-open #tabContent #uploadSection {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    min-height: 0;
    flex: 1 1 auto;
  }
  body.naptar-open #tabContent #uploadSection .tabContentHeader {
    flex: 0 0 auto;
  }
  body.naptar-open #tabContent #uploadSection .upload-body {
    flex: 1 1 auto;
    min-height: 0;
    display: block;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 14px calc(28px + env(safe-area-inset-bottom, 0px));
  }
  body.naptar-open #tabContent .upload-body .upload-row {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    gap: 12px;
  }
  body.naptar-open #tabContent .upload-body .upload-left,
  body.naptar-open #tabContent .upload-body .upload-right {
    max-width: 100%;
    width: 100%;
  }
  body.naptar-open #tabContent .upload-body .upload-left {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  body.naptar-open #tabContent .upload-body .upload-right {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  body.naptar-open #tabContent .upload-controls {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    text-align: left !important;
    gap: 12px !important;
    background: #fff4eb;
    border: 2px solid #ff6600;
    border-radius: 16px;
    padding: 12px 14px;
    margin-bottom: 0;
    box-shadow: 0 4px 14px rgba(255, 102, 0, 0.18);
  }
  body.naptar-open #tabContent #uploadButton {
    width: 56px;
    height: 56px;
    font-size: 26px;
    margin-right: 0;
    flex: 0 0 auto;
    box-shadow: 0 4px 14px rgba(76, 175, 80, 0.4);
  }
  body.naptar-open #tabContent .upload-text {
    text-align: left !important;
    font-size: 15px;
    line-height: 1.35;
    font-weight: 600;
    color: #e65c00;
    text-decoration: none;
  }
  body.naptar-open #tabContent #uploadLeftExtras,
  body.naptar-open #tabContent #thumbsTopbar {
    display: flex !important;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }

  body.naptar-open #tabContent .backgrounds-grid,
  body.naptar-open #tabContent .template-grid,
  body.naptar-open #tabContent .asset-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    overflow: visible;
    flex-wrap: unset;
    padding-bottom: 8px;
  }
  body.naptar-open #tabContent .background-thumb,
  body.naptar-open #tabContent .template-card-user,
  body.naptar-open #tabContent .asset-card {
    min-width: 0;
    max-width: none;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    flex-shrink: 1;
    border-radius: 14px;
  }
  body.naptar-open #tabContent .template-category-list {
    gap: 8px;
    margin-bottom: 12px;
  }
  body.naptar-open #tabContent .template-cat-btn {
    padding: 8px 12px;
    font-size: 13px;
  }
  body.naptar-open #tabContent .apply-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
  }
  body.naptar-open #tabContent .apply-button {
    width: 100%;
    justify-content: center;
    border-radius: 12px;
    padding: 10px 12px;
  }
  body.naptar-open #tabContent .backgrounds-category h5 {
    margin: 14px 0 8px;
    font-size: 13px;
    color: #666;
  }

  body.naptar-open #tabContent #thumbnailContainer {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    white-space: normal;
    margin-top: 0;
  }
  body.naptar-open #tabContent .thumbnail-controls {
    display: flex;
    gap: 8px;
    margin: 0 0 10px;
    flex: 0 0 auto;
  }
  /* Mobil fényképek sheet – AJT stílusú studio elrendezés */
  body.tab-sheet-open > #tabContent .naptar-upload-studio,
  body.naptar-open.tab-sheet-open #tabContent .naptar-upload-studio {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px;
    width: 100%;
    min-height: 0;
    flex: 1 1 auto;
  }
  body.tab-sheet-open > #tabContent .naptar-upload-studio .upload-left,
  body.tab-sheet-open > #tabContent .naptar-upload-studio .upload-right {
    width: 100% !important;
    max-width: none !important;
    flex: 0 0 auto;
  }
  body.tab-sheet-open > #tabContent .naptar-upload-studio .upload-right {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  body.tab-sheet-open > #tabContent .upload-dropzone.ajt-upload-dropzone {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #ff6600;
    border-radius: 16px;
    background: #fff4eb;
    box-shadow: 0 4px 14px rgba(255, 102, 0, 0.16);
    cursor: pointer;
  }
  body.tab-sheet-open > #tabContent .upload-dropzone.ajt-upload-dropzone #uploadButton,
  body.tab-sheet-open > #tabContent .ajt-upload-main-btn {
    flex: 0 0 auto;
    width: 52px !important;
    height: 52px !important;
    min-height: 52px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 14px !important;
    background: linear-gradient(180deg, #ff7a1a, #f05600) !important;
    color: #fff !important;
    font-size: 20px !important;
    box-shadow: 0 8px 18px rgba(255, 102, 0, 0.28);
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }
  body.tab-sheet-open > #tabContent .ajt-upload-dropzone-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
  }
  body.tab-sheet-open > #tabContent .ajt-upload-dropzone-copy strong {
    font-size: 14px;
    font-weight: 700;
    color: #e65c00;
  }
  body.tab-sheet-open > #tabContent .ajt-upload-dropzone-copy .clickable-upload-text {
    color: #6b7280;
    text-decoration: none;
    font-size: 12px;
    line-height: 1.4;
    font-weight: 500;
  }
  body.tab-sheet-open > #tabContent .naptar-upload-progress.ajt-upload-progress {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #fff7ed;
    border: 1px solid #ffd7b0;
  }
  body.tab-sheet-open > #tabContent .naptar-upload-progress.ajt-upload-progress[hidden] {
    display: none !important;
  }
  body.tab-sheet-open > #tabContent .ajt-upload-progress-track {
    height: 8px;
    border-radius: 999px;
    background: #ffe8d1;
    overflow: hidden;
  }
  body.tab-sheet-open > #tabContent .ajt-upload-progress-fill {
    display: block;
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: linear-gradient(90deg, #ff7a1a, #f05600);
    transition: width 0.22s ease;
  }
  body.tab-sheet-open > #tabContent .ajt-upload-progress-text {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: #9a3412;
  }
  body.tab-sheet-open > #tabContent .thumbnail-wrapper.ajt-thumb-uploading,
  body.tab-sheet-open > #tabContent .thumbnail-wrapper.is-upload-pending {
    position: relative;
    background: #f3f4f6;
    border: 1px dashed #d1d5db;
    animation: naptarThumbPulse 1.1s ease-in-out infinite;
  }
  body.tab-sheet-open > #tabContent .thumbnail-wrapper.ajt-thumb-uploading img,
  body.tab-sheet-open > #tabContent .thumbnail-wrapper.is-upload-pending img {
    filter: grayscale(1) brightness(0.92);
    opacity: 0.7;
  }
  body.tab-sheet-open > #tabContent .naptar-thumb-uploading-label {
    position: absolute;
    left: 50%;
    bottom: 6px;
    transform: translateX(-50%);
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    background: rgba(0,0,0,0.55);
    border-radius: 8px;
    padding: 2px 6px;
    pointer-events: none;
    white-space: nowrap;
  }
  @keyframes naptarThumbPulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
  }
  /* Mobil sheet feltöltéskor ne takarja a full-screen overlay a modal tartalmát */
  body.tab-sheet-open #uploadOverlay.is-compact {
    display: none !important;
  }

  body.naptar-open #tabContent .thumbnails-wrapper {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, 104px);
    grid-auto-rows: 104px;
    justify-content: center;
    gap: 10px;
    padding: 0 2px 12px;
    align-items: start;
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-height: none;
    flex-wrap: unset;
  }
  body.naptar-open #tabContent .thumbnail-wrapper {
    position: relative;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 104px !important;
    height: 104px !important;
    min-width: 104px !important;
    min-height: 104px !important;
    max-width: 104px !important;
    max-height: 104px !important;
    flex: 0 0 104px !important;
    aspect-ratio: auto;
    border-radius: 10px;
    overflow: hidden !important;
    background: #f4f2f0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  }
  body.naptar-open #tabContent .thumbnail-img {
    position: static;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain;
    object-position: center;
    display: block;
  }
  body.naptar-open #tabContent .thumbnail-wrapper .delete-icon {
    z-index: 3;
  }
  body.naptar-open #tabContent .thumb-tooltip {
    display: none;
  }
  body.naptar-open #tabContent .settings-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  body.naptar-open #tabContent .compact-toolbar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    background: #f7f4f1;
    border-radius: 14px;
  }
  body.naptar-open #tabContent .toolbar-section {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  body.naptar-open #tabContent .tool-btn {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    font-size: 16px;
  }
  body.naptar-open #tabContent .text-input-container,
  body.naptar-open #tabContent .text-studio {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  body.naptar-open #tabContent .text-studio-card {
    background: #f7f7f8;
    border: 1px solid #eceef0;
    border-radius: 14px;
    padding: 12px;
  }
  body.naptar-open #tabContent .text-studio-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #6b7280;
    margin: 0 0 8px;
  }
  body.naptar-open #tabContent #textInput {
    min-height: 110px;
    font-size: 16px;
    padding: 12px;
    border-radius: 12px;
    width: 100%;
    box-sizing: border-box;
  }
  body.naptar-open #tabContent .text-add-button {
    width: 100%;
    justify-content: center;
    padding: 14px 16px;
    font-size: 16px;
    border-radius: 14px;
  }
  body.naptar-open #tabContent #fontFamily,
  body.naptar-open #tabContent .compact-select {
    min-height: 42px;
    font-size: 15px;
    border-radius: 10px;
    flex: 1;
  }
  body.naptar-open #tabContent #sablonokBody {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
  }
  body.naptar-open #tabContent .template-category-list {
    flex: 0 0 auto;
  }
  body.naptar-open #tabContent .template-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 auto;
    min-height: 0;
    padding-bottom: 12px;
  }
  body.naptar-open #tabContent .template-card-user {
    min-width: 0 !important;
    max-width: none !important;
    width: 100%;
    height: auto !important;
    aspect-ratio: 3 / 4;
    border-radius: 14px;
  }
  body.naptar-open #tabContent .template-card-user img {
    height: calc(100% - 28px);
    object-fit: cover;
  }
  body.naptar-open #tabContent .template-card-title {
    font-size: 12px;
    padding: 6px;
  }
  body.naptar-open #tabContent .mobile-sort-select-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    font-size: 13px;
    color: #555;
  }
  body.naptar-open #tabContent .mobile-sort-select-wrap select {
    min-height: 36px;
    border-radius: 10px;
    border: 1px solid #ddd;
    padding: 6px 10px;
    font-size: 14px;
    background: #fff;
  }
  body.naptar-open #tabContent #sortImagesBtn {
    display: none !important;
  }
}

@keyframes tabSheetUp {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- Sablonok fül stílusok --- */
.template-category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.template-cat-btn {
  padding: 5px 10px;
  border: 1px solid #ddd;
  border-radius: 999px;
  background: #f8f8f8;
  cursor: pointer;
  font-size: 12px;
  transition: 0.15s;
}
.template-cat-btn:hover,
.template-cat-btn.active {
  background: #FF6600;
  color: white;
  border-color: #FF6600;
}
.template-grid {
  display: flex;
  overflow-x: auto;
  padding-bottom: 10px;
  gap: 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.3) transparent;
  flex-wrap: nowrap;
}
.template-grid::-webkit-scrollbar {
  height: 4px;
}
.template-grid::-webkit-scrollbar-track {
  background: transparent;
}
.template-grid::-webkit-scrollbar-thumb {
  background-color: rgba(0,0,0,0.3);
  border-radius: 4px;
}
.template-card-user {
  min-width: 90px;
  max-width: 90px;
  height: 90px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: 0.15s;
  flex-shrink: 0;
}
.template-card-user.is-loading {
  opacity: 0.55;
  pointer-events: none;
}
.template-card-user:hover {
  border-color: #FF6600;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.template-card-user img {
  width: 100%;
  height: calc(100% - 22px);
  object-fit: contain;
}
.template-card-placeholder {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ccc;
  font-size: 24px;
}
.template-card-title {
  font-size: 10px;
  padding: 2px 4px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  background: #f8f8f8;
}

/* --- Clipartok és maszkok fül --- */
.asset-grid {
  display: flex;
  overflow-x: auto;
  padding-bottom: 10px;
  gap: 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.3) transparent;
  flex-wrap: nowrap;
}
.asset-grid::-webkit-scrollbar {
  height: 4px;
}
.asset-grid::-webkit-scrollbar-track {
  background: transparent;
}
.asset-grid::-webkit-scrollbar-thumb {
  background-color: rgba(0,0,0,0.3);
  border-radius: 4px;
}
.asset-card {
  min-width: 85px;
  max-width: 85px;
  height: 85px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: 0.15s;
  flex-shrink: 0;
}
.asset-card:hover {
  border-color: #FF6600;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.asset-card img {
  width: 100%;
  height: calc(100% - 22px);
  object-fit: contain;
}
.asset-card-placeholder {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ccc;
  font-size: 24px;
}
.asset-card-title {
  font-size: 9px;
  padding: 2px 4px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  background: #f8f8f8;
}

.canvas-mask-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 10;
  background-repeat: no-repeat;
  background-position: center center;
  background-size: contain;
}

/* --- Mobil tabok: scrollozható chip-sor --- */
@media (max-width: 768px) {
  body.naptar-open #tabItemsWrapper {
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  body.naptar-open #tabItemsWrapper::-webkit-scrollbar {
    display: none;
  }
  body.naptar-open #tabItemsWrapper .tabItem {
    flex: 0 0 auto !important;
    min-width: 58px !important;
    max-width: 78px !important;
    width: auto !important;
  }
}

/* --- Admin sablon gyorsmásoló eszköztár --- */
#adminTemplateToolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  width: 100%;
  align-self: stretch;
  box-sizing: border-box;
  padding: 2px 8px 8px;
  margin: 0 0 4px;
  position: relative;
  z-index: 50;
  flex-shrink: 0;
}

#adminTemplateToolbar .admin-template-toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 6px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #f3f4f6;
  color: #333;
  font-size: 11px;
  font-family: inherit;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}

#adminTemplateToolbar .admin-template-toolbar-btn:hover {
  background: #e5e7eb;
  border-color: #ccc;
}

#adminTemplateToolbar .admin-template-toolbar-btn i {
  font-size: 12px;
  color: #555;
}

/* ===============================
   Asztali naptár: stúdió-nézet
   =============================== */
@media (min-width: 769px) {
  body.naptar-desktop {
    padding-bottom: 0;
    background: #e8eaed;
    --naptar-panel-w: min(360px, 24vw);
    --naptar-rail-w: 252px;
    --naptar-rail-space: 308px;
  }

  body.naptar-desktop #naptarContainer {
    margin-left: 76px;
    margin-right: var(--naptar-rail-space);
    width: auto;
    max-width: none;
    align-items: stretch;
    box-sizing: border-box;
    background: transparent;
    padding-bottom: 0;
    height: 100vh;
    min-height: 100vh;
    max-height: 100vh;
    overflow: hidden;
  }

  body.naptar-desktop.desktop-panel-open #naptarContainer {
    margin-left: calc(76px + var(--naptar-panel-w));
  }

  body.naptar-desktop #naptarStickyChrome,
  body.naptar-desktop #desktopTopBar {
    width: 100%;
    max-width: 100%;
    background: #e8eaed;
    box-shadow: none;
    overflow: visible;
    box-sizing: border-box;
  }

  body.naptar-desktop #naptarStickyChrome {
    flex: 0 0 auto;
    position: relative;
    z-index: 1195;
    padding: 4px 10px 2px;
    overflow: visible;
  }

  body.naptar-desktop #desktopTopBar {
    border-radius: 0;
    padding: 0;
    margin-bottom: 0;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    gap: 8px;
    align-items: center;
    justify-content: center;
    overflow: visible;
    position: relative;
    z-index: 2;
  }

  body.naptar-desktop .month-switcher {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    min-width: 0;
    flex: 1 1 auto;
  }

  body.naptar-desktop .month-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(15, 18, 28, 0.06);
  }

  body.naptar-desktop .month-nav:hover:not(:disabled) {
    background: #fff7ed;
    color: #c2410c;
    border-color: #fed7aa;
  }

  body.naptar-desktop .month-nav:disabled,
  body.naptar-desktop .month-nav.is-disabled {
    opacity: 0.35;
    cursor: default;
    box-shadow: none;
  }

  body.naptar-desktop #desktopTopBar #monthBar {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    width: auto;
    background: #fff;
    box-shadow: 0 4px 14px rgba(15, 18, 28, 0.06);
    padding: 6px 8px;
    gap: 5px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    justify-content: center;
    align-items: center;
    border-radius: 14px;
    border: 1px solid #e8eaed;
    scrollbar-width: thin;
    scroll-behavior: smooth;
  }

  body.naptar-desktop #desktopTopBar #monthBar .month {
    flex: 0 0 auto;
    min-width: auto;
    padding: 0 10px;
  }

  body.naptar-desktop.desktop-panel-open #desktopTopBar #monthBar .month {
    padding: 0 8px;
    font-size: 11px;
  }

  body.naptar-desktop.desktop-panel-open #desktopTopBar #monthBar .month span i.fa-calendar-day,
  body.naptar-desktop.desktop-panel-open #desktopTopBar #monthBar .month span i.fa-book-open {
    display: none;
  }

  body.naptar-desktop #vissza-link {
    flex: 0 0 auto;
  }

  body.naptar-desktop #tabMenu > #vissza-link {
    display: block;
    padding: 12px 8px 6px;
    flex: 0 0 auto;
    width: 100%;
    box-sizing: border-box;
  }

  body.naptar-desktop #tabMenu > #vissza-link .back-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    padding: 8px 4px 7px;
    border-radius: 12px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-align: center;
    white-space: normal;
    line-height: 1.15;
    box-shadow: 0 6px 14px rgba(255, 102, 0, 0.22);
  }

  body.naptar-desktop #tabMenu > #vissza-link .back-link i {
    font-size: 15px;
  }

  body.naptar-desktop #tabMenu > #vissza-link .back-link-text {
    display: none;
  }

  body.naptar-desktop #tabMenu > #vissza-link .back-link-short {
    display: block;
  }

  body.naptar-desktop #desktopTopBar #monthBar {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    width: auto;
    background: #fff;
    box-shadow: 0 4px 14px rgba(15, 18, 28, 0.06);
    padding: 6px 8px;
    gap: 5px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    justify-content: center;
    align-items: center;
    border-radius: 14px;
    border: 1px solid #e8eaed;
    scrollbar-width: thin;
    scroll-behavior: smooth;
  }

  body.naptar-desktop #desktopTopBar #monthBar.is-overflow {
    justify-content: flex-start;
  }

  body.naptar-desktop #desktopTopBar #monthBar .month {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 34px;
    min-width: auto;
    flex: 0 0 auto;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    background: #fff;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(15, 18, 28, 0.04);
    border-radius: 999px;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  }

  body.naptar-desktop #desktopTopBar #monthBar .month span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    line-height: 1;
    white-space: nowrap;
  }

  body.naptar-desktop #desktopTopBar #monthBar .month span i.fa-calendar-day,
  body.naptar-desktop #desktopTopBar #monthBar .month span i.fa-book-open {
    display: inline-block;
    font-size: 11px;
    opacity: 0.85;
  }

  body.naptar-desktop #desktopTopBar #monthBar .month .edited-indicator {
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 9px;
  }

  body.naptar-desktop #desktopTopBar #monthBar .month:hover {
    background: #fff7ed;
    color: #c2410c;
    border-color: #fed7aa;
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.1);
    transform: translateY(-1px);
  }

  body.naptar-desktop #desktopTopBar #monthBar .month.active,
  body.naptar-desktop #desktopTopBar #monthBar .month.active:hover {
    background: var(--primary-color);
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    font-weight: 700;
    box-shadow: 0 6px 16px rgba(255, 102, 0, 0.28);
    transform: none;
  }

  body.naptar-desktop #desktopTopBar #monthBar .month.active span,
  body.naptar-desktop #desktopTopBar #monthBar .month.active i {
    color: #fff;
  }

  body.naptar-desktop #zoomBar,
  body.naptar-desktop #zoomBar.zoom-bar,
  body.naptar-desktop .zoom-bar {
    display: none;
  }

  body.naptar-desktop #mobilePhotoStrip {
    display: none !important;
  }

  body.naptar-desktop #desktopRightRail #zoomBar,
  body.naptar-desktop #desktopRightRail #zoomBar.zoom-bar {
    display: block !important;
    width: 100%;
    margin: 0 0 12px;
    padding: 0 0 12px;
    border-bottom: 1px solid #eceef0;
  }

  body.naptar-desktop #desktopRightRail .zoom-bar-inner {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 8px;
    gap: 6px;
    background: #f6f7f8;
    border: 1px solid #e8eaed;
    box-shadow: none;
  }

  body.naptar-desktop #desktopRightRail .zoom-bar-inner i {
    font-size: 12px;
  }

  body.naptar-desktop #desktopRightRail #zoomSlider {
    min-width: 0;
  }

  body.naptar-desktop #desktopRightRail .zoom-value {
    min-width: 40px;
    font-size: 11px;
  }

  body.naptar-desktop #desktopRightRail .zoom-cart-btn {
    display: none !important;
  }

  body.naptar-desktop #desktopRightRail #vissza-link {
    display: block;
    width: 100%;
    margin: 0 0 10px;
    padding: 0 0 10px;
    border-bottom: 1px solid #eceef0;
    background: transparent;
    text-align: left;
  }

  body.naptar-desktop #desktopRightRail #vissza-link .back-link {
    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;
    letter-spacing: 0;
    text-align: left;
    white-space: normal;
    line-height: 1.25;
    box-sizing: border-box;
    box-shadow: 0 6px 14px rgba(255, 102, 0, 0.2);
    background: var(--primary-color);
    color: #fff;
    text-decoration: none;
  }

  body.naptar-desktop #desktopRightRail #vissza-link .back-link:visited {
    color: #fff;
    text-decoration: none;
  }

  body.naptar-desktop #desktopRightRail #vissza-link .back-link i {
    font-size: 14px;
    flex: 0 0 auto;
  }

  body.naptar-desktop #desktopRightRail #vissza-link .back-link-text {
    display: inline;
    font-size: 12px;
  }

  body.naptar-desktop #desktopRightRail #vissza-link .back-link-short {
    display: none;
  }

  body.naptar-desktop #naptarCanvasStage {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    overflow: hidden;
    justify-content: stretch;
    align-items: stretch;
    padding: 8px 8px 10px;
    box-sizing: border-box;
  }

  @supports (justify-content: safe center) {
    body.naptar-desktop #naptarCanvasStage {
      justify-content: stretch;
    }
  }

  body.naptar-desktop #naptarCanvasStage.is-overflow-x .naptar-stage-cluster {
    justify-content: flex-start;
  }

  body.naptar-desktop #naptarCanvasStage.is-overflow-y .naptar-stage-cluster {
    align-items: flex-start;
  }

  body.naptar-desktop #naptarCanvasStage > .naptar-stage-cluster {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    gap: 0;
  }

  body.naptar-desktop #naptarCanvasStage .calendar-with-spiral-wrapper {
    margin: 0 auto;
    flex: 0 0 auto;
  }

  body.naptar-desktop #canvasContainer,
  body.naptar-desktop .calendar-with-spiral-wrapper #canvasContainer {
    margin-bottom: 0 !important;
  }

  body.naptar-desktop #desktopControllerDock {
    display: flex !important;
    flex-direction: row;
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    width: 100%;
    max-width: 100%;
    min-height: 56px;
    margin: 8px 0 0;
    z-index: 40;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    padding: 0;
    background: transparent;
    box-sizing: border-box;
  }

  body.naptar-desktop #desktopControllerDock .controller-buttons {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    width: auto;
    justify-content: center;
    align-items: center;
    background: #fff;
    border: 1px solid #e4e6e8;
    box-shadow: 0 8px 24px rgba(15, 18, 28, 0.08);
    border-radius: 22px;
    padding: 6px 12px;
  }

  body.naptar-desktop #desktopControllerDock .controller-buttons.is-disabled {
    opacity: 0.42;
    filter: grayscale(0.25);
  }

  body.naptar-desktop #desktopControllerDock .controller-buttons.is-disabled .controller-btn,
  body.naptar-desktop #desktopControllerDock .controller-buttons.is-disabled .mask-inner-btn {
    cursor: not-allowed;
    pointer-events: none;
  }

  body.naptar-desktop #desktopControllerDock .controller-buttons.is-disabled .controller-btn:hover {
    transform: none;
    box-shadow: none;
    background: #fff;
  }

  body.naptar-desktop #desktopControllerDock [data-action="autofill"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 0;
    padding: 8px 14px;
    min-height: 38px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 12px;
    background: #fff;
    color: #374151;
    border: 1px solid #e5e7eb;
    box-shadow: 0 8px 20px rgba(15, 18, 28, 0.06);
    cursor: pointer;
  }

  body.naptar-desktop #desktopControllerDock [data-action="autofill"]:hover {
    background: #f9fafb;
    color: #111827;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(15, 18, 28, 0.08);
  }

  body.naptar-desktop #tabMenu {
    position: fixed;
    top: 0;
    left: 0;
    right: auto;
    bottom: 0;
    width: 76px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f4f5f7;
    border-radius: 0;
    border-right: 1px solid #e4e6e8;
    box-shadow: none;
    z-index: 1200;
    overflow: visible;
  }

  body.naptar-desktop #tabHeader,
  body.naptar-desktop #headerRowTop,
  body.naptar-desktop #headerRowBottom {
    display: contents;
  }

  body.naptar-desktop #tabHeader #tabItemsWrapper,
  body.naptar-desktop #tabItemsWrapper {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 6px;
    padding: 10px 8px 20px;
    height: auto;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    box-sizing: border-box;
  }

  body.naptar-desktop #tabHeader #tabItemsWrapper .tabItem,
  body.naptar-desktop #tabItemsWrapper .tabItem,
  body.naptar-desktop .tabItem {
    flex: 0 0 auto !important;
    width: 100%;
    min-width: 0 !important;
    max-width: none !important;
    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 !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    box-sizing: border-box;
    background: transparent;
    color: #6b7280;
    box-shadow: none;
    border: 1px solid transparent;
    transition: background 0.22s ease, color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  }

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

  body.naptar-desktop .tabItem br {
    display: none;
  }

  body.naptar-desktop .tabItem i {
    font-size: 17px;
    margin: 0;
    color: inherit;
    transition: transform 0.22s ease;
  }

  body.naptar-desktop .tabItem:hover i {
    transform: scale(1.06);
  }

  body.naptar-desktop .tabItem.active::after {
    display: none;
  }

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

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

  body.naptar-desktop .header-separator {
    display: none;
  }

  body.naptar-desktop #tabContent {
    position: fixed;
    left: 76px;
    top: 0;
    bottom: 0;
    width: var(--naptar-panel-w);
    max-height: none !important;
    height: 100vh;
    z-index: 1190;
    overflow: hidden;
    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);
    padding: 0;
    box-sizing: border-box;
    transform: translateX(-18px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
  }

  body.naptar-desktop.desktop-panel-open #tabContent {
    display: flex !important;
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }

  body.naptar-desktop #tabContent .tabContentHeader {
    position: relative;
    flex: 0 0 auto;
    padding: 18px 18px 14px;
    background: #fff;
    border-bottom: 1px solid #f0f1f3;
    margin-bottom: 0;
  }

  body.naptar-desktop #tabContent .tabContentHeader h4 {
    font-size: 16px;
    font-weight: 650;
    letter-spacing: -0.02em;
    color: #111827;
  }

  body.naptar-desktop #closeTabContent {
    background: #f3f4f6;
    color: #6b7280;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    box-shadow: none;
    transition: background 0.2s ease, color 0.2s ease;
  }

  body.naptar-desktop #closeTabContent:hover {
    background: #eceff3;
    color: #111827;
    transform: none;
  }

  body.naptar-desktop #tabContent .tabContentBody,
  body.naptar-desktop #tabContent #uploadSection {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 18px 28px;
    max-height: none;
    -webkit-overflow-scrolling: touch;
  }

  body.naptar-desktop #tabContent #uploadSection {
    display: flex;
    flex-direction: column;
    padding: 0;
  }

  body.naptar-desktop #tabContent #uploadSection .tabContentHeader {
    flex: 0 0 auto;
  }

  body.naptar-desktop #tabContent #uploadSection .upload-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 18px 28px;
  }

  body.naptar-desktop #tabContent .upload-body .upload-row {
    flex-direction: column;
    gap: 12px;
  }

  body.naptar-desktop #tabContent .upload-body .upload-left,
  body.naptar-desktop #tabContent .upload-body .upload-right {
    flex: 1 1 auto;
    max-width: none;
    width: 100%;
  }

  body.naptar-desktop #tabContent .upload-body .upload-left {
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    max-width: none;
  }

  body.naptar-desktop #tabContent #uploadLeftExtras {
    display: flex;
    width: 100%;
  }

  body.naptar-desktop #tabContent .upload-dropzone {
    display: flex;
    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;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  }

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

  body.naptar-desktop #tabContent .upload-dropzone #uploadButton {
    width: 48px;
    height: 48px;
    margin: 0;
    border-radius: 14px;
    background: linear-gradient(180deg, #ff7a1a, #f05600);
    color: #fff;
    font-size: 18px;
    box-shadow: 0 8px 18px rgba(255, 102, 0, 0.28);
    flex: 0 0 auto;
  }

  body.naptar-desktop #tabContent .upload-dropzone #uploadButton:hover {
    transform: translateY(-1px);
    background: linear-gradient(180deg, #ff8a33, #ff6600);
  }

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

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

  body.naptar-desktop #tabContent .upload-dropzone .clickable-upload-text {
    color: #6b7280;
    text-decoration: none;
    font-size: 12px;
    line-height: 1.4;
  }

  /* Asztali feltöltés – AJT mintájú studio + inline progress */
  body.naptar-desktop #tabContent .naptar-upload-studio {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px;
    width: 100%;
  }
  body.naptar-desktop #tabContent .upload-dropzone.ajt-upload-dropzone {
    border-radius: 16px;
  }
  body.naptar-desktop #tabContent .ajt-upload-main-btn,
  body.naptar-desktop #tabContent .upload-dropzone.ajt-upload-dropzone #uploadButton {
    width: 48px !important;
    height: 48px !important;
    min-height: 48px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }
  body.naptar-desktop #tabContent .naptar-upload-progress.ajt-upload-progress {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #fff7ed;
    border: 1px solid #ffd7b0;
  }
  body.naptar-desktop #tabContent .naptar-upload-progress.ajt-upload-progress[hidden] {
    display: none !important;
  }
  body.naptar-desktop #tabContent .ajt-upload-progress-track {
    height: 8px;
    border-radius: 999px;
    background: #ffe8d1;
    overflow: hidden;
  }
  body.naptar-desktop #tabContent .ajt-upload-progress-fill {
    display: block;
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: linear-gradient(90deg, #ff7a1a, #f05600);
    transition: width 0.22s ease;
  }
  body.naptar-desktop #tabContent .ajt-upload-progress-text {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: #9a3412;
  }
  @keyframes naptarThumbPulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
  }
  body.naptar-desktop #tabContent .thumbnail-wrapper.ajt-thumb-uploading,
  body.naptar-desktop #tabContent .thumbnail-wrapper.is-upload-pending {
    position: relative;
    background: #f3f4f6;
    border: 1px dashed #d1d5db;
    animation: naptarThumbPulse 1.1s ease-in-out infinite;
  }
  body.naptar-desktop #tabContent .thumbnail-wrapper.ajt-thumb-uploading img,
  body.naptar-desktop #tabContent .thumbnail-wrapper.is-upload-pending img {
    filter: grayscale(1) brightness(0.92);
    opacity: 0.7;
  }
  body.naptar-desktop #tabContent .naptar-thumb-uploading-label {
    position: absolute;
    left: 50%;
    bottom: 8px;
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: rgba(0,0,0,0.55);
    border-radius: 8px;
    padding: 2px 8px;
    pointer-events: none;
    white-space: nowrap;
  }
  body.naptar-desktop.desktop-panel-open #uploadOverlay.is-compact,
  body.naptar-desktop #uploadOverlay.is-compact {
    display: none !important;
  }

  body.naptar-desktop #tabContent .thumbnails-wrapper {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    align-content: flex-start;
    gap: 8px;
    max-height: none;
    padding: 2px 0 8px;
  }

  body.naptar-desktop #tabContent .thumbnail-wrapper {
    width: calc(50% - 6px) !important;
    max-width: none;
    height: auto !important;
    aspect-ratio: 1 / 1;
    min-width: 0;
    min-height: 0;
  }

  body.naptar-desktop #tabContent .thumbnail-wrapper img,
  body.naptar-desktop #tabContent .thumbnail-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  body.naptar-desktop #tabContent .template-grid,
  body.naptar-desktop #tabContent .asset-grid,
  body.naptar-desktop #tabContent .backgrounds-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    overflow-x: hidden;
    overflow-y: visible;
    flex-wrap: unset;
    padding-bottom: 8px;
  }

  body.naptar-desktop #tabContent .template-card-user,
  body.naptar-desktop #tabContent .asset-card,
  body.naptar-desktop #tabContent .background-thumb {
    min-width: 0 !important;
    max-width: none !important;
    width: 100%;
    height: auto !important;
    aspect-ratio: 1 / 1;
    flex-shrink: 1;
    box-sizing: border-box;
  }

  body.naptar-desktop #tabContent .template-card-user img,
  body.naptar-desktop #tabContent .asset-card img {
    width: 100%;
    height: calc(100% - 22px);
    object-fit: contain;
  }

  body.naptar-desktop #tabContent .background-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  body.naptar-desktop #tabContent .template-card-user {
    aspect-ratio: 3 / 4;
  }

  body.naptar-desktop #desktopRightRail {
    display: none;
    position: fixed;
    top: 16px;
    right: 16px;
    width: var(--naptar-rail-w);
    z-index: 40;
    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;
    pointer-events: auto;
  }

  body.naptar-desktop #desktopRightRail:not(:empty) {
    display: flex;
  }

  body.naptar-desktop #selectedProductInfo,
  body.naptar-desktop #tabMenu .selected-product-info,
  body.naptar-desktop .selected-product-info.compact {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 252px;
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin: 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);
    text-align: left;
    white-space: normal;
    opacity: 1;
    box-sizing: border-box;
  }

  body.naptar-desktop #desktopRightRail #selectedProductInfo {
    position: relative;
    top: auto;
    right: auto;
    width: 100%;
    margin: 0;
    padding: 0 0 12px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
  }

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

  body.naptar-desktop #selectedProductInfo .spi-qty-price-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  body.naptar-desktop #selectedProductInfo .spi-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary-color);
  }

  body.naptar-desktop #selectedProductInfo .spi-cart-btn,
  body.naptar-desktop #desktopRightRail .spi-cart-btn {
    display: flex !important;
    width: 100%;
    justify-content: center;
    margin-top: 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);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  }

  body.naptar-desktop #selectedProductInfo .spi-cart-btn:hover,
  body.naptar-desktop #desktopRightRail .spi-cart-btn:hover {
    transform: translateY(-1px);
    background: linear-gradient(180deg, #ff8a33 0%, #ff6600 100%);
    box-shadow: 0 14px 28px rgba(255, 102, 0, 0.4);
  }

  body.naptar-desktop #selectedProductInfo .spi-cart-btn.disabled,
  body.naptar-desktop #desktopRightRail .spi-cart-btn.disabled,
  body.naptar-desktop .spi-cart-btn.disabled {
    background: #c4c7cc;
    background-image: none;
    color: #fff;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 1;
    filter: none;
  }

  body.naptar-desktop #selectedProductInfo .spi-cart-btn.disabled:hover,
  body.naptar-desktop #desktopRightRail .spi-cart-btn.disabled:hover,
  body.naptar-desktop .spi-cart-btn.disabled:hover {
    transform: none;
    background: #c4c7cc;
    background-image: none;
    box-shadow: none;
  }

  body.naptar-desktop #tabHeader #topActionsWrapper,
  body.naptar-desktop #topActionsWrapper {
    position: fixed;
    right: 16px;
    top: 210px;
    left: auto;
    bottom: auto;
    width: 252px;
    z-index: 1170;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: stretch;
    gap: 6px;
    padding: 0;
    border: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    transform: none;
  }

  body.naptar-desktop #desktopRightRail #topActionsWrapper {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    width: 100%;
    margin: 0;
    padding: 12px 0 0;
    border-top: 1px solid #eceef0;
    background: transparent;
    box-shadow: none;
  }

  body.naptar-desktop.desktop-panel-open #tabHeader #topActionsWrapper,
  body.naptar-desktop.desktop-panel-open #topActionsWrapper {
    left: auto;
  }

  body.naptar-desktop #tabHeader #topActionsWrapper .actionButton,
  body.naptar-desktop #topActionsWrapper .actionButton,
  body.naptar-desktop #desktopRightRail #topActionsWrapper .actionButton {
    width: auto;
    min-width: 0;
    max-width: none;
    flex: 1 1 0;
    justify-content: center;
    padding: 7px 4px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
    min-height: 34px;
    background: #fff;
    color: #4b5563;
    border: 1px solid #e5e7eb;
    box-shadow: none;
    transform: none;
  }

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

  body.naptar-desktop #topActionsWrapper .actionButton i {
    font-size: 11px;
  }

  body.naptar-desktop #topActionsWrapper .actionButton[data-action="elonezet"] {
    background: #fff7ed;
    color: #c2410c;
    border-color: #fed7aa;
  }

  body.naptar-desktop #topActionsWrapper .actionButton[data-action="autofill"],
  body.naptar-desktop #desktopRightRail #topActionsWrapper [data-action="autofill"] {
    display: none !important;
  }

  body.naptar-desktop #mobileControllerDock {
    display: none !important;
  }

  body.naptar-desktop #tabContent .settings-stack,
  body.naptar-desktop #tabContent .settings-grid,
  body.naptar-desktop #tabContent .calendar-settings-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    grid-template-columns: none;
  }

  body.naptar-desktop #tabContent .settings-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    align-items: stretch;
  }

  body.naptar-desktop #tabContent .settings-pair .settings-section {
    margin: 0;
    min-width: 0;
  }

  body.naptar-desktop #tabContent .setting-card,
  body.naptar-desktop #tabContent .settings-section {
    background: #f8f9fa;
    border: 1px solid #eceef0;
    border-radius: 14px;
    padding: 14px 14px 12px;
    box-shadow: none;
    transform: none;
  }

  body.naptar-desktop #tabContent .setting-card:hover {
    transform: none;
    box-shadow: none;
  }

  body.naptar-desktop #tabContent .thumbnail-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 4px 0 12px;
    padding: 8px 10px;
    background: #f8f9fa;
    border: 1px solid #eceef0;
    border-radius: 12px;
  }

  body.naptar-desktop #tabContent .thumb-sort-select-wrap,
  body.naptar-desktop #tabContent .mobile-sort-select-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    flex: 1 1 auto;
  }

  body.naptar-desktop #tabContent .thumb-sort-select-wrap select,
  body.naptar-desktop #tabContent .mobile-sort-select-wrap select {
    min-height: 34px;
    border-radius: 10px;
    border: 1px solid #e4e6e8;
    padding: 6px 12px;
    font-size: 13px;
    background: #fff;
    color: #111827;
    min-width: 0;
    flex: 1 1 auto;
    cursor: pointer;
  }

  body.naptar-desktop #tabContent .icon-btn.danger {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #fff;
    color: #b91c1c;
    border: 1px solid #fecaca;
    box-shadow: none;
  }

  body.naptar-desktop #sortImagesBtn {
    display: none !important;
  }

  body.naptar-desktop #tabContent .text-studio {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  body.naptar-desktop #tabContent .text-studio-card {
    background: #f8f9fa;
    border: 1px solid #eceef0;
    border-radius: 14px;
    padding: 14px;
  }

  body.naptar-desktop #tabContent .text-studio-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6b7280;
    margin: 0 0 10px;
  }

  body.naptar-desktop #tabContent .text-studio #textInput {
    width: 100%;
    min-height: 110px;
    box-sizing: border-box;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    background: #fff;
  }

  body.naptar-desktop #tabContent .text-studio #textInput:focus {
    outline: none;
    border-color: #fdba74;
    box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.12);
  }

  body.naptar-desktop #tabContent .text-studio .text-studio-size {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 12px;
    font-weight: 700;
    color: #6b7280;
  }

  body.naptar-desktop #tabContent .text-studio .text-studio-size input {
    width: 84px;
    height: 36px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0 10px;
    font-size: 14px;
  }

  body.naptar-desktop #tabContent .text-studio .text-add-button {
    width: 100%;
    justify-content: center;
    margin-top: 10px;
    min-height: 42px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    background: var(--primary-color);
    color: #fff;
  }

  body.naptar-desktop #tabContent .compact-toolbar,
  body.naptar-desktop #tabContent .toolbar-section {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    background: transparent;
    width: 100%;
  }

  body.naptar-desktop #tabContent .tool-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
    cursor: pointer;
  }

  body.naptar-desktop #tabContent .tool-btn:hover,
  body.naptar-desktop #tabContent .tool-btn.active {
    background: #fff7ed;
    color: #c2410c;
    border-color: #fed7aa;
  }

  body.naptar-desktop #tabContent .divider {
    width: 1px;
    height: 22px;
    background: #e5e7eb;
    margin: 0 4px;
  }

  body.naptar-desktop #tabContent .font-controls {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: 100%;
  }

  body.naptar-desktop #tabContent .color-picker-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }

  body.naptar-desktop #tabContent #textColor {
    width: 42px;
    height: 36px;
    padding: 0;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
  }

  body.naptar-desktop #tabContent .preset-colors-compact {
    display: flex !important;
    flex-wrap: wrap;
    gap: 6px;
    position: static;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  body.naptar-desktop #tabContent .preset-color {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 1px solid rgba(15, 18, 28, 0.12);
    cursor: pointer;
  }

  body.naptar-desktop #tabContent #fontFamily,
  body.naptar-desktop #tabContent .compact-select {
    width: 100%;
    min-height: 40px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    padding: 0 12px;
    background: #fff;
    font-size: 13px;
  }

  @media (max-width: 1600px) {
    body.naptar-desktop {
      --naptar-panel-w: min(306px, 26vw);
    }
  }

  @media (max-width: 1366px) {
    body.naptar-desktop #desktopTopBar #vissza-link .back-link-text {
      display: none;
    }
    body.naptar-desktop #desktopTopBar #vissza-link .back-link {
      width: 38px;
      justify-content: center;
      padding: 8px 0;
    }
  }
}

/* Asztali modalok: elegáns, szélesebb előnézet / mentés */
@media (min-width: 769px) {
  .modalOverlay {
    background: rgba(17, 20, 28, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .modalContent {
    padding: 32px 34px 26px;
    max-width: 520px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.7);
  }

  .modalContent:has(.preview-grid) {
    max-width: min(920px, 92vw);
    width: min(920px, 92vw);
  }

  .modalContent:has(.save-calendar-tabs),
  .modalContent:has(.text-style-modal) {
    max-width: min(640px, 92vw);
    width: min(640px, 92vw);
  }

  .modalContent:has(.custom-events-modal) {
    max-width: min(880px, 94vw);
    width: min(880px, 94vw);
  }

  .modalContent h2,
  .modalContent h3 {
    margin: 0 0 16px;
    font-size: 20px;
    font-weight: 650;
    letter-spacing: -0.03em;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .modalContent p {
    color: #4b5563;
    line-height: 1.55;
    margin: 0 0 12px;
  }

  .modalContent .btn,
  .modalContent .confirm-btn {
    border-radius: 11px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  }

  .modalContent .btn:hover,
  .modalContent .confirm-btn:hover {
    transform: translateY(-1px);
  }

  .closeModalBtn {
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #f4f5f7;
    color: #6b7280;
  }

  .tab-header {
    background: #f6f7f8;
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
    border-bottom: 0;
    margin-bottom: 16px;
  }

  .tab-btn {
    border-radius: 9px;
    padding: 9px 14px;
  }

  .tab-btn.active {
    background: #fff;
    color: #111827;
    box-shadow: 0 4px 12px rgba(15, 18, 28, 0.06);
  }

  .confirm-modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 18px;
  }

  #cropperModal.cropper-modal {
    background: rgba(17, 20, 28, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  #cropperModal .cropper-modal-content {
    border-radius: 18px;
    box-shadow: 0 28px 80px rgba(15, 18, 28, 0.3);
  }

  #evkoziModalOverlay {
    background: rgba(17, 20, 28, 0.48) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 24px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.32s ease;
  }

  #evkoziModalOverlay.is-visible {
    opacity: 1;
  }

  #evkoziModalInnerContent {
    border-radius: 18px !important;
    box-shadow: 0 28px 80px rgba(15, 18, 28, 0.28);
    padding: 28px 32px 24px !important;
    transform: translateY(36px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.32s ease;
  }

  #evkoziModalOverlay.is-visible #evkoziModalInnerContent {
    transform: translateY(0);
    opacity: 1;
  }

  .header-design-modal-overlay {
    background: rgba(17, 20, 28, 0.5);
    backdrop-filter: blur(12px);
  }
}

.back-link-short {
  display: none;
}

#desktopRightRail {
  display: none;
}

.thumb-sort-select-wrap,
.mobile-sort-select-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #555;
}

.thumb-sort-select-wrap select,
.mobile-sort-select-wrap select {
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid #ddd;
  padding: 6px 10px;
  font-size: 14px;
  background: #fff;
  cursor: pointer;
}

.events-modal-studio .events-icon-grid,
.events-modal-studio .icon-selection .icons-grid,
.events-modal-studio .icon-selection .icons-grid.compact-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)) !important;
  gap: 6px !important;
  max-height: none !important;
  overflow: visible !important;
  flex-wrap: unset !important;
}

@media (max-width: 768px) {
  .events-modal-body {
    grid-template-columns: 1fr;
  }

  .events-modal-studio .custom-events-list {
    min-height: 120px;
    max-height: 180px;
  }
}

.events-panel-embed.custom-events-modal .event-form,
.events-panel-embed.custom-events-modal .event-form .form-row-wrapper,
#tabContent .events-panel-embed .event-form {
  display: flex !important;
  flex-direction: column !important;
  grid-template-columns: none !important;
  grid-template-areas: none !important;
  width: 100% !important;
}

#tabContent .events-panel-embed .icon-selection,
#tabContent .events-panel-embed .date-selection,
#tabContent .events-panel-embed .form-row {
  width: 100% !important;
  max-width: 100% !important;
  grid-column: 1 / -1 !important;
  grid-area: unset !important;
}

.events-panel-embed.custom-events-modal .icon-selection .icons-grid,
.events-panel-embed.custom-events-modal .icons-grid.compact-grid,
#tabContent .events-panel-embed .icon-selection .icons-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)) !important;
  gap: 6px !important;
  width: 100% !important;
  max-width: 100% !important;
  max-height: 160px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  flex-wrap: unset !important;
}

#tabContent .events-panel-embed .icon-option,
#tabContent .events-panel-embed .icons-grid.compact-grid .icon-option {
  width: 100% !important;
  max-width: none !important;
  height: 42px !important;
  min-width: 0 !important;
}

body.naptar-desktop #tabContent .events-tab-body {
  padding-top: 12px;
}

@media (max-width: 768px) {
  .events-panel-embed.custom-events-modal .icon-option,
  .events-panel-embed.custom-events-modal .icons-grid.compact-grid .icon-option {
    width: 100%;
    height: 38px;
    flex-shrink: 0;
  }
}

/* === Elrendezés (oldalszintű fénykép-slotok) === */
.layout-hint {
  margin: 8px 0 14px;
  font-size: 13px;
  line-height: 1.45;
  color: #64748b;
}
.layout-apply-options {
  margin-bottom: 4px;
}
.layout-group {
  margin-bottom: 16px;
}
.layout-group-title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}
.layout-group-title i { color: #ff6600; }
.layout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px;
}
.layout-card {
  appearance: none;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 12px;
  padding: 8px;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, box-shadow .15s, transform .12s;
}
.layout-card:hover {
  border-color: #ff6600;
  box-shadow: 0 6px 16px rgba(15, 23, 42, .08);
  transform: translateY(-1px);
}
.layout-card.selected {
  border-color: #ff6600;
  box-shadow: 0 0 0 2px rgba(255, 102, 0, .25);
}
.layout-mini {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #f1f5f9;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 8px;
}
.layout-mini-slot {
  position: absolute;
  box-sizing: border-box;
  background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 3px;
}
.layout-card-title {
  display: block;
  font-size: 12px;
  font-weight: 650;
  color: #1e293b;
  line-height: 1.25;
}
.layout-card-count {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: #94a3b8;
}
