.popwd {
  --navy: #061b3c;
  --navy-dark: #062a61;
  --blue: #075bd3;
  --blue-card: #0b50b0;
  --blue-deep: #083e89;
  --cyan: #5ec9f8;
  --line: rgba(6, 27, 60, .12);
  --soft: #f4fafe;
  --soft-blue: #e1f4fd;
  --muted: #4a5c75;
  --orange: #ff9800;
  font-family: Inter, Arial, sans-serif;
  color: var(--navy);
}
.popwd * {
  box-sizing: border-box;
}

.popwd-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 34px;
  align-items: stretch;
  padding: 86px 6vw 46px;
  background:
    radial-gradient(circle at 15% 15%, rgba(94, 201, 248, .35), transparent 30%),
    linear-gradient(135deg, #f4fafe 0%, #edf7ff 48%, #e1f4fd 100%);
  border-radius: 0 0 42px 42px;
}

.popwd-hero-copy span {
  display: inline-flex;
  border: 1px solid rgba(7, 91, 211, .18);
  border-radius: 999px;
  padding: 8px 13px;
  color: var(--blue);
  font-weight: 950;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: .09em;
  background: #fff;
}

.popwd h1 {
  font-size: clamp(48px, 7vw, 92px);
  line-height: .88;
  letter-spacing: -.06em;
  margin: 18px 0;
  color: var(--navy);
}

.popwd p {
  color: var(--muted);
  line-height: 1.65;
}

.popwd-hero-copy p {
  font-size: 19px;
  max-width: 730px;
}

.popwd-hero-actions,
.popwd-tools {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.popwd-hero-actions {
  margin-top: 28px;
}

.popwd-btn,
.popwd-tools button,
.popwd-choice-grid button,
.popwd-steps button,
.popwd-layer {
  border: 0;
  cursor: pointer;
  font-weight: 900;
}

.popwd-layer {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
}

.popwd-layer-num {
  width: 18px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted, #666);
}

.popwd-layer-thumb {
  width: 36px;
  height: 24px;
  object-fit: cover;
  border-radius: 2px;
  background: #eee;
}

.popwd-text {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-weight: 600;
  pointer-events: none;
}

.popwd-text-editor {
  background: #fff;
  border: 1px solid rgba(0,0,0,.08);
  padding: 8px;
  border-radius: 6px;
}


.popwd-text-editor input[type="text"],
.popwd-text-editor input[type="number"],
.popwd-text-editor select,
.popwd-text-editor input[type="color"] {
  width: 100%;
  padding: 8px;
  box-sizing: border-box;
  font-size: 14px;
}

.popwd-text-editor select {
  width: 100%;
  padding: 8px;
}

.popwd-font-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 36px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 6px 14px rgba(0,0,0,0.06);
  padding: 4px 6px;
  font-weight: 700;
}

#popwd-text-font {
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.06);
  padding: 8px 12px;
  font-weight: 800;
}

.popwd-text-editor .popwd-tools button {
  min-width: 40px;
  padding: 6px 10px;
  font-weight: 700;
}

.popwd-text-editor .popwd-tools button.active {
  background: rgba(0,0,0,0.08);
}

.popwd-tab-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.popwd-tab-button {
  background: #edf4ff;
  border: 1px solid rgba(7, 91, 211, .12);
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 800;
  color: var(--navy);
  transition: .18s ease;
}

.popwd-tab-button.active {
  background: linear-gradient(135deg, var(--blue), var(--navy));
  color: #fff;
}

.popwd-tab-panel {
  display: none;
}

.popwd-tab-panel.active {
  display: block;
}

.popwd-tab-placeholder {
  background: #f8fbff;
  border: 1px solid rgba(7, 91, 211, .12);
  border-radius: 18px;
  padding: 18px;
}

.popwd-tooltip {
  position: absolute;
  left: 0;
  top: 0;
  transform: translateY(-100%);
  background: rgba(5, 26, 59, 0.94);
  color: #fff;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 20;
  box-shadow: 0 16px 34px rgba(0,0,0,.18);
}

.popwd-tooltip.visible {
  opacity: 1;
  transform: translateY(-110%);
}

.popwd-panel {
  position: relative;
}

.popwd-tooltip::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  border-width: 6px 6px 0 6px;
  border-style: solid;
  border-color: rgba(5, 26, 59, 0.94) transparent transparent transparent;
}

.popwd-layer.drag-over {
  outline: 2px dashed rgba(0,0,0,0.12);
}

.popwd-layer.dragging {
  opacity: 0.5;
}

.popwd-layer-label {
  flex: 1 1 auto;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


.popwd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 999px;
  padding: 15px 22px;
  transition: .22s ease;
}

.popwd-btn:hover {
  transform: translateY(-2px);
}

.popwd-btn.primary {
  background: linear-gradient(135deg, var(--blue), var(--navy));
  color: #fff;
  box-shadow: 0 18px 34px rgba(7, 91, 211, .24);
}

.popwd-btn.ghost {
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--line);
}

.popwd-btn.whatsapp {
  background: #24d366;
  color: #fff;
}

.popwd-btn.full {
  width: 100%;
}

.popwd-price-card {
  position: relative;
  overflow: hidden;
  border-radius: 34px;
  padding: 30px;
  background: linear-gradient(145deg, var(--navy-dark) 0%, var(--blue-card) 55%, var(--blue) 100%);
  color: #fff;
  box-shadow: 0 30px 70px rgba(6, 27, 60, .22);
}

.popwd-price-card small {
  position: relative;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 950;
  color: #9fe3ff;
}

.popwd-price-card strong {
  position: relative;
  display: block;
  font-size: 62px;
  margin: 45px 0 10px;
}

.popwd-price-card p {
  position: relative;
  color: rgba(255, 255, 255, .82);
}

.popwd-layout {
  display: grid;
  grid-template-columns: 390px minmax(0, 1fr);
  gap: 24px;
  padding: 34px 6vw 80px;
  background: #f7faff;
}

.popwd-panel,
.popwd-stage-card {
  background: rgba(255, 255, 255, .88);
  border: 1px solid var(--line);
  border-radius: 32px;
  box-shadow: 0 24px 70px rgba(5, 26, 59, .09);
  backdrop-filter: blur(14px);
}

.popwd-panel {
  padding: 18px;
  position: sticky;
  top: 24px;
  align-self: start;
}

.popwd-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.popwd-steps button {
  background: #edf4ff;
  color: #334761;
  border-radius: 18px;
  padding: 10px 6px;
}

.popwd-steps b {
  display: block;
  color: var(--blue);
  font-size: 18px;
}

.popwd-steps .active {
  background: linear-gradient(135deg, var(--blue), var(--navy));
  color: #fff;
}

.popwd-steps .active b {
  color: #9fe3ff;
}

.popwd-panel-block {
  display: none;
  animation: popwdFade .25s ease;
}

.popwd-panel-block.active {
  display: block;
}

.popwd-panel h2 {
  font-size: 24px;
  margin: 8px 0 16px;
  color: var(--navy);
}

.popwd-panel h3 {
  font-size: 13px;
  margin: 18px 0 9px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.popwd label {
  display: block;
  margin: 12px 0;
  color: var(--navy);
  font-weight: 900;
}

.popwd input,
.popwd textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 13px 14px;
  color: var(--navy);
  font-weight: 800;
  outline: none;
}

.popwd input[type=color] {
  height: 52px;
  padding: 5px;
}

.popwd input[type=range] {
  padding: 0;
}

.popwd-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.popwd-upload {
  display: grid;
  place-items: center;
  min-height: 132px;
  border: 2px dashed rgba(7, 91, 211, .25);
  border-radius: 22px;
  background: linear-gradient(135deg, #fff, #eef6ff);
  text-align: center;
  color: var(--blue) !important;
}

.popwd-upload input {
  display: none;
}

.popwd-tools button {
  background: #edf4ff;
  color: var(--navy);
  border-radius: 14px;
  padding: 11px 12px;
  transition: .18s ease;
}

.popwd-tools button:hover {
  background: #dfeeff;
  transform: translateY(-1px);
}

.popwd-tools .danger {
  background: #fff1f1;
  color: #c72d2d;
}

.popwd-tools.vertical {
  display: grid;
}

.popwd-check {
  display: flex !important;
  align-items: center;
  gap: 10px;
}

.popwd-check input {
  width: 0;
  height: 0;
  opacity: 0;
  position: absolute;
  pointer-events: none;
}

.popwd-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.popwd-switch-track {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: rgba(232, 235, 238, 0.16);
 
  position: relative;
}

.popwd-switch-thumb {
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.14);
  transition: transform .2s ease;
}

.popwd-switch input:checked + .popwd-switch-track {
  background: rgba(7, 91, 211, .7);
}

.popwd-switch input:checked + .popwd-switch-track + .popwd-switch-thumb {
  transform: translateX(20px);
}

.popwd-switch-label {
  font-weight: 900;
  color: var(--navy);
}


.popwd-choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.popwd-choice-grid button {
  border-radius: 16px;
  background: #edf4ff;
  color: var(--navy);
  padding: 14px 10px;
}

.popwd-choice-grid .active {
  background: linear-gradient(135deg, var(--blue), var(--navy));
  color: #fff;
}

.popwd-summary {
  border-radius: 18px;
  background: #f3f7ff;
  border: 1px solid var(--line);
  padding: 14px;
  color: #334761;
  line-height: 1.7;
}

.popwd-stage-card {
  padding: 22px;
  min-height: 680px;
}

.popwd-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.popwd-toolbar b {
  display: block;
  font-size: 24px;
  color: var(--navy);
}

.popwd-toolbar span {
  color: var(--muted);
  font-weight: 800;
}

.popwd-price-chip {
  border-radius: 18px;
  background: var(--navy);
  color: #fff;
  padding: 12px 16px;
  text-align: right;
}

.popwd-price-chip span {
  display: block;
  color: #9fe3ff;
  font-size: 12px;
  text-transform: uppercase;
}

.popwd-price-chip b {
  color: #fff;
}

.popwd-canvas-outer {
  display: grid;
  place-items: center;
  min-height: 560px;
  border-radius: 28px;
  background: linear-gradient(135deg, #eef4fb, #ffffff);
  overflow: auto;
  padding: 26px;
}

.popwd-wall {
  position: relative;
  background: #f2efe8;
  box-shadow: 0 28px 80px rgba(5, 26, 59, .18);
  overflow: hidden;
  border-radius: 0;
  --texture: none;
  --tex-op: .35;
}

.popwd-wall::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--texture);
  opacity: var(--tex-op);
  pointer-events: none;
}

.popwd-wall.grid-on {
  background-image: none !important;
}

.popwd-work {
  position: absolute;
  border: 1px dashed rgba(7, 91, 211, .34);
  border-radius: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity .18s ease;
}

.popwd-work.visible {
  opacity: 1;
}

.popwd-snap-line {
  position: absolute;
  pointer-events: none;
  background: transparent;
  z-index: 2;
}

.popwd-snap-line-x,
.popwd-snap-line-y {
  display: none;
}

.popwd-snap-line-x {
  height: 2px;
  left: 0;
  right: 0;
  border-top: 1px dashed rgba(7, 91, 211, .85);
}

.popwd-snap-line-y {
  width: 2px;
  top: 0;
  bottom: 0;
  border-left: 1px dashed rgba(7, 91, 211, .85);
}

.popwd-work.led {
  box-shadow:
    0 0 var(--led-blur, 40px) var(--led-color, #2f83ff),
    inset 0 0 28px rgba(255, 255, 255, .45);
}

.popwd-item {
  position: absolute;
  cursor: grab;
  transform-origin: center center;
  pointer-events: auto;
}

.popwd-item:active {
  cursor: grabbing;
}

.popwd-item.selected {
  outline: 1px solid rgba(57, 199, 255, .75);
  outline-offset: 2px;
}

.popwd-item img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 2px;
  box-shadow: none;
  user-select: none;
  pointer-events: none;
}

.popwd-resize-dot,
.popwd-rotate-handle {
  position: absolute;
  opacity: 0;
  transition: opacity .18s ease, transform .18s ease;
}

.popwd-resize-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid rgba(7, 91, 211, .45);
  box-shadow: 0 6px 14px rgba(0, 0, 0, .12);
  pointer-events: auto;
  cursor: pointer;
}

.popwd-resize-dot[data-handle="0"] {
  top: -5px;
  left: -5px;
}

.popwd-resize-dot[data-handle="1"] {
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
}

.popwd-resize-dot[data-handle="2"] {
  top: -5px;
  right: -5px;
}

.popwd-resize-dot[data-handle="3"] {
  top: 50%;
  right: -5px;
  transform: translateY(-50%);
}

.popwd-resize-dot[data-handle="4"] {
  bottom: -5px;
  right: -5px;
}

.popwd-resize-dot[data-handle="5"] {
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
}

.popwd-resize-dot[data-handle="6"] {
  bottom: -5px;
  left: -5px;
}

.popwd-resize-dot[data-handle="7"] {
  top: 50%;
  left: -5px;
  transform: translateY(-50%);
}

.popwd-rotate-handle {
  top: -28px;
  left: 50%;
  width: 16px;
  height: 16px;
  transform: translateX(-50%);
  background: #fff;
  border: 2px solid rgba(7, 91, 211, .55);
  border-radius: 50%;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .16);
  cursor: grab;
  pointer-events: auto;
}

.popwd-rotate-handle::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  border: 2px solid rgba(7, 91, 211, .75);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.popwd-item.selected .popwd-resize-dot,
.popwd-item.selected .popwd-rotate-handle {
  opacity: 1;
}

.popwd-item.selected .popwd-rotate-handle:active,
.popwd-item.selected .popwd-resize-dot:active {
  box-shadow: 0 10px 20px rgba(0, 0, 0, .18);
}

.popwd-hints {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.popwd-hints span {
  border-radius: 999px;
  background: #edf4ff;
  color: #334761;
  padding: 8px 12px;
  font-weight: 900;
  font-size: 13px;
}

.popwd-keyboard-shortcuts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.popwd-keyboard-shortcuts span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(237, 244, 255, .95);
  border: 1px solid rgba(10, 99, 232, .12);
  color: #334761;
  font-size: 13px;
  font-weight: 700;
}

.popwd-keyboard-shortcuts strong {
  font-size: 13px;
  color: #0a63e8;
}

.popwd-layers {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.popwd-layer {
  width: 100%;
  text-align: left;
  background: #edf4ff;
  color: var(--navy);
  border-radius: 14px;
  padding: 11px 12px;
  transition: .18s ease;
}

.popwd-layer:hover {
  background: #dfeeff;
}

.popwd-layer.active {
  background: linear-gradient(135deg, var(--blue), var(--navy));
  color: #fff;
}

.popwd-muted {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  font-size: 14px;
}

.popwd-message {
  font-weight: 900;
}

.popwd-message.ok {
  color: #159447;
}

.popwd-message.err {
  color: #c72d2d;
}

@keyframes popwdFade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 1100px) {
  .popwd-hero,
  .popwd-layout {
    grid-template-columns: 1fr;
  }

  .popwd-panel {
    position: static;
  }

  .popwd-stage-card {
    min-height: auto;
  }
}

@media (max-width: 640px) {
  .popwd-hero,
  .popwd-layout {
    padding-left: 18px;
    padding-right: 18px;
  }

  .popwd-grid-2,
  .popwd-choice-grid {
    grid-template-columns: 1fr;
  }

  .popwd-steps span {
    display: none;
  }

  .popwd-canvas-outer {
    padding: 14px;
    min-height: 420px;
  }

  .popwd-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .popwd-price-chip {
    text-align: left;
  }
}

/* =========================================================
   Editor panel: tabovi kao header, ne kao dugmići
   Dodato/override za "Slike i kompozicija" panel
   ========================================================= */

.popwd-panel-block[data-panel="2"] {
  --editor-bg: #0b1626;
  --editor-bg-soft: #292929;
  --editor-line: rgba(255, 255, 255, .08);
  --editor-text: #e7e7e7;
  --editor-muted: #9a9a9a;
  --editor-accent: var(--blue);
  --editor-btn: #3b3b3b;
  --editor-btn-hover: #4a4a4a;
  --editor-blue: var(--cyan);
  color: var(--editor-text);
}

/* Sakriva naslov iznad tabova da tabovi budu prvi red, kao na primeru */
.popwd-panel-block[data-panel="2"] > h2 {
  display: none;
}

/* Tab bar */
.popwd-panel-block[data-panel="2"] .popwd-tab-bar {
  display: flex;
  align-items: stretch;
  width: calc(100% + 36px);
  margin: -18px -18px 14px;
  padding: 0;
  gap: 0;
  flex-wrap: nowrap;
  overflow: hidden;
  border-bottom: 1px solid var(--editor-line);
  border-radius: 8px 8px 0 0;
  background: var(--editor-bg);
}

/* Reset button izgleda */
.popwd-panel-block[data-panel="2"] .popwd-tab-button {
  flex: 1 1 0;
  min-width: 0;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--editor-muted);
  box-shadow: none;
  outline: 0;
  padding: 12px 8px 10px;
  cursor: pointer;
  position: relative;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  transition: color .18s ease, background .18s ease;
}

.popwd-panel-block[data-panel="2"] .popwd-tab-button:hover {
  color: #fff;
  background: rgba(255, 255, 255, .03);
}

.popwd-panel-block[data-panel="2"] .popwd-tab-button.active {
  color: var(--editor-accent);
  background: transparent;
}

.popwd-panel-block[data-panel="2"] .popwd-tab-button.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--editor-accent);
}

/* Tab content */
.popwd-panel-block[data-panel="2"] .popwd-tab-panel {
  display: none;
}

.popwd-panel-block[data-panel="2"] .popwd-tab-panel.active {
  display: block;
}

/* Naslovi u editor panelu */
.popwd-panel-block[data-panel="2"] h3 {
  margin: 12px 0 7px;
  color: var(--editor-muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
}

/* Dugmići alata da izgledaju kompaktno kao ikonice */
.popwd-panel-block[data-panel="2"] .popwd-tools {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.popwd-panel-block[data-panel="2"] .popwd-tools button {
  width: 25px;
  min-width: 25px;
  height: 25px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 5px;
  background: var(--editor-btn);
  color: #f0f0f0;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  box-shadow: none;
}

.popwd-panel-block[data-panel="2"] .popwd-tools button:hover {
  background: var(--editor-btn-hover);
  transform: none;
}

.popwd-panel-block[data-panel="2"] .popwd-tools .danger {
  background: var(--editor-btn);
  color: #f0f0f0;
}

/* Ako koristiš emoji strelice, ovo im daje sličan plavi square feel */
.popwd-panel-block[data-panel="2"] .popwd-tools button[data-action*="align"],
.popwd-panel-block[data-panel="2"] .popwd-tools button[data-action="front"],
.popwd-panel-block[data-panel="2"] .popwd-tools button[data-action="forward"],
.popwd-panel-block[data-panel="2"] .popwd-tools button[data-action="backward"],
.popwd-panel-block[data-panel="2"] .popwd-tools button[data-action="back"],
.popwd-panel-block[data-panel="2"] .popwd-tools button[data-action="flip-y"] {
  background: #3a3f44;
}

/* Switch/snap blok kao na slici */
.popwd-panel-block[data-panel="2"] .popwd-switch {
  width: 100%;
  min-height: 31px;
  margin: 7px 0;
  padding: 5px 8px;
  border-radius: 5px;
  background: var(--editor-bg-soft);
  display: flex !important;
  align-items: center;
}

.popwd-panel-block[data-panel="2"] .popwd-switch-label {
  color: var(--editor-text);
  font-size: 12px;
  font-weight: 800;
  order: 1;
}

.popwd-panel-block[data-panel="2"] .popwd-switch-track {
  width: 35px;
  height: 19px;
  margin-left: auto;
  border-radius: 999px;
  background: #555;
  order: 2;
}

.popwd-panel-block[data-panel="2"] .popwd-switch-thumb {
  left: auto;
  right: 21px;
  top: 50%;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  order: 3;
}

.popwd-panel-block[data-panel="2"] .popwd-switch input:checked + .popwd-switch-track {
  background: var(--editor-accent);
}

.popwd-panel-block[data-panel="2"] .popwd-switch input:checked + .popwd-switch-track + .popwd-switch-thumb {
  transform: translate(18px, -50%);
}

/* Placeholder i editor forme u dark varijanti */
.popwd-panel-block[data-panel="2"] .popwd-tab-placeholder,
.popwd-panel-block[data-panel="2"] .popwd-text-editor {
  background: var(--editor-bg-soft);
  border: 1px solid var(--editor-line);
  border-radius: 8px;
  color: var(--editor-text);
}

.popwd-panel-block[data-panel="2"] label {
  color: var(--editor-text);
}

.popwd-panel-block[data-panel="2"] input,
.popwd-panel-block[data-panel="2"] textarea,
.popwd-panel-block[data-panel="2"] select {
  border-color: var(--editor-line);
  background: #151515;
  color: var(--editor-text);
}

.popwd-panel-block[data-panel="2"] .popwd-muted {
  color: var(--editor-muted);
}

/* Layer lista */
.popwd-panel-block[data-panel="2"] .popwd-layer {
  background: var(--editor-bg-soft);
  color: var(--editor-text);
  border-radius: 6px;
}

.popwd-panel-block[data-panel="2"] .popwd-layer:hover {
  background: var(--editor-btn-hover);
}

.popwd-panel-block[data-panel="2"] .popwd-layer.active {
  background: var(--editor-accent);
  color: #111;
}

/* Upload zona u ovom panelu */
.popwd-panel-block[data-panel="2"] .popwd-upload {
  border-color: rgba(255, 152, 0, .35);
  background: #eaf5fe;
  color: var(--editor-accent) !important;
}


/* =========================================================
   Paleta iz hero slike - finalni override
   ========================================================= */

.popwd-hero {
  background:
    radial-gradient(circle at 12% 18%, rgba(94, 201, 248, .35), transparent 28%),
    linear-gradient(135deg, #f4fafe 0%, #edf7ff 48%, #e1f4fd 100%);
}

.popwd h1,
.popwd-panel h2,
.popwd-toolbar b,
.popwd label,
.popwd-switch-label,
.popwd-price-chip,
.popwd-tab-button,
.popwd-choice-grid button,
.popwd-steps button,
.popwd-layer {
  color: var(--navy);
}

.popwd p,
.popwd-hero-copy p,
.popwd-toolbar span,
.popwd-muted,
.popwd-layer-num {
  color: var(--muted);
}

.popwd-hero-copy span {
  color: var(--blue);
  background: #fff;
  border-color: rgba(7, 91, 211, .16);
  box-shadow: 0 8px 22px rgba(6, 27, 60, .06);
}

.popwd-btn.primary,
.popwd-steps .active,
.popwd-choice-grid .active,
.popwd-layer.active {
  background: linear-gradient(135deg, var(--blue), var(--navy-dark));
  color: #fff;
  box-shadow: 0 18px 34px rgba(7, 91, 211, .24);
}

.popwd-btn.ghost {
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--line);
}

.popwd-price-card {
  background: linear-gradient(145deg, var(--navy-dark) 0%, var(--blue-card) 55%, var(--blue) 100%);
  color: #fff;
  box-shadow: 0 30px 70px rgba(6, 27, 60, .22);
}

.popwd-price-card small,
.popwd-steps .active b,
.popwd-price-chip span {
  color: #9fe3ff;
}

.popwd-price-card p {
  color: rgba(255, 255, 255, .82);
}

.popwd-layout {
  background: #f7fbff;
}

.popwd-panel,
.popwd-stage-card {
  border-color: var(--line);
  box-shadow: 0 24px 70px rgba(6, 27, 60, .09);
}

.popwd-tools button,
.popwd-choice-grid button,
.popwd-steps button,
.popwd-layer,
.popwd-hints span,
.popwd-keyboard-shortcuts span {
  background: #edf7ff;
  color: var(--navy);
}

.popwd-tools button:hover,
.popwd-layer:hover {
  background: #dff1ff;
}

.popwd-upload {
  border-color: rgba(7, 91, 211, .22);
  background: linear-gradient(135deg, #fff, #edf7ff);
  color: var(--blue) !important;
}

.popwd-switch input:checked + .popwd-switch-track {
  background: var(--blue);
}

.popwd-price-chip {
  background: var(--navy);
  color: #fff;
}

.popwd-panel-block[data-panel="2"] {
  --editor-accent: var(--blue);
  --editor-blue: var(--cyan);
}

.popwd-panel-block[data-panel="2"] .popwd-tab-button.active {
  color: var(--cyan);
}

.popwd-panel-block[data-panel="2"] .popwd-tab-button.active::after {
  background: var(--cyan);
}

.popwd-panel-block[data-panel="2"] .popwd-upload {
  border-color: rgba(94, 201, 248, .35);
  color: var(--cyan) !important;
}


/* =========================================================
   FINAL PREMIUM UI OVERRIDE
   Tamna, pregledna i prijatna editor površina + svetao stage
   ========================================================= */

.popwd {
  --navy: #071a35;
  --navy-dark: #091f42;
  --ink: #0b1728;
  --blue: #0b5ed7;
  --blue-2: #1677ff;
  --cyan: #6fdcff;
  --cyan-soft: #c9f4ff;
  --panel-bg: #0a1424;
  --panel-bg-2: #101b2d;
  --card-bg: rgba(255, 255, 255, .065);
  --card-bg-hover: rgba(255, 255, 255, .095);
  --card-line: rgba(255, 255, 255, .09);
  --text-on-dark: #f4f8ff;
  --text-soft: #aab8ca;
  --text-muted: #8292a8;
  --soft: #f6fbff;
  --soft-blue: #eaf6ff;
  --muted: #49617f;
  --line: rgba(7, 26, 53, .11);
  --orange: #ff9f1c;
  --danger: #ff5b5b;
  font-family: Inter, Arial, sans-serif;
  color: var(--navy);
}

/* Global light area */
.popwd-hero {
  background:
    radial-gradient(circle at 11% 17%, rgba(111, 220, 255, .30), transparent 31%),
    radial-gradient(circle at 82% 8%, rgba(11, 94, 215, .10), transparent 27%),
    linear-gradient(135deg, #f8fcff 0%, #eef8ff 52%, #e8f5ff 100%);
  border-radius: 0 0 38px 38px;
}

.popwd h1 {
  color: #071a35;
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
}

.popwd p,
.popwd-hero-copy p,
.popwd-toolbar span,
.popwd-muted,
.popwd-layer-num {
  color: var(--muted);
}

.popwd-hero-copy span {
  color: var(--blue);
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(11, 94, 215, .15);
  box-shadow: 0 10px 30px rgba(7, 26, 53, .07);
}

.popwd-btn.primary,
.popwd-steps .active,
.popwd-choice-grid .active {
  background: linear-gradient(135deg, #0b5ed7 0%, #092a5e 100%);
  color: #fff;
  box-shadow: 0 16px 38px rgba(11, 94, 215, .25);
}

.popwd-btn.ghost {
  background: rgba(255,255,255,.94);
  color: var(--navy);
  border: 1px solid rgba(7, 26, 53, .12);
  box-shadow: 0 12px 28px rgba(7, 26, 53, .06);
}

.popwd-price-card {
  background:
    radial-gradient(circle at 87% 9%, rgba(111, 220, 255, .16), transparent 34%),
    linear-gradient(145deg, #08224d 0%, #0d469a 52%, #0b63d8 100%);
  color: #fff;
  box-shadow: 0 28px 76px rgba(7, 26, 53, .22);
}

.popwd-price-card small,
.popwd-steps .active b,
.popwd-price-chip span {
  color: #bceeff;
}

.popwd-price-card p {
  color: rgba(255, 255, 255, .84);
}

.popwd-layout {
  background:
    radial-gradient(circle at 0% 0%, rgba(111, 220, 255, .12), transparent 26%),
    linear-gradient(180deg, #f7fbff 0%, #edf6ff 100%);
}

.popwd-stage-card {
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(7, 26, 53, .10);
  box-shadow: 0 24px 70px rgba(7, 26, 53, .10);
}

.popwd-canvas-outer {
  background: linear-gradient(135deg, #edf5ff 0%, #ffffff 100%);
}

/* Premium dark sidebar */
.popwd-panel {
  overflow: hidden;
  background:
    radial-gradient(circle at 18% -8%, rgba(111, 220, 255, .13), transparent 38%),
    linear-gradient(180deg, #0d1829 0%, #08111f 100%);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 28px;
  box-shadow: 0 28px 80px rgba(3, 11, 24, .34);
  color: var(--text-on-dark);
}

.popwd-panel h2,
.popwd-panel h3,
.popwd-panel label,
.popwd-panel .popwd-switch-label,
.popwd-panel .popwd-muted,
.popwd-panel .popwd-layer-num {
  color: inherit;
}

.popwd-panel h3,
.popwd-panel-block[data-panel="2"] h3 {
  margin: 15px 0 8px;
  color: #93a3ba;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.popwd-panel label {
  color: #eef5ff;
}

/* Step navigation still readable inside dark panel */
.popwd-steps button {
  background: rgba(255,255,255,.07);
  color: #aebdd0;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 14px;
}

.popwd-steps button b {
  color: #7edfff;
}

.popwd-steps .active {
  background: linear-gradient(135deg, #1d7fff 0%, #0b5ed7 100%);
  color: #fff;
  border-color: rgba(126,223,255,.32);
}

/* Panel 2 editor: full dark shell, soft cards */
.popwd-panel-block[data-panel="2"] {
  --editor-bg: transparent;
  --editor-bg-soft: rgba(255,255,255,.065);
  --editor-line: rgba(255,255,255,.09);
  --editor-text: #f4f8ff;
  --editor-muted: #93a3ba;
  --editor-accent: #6fdcff;
  --editor-btn: rgba(255,255,255,.09);
  --editor-btn-hover: rgba(255,255,255,.14);
  --editor-blue: #6fdcff;
  color: var(--editor-text);
}

.popwd-panel-block[data-panel="2"] > h2 {
  display: none;
}

.popwd-panel-block[data-panel="2"] .popwd-tab-bar {
  display: flex;
  align-items: stretch;
  width: calc(100% + 36px);
  margin: -18px -18px 16px;
  padding: 0;
  gap: 0;
  flex-wrap: nowrap;
  overflow: hidden;
  background: rgba(5, 12, 24, .58);
  border-bottom: 1px solid rgba(255,255,255,.08);
  border-radius: 0;
}

.popwd-panel-block[data-panel="2"] .popwd-tab-button {
  flex: 1 1 0;
  min-width: 0;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #8f9fb4;
  box-shadow: none;
  outline: 0;
  padding: 13px 8px 11px;
  cursor: pointer;
  position: relative;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  transition: color .18s ease, background .18s ease;
}

.popwd-panel-block[data-panel="2"] .popwd-tab-button:hover {
  color: #eef7ff;
  background: rgba(255,255,255,.04);
}

.popwd-panel-block[data-panel="2"] .popwd-tab-button.active {
  color: #8fe9ff;
  background: rgba(111,220,255,.045);
}

.popwd-panel-block[data-panel="2"] .popwd-tab-button.active::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 0;
  height: 2px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(90deg, #37bfff, #8fe9ff);
}

.popwd-panel-block[data-panel="2"] .popwd-tab-panel {
  display: none;
}

.popwd-panel-block[data-panel="2"] .popwd-tab-panel.active {
  display: block;
}

.popwd-panel-block[data-panel="2"] .popwd-upload {
  min-height: 118px;
  border: 1px dashed rgba(143,233,255,.35);
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 0%, rgba(111,220,255,.12), transparent 48%),
    rgba(255,255,255,.055);
  color: #b9f2ff !important;
  font-size: 13px;
  line-height: 1.55;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

/* Tool buttons: less aggressive, consistent, visible */
.popwd-panel-block[data-panel="2"] .popwd-tools {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.popwd-panel-block[data-panel="2"] .popwd-tools button {
  width: 27px;
  min-width: 27px;
  height: 27px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(255,255,255,.13), rgba(255,255,255,.075));
  color: #f4f8ff;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 5px 14px rgba(0,0,0,.20), inset 0 1px 0 rgba(255,255,255,.04);
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}

.popwd-panel-block[data-panel="2"] .popwd-tools button:hover {
  background: linear-gradient(180deg, rgba(111,220,255,.22), rgba(255,255,255,.095));
  border-color: rgba(111,220,255,.25);
  transform: translateY(-1px);
}

.popwd-panel-block[data-panel="2"] .popwd-tools .danger {
  background: linear-gradient(180deg, rgba(255,255,255,.13), rgba(255,255,255,.075));
  color: #f4f8ff;
}

/* Cards and form blocks */
.popwd-panel-block[data-panel="2"] .popwd-text-editor,
.popwd-panel-block[data-panel="2"] .popwd-tab-placeholder {
  background: rgba(255,255,255,.065);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 13px;
  color: #f4f8ff;
  padding: 11px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

.popwd-panel-block[data-panel="2"] .popwd-text-editor h3 {
  margin-top: 2px;
}

.popwd-panel-block[data-panel="2"] input,
.popwd-panel-block[data-panel="2"] textarea,
.popwd-panel-block[data-panel="2"] select,
.popwd-panel-block[data-panel="2"] #popwd-text-font {
  background: rgba(5, 12, 24, .62);
  border: 1px solid rgba(255,255,255,.075);
  color: #ffffff;
  border-radius: 11px;
  font-weight: 800;
}

.popwd-panel-block[data-panel="2"] input:focus,
.popwd-panel-block[data-panel="2"] textarea:focus,
.popwd-panel-block[data-panel="2"] select:focus {
  border-color: rgba(111,220,255,.52);
  box-shadow: 0 0 0 3px rgba(111,220,255,.12);
}

.popwd-panel-block[data-panel="2"] input[type="color"] {
  height: 36px;
  padding: 4px;
  border-radius: 10px;
}

.popwd-panel-block[data-panel="2"] .popwd-font-preview {
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.08);
  color: #dce9f8;
  box-shadow: none;
}

/* Switch rows: balanced and not too loud */
.popwd-panel-block[data-panel="2"] .popwd-switch {
  width: 100%;
  min-height: 34px;
  margin: 7px 0;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(255,255,255,.065);
  border: 1px solid rgba(255,255,255,.08);
  display: flex !important;
  align-items: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}

.popwd-panel-block[data-panel="2"] .popwd-switch-label {
  color: #eef5ff;
  font-size: 12px;
  font-weight: 800;
  order: 1;
}

.popwd-panel-block[data-panel="2"] .popwd-switch-track {
  width: 38px;
  height: 21px;
  margin-left: auto;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.06);
  order: 2;
}

.popwd-panel-block[data-panel="2"] .popwd-switch-thumb {
  left: auto;
  right: 22px;
  top: 50%;
  width: 17px;
  height: 17px;
  transform: translateY(-50%);
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.26);
  order: 3;
}

.popwd-panel-block[data-panel="2"] .popwd-switch input:checked + .popwd-switch-track {
  background: linear-gradient(135deg, #ff9f1c, #ff8a00);
  border-color: rgba(255,255,255,.16);
}

.popwd-panel-block[data-panel="2"] .popwd-switch input:checked + .popwd-switch-track + .popwd-switch-thumb {
  transform: translate(18px, -50%);
}

/* Layers */
.popwd-panel-block[data-panel="2"] .popwd-layers {
  gap: 8px;
}

.popwd-panel-block[data-panel="2"] .popwd-layer {
  background: rgba(255,255,255,.065);
  border: 1px solid rgba(255,255,255,.08);
  color: #eef5ff;
  border-radius: 10px;
  padding: 9px 10px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}

.popwd-panel-block[data-panel="2"] .popwd-layer:hover {
  background: rgba(255,255,255,.095);
}

.popwd-panel-block[data-panel="2"] .popwd-layer.active {
  background: linear-gradient(135deg, #8fe9ff 0%, #3caaf0 100%);
  border-color: rgba(143,233,255,.45);
  color: #071426;
  box-shadow: 0 10px 24px rgba(60,170,240,.22);
}

.popwd-panel-block[data-panel="2"] .popwd-layer.active .popwd-layer-num,
.popwd-panel-block[data-panel="2"] .popwd-layer.active .popwd-layer-label {
  color: #071426;
}

.popwd-panel-block[data-panel="2"] .popwd-muted {
  color: #9aaabe;
}

/* Other dark-panel components */
.popwd-panel .popwd-choice-grid button,
.popwd-panel .popwd-tools button,
.popwd-panel .popwd-layer,
.popwd-panel .popwd-hints span,
.popwd-panel .popwd-keyboard-shortcuts span {
  background: rgba(255,255,255,.075);
  color: #eef5ff;
  border: 1px solid rgba(255,255,255,.08);
}

.popwd-panel .popwd-choice-grid button:hover,
.popwd-panel .popwd-layer:hover {
  background: rgba(255,255,255,.11);
}

.popwd-panel .popwd-choice-grid .active,
.popwd-panel .popwd-layer.active {
  background: linear-gradient(135deg, #8fe9ff 0%, #3caaf0 100%);
  color: #071426;
}

.popwd-panel input,
.popwd-panel textarea,
.popwd-panel select {
  background: rgba(5, 12, 24, .62);
  border-color: rgba(255,255,255,.085);
  color: #fff;
}

.popwd-summary {
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.08);
  color: #dbe7f5;
}

.popwd-tooltip {
  background: rgba(5, 12, 24, .96);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 18px 42px rgba(0,0,0,.32);
}

.popwd-tooltip::after {
  border-color: rgba(5, 12, 24, .96) transparent transparent transparent;
}

/* Keep wall/stage controls visible but not too bright */
.popwd-work {
  border-color: rgba(11, 94, 215, .42);
}

.popwd-snap-line-x {
  border-top-color: rgba(11, 94, 215, .82);
}

.popwd-snap-line-y {
  border-left-color: rgba(11, 94, 215, .82);
}

.popwd-item.selected {
  outline-color: rgba(111, 220, 255, .78);
}

.popwd-resize-dot,
.popwd-rotate-handle {
  border-color: rgba(11, 94, 215, .48);
}

@media (max-width: 640px) {
  .popwd-panel {
    border-radius: 22px;
  }

  .popwd-panel-block[data-panel="2"] .popwd-tab-bar {
    width: calc(100% + 28px);
    margin: -14px -14px 14px;
  }

  .popwd-panel-block[data-panel="2"] .popwd-tab-button {
    font-size: 11px;
    padding-inline: 5px;
  }
}

/* =========================================================
   Final UI polish: switch, buttons, upload centering
   ========================================================= */

/* Upload zona: tekst tačno u centru, bez bežanja gore */
.popwd-panel-block[data-panel="2"] .popwd-upload {
  min-height: 108px;
  padding: 18px 16px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  line-height: 1.45;
  letter-spacing: -.01em;
  border-radius: 14px;
  color: #b9f1ff !important;
  background:
    linear-gradient(180deg, rgba(15, 32, 52, .96), rgba(12, 27, 45, .96));
  border: 1px dashed rgba(123, 214, 246, .46);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.035),
    0 10px 26px rgba(2, 8, 18, .16);
}

.popwd-panel-block[data-panel="2"] .popwd-upload br {
  line-height: 1.8;
}

/* Tool dugmići: malo veći, čitljiviji i prijatniji za klik */
.popwd-panel-block[data-panel="2"] .popwd-tools {
  gap: 7px;
}

.popwd-panel-block[data-panel="2"] .popwd-tools button {
  width: 30px;
  min-width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.13), rgba(255,255,255,.075));
  border: 1px solid rgba(255,255,255,.10);
  color: #f3f8ff;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.055),
    0 5px 13px rgba(0,0,0,.18);
}

.popwd-panel-block[data-panel="2"] .popwd-tools button:hover {
  background: linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,.10));
  border-color: rgba(139, 226, 255, .22);
  transform: translateY(-1px);
}

/* Switch redovi: stabilna pozicija thumb-a, bez presecanja/iskakanja */
.popwd-panel-block[data-panel="2"] .popwd-switch {
  position: relative;
  min-height: 38px;
  padding: 7px 10px;
  overflow: hidden;
  border-radius: 11px;
}

.popwd-panel-block[data-panel="2"] .popwd-switch-track {
  width: 46px;
  height: 24px;
  margin-left: auto;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: inset 0 2px 5px rgba(0,0,0,.20);
}

.popwd-panel-block[data-panel="2"] .popwd-switch-thumb {
  position: absolute;
  right: 32px;
  top: 50%;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  background: #f8fbff;
  box-shadow:
    0 2px 8px rgba(0,0,0,.26),
    inset 0 1px 0 rgba(255,255,255,.8);
}

.popwd-panel-block[data-panel="2"] .popwd-switch input:checked + .popwd-switch-track {
  background: linear-gradient(135deg, #5dd7ff 0%, #0b7ce3 100%);
  border-color: rgba(125, 226, 255, .55);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.20),
    0 0 0 3px rgba(93, 215, 255, .10);
}

.popwd-panel-block[data-panel="2"] .popwd-switch input:checked + .popwd-switch-track + .popwd-switch-thumb {
  right: 12px;
  transform: translateY(-50%);
}

.popwd-panel-block[data-panel="2"] .popwd-switch-label {
  max-width: calc(100% - 60px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .popwd-panel-block[data-panel="2"] .popwd-tools button {
    width: 32px;
    min-width: 32px;
    height: 32px;
  }

  .popwd-panel-block[data-panel="2"] .popwd-upload {
    min-height: 112px;
  }
}

/* =========================================================
   Premium editor buttons: veći touch target + click animacija
   + aktivno stanje za Bold / Italic
   ========================================================= */

.popwd-panel-block[data-panel="2"] .popwd-tools {
  gap: 8px;
}

.popwd-panel-block[data-panel="2"] .popwd-tools button {
  width: 34px;
  min-width: 34px;
  height: 34px;
  border-radius: 9px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(180deg, rgba(49, 67, 91, .98), rgba(27, 39, 57, .98));
  border: 1px solid rgba(255, 255, 255, .10);
  color: #f2f7ff;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.08),
    0 7px 14px rgba(0, 0, 0, .18);
  transition:
    transform .12s ease,
    box-shadow .16s ease,
    background .18s ease,
    border-color .18s ease,
    color .18s ease;
}

.popwd-panel-block[data-panel="2"] .popwd-tools button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(125, 226, 255, .32), transparent 58%);
  opacity: 0;
  transform: scale(.35);
  transition: opacity .18s ease, transform .18s ease;
  z-index: -1;
}

.popwd-panel-block[data-panel="2"] .popwd-tools button:hover {
  background: linear-gradient(180deg, rgba(59, 80, 109, .98), rgba(32, 48, 70, .98));
  border-color: rgba(125, 226, 255, .24);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.10),
    0 10px 20px rgba(0, 0, 0, .22);
  transform: translateY(-1px);
}

.popwd-panel-block[data-panel="2"] .popwd-tools button:active {
  transform: translateY(1px) scale(.94);
  box-shadow:
    inset 0 2px 8px rgba(0, 0, 0, .34),
    0 3px 8px rgba(0, 0, 0, .18);
}

.popwd-panel-block[data-panel="2"] .popwd-tools button:active::after {
  opacity: 1;
  transform: scale(1.35);
}

.popwd-panel-block[data-panel="2"] .popwd-tools button:focus-visible {
  outline: 0;
  border-color: rgba(125, 226, 255, .7);
  box-shadow:
    0 0 0 3px rgba(125, 226, 255, .16),
    inset 0 1px 0 rgba(255,255,255,.10),
    0 10px 20px rgba(0, 0, 0, .22);
}

/* Plavkasti alatni dugmići: layer/align akcije ostaju jasne, ali ne prejake */
.popwd-panel-block[data-panel="2"] .popwd-tools button[data-action*="align"],
.popwd-panel-block[data-panel="2"] .popwd-tools button[data-action="front"],
.popwd-panel-block[data-panel="2"] .popwd-tools button[data-action="forward"],
.popwd-panel-block[data-panel="2"] .popwd-tools button[data-action="backward"],
.popwd-panel-block[data-panel="2"] .popwd-tools button[data-action="back"],
.popwd-panel-block[data-panel="2"] .popwd-tools button[data-action="flip-y"] {
  background: linear-gradient(180deg, #2b6796, #214c76);
  border-color: rgba(125, 226, 255, .18);
}

.popwd-panel-block[data-panel="2"] .popwd-tools button[data-action*="align"]:hover,
.popwd-panel-block[data-panel="2"] .popwd-tools button[data-action="front"]:hover,
.popwd-panel-block[data-panel="2"] .popwd-tools button[data-action="forward"]:hover,
.popwd-panel-block[data-panel="2"] .popwd-tools button[data-action="backward"]:hover,
.popwd-panel-block[data-panel="2"] .popwd-tools button[data-action="back"]:hover,
.popwd-panel-block[data-panel="2"] .popwd-tools button[data-action="flip-y"]:hover {
  background: linear-gradient(180deg, #347aae, #265987);
}

/* Tekst editor dugmići B / I */
.popwd-panel-block[data-panel="2"] .popwd-text-editor .popwd-tools button,
.popwd-panel-block[data-panel="2"] #popwd-text-bold,
.popwd-panel-block[data-panel="2"] #popwd-text-italic {
  width: 34px;
  min-width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(61, 76, 99, .95), rgba(38, 50, 70, .95));
  color: #dfe9f7;
}

/* Aktivno stanje: radi sa .active, .is-active ili aria-pressed="true" */
.popwd-panel-block[data-panel="2"] #popwd-text-bold.active,
.popwd-panel-block[data-panel="2"] #popwd-text-italic.active,
.popwd-panel-block[data-panel="2"] #popwd-text-bold.is-active,
.popwd-panel-block[data-panel="2"] #popwd-text-italic.is-active,
.popwd-panel-block[data-panel="2"] #popwd-text-bold[aria-pressed="true"],
.popwd-panel-block[data-panel="2"] #popwd-text-italic[aria-pressed="true"],
.popwd-panel-block[data-panel="2"] .popwd-text-editor .popwd-tools button.active,
.popwd-panel-block[data-panel="2"] .popwd-text-editor .popwd-tools button.is-active,
.popwd-panel-block[data-panel="2"] .popwd-text-editor .popwd-tools button[aria-pressed="true"] {
  background: linear-gradient(135deg, #7de2ff 0%, #2d9fee 100%);
  border-color: rgba(180, 244, 255, .72);
  color: #071827;
  box-shadow:
    0 0 0 1px rgba(125, 226, 255, .22),
    0 9px 20px rgba(45, 159, 238, .28),
    inset 0 1px 0 rgba(255,255,255,.34);
}

.popwd-panel-block[data-panel="2"] #popwd-text-bold.active::after,
.popwd-panel-block[data-panel="2"] #popwd-text-italic.active::after,
.popwd-panel-block[data-panel="2"] #popwd-text-bold.is-active::after,
.popwd-panel-block[data-panel="2"] #popwd-text-italic.is-active::after,
.popwd-panel-block[data-panel="2"] #popwd-text-bold[aria-pressed="true"]::after,
.popwd-panel-block[data-panel="2"] #popwd-text-italic[aria-pressed="true"]::after,
.popwd-panel-block[data-panel="2"] .popwd-text-editor .popwd-tools button.active::after,
.popwd-panel-block[data-panel="2"] .popwd-text-editor .popwd-tools button.is-active::after,
.popwd-panel-block[data-panel="2"] .popwd-text-editor .popwd-tools button[aria-pressed="true"]::after {
  opacity: .35;
  transform: scale(1);
}

.popwd-panel-block[data-panel="2"] #popwd-text-bold.active:hover,
.popwd-panel-block[data-panel="2"] #popwd-text-italic.active:hover,
.popwd-panel-block[data-panel="2"] #popwd-text-bold.is-active:hover,
.popwd-panel-block[data-panel="2"] #popwd-text-italic.is-active:hover,
.popwd-panel-block[data-panel="2"] #popwd-text-bold[aria-pressed="true"]:hover,
.popwd-panel-block[data-panel="2"] #popwd-text-italic[aria-pressed="true"]:hover {
  background: linear-gradient(135deg, #93e9ff 0%, #39aaf4 100%);
}

@media (max-width: 640px) {
  .popwd-panel-block[data-panel="2"] .popwd-tools button,
  .popwd-panel-block[data-panel="2"] .popwd-text-editor .popwd-tools button,
  .popwd-panel-block[data-panel="2"] #popwd-text-bold,
  .popwd-panel-block[data-panel="2"] #popwd-text-italic {
    width: 38px;
    min-width: 38px;
    height: 38px;
  }
}


/* =========================================================
   Ramovi za slike - presetovi + kontrole
   ========================================================= */

.popwd-frame {
  width: 100%;
  height: 100%;
  padding: var(--frame-padding, 0px);
  border: var(--frame-size, 0px) solid var(--frame-color, transparent);
  border-radius: var(--frame-radius, 2px);
  background: var(--frame-mat, transparent);
  box-shadow: var(--frame-shadow, none);
  overflow: hidden;
}

.popwd-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: max(0px, calc(var(--frame-radius, 2px) - var(--frame-size, 0px)));
  box-shadow: none;
  user-select: none;
  pointer-events: none;
}

.popwd-frame-panel {
  display: grid;
  gap: 12px;
}

.popwd-frame-help {
  font-size: 12px;
  line-height: 1.55;
  margin: 0 0 4px;
}

.popwd-frame-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.popwd-frame-grid button {
  min-height: 74px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.065), rgba(255,255,255,.035));
  color: #eaf3ff;
  cursor: pointer;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px;
  text-align: left;
  transition: transform .14s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.popwd-frame-grid button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(125, 226, 255, .28);
  background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.045));
}

.popwd-frame-grid button.active {
  border-color: rgba(125, 226, 255, .62);
  background: linear-gradient(135deg, rgba(125, 226, 255, .18), rgba(45, 159, 238, .14));
  box-shadow: 0 0 0 3px rgba(125, 226, 255, .08);
}

.popwd-frame-grid button:disabled,
.popwd-frame-controls input:disabled,
.popwd-frame-reset:disabled {
  opacity: .42;
  cursor: not-allowed;
}

.popwd-frame-grid b {
  font-size: 12px;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
}

.popwd-frame-swatch {
  width: 42px;
  height: 42px;
  border-radius: 9px;
  display: block;
  background: #253249;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.10), 0 8px 18px rgba(0,0,0,.22);
}

.popwd-frame-swatch::after {
  content: "";
  position: absolute;
  inset: 11px;
  border-radius: 3px;
  background: linear-gradient(135deg, #8fe9ff, #d9f5ff);
}

.popwd-frame-swatch.none {
  background: rgba(255,255,255,.06);
}
.popwd-frame-swatch.none::after {
  inset: 8px;
}
.popwd-frame-swatch.thin-black { background: #080d18; }
.popwd-frame-swatch.thin-white { background: #ffffff; }
.popwd-frame-swatch.thin-white::after { background: #9bdcf8; }
.popwd-frame-swatch.gallery { background: #111827; box-shadow: inset 0 0 0 4px #fff, 0 8px 18px rgba(0,0,0,.22); }
.popwd-frame-swatch.oak { background: linear-gradient(135deg, #d6a15f, #8c552b); }
.popwd-frame-swatch.walnut { background: linear-gradient(135deg, #754521, #2b160d); }
.popwd-frame-swatch.gold { background: linear-gradient(135deg, #f6df8c, #a77a1f); }
.popwd-frame-swatch.floating { background: #f8fbff; box-shadow: 0 12px 22px rgba(0,0,0,.26); }
.popwd-frame-swatch.poster { background: #e5e7eb; }
.popwd-frame-swatch.premium-black { background: linear-gradient(135deg, #0b1020, #020617); }

.popwd-frame-controls {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.085);
}

.popwd-frame-controls label {
  margin: 8px 0;
  font-size: 12px;
}

.popwd-frame-controls input[type="range"] {
  accent-color: #5dd7ff;
}

.popwd-frame-reset {
  margin-top: 10px;
  min-height: 38px;
}

@media (max-width: 640px) {
  .popwd-frame-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   Focus image editor overlay
   Selektovana slika ostaje vidljiva, ostatak se zatamni
   ========================================================= */
.popwd-selected-edit-btn {
  position: fixed;
  z-index: 9998;
  transform: translate(-50%, -100%);
  border: 1px solid rgba(142, 233, 255, .45);
  border-radius: 999px;
  background: linear-gradient(135deg, #7de7ff 0%, #0b7ce3 100%);
  color: #061426;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .01em;
  cursor: pointer;
  box-shadow: 0 14px 32px rgba(3, 17, 38, .26), 0 0 0 4px rgba(125, 226, 255, .12);
  transition: transform .16s ease, box-shadow .18s ease, filter .18s ease;
}

.popwd-selected-edit-btn:hover {
  transform: translate(-50%, -104%);
  filter: brightness(1.04);
  box-shadow: 0 18px 40px rgba(3, 17, 38, .32), 0 0 0 5px rgba(125, 226, 255, .16);
}

.popwd-selected-edit-btn:active {
  transform: translate(-50%, -96%) scale(.97);
}

.popwd-selected-edit-btn[hidden],
.popwd-image-edit-overlay[hidden] {
  display: none !important;
}

.popwd-image-edit-overlay {
  position: fixed;
  inset: 0;
  z-index: 9990;
  pointer-events: none;
}

.popwd-image-edit-overlay.open {
  pointer-events: auto;
}

.popwd-image-edit-dim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 48% 45%, rgba(13, 34, 62, .35), rgba(2, 8, 20, .76) 54%, rgba(2, 8, 20, .88) 100%);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  opacity: 0;
  transition: opacity .2s ease;
}

.popwd-image-edit-overlay.open .popwd-image-edit-dim {
  opacity: 1;
}

.popwd.popwd-image-editing .popwd-stage-card,
.popwd.popwd-image-editing .popwd-panel,
.popwd.popwd-image-editing .popwd-hero {
  transition: filter .2s ease;
}

.popwd.popwd-image-editing .popwd-item:not(.popwd-edit-focus) {
  filter: saturate(.65) brightness(.72);
}

.popwd.popwd-image-editing .popwd-item.popwd-edit-focus {
  z-index: 10001 !important;
  outline: 2px solid rgba(125, 226, 255, .92);
  outline-offset: 6px;
  box-shadow: 0 0 0 9999px rgba(2, 8, 20, .04), 0 28px 80px rgba(0, 0, 0, .38);
}

.popwd-image-edit-panel {
  position: absolute;
  top: 50%;
  right: clamp(18px, 5vw, 72px);
  width: min(430px, calc(100vw - 36px));
  max-height: min(760px, calc(100vh - 36px));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 26px;
  border: 1px solid rgba(255,255,255,.13);
  background:
    linear-gradient(180deg, rgba(17, 31, 51, .96), rgba(8, 18, 33, .98));
  box-shadow: 0 36px 120px rgba(0, 0, 0, .48), inset 0 1px 0 rgba(255,255,255,.06);
  transform: translate(22px, -50%) scale(.985);
  opacity: 0;
  transition: opacity .2s ease, transform .22s cubic-bezier(.2,.8,.2,1);
}

.popwd-image-edit-overlay.open .popwd-image-edit-panel {
  opacity: 1;
  transform: translate(0, -50%) scale(1);
}

.popwd-image-edit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.popwd-image-edit-head span {
  display: block;
  color: #7de7ff;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .11em;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.popwd-image-edit-head strong {
  display: block;
  color: #f3f9ff;
  font-size: 20px;
  letter-spacing: -.03em;
}

.popwd-image-edit-close {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  color: #dcecff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: transform .14s ease, background .18s ease;
}

.popwd-image-edit-close:hover {
  background: rgba(255,255,255,.1);
}

.popwd-image-edit-close:active {
  transform: scale(.94);
}

.popwd-image-edit-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 10px;
  gap: 8px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.popwd-image-edit-tabs button {
  height: 36px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  background: rgba(255,255,255,.045);
  color: #91a8c2;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, transform .14s ease, border-color .18s ease;
}

.popwd-image-edit-tabs button:hover {
  color: #fff;
  background: rgba(255,255,255,.075);
}

.popwd-image-edit-tabs button.active {
  color: #061426;
  border-color: rgba(125,226,255,.55);
  background: linear-gradient(135deg, #7de7ff, #36aef4);
  box-shadow: 0 10px 22px rgba(24, 174, 244, .18);
}

.popwd-image-edit-tabs button:active,
.popwd-edit-actions button:active,
.popwd-edit-secondary:active {
  transform: scale(.97);
}

.popwd-image-edit-body {
  padding: 14px;
  overflow: auto;
}

.popwd-image-edit-tab {
  display: none;
}

.popwd-image-edit-tab.active {
  display: block;
  animation: popwdEditFade .18s ease;
}

@keyframes popwdEditFade {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}

.popwd-edit-frame-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 12px;
}

.popwd-edit-control-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.09);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

.popwd-edit-control-card label {
  margin: 0;
  color: #dcecff;
  font-size: 12px;
  font-weight: 900;
}

.popwd-edit-control-card input[type="range"] {
  width: 100%;
  height: 4px;
  padding: 0;
  margin-top: 9px;
  accent-color: #5dd7ff;
}

.popwd-edit-control-card input[type="color"] {
  height: 40px;
  width: 100%;
  margin-top: 7px;
  padding: 3px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.09);
  background: #101928;
}

.popwd-edit-control-card select {
  width: 100%;
  min-height: 42px;
  margin-top: 8px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.09);
  background: #101928;
  color: #f3f9ff;
  padding: 0 12px;
  font-weight: 800;
}

.popwd-edit-color-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.popwd-edit-secondary,
.popwd-edit-actions button {
  min-height: 42px;
  border: 1px solid rgba(125,226,255,.18);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.085), rgba(255,255,255,.045));
  color: #f4f9ff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 950;
  transition: background .18s ease, transform .14s ease, border-color .18s ease;
}

.popwd-edit-secondary:hover,
.popwd-edit-actions button:hover {
  border-color: rgba(125,226,255,.36);
  background: linear-gradient(180deg, rgba(125,226,255,.14), rgba(255,255,255,.06));
}

.popwd-edit-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.popwd-frame img,
.popwd-item img {
  transition: filter .18s ease, opacity .18s ease, object-fit .18s ease;
}

@media (max-width: 900px) {
  .popwd-image-edit-panel {
    left: 18px;
    right: 18px;
    top: auto;
    bottom: 18px;
    width: auto;
    max-height: 72vh;
    transform: translateY(22px) scale(.985);
  }

  .popwd-image-edit-overlay.open .popwd-image-edit-panel {
    transform: translateY(0) scale(1);
  }
}

/* =========================================================
   Image editor UX fixes: smaller edit button, visible focus,
   image-first workflow, crop tools, better bg remove controls
   ========================================================= */
.popwd-selected-edit-btn {
  transform: none !important;
  padding: 5px 9px !important;
  min-height: 26px !important;
  border-radius: 9px !important;
  font-size: 10px !important;
  line-height: 1 !important;
  letter-spacing: .02em !important;
  box-shadow: 0 8px 18px rgba(3, 17, 38, .22), 0 0 0 3px rgba(125, 226, 255, .09) !important;
}

.popwd-selected-edit-btn:hover {
  transform: translateY(-1px) !important;
}

.popwd-selected-edit-btn:active {
  transform: translateY(1px) scale(.96) !important;
}

.popwd-image-edit-dim {
  background: rgba(2, 8, 20, .40) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.popwd.popwd-image-editing .popwd-panel,
.popwd.popwd-image-editing .popwd-hero,
.popwd.popwd-image-editing .popwd-toolbar,
.popwd.popwd-image-editing .popwd-hints {
  filter: brightness(.72) saturate(.75) !important;
}

.popwd.popwd-image-editing .popwd-stage-card {
  position: relative;
  z-index: 9996;
  filter: none !important;
}

.popwd.popwd-image-editing .popwd-canvas-outer {
  background: linear-gradient(135deg, rgba(238,244,251,.62), rgba(255,255,255,.8));
}

.popwd.popwd-image-editing .popwd-item:not(.popwd-edit-focus) {
  filter: saturate(.45) brightness(.58) blur(.4px) !important;
  opacity: .55;
}

.popwd.popwd-image-editing .popwd-item.popwd-edit-focus {
  z-index: 9999 !important;
  filter: none !important;
  opacity: 1 !important;
  outline: 2px solid rgba(125, 226, 255, .95) !important;
  outline-offset: 8px !important;
  box-shadow: 0 26px 90px rgba(0, 0, 0, .42), 0 0 0 9999px rgba(2, 8, 20, .015) !important;
}

.popwd-image-edit-overlay {
  z-index: 9990 !important;
}

.popwd-image-edit-panel {
  z-index: 10020;
  width: min(440px, calc(100vw - 36px)) !important;
}

.popwd-image-edit-tabs {
  grid-template-columns: repeat(3, 1fr) !important;
}

.popwd-edit-actions.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.popwd-edit-note {
  margin: -4px 0 0 !important;
  color: #8fa7c3 !important;
  font-size: 11px !important;
  line-height: 1.45 !important;
  font-weight: 700 !important;
}

.popwd-frame {
  overflow: hidden;
}

.popwd-frame img,
.popwd-item img {
  transform-origin: center center;
  will-change: filter, opacity, object-position, transform;
}

#popwd-img-bg-remove {
  border-color: rgba(125,226,255,.34);
  background: linear-gradient(135deg, rgba(125,226,255,.18), rgba(255,255,255,.06));
}

#popwd-img-bg-restore {
  color: #cde4ff;
}

/* Keep selected image visually clear while edit panel is open. Dimming is handled on surrounding UI/items. */
.popwd-image-edit-overlay {
  z-index: 10010 !important;
}

.popwd-image-edit-dim {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.popwd-image-edit-panel {
  position: absolute;
  z-index: 2;
}

/* =========================================================
   Image editor v3: darker focus, layer edit button, manual crop
   ========================================================= */
.popwd-layer {
  position: relative;
}

.popwd-layer-edit {
  flex: 0 0 auto;
  margin-left: auto;
  min-width: 42px;
  height: 24px;
  padding: 0 9px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(125, 226, 255, .22);
  background: linear-gradient(135deg, rgba(125,226,255,.16), rgba(255,255,255,.06));
  color: #9feaff;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .02em;
  cursor: pointer;
  transition: transform .14s ease, background .18s ease, border-color .18s ease, color .18s ease;
}

.popwd-layer-edit:hover,
.popwd-layer-edit:focus-visible {
  color: #061426;
  border-color: rgba(125, 226, 255, .55);
  background: linear-gradient(135deg, #7de7ff, #2fa8ee);
  outline: none;
}

.popwd-layer-edit:active {
  transform: scale(.94);
}

.popwd-selected-edit-btn {
  display: none !important;
}

.popwd-image-edit-overlay {
  z-index: 10000 !important;
  pointer-events: none;
}

.popwd-image-edit-overlay.open {
  pointer-events: auto;
}

.popwd-image-edit-dim {
  z-index: 0 !important;
  background: rgba(1, 6, 16, .78) !important;
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
}

.popwd-image-edit-overlay.open .popwd-image-edit-dim {
  opacity: 1 !important;
}

.popwd-image-edit-spotlight {
  position: fixed;
  z-index: 1;
  pointer-events: none;
  transform-origin: center center;
  filter: none !important;
  opacity: 1 !important;
  animation: popwdSpotlightIn .18s ease both;
}

.popwd-image-edit-spotlight::after {
  content: "";
  position: absolute;
  inset: -10px;
  border: 2px solid rgba(125, 226, 255, .95);
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.16), 0 28px 90px rgba(0,0,0,.55), 0 0 44px rgba(93,215,255,.22);
  pointer-events: none;
}

.popwd-spotlight-frame {
  width: 100%;
  height: 100%;
}

.popwd-spotlight-frame img {
  display: block;
  width: 100%;
  height: 100%;
  user-select: none;
  pointer-events: none;
}

@keyframes popwdSpotlightIn {
  from { opacity: 0; transform: scale(.985); }
  to { opacity: 1; }
}

.popwd.popwd-image-editing .popwd-panel,
.popwd.popwd-image-editing .popwd-hero,
.popwd.popwd-image-editing .popwd-toolbar,
.popwd.popwd-image-editing .popwd-stage-card {
  filter: brightness(.38) saturate(.55) !important;
}

.popwd.popwd-image-editing .popwd-item.popwd-edit-focus {
  filter: none !important;
}

.popwd-image-edit-panel {
  z-index: 2 !important;
  width: min(460px, calc(100vw - 36px)) !important;
}

.popwd-crop-work {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(125,226,255,.22);
  background:
    linear-gradient(45deg, rgba(255,255,255,.07) 25%, transparent 25% 75%, rgba(255,255,255,.07) 75%),
    linear-gradient(45deg, rgba(255,255,255,.07) 25%, transparent 25% 75%, rgba(255,255,255,.07) 75%),
    #111a29;
  background-position: 0 0, 10px 10px, 0 0;
  background-size: 20px 20px, 20px 20px, auto;
  cursor: grab;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 18px 46px rgba(0,0,0,.22);
}

.popwd-crop-work.dragging {
  cursor: grabbing;
  border-color: rgba(125,226,255,.55);
}

.popwd-crop-work.picking-bg {
  cursor: crosshair;
  border-color: rgba(255, 210, 102, .85);
  box-shadow: inset 0 0 0 2px rgba(255, 210, 102, .18), 0 18px 46px rgba(0,0,0,.22);
}

#popwd-crop-preview {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform-origin: center center;
  user-select: none;
  pointer-events: none;
  transition: filter .18s ease, opacity .18s ease, transform .12s ease, object-position .12s ease;
}

.popwd-crop-gridline {
  position: absolute;
  pointer-events: none;
  background: rgba(255,255,255,.38);
  opacity: .55;
}

.popwd-crop-gridline.v1,
.popwd-crop-gridline.v2 {
  top: 0;
  bottom: 0;
  width: 1px;
}

.popwd-crop-gridline.v1 { left: 33.333%; }
.popwd-crop-gridline.v2 { left: 66.666%; }

.popwd-crop-gridline.h1,
.popwd-crop-gridline.h2 {
  left: 0;
  right: 0;
  height: 1px;
}

.popwd-crop-gridline.h1 { top: 33.333%; }
.popwd-crop-gridline.h2 { top: 66.666%; }

.popwd-edit-actions.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.popwd-crop-zoom-range {
  margin-top: -4px !important;
}

#popwd-img-bg-remove {
  border-color: rgba(255, 210, 102, .34) !important;
  background: linear-gradient(135deg, rgba(255,210,102,.18), rgba(125,226,255,.08)) !important;
}

#popwd-img-bg-remove:hover {
  border-color: rgba(255, 210, 102, .62) !important;
  background: linear-gradient(135deg, rgba(255,210,102,.28), rgba(125,226,255,.12)) !important;
}

@media (max-width: 900px) {
  .popwd-image-edit-spotlight {
    display: none;
  }

  .popwd.popwd-image-editing .popwd-stage-card {
    filter: brightness(.52) saturate(.65) !important;
  }
}

/* =========================================================
   Image editor v4 fixes: stronger focus + smoother manual crop
   ========================================================= */
.popwd-image-edit-overlay.open .popwd-image-edit-dim {
  background: rgba(0, 4, 12, .88) !important;
  backdrop-filter: blur(8px) saturate(.65) !important;
  -webkit-backdrop-filter: blur(8px) saturate(.65) !important;
}

.popwd.popwd-image-editing .popwd-panel,
.popwd.popwd-image-editing .popwd-hero,
.popwd.popwd-image-editing .popwd-toolbar,
.popwd.popwd-image-editing .popwd-stage-card {
  filter: brightness(.22) saturate(.45) blur(1px) !important;
}

.popwd-image-edit-spotlight {
  z-index: 3 !important;
}

.popwd-image-edit-panel {
  z-index: 4 !important;
}

.popwd-image-edit-spotlight::after {
  inset: -12px !important;
  border-color: rgba(137, 231, 255, .98) !important;
  box-shadow:
    0 0 0 9999px rgba(0, 4, 12, .03),
    0 0 0 1px rgba(255,255,255,.22),
    0 34px 100px rgba(0,0,0,.72),
    0 0 58px rgba(93,215,255,.32) !important;
}

.popwd-crop-work {
  min-height: 220px;
  max-height: 430px;
  touch-action: none;
}

#popwd-crop-preview {
  will-change: transform, object-position;
}

.popwd-crop-work.dragging #popwd-crop-preview {
  transition: filter .18s ease, opacity .18s ease;
}

.popwd-edit-note {
  user-select: none;
}

.popwd-layer-edit {
  min-width: 48px !important;
  height: 26px !important;
  font-size: 10px !important;
}

/* =========================================================
   Zid texture + review wall photo upload
   ========================================================= */
.popwd-wall-texture-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 14px;
}

.popwd-wall-texture-grid button {
  appearance: none;
  border: 1px solid rgba(7, 31, 72, .10);
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(237,247,255,.92));
  color: var(--navy, #071f48);
  border-radius: 14px;
  padding: 10px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 10px 22px rgba(7, 31, 72, .06);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}

.popwd-wall-texture-grid button span {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(7, 91, 211, .08);
  color: var(--blue, #075bd3);
  flex: 0 0 auto;
  font-size: 15px;
}

.popwd-wall-texture-grid button b {
  font-size: 12px;
  line-height: 1.15;
}

.popwd-wall-texture-grid button:hover {
  transform: translateY(-1px);
  border-color: rgba(7, 91, 211, .22);
  box-shadow: 0 14px 28px rgba(7, 31, 72, .10);
}

.popwd-wall-texture-grid button.active {
  background: linear-gradient(135deg, var(--blue, #075bd3), var(--navy, #071f48));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 16px 34px rgba(7, 91, 211, .22);
}

.popwd-wall-texture-grid button.active span {
  background: rgba(255,255,255,.18);
  color: #fff;
}

.popwd-wall.has-wall-photo {
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
}

.popwd-wall.has-wall-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.12);
  pointer-events: none;
  z-index: 0;
}

.popwd-wall.has-wall-photo > * {
  position: relative;
  z-index: 1;
}

.popwd-wall-photo-upload {
  min-height: 112px !important;
  gap: 7px;
  padding: 18px !important;
}

.popwd-wall-photo-upload small {
  display: block;
  margin-top: 5px;
  color: var(--muted, #405c7d);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

@media (max-width: 640px) {
  .popwd-wall-texture-grid {
    grid-template-columns: 1fr;
  }
}


/* Cena rada / putni troškovi - dodat live breakdown */
.popwd-price-breakdown {
  position: relative;
  display: grid;
  gap: 6px;
  margin: 10px 0 14px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.14);
  color: rgba(255,255,255,.88);
  font-size: 13px;
  font-weight: 800;
}

.popwd-price-breakdown span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.popwd-price-breakdown b {
  color: #fff;
  font-weight: 950;
}

.popwd-price-chip-detail {
  display: block;
  margin-top: 6px;
  color: rgba(255,255,255,.78);
  font-size: 11px;
  line-height: 1.45;
  font-weight: 800;
}

.popwd-price-chip-detail em {
  color: #fff;
  font-style: normal;
  font-weight: 950;
}


/* Tekstura zida se više ne prikazuje vizuelno u live preview-u.
   Izbor podloge ostaje samo kao informacija za pregled/admin zahtev. */
.popwd-wall::before {
  background: none !important;
  opacity: 0 !important;
}

/* =========================================================
   Final UX polish: locked preview steps, cleaner price cards,
   wall preview height based on wall size only
   ========================================================= */
.popwd-layout {
  align-items: flex-start !important;
}

.popwd-stage-card {
  align-self: flex-start !important;
  min-height: 0 !important;
  height: auto !important;
}

.popwd-canvas-outer {
  min-height: 0 !important;
  height: auto !important;
  padding: 28px !important;
}

.popwd-editor-locked .popwd-item {
  pointer-events: none !important;
  cursor: default !important;
}

.popwd-editor-locked .popwd-item.selected {
  outline: 0 !important;
}

.popwd-editor-locked .popwd-resize-dot,
.popwd-editor-locked .popwd-rotate-handle,
.popwd-editor-locked .popwd-snap-line,
.popwd-editor-locked .popwd-work {
  display: none !important;
}

.popwd-price-card small {
  display: block;
  margin-bottom: 22px;
  font-size: 13px;
  letter-spacing: .13em;
}

.popwd-price-card strong {
  margin: 18px 0 18px !important;
  font-size: clamp(58px, 5.8vw, 86px) !important;
  line-height: .9;
  letter-spacing: -.045em;
}

.popwd-price-breakdown {
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,.14);
  color: rgba(255,255,255,.82);
  font-size: 13px;
  font-weight: 800;
}

.popwd-price-chip {
  min-width: 190px;
  padding: 14px 18px !important;
  background: linear-gradient(145deg, #081b3d 0%, #0b58bd 100%) !important;
  box-shadow: 0 16px 38px rgba(7, 26, 53, .16);
}

.popwd-price-chip span {
  font-size: 11px;
  letter-spacing: .12em;
}

.popwd-price-chip b {
  margin-top: 4px;
  display: block;
  font-size: 30px !important;
  line-height: 1;
  letter-spacing: -.035em;
}

.popwd-price-chip-detail {
  margin-top: 8px;
  color: rgba(255,255,255,.72);
}

.popwd-panel-block[data-panel="3"] .popwd-summary {
  background: rgba(255,255,255,.065);
  border: 1px solid rgba(255,255,255,.10);
  color: rgba(255,255,255,.90);
}

.popwd-panel-block[data-panel="3"] .popwd-upload {
  min-height: 104px;
  border-color: rgba(106,220,255,.32) !important;
  background: rgba(255,255,255,.045) !important;
}

.popwd-travel-info.is-ok {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(93, 215, 255, .10);
  border: 1px solid rgba(93, 215, 255, .16);
  color: #c9f3ff !important;
}

.popwd-travel-info.is-error {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 80, 80, .10);
  border: 1px solid rgba(255, 80, 80, .20);
  color: #ffd2d2 !important;
}
