.nds-wrap {
  background: #FFFFFF;
  border: 1px solid #E8DCD6;
  border-radius: 18px;
  box-shadow: 0 12px 36px rgba(45, 33, 30, 0.07);
  overflow: hidden;
  color: #2D211E;
}
.nds-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  background: #FBF8F5;
  border-bottom: 1px solid #E8DCD6;
}
.nds-topbar-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.nds-tbtn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 11px;
  border-radius: 8px;
  border: 1px solid #DFCFC7;
  background: #FFFFFF;
  color: #2D211E;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s ease;
  white-space: nowrap;
}
.nds-tbtn:hover:not(:disabled) { border-color: #C47D84; background: #FDF6F7; }
.nds-tbtn:disabled { opacity: 0.42; cursor: not-allowed; }
.nds-tbtn.is-active, .nds-tbtn.is-active:hover { background: #2D211E; color: #FFFFFF; border-color: #2D211E; }
.nds-tbtn-accent { background: #C47D84; color: #FFFFFF; border-color: #C47D84; }
.nds-tbtn-accent:hover:not(:disabled) { background: #A55D66; border-color: #A55D66; color: #FFFFFF; }
.nds-tbtn-dark { background: #2D211E; color: #FBF8F5; border-color: #2D211E; }
.nds-tbtn-dark:hover:not(:disabled) { background: #4B3833; }

.nds-grid {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr) 295px;
  min-height: 610px;
}
.nds-col {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.nds-col-left { border-right: 1px solid #E8DCD6; background: #FCF9F7; max-height: 700px; overflow-y: auto; }
.nds-col-right { border-left: 1px solid #E8DCD6; background: #FCF9F7; max-height: 700px; overflow-y: auto; }
.nds-col-center {
  background: radial-gradient(circle at 50% 35%, #FFFFFF 0%, #F8EFEA 100%);
  align-items: center;
  justify-content: space-between;
  padding: 16px;
}

.nds-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  background: #F2E7E1;
  padding: 4px;
  border-radius: 10px;
}
.nds-tab {
  padding: 7px 4px;
  border: none;
  border-radius: 7px;
  background: transparent;
  font-size: 0.77rem;
  font-weight: 600;
  color: #6B5853;
  cursor: pointer;
}
.nds-tab.is-active { background: #FFFFFF; color: #2D211E; box-shadow: 0 1px 4px rgba(45,33,30,0.08); }

.nds-panel { display: flex; flex-direction: column; gap: 12px; }
.nds-panel[hidden] { display: none; }
.nds-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7A645E;
  margin: 0 0 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nds-chip-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.nds-chip-grid-4 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.nds-chip {
  padding: 8px 9px;
  border-radius: 9px;
  border: 1px solid #E4D6CE;
  background: #FFFFFF;
  font-size: 0.8rem;
  font-weight: 600;
  color: #2D211E;
  cursor: pointer;
  text-align: left;
  transition: all 0.14s ease;
}
.nds-chip:hover { border-color: #C47D84; }
.nds-chip.is-active { background: #2D211E; color: #FFFFFF; border-color: #2D211E; }

.nds-cat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.nds-cat-pill {
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid #E4D6CE;
  background: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 600;
  color: #6B5853;
  cursor: pointer;
}
.nds-cat-pill.is-active { background: #C47D84; color: #FFFFFF; border-color: #C47D84; }

.nds-swatches {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.nds-swatch {
  height: 36px;
  border-radius: 9px;
  border: 2px solid #FFFFFF;
  box-shadow: 0 0 0 1px rgba(45,33,30,0.16);
  cursor: pointer;
  position: relative;
  transition: transform 0.12s ease;
}
.nds-swatch:hover { transform: scale(1.06); }
.nds-swatch.is-active { box-shadow: 0 0 0 2px #2D211E; }

.nds-mini-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.nds-mini-swatch {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid #FFFFFF; box-shadow: 0 0 0 1px rgba(45,33,30,0.18);
  cursor: pointer; padding: 0;
}

.nds-hex-bar {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nds-hex-bar input[type="color"] {
  width: 36px; height: 34px; border: 1px solid #DFCFC7; border-radius: 8px; padding: 2px; background: #fff; cursor: pointer;
}
.nds-hex-bar input[type="text"] {
  flex: 1; min-width: 0; padding: 6px 9px; border-radius: 8px;
  border: 1px solid #DFCFC7; background: #FFFFFF;
  font-family: ui-monospace, SFMono-Regular, monospace; font-size: 0.82rem;
}

/* Canvas Area */
.nds-canvas-head {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.nds-segmented {
  display: inline-flex;
  background: #EFE4DE;
  padding: 3px;
  border-radius: 999px;
  gap: 2px;
}
.nds-seg {
  border: none; background: transparent; padding: 5px 12px;
  border-radius: 999px; font-size: 0.78rem; font-weight: 600; color: #6B5853; cursor: pointer;
}
.nds-seg.is-active { background: #FFFFFF; color: #2D211E; box-shadow: 0 1px 4px rgba(45,33,30,0.08); }

.nds-skin-row { display: flex; align-items: center; gap: 6px; font-size: 0.76rem; color: #6B5853; }
.nds-skin-dot {
  width: 20px; height: 20px; border-radius: 50%; border: 2px solid #FFFFFF;
  box-shadow: 0 0 0 1px rgba(45,33,30,0.2); cursor: pointer; padding: 0;
}
.nds-skin-dot.is-active { box-shadow: 0 0 0 2px #C47D84; }

.nds-stage {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
  min-height: 360px;
}
.nds-stage svg {
  width: 100%;
  max-width: 660px;
  max-height: 410px;
  height: auto;
  display: block;
  user-select: none;
}
.nds-nail-hit { cursor: pointer; transition: filter 0.14s ease; }
.nds-nail-hit:hover { filter: drop-shadow(0 4px 10px rgba(196,125,132,0.35)); }

.nds-finger-bar {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}
.nds-finger-pill {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid #DFCFC7;
  background: #FFFFFF;
  font-size: 0.76rem;
  font-weight: 600;
  color: #6B5853;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.nds-finger-pill i { width: 10px; height: 10px; border-radius: 50%; border: 1px solid rgba(0,0,0,0.18); display: inline-block; }
.nds-finger-pill.is-active { background: #2D211E; color: #FFFFFF; border-color: #2D211E; }

/* Right Panel Controls */
.nds-box {
  background: #FFFFFF;
  border: 1px solid #E8DCD6;
  border-radius: 12px;
  padding: 11px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.nds-slider-row {
  display: grid;
  grid-template-columns: 62px 1fr 36px;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  color: #6B5853;
}
.nds-slider-row input[type="range"] { width: 100%; accent-color: #C47D84; }
.nds-slider-val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: #2D211E; }

.nds-layer-list { display: flex; flex-direction: column; gap: 5px; }
.nds-layer-item {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 6px 8px; border-radius: 8px; border: 1px solid #E8DCD6; background: #FBF8F5;
  font-size: 0.78rem; cursor: pointer;
}
.nds-layer-item.is-active { border-color: #C47D84; background: #FDF2F3; }
.nds-layer-del {
  border: none; background: transparent; color: #A55D66; font-weight: 700; cursor: pointer; padding: 0 4px;
}

.nds-mini-tpls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
  overflow-x: hidden;
}
.nds-mini-tpl {
  border: 1px solid #E8DCD6;
  background: #FBF8F5;
  border-radius: 9px;
  padding: 6px;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.nds-mini-tpl:hover { border-color: #C47D84; }
.nds-mini-tpl span { font-size: 0.72rem; font-weight: 600; color: #2D211E; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nds-export-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.nds-toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: #2D211E; color: #FFFFFF; padding: 10px 18px; border-radius: 999px;
  font-size: 0.85rem; font-weight: 600; z-index: 999; box-shadow: 0 8px 24px rgba(0,0,0,0.22);
}
.nds-toast[hidden] { display: none; }

.nds-saved-list { display: flex; flex-direction: column; gap: 6px; max-height: 140px; overflow-y: auto; }
.nds-saved-item {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 6px 8px; border-radius: 8px; background: #FBF8F5; border: 1px solid #E8DCD6; font-size: 0.76rem;
}

.nds-mob-tabs { display: none; }

@media (max-width: 1120px) {
  .nds-grid { grid-template-columns: 1fr; }
  .nds-col-center { order: 1; }
  .nds-mob-tabs {
    display: flex; gap: 6px; padding: 10px 14px; background: #F4E9E4;
    border-top: 1px solid #E8DCD6; border-bottom: 1px solid #E8DCD6;
    overflow-x: auto; scrollbar-width: none; order: 2;
  }
  .nds-mob-tabs::-webkit-scrollbar { display: none; }
  .nds-col-left { order: 3; border-right: none; border-bottom: 1px solid #E8DCD6; max-height: none; }
  .nds-col-right { order: 4; border-left: none; max-height: none; }
  .nds-col-left.mob-hidden, .nds-col-right.mob-hidden { display: none; }
}
@media (max-width: 600px) {
  .nds-topbar { padding: 10px 12px; }
  .nds-stage { min-height: 260px; }
  .nds-tbtn { padding: 6px 9px; font-size: 0.76rem; }
}
