.np-shell {
  display: flex;
  height: calc(100vh - 0px);
  overflow: hidden;
  background: #e0e0e0;
}

.np-canvas-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-width: 0;
}

.np-canvas {
  position: relative;
  height: 85vh;
  width: calc(85vh * 9 / 16);
  border-radius: 12px;
  border: 2px solid #6D28D9;
  overflow: hidden;
  background: #ffffff;
  cursor: crosshair;
}

.np-hint {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  pointer-events: none;
  color: #ffffff;
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  transition: opacity 0.2s;
}

.np-sticker-el {
  position: absolute;
  font-size: 48px;
  cursor: move;
  user-select: none;
  line-height: 1;
  touch-action: none;
}

.np-sticker-el.selected-highlight {
  filter: drop-shadow(0 0 4px #6D28D9) drop-shadow(0 0 1px #6D28D9);
}

.np-sticker-el.active {
  cursor: grab;
}

.np-sticker-el.np-selected {
  outline: 2px solid #6D28D9;
  border-radius: 4px;
}

.np-rail {
  width: 40vw;
  min-width: 340px;
  max-width: 600px;
  border-left: 1px solid rgba(0,0,0,0.08);
  background: #ffffff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.np-rail-block {
  padding: 12px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.np-rail-label {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 8px;
}

.np-sticker-block {
  flex: 0 0 auto;
  height: 370px;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  overflow: hidden;
}

.np-sticker-header {
  padding: 12px 12px 4px;
  flex-shrink: 0;
}

.np-section-header {
  padding: 14px 12px 10px;
  flex-shrink: 0;
  text-align: center;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.np-section-header-label {
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #18181b;
  letter-spacing: 0.04em;
}

.np-sticker-scroll {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 4px 12px 8px;
}

.np-sticker-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
}

.np-sticker-tile {
  aspect-ratio: 1;
  border-radius: 6px;
  border: 0.5px solid rgba(0,0,0,0.08);
  overflow: hidden;
  cursor: pointer;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s, border-color 0.1s;
}

.np-sticker-tile:hover {
  transform: scale(1.08);
  border-color: #6D28D9;
}

.np-sticker-tile img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 3px;
}


.np-bg-block {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.np-bg-tabs {
  display: flex;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  flex-shrink: 0;
}

.np-bg-tab {
  flex: 1;
  padding: 9px;
  font-size: 15px;
  text-align: center;
  cursor: pointer;
  color: #888;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  font-family: 'Poppins', sans-serif;
  transition: all 0.15s;
}

.np-bg-tab.active {
  color: #6D28D9;
  border-bottom: 2px solid #6D28D9;
  font-weight: 500;
}

.np-bg-panel {
  display: none;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 10px;
}

.np-bg-panel.active {
  display: block;
}

.np-pattern-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-bottom: 10px;
}

.np-pattern-btn {
  padding: 6px 4px;
  font-size: 14px;
  border: 0.5px solid rgba(0,0,0,0.12);
  border-radius: 6px;
  background: transparent;
  color: #888;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  text-align: center;
  transition: all 0.1s;
}

.np-pattern-btn.active {
  border-color: #6D28D9;
  color: #6D28D9;
  font-weight: 500;
}

.np-color-section {
  margin-bottom: 8px;
}

.np-color-section-label {
  font-size: 9px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
  font-family: 'Poppins', sans-serif;
}

.np-color-toggle {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.np-color-slot-btn {
  padding: 5px 12px;
  font-size: 11px;
  border: 2px solid rgba(0,0,0,0.15);
  border-radius: 20px;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
  transition: border-color 0.1s;
}

.np-color-slot-btn.active {
  border-color: #18181b;
}

.np-color-family {
  display: flex;
  gap: 2px;
  margin-bottom: 2px;
}

.np-color-dot {
  flex: 1;
  aspect-ratio: 1;
  border-radius: 50%;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: transform 0.1s;
}

.np-color-dot:hover {
  transform: scale(1.2);
}

.np-color-dot.np-sel {
  border-color: #18181b;
  transform: scale(1.1);
}

.np-ctrl-label {
  font-size: 9px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 6px 0 4px;
  font-family: 'Poppins', sans-serif;
}

.np-dir-btns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-bottom: 6px;
}

.np-dir-btn {
  padding: 8px 4px;
  font-size: 16px;
  border: 0.5px solid rgba(0,0,0,0.12);
  border-radius: 6px;
  background: transparent;
  color: #444;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  text-align: center;
  transition: all 0.1s;
  width: 100%;
}

.np-dir-btn.active {
  background: #6D28D9;
  color: #fff;
  border-color: #6D28D9;
}

.np-slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.np-slider-row input[type="range"] {
  flex: 1;
  accent-color: #6D28D9;
}

.np-slider-val {
  font-size: 10px;
  color: #888;
  min-width: 28px;
  text-align: right;
  font-family: 'Poppins', sans-serif;
}

.np-my-bg-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.np-my-bg-tile {
  aspect-ratio: 9/16;
  border-radius: 6px;
  border: 0.5px solid rgba(0,0,0,0.08);
  cursor: pointer;
  transition: transform 0.1s;
  overflow: hidden;
}

.np-my-bg-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.np-my-bg-tile:hover {
  transform: scale(1.04);
  border-color: #6D28D9;
}

.np-next-block {
  padding: 12px;
  margin-top: auto;
  flex-shrink: 0;
}

.np-next-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(to top right, #6D28D9, #14B8A6);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.np-next-btn:hover {
  opacity: 0.9;
}

.np-empty {
  font-size: 12px;
  color: #aaa;
  font-family: 'Poppins', sans-serif;
  padding: 12px 0;
  text-align: center;
}

.np-transform-box {
  display: none;
  position: absolute;
  inset: -8px;
  pointer-events: none;
}

.np-sticker-el.np-selected .np-transform-box {
  display: block;
}

.np-transform-outline {
  position: absolute;
  inset: 0;
  border: 1.5px solid #6D28D9;
  border-radius: 2px;
  pointer-events: none;
}

.np-rot-line {
  position: absolute;
  left: 50%;
  top: -24px;
  width: 1px;
  height: 24px;
  background: #6D28D9;
  transform: translateX(-50%);
  pointer-events: none;
}

.np-rot-handle {
  position: absolute;
  left: 50%;
  top: -32px;
  width: 12px;
  height: 12px;
  background: #ffffff;
  border: 2px solid #6D28D9;
  border-radius: 50%;
  transform: translateX(-50%);
  cursor: grab;
  pointer-events: all;
}

.np-rot-handle:active {
  cursor: grabbing;
}

.np-corner {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #ffffff;
  border: 2px solid #6D28D9;
  border-radius: 2px;
  pointer-events: all;
}

.np-corner.tl { top: 0; left: 0; cursor: nwse-resize; transform: translate(-50%, -50%); }
.np-corner.tr { top: 0; right: 0; cursor: nesw-resize; transform: translate(50%, -50%); }
.np-corner.bl { bottom: 0; left: 0; cursor: nesw-resize; transform: translate(-50%, 50%); }
.np-corner.br { bottom: 0; right: 0; cursor: nwse-resize; transform: translate(50%, 50%); }

@media (max-width: 768px) {
  .np-rail {
    display: none;
  }
  .np-canvas {
    width: 92vw;
    height: calc(92vw * 16 / 9);
  }
}

@media (max-width: 768px) {
  .np-mobile-trigger {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #18181b;
  }
}

.np-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: #18181b;
  border-radius: 6px;
  cursor: pointer;
}

.np-menu-item:active {
  background: #f5f3ff;
}

.np-menu-next-disabled {
  opacity: 0.4;
  pointer-events: none;
}
