:root {
  --studio-accent: #aa1c41;
  --studio-surface: #fff9f6;
  --studio-card: #ffffff;
  --studio-ink: #2e2528;
  --studio-muted: #776d70;
  --studio-border: #eadfe0;
  --studio-shadow: 0 16px 42px rgba(83, 36, 50, .10);
  --studio-radius: 18px;
}

body.shop-studio-page,
body.shop-public-page {
  background: var(--studio-surface);
  color: var(--studio-ink);
  font-family: "Noto Sans KR", system-ui, sans-serif;
}

.shop-studio-nav {
  background: rgba(255, 255, 255, .88);
  border-bottom: 1px solid rgba(170, 28, 65, .10);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.shop-studio-wrap {
  max-width: 1380px;
  margin: 0 auto;
  padding: 28px 18px 64px;
}

.studio-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.studio-kicker,
.preview-eyebrow {
  color: var(--studio-accent);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.studio-intro h1 {
  margin: 4px 0 8px;
  font-size: clamp(1.65rem, 4vw, 2.5rem);
  font-weight: 900;
  letter-spacing: -.055em;
}

.studio-intro p {
  max-width: 680px;
  margin: 0;
  color: var(--studio-muted);
}

.studio-grid {
  display: grid;
  grid-template-columns: minmax(280px, .78fr) minmax(360px, 1.22fr);
  gap: 22px;
  align-items: start;
}

.studio-panel,
.shop-preview-shell {
  border: 1px solid var(--studio-border);
  border-radius: var(--studio-radius);
  background: var(--studio-card);
  box-shadow: var(--studio-shadow);
}

.studio-panel {
  padding: 20px;
}

.studio-panel + .studio-panel {
  margin-top: 14px;
}

.studio-panel h2 {
  margin: 0 0 5px;
  font-size: 1.02rem;
  font-weight: 850;
}

.studio-panel .panel-help {
  margin: 0 0 16px;
  color: var(--studio-muted);
  font-size: .84rem;
  line-height: 1.55;
}

.studio-label {
  display: block;
  margin: 0 0 6px;
  color: #594d50;
  font-size: .82rem;
  font-weight: 800;
}

.studio-input,
.studio-textarea {
  width: 100%;
  border: 1px solid var(--studio-border);
  border-radius: 12px;
  background: #fffdfc;
  color: var(--studio-ink);
  padding: 11px 12px;
  outline: 0;
  transition: border-color .2s, box-shadow .2s;
}

.studio-input:focus,
.studio-textarea:focus {
  border-color: var(--studio-accent);
  box-shadow: 0 0 0 3px rgba(170, 28, 65, .12);
}

.studio-textarea {
  min-height: 94px;
  resize: vertical;
}

.studio-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.studio-theme-grid,
.studio-item-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.studio-theme-card,
.studio-item-card {
  position: relative;
  border: 1px solid var(--studio-border);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.studio-theme-card:hover,
.studio-item-card:hover {
  transform: translateY(-2px);
}

.studio-theme-card.active,
.studio-item-card.active {
  border-color: var(--studio-accent);
  box-shadow: 0 0 0 3px rgba(170, 28, 65, .12);
}

.studio-theme-swatch {
  height: 66px;
  border-radius: 13px 13px 0 0;
  background: var(--swatch-surface, #fff9f6);
  position: relative;
  overflow: hidden;
}

.studio-theme-swatch::after {
  content: "";
  position: absolute;
  left: 16%;
  right: 16%;
  bottom: 12px;
  height: 12px;
  border-radius: 99px;
  background: var(--swatch-accent, #aa1c41);
}

.studio-theme-card strong,
.studio-item-card strong {
  display: block;
  padding: 9px 10px 10px;
  font-size: .8rem;
}

.studio-item-card {
  min-height: 88px;
  padding: 12px;
}

.studio-item-card .item-glyph {
  display: block;
  color: var(--studio-accent);
  font-size: 1.35rem;
  line-height: 1;
  margin-bottom: 8px;
}

.studio-product-list {
  max-height: 286px;
  overflow: auto;
  border-top: 1px solid var(--studio-border);
  border-bottom: 1px solid var(--studio-border);
}

.studio-product-composer {
  margin: 0 0 18px;
  padding: 18px;
  border: 1px solid rgba(170, 28, 65, .16);
  border-radius: 20px;
  background: #fffaf8;
  box-shadow: 0 8px 24px -10px rgba(55, 28, 20, .22);
}

.studio-approval-banner {
  display: inline-flex;
  max-width: 760px;
  margin-top: 10px;
  padding: 8px 12px;
  border: 1px solid rgba(170, 28, 65, .16);
  border-radius: 9999px;
  color: #7b4b41;
  background: rgba(255, 250, 248, .9);
  font-size: .82rem;
}

.studio-approval-banner[data-status="pending"] {
  border-color: rgba(176, 119, 20, .22);
  color: #805c12;
  background: #fff8e7;
}

.studio-approval-banner[data-status="approved"] {
  border-color: rgba(26, 122, 74, .22);
  color: #17613b;
  background: #effbf3;
}

.studio-approval-banner[data-status="rejected"] {
  border-color: rgba(170, 28, 65, .24);
  color: #8b2344;
  background: #fff0f3;
}

.studio-composer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.studio-composer-header strong,
.studio-composer-header span {
  display: block;
}

.studio-composer-header strong {
  color: #341e1a;
  font-size: 1.05rem;
}

.studio-composer-header span {
  margin-top: 4px;
  color: #856c66;
  font-size: .83rem;
}

.studio-icon-button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9999px;
  color: #856c66;
  background: #f1e6e1;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.studio-category-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.studio-category-grid label,
.studio-form-checks label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #5e4842;
  font-size: .88rem;
}

.studio-category-grid input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.studio-category-grid span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid #eadbd5;
  border-radius: 9999px;
  background: #fff;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}

.studio-category-grid input:checked + span {
  border-color: #aa1c41;
  color: #fff;
  background: #aa1c41;
  box-shadow: 0 6px 16px -8px rgba(170, 28, 65, .8);
}

.studio-category-grid span:active,
.studio-btn:active,
.studio-icon-button:active {
  transform: scale(.97);
}

.studio-form-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.studio-form-checks input {
  accent-color: #aa1c41;
}

.studio-upload-preview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.studio-upload-thumb {
  min-width: 0;
  overflow: hidden;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 5px 14px -10px rgba(55, 28, 20, .65);
}

.studio-upload-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.studio-upload-thumb span {
  display: block;
  overflow: hidden;
  padding: 5px 6px;
  color: #856c66;
  font-size: .68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 560px) {
  .studio-product-composer {
    padding: 14px;
    border-radius: 16px;
  }

  .studio-upload-preview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.studio-product-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 11px 4px;
  border-bottom: 1px solid #f1e9e9;
}

.studio-product-row:last-child { border-bottom: 0; }

.studio-product-row img {
  width: 48px;
  height: 48px;
  border-radius: 11px;
  object-fit: cover;
  background: #f1eceb;
}

.studio-product-row .product-name {
  font-size: .86rem;
  font-weight: 800;
}

.studio-product-row .product-meta {
  margin-top: 2px;
  color: var(--studio-muted);
  font-size: .74rem;
}

.studio-product-slot {
  border: 1px dashed #d8c8cc;
  border-radius: 12px;
  padding: 8px 10px;
  background: #fffaf9;
}

.studio-product-slot select {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--studio-accent);
  font-size: .75rem;
  font-weight: 800;
}

.studio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.studio-btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: .84rem;
  font-weight: 800;
  transition: transform .15s ease, filter .15s ease;
}

.studio-btn:active { transform: scale(.97); }
.studio-btn-primary { background: var(--studio-accent); color: #fff; }
.studio-btn-secondary { border-color: var(--studio-border); background: #fff; color: var(--studio-ink); }
.studio-btn-primary:hover { filter: brightness(.95); color: #fff; }
.studio-btn-secondary:hover { border-color: var(--studio-accent); color: var(--studio-accent); }

.shop-preview-shell {
  position: sticky;
  top: 84px;
  overflow: hidden;
}

.shop-preview-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--studio-border);
  background: #fff;
}

.shop-preview-toolbar small { color: var(--studio-muted); }

.shop-preview {
  min-height: 600px;
  padding: 28px;
  background: var(--preview-surface, #fff9f6);
}

.shop-preview-hero {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 18px;
  align-items: end;
  margin-bottom: 20px;
}

.shop-preview-hero h2 {
  margin: 7px 0 7px;
  color: var(--preview-accent, #aa1c41);
  font-size: clamp(1.7rem, 5vw, 3rem);
  line-height: 1.02;
  letter-spacing: -.07em;
}

.shop-preview-hero p {
  max-width: 42ch;
  margin: 0;
  color: #715f64;
  line-height: 1.6;
}

.preview-art {
  min-height: 142px;
  border-radius: calc(var(--preview-radius, 18px) + 4px);
  background:
    linear-gradient(140deg, color-mix(in srgb, var(--preview-accent, #aa1c41) 18%, transparent), transparent 64%),
    #f0ddd9;
  overflow: hidden;
  position: relative;
}

.preview-art::before,
.preview-art::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, .55);
}
.preview-art::before { width: 130px; height: 130px; right: -22px; top: -36px; }
.preview-art::after { width: 72px; height: 72px; left: 28px; bottom: -26px; }

.preview-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 14px 0 20px;
}

.preview-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--preview-accent, #aa1c41);
  color: #fff;
  font-size: .73rem;
  font-weight: 800;
}

.preview-section {
  margin-top: 17px;
}

.preview-section-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 9px;
}

.preview-section-title strong { font-size: .92rem; }
.preview-section-title span { color: #8a7c7f; font-size: .73rem; }

.preview-shelf {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.preview-product {
  min-width: 0;
  border-radius: var(--preview-radius, 18px);
  border: 1px solid rgba(125, 82, 89, .12);
  background: var(--preview-card, #fff);
  padding: 10px;
}

.preview-product img,
.preview-product .preview-image-placeholder {
  width: 100%;
  aspect-ratio: 1 / .78;
  border-radius: calc(var(--preview-radius, 18px) - 5px);
  object-fit: cover;
  background: #f1e7e3;
}

.preview-product .preview-image-placeholder {
  display: grid;
  place-items: center;
  color: #ad9196;
  font-size: 1.4rem;
}

.preview-product strong {
  display: block;
  overflow: hidden;
  margin-top: 8px;
  font-size: .8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-product small { color: #8a7c7f; }

.preview-policy {
  border-left: 3px solid var(--preview-accent, #aa1c41);
  padding: 12px 14px;
  background: rgba(255, 255, 255, .56);
  color: #66565a;
  font-size: .8rem;
  line-height: 1.6;
}

.shop-public-page .shop-public-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 30px 16px 64px;
}

.shop-public-shell {
  border-radius: var(--preview-radius, 18px);
  background: var(--preview-surface, #fff9f6);
  padding: clamp(20px, 5vw, 48px);
  box-shadow: var(--studio-shadow);
}

.shop-public-shell .shop-preview-hero { margin-bottom: 28px; }

.studio-status {
  min-height: 22px;
  margin-top: 10px;
  color: var(--studio-muted);
  font-size: .82rem;
}

.studio-status.error { color: #a51d37; }
.studio-status.success { color: #1d6f49; }

.studio-empty {
  padding: 28px 16px;
  border: 1px dashed #d9cbcc;
  border-radius: 14px;
  color: var(--studio-muted);
  text-align: center;
  font-size: .84rem;
}

@media (max-width: 900px) {
  .studio-grid { grid-template-columns: 1fr; }
  .shop-preview-shell { position: static; }
}

@media (max-width: 560px) {
  .shop-studio-wrap { padding: 20px 12px 42px; }
  .studio-intro { display: block; }
  .studio-form-row,
  .shop-preview-hero { grid-template-columns: 1fr; }
  .studio-theme-grid,
  .studio-item-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shop-preview { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .studio-theme-card,
  .studio-item-card,
  .studio-btn,
  .studio-input,
  .studio-textarea { transition: none; }
}
