:root {
  --bg-deep: #0b101b;
  --bg-panel: rgba(18, 25, 40, 0.82);
  --bg-card-ui: rgba(255, 255, 255, 0.06);
  --border-subtle: rgba(255, 255, 255, 0.12);
  --text-main: #f6f3ec;
  --text-muted: #b4bccb;
  --accent: #e3b864;
  --accent-strong: #f2cc7e;
  --danger: #e85d68;
  --radius-lg: 20px;
  --radius-md: 12px;
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: radial-gradient(circle at 20% 10%, #1a243b 0%, #0b101b 55%, #070a12 100%);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Segoe UI", sans-serif;
  overflow-x: hidden;
}

#snow-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

#ambient-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(circle at 65% 45%, var(--theme-glow, rgba(227, 184, 100, 0.2)), transparent 55%);
  transition: background 0.6s ease;
}

.is-hidden {
  display: none !important;
}

/* Top Navigation */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  background: rgba(11, 16, 27, 0.78);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

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

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #b82934, #7a1622);
  border: 1px solid rgba(227, 184, 100, 0.55);
  color: #ffe39c;
  font-size: 18px;
  box-shadow: 0 6px 18px rgba(184, 41, 52, 0.35);
}

.brand-title {
  margin: 0;
  font-size: 17px;
  letter-spacing: 0.5px;
  font-weight: 700;
}

.brand-subtitle {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.mode-switch {
  display: flex;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
}

.mode-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-btn.is-active {
  background: rgba(227, 184, 100, 0.2);
  color: #ffe6aa;
  box-shadow: inset 0 0 0 1px rgba(227, 184, 100, 0.45);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.icon-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}

.icon-pill:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.icon-pill.is-playing {
  border-color: rgba(124, 232, 166, 0.55);
  background: rgba(46, 150, 92, 0.24);
  color: #c8f7d9;
}

.icon-pill.accent-pill {
  border-color: rgba(227, 184, 100, 0.4);
  background: rgba(227, 184, 100, 0.14);
  color: #ffe5a6;
}

.icon-pill.primary-pill {
  border-color: rgba(227, 184, 100, 0.6);
  background: linear-gradient(135deg, #c7353d, #8c1c25);
  color: #fff6e5;
}

.icon-pill.pro-pill {
  border-color: rgba(242, 204, 126, 0.5);
  background: rgba(242, 204, 126, 0.14);
  color: #ffe8a8;
}

.icon-pill.pro-pill.is-pro {
  border-color: rgba(124, 232, 166, 0.55);
  background: rgba(46, 150, 92, 0.22);
  color: #c8f7d9;
}

/* Studio Layout */
.studio-layout {
  position: relative;
  z-index: 5;
  max-width: 1360px;
  margin: 0 auto;
  padding: 22px 24px 36px;
  display: grid;
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}

/* Editor Panel */
.editor-panel {
  min-width: 0;
  background: var(--bg-panel);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.editor-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.22);
}

.tab-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 13px 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tab-btn.is-active {
  color: #ffe5a6;
  background: rgba(255, 255, 255, 0.04);
  border-bottom-color: var(--accent);
}

.editor-body {
  padding: 18px;
  max-height: calc(100vh - 170px);
  overflow-y: auto;
}

.tab-pane {
  display: none;
  flex-direction: column;
  gap: 18px;
}

.tab-pane.is-active {
  display: flex;
}

.field-group {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.text-input {
  min-width: 0;
}

.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

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

.text-input,
.text-area {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: rgba(8, 12, 22, 0.65);
  color: var(--text-main);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.text-input:focus,
.text-area:focus {
  outline: none;
  border-color: var(--accent);
}

.text-area {
  resize: vertical;
  line-height: 1.55;
}

/* Grids */
.theme-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.theme-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card-ui);
  color: var(--text-main);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.theme-card.is-selected {
  border-color: var(--accent);
  background: rgba(227, 184, 100, 0.14);
  box-shadow: 0 0 0 1px rgba(227, 184, 100, 0.4);
}

.swatch-dots {
  display: flex;
  gap: 6px;
}

.swatch-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

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

.choice-btn,
.font-btn,
.seal-btn,
.snow-btn,
.song-btn {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card-ui);
  color: var(--text-main);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.choice-btn {
  display: flex;
  align-items: center;
  gap: 8px;
}

.choice-btn.is-selected,
.font-btn.is-selected,
.seal-btn.is-selected,
.snow-btn.is-selected,
.song-btn.is-selected {
  border-color: var(--accent);
  background: rgba(227, 184, 100, 0.16);
  color: #ffe8b3;
}

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

.font-btn,
.seal-btn,
.snow-btn {
  text-align: center;
}

.template-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-btn {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(227, 184, 100, 0.35);
  background: rgba(227, 184, 100, 0.1);
  color: #ffe3a3;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.chip-btn:hover {
  background: rgba(227, 184, 100, 0.25);
}

.sticker-palette {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.sticker-add-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card-ui);
  color: var(--text-muted);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.2s ease;
}

.sticker-add-btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  color: var(--text-main);
}

.sticker-add-btn .emoji {
  font-size: 22px;
}

.sticker-add-btn .lbl {
  font-size: 11px;
}

.sticker-inspector {
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.26);
  border: 1px solid var(--border-subtle);
}

.inspector-hint {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.inspector-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.slider-row {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.slider-row input[type="range"] {
  accent-color: var(--accent);
}

.mini-link,
.danger-link {
  background: none;
  border: none;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}

.mini-link {
  color: var(--accent-strong);
}

.danger-link {
  color: var(--danger);
}

.seal-grid,
.snow-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.song-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.song-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Stage Panel */
.stage-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.stage-toolbar {
  width: 100%;
  max-width: 520px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.face-switch {
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
}

.face-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.face-btn.is-active {
  background: var(--accent);
  color: #1f1408;
}

.stage-tip {
  font-size: 12px;
  color: var(--text-muted);
}

/* 3D Greeting Card */
.card-viewport {
  perspective: 1400px;
  width: min(440px, 90vw);
  aspect-ratio: 4 / 5.1;
}

.card-3d {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.72s cubic-bezier(0.22, 1, 0.36, 1);
}

.card-3d.is-flipped {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 24px;
  padding: 18px;
  box-shadow: 0 28px 65px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  overflow: hidden;
  user-select: none;
}

.card-inside {
  transform: rotateY(180deg);
}

.card-frame {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 16px;
  border: 1.5px solid var(--card-accent, #e3b864);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.corner-ornament {
  position: absolute;
  font-size: 14px;
  color: var(--card-accent, #e3b864);
  opacity: 0.85;
}

.corner-ornament.tl { top: 8px; left: 10px; }
.corner-ornament.tr { top: 8px; right: 10px; }
.corner-ornament.bl { bottom: 8px; left: 10px; }
.corner-ornament.br { bottom: 8px; right: 10px; }

.cover-art {
  width: 100%;
  max-height: 225px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
}

.cover-art svg {
  width: 100%;
  max-width: 280px;
  height: auto;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.35));
}

.cover-typography {
  text-align: center;
  padding: 4px 8px;
}

.cover-headline {
  margin: 0 0 8px;
  font-size: clamp(24px, 3.2vw, 31px);
  line-height: 1.2;
  color: var(--card-cover-text, #fff5e1);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  word-break: break-word;
}

.cover-subhead {
  margin: 0;
  font-size: 14px;
  color: var(--card-accent, #e3b864);
  line-height: 1.45;
  word-break: break-word;
}

.cover-footer {
  text-align: center;
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--card-accent, #e3b864);
  opacity: 0.88;
}

/* Inside Face */
.inside-frame {
  padding: 28px 26px;
  color: var(--card-inside-text, #4a1b1f);
}

.inside-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.inside-to {
  font-size: 20px;
  font-weight: 700;
}

.inside-rule {
  width: 90px;
  height: 2px;
  background: var(--card-accent, #e3b864);
}

.inside-body {
  flex: 1;
  padding: 22px 0;
  font-size: 16px;
  line-height: 1.85;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-y: auto;
}

.inside-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.inside-stamp {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px dashed var(--card-accent, #e3b864);
  color: var(--card-inside-text, #4a1b1f);
  opacity: 0.78;
}

.inside-from {
  font-size: 17px;
  font-weight: 700;
}

/* Sticker Layer */
.sticker-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.sticker-item {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 36px;
  line-height: 1;
  pointer-events: auto;
  cursor: grab;
  padding: 4px;
  border-radius: 10px;
  transition: box-shadow 0.15s ease;
  touch-action: none;
}

.sticker-layer.readonly .sticker-item {
  pointer-events: none;
}

.sticker-item.is-selected {
  box-shadow: 0 0 0 2px #ffe39c, 0 4px 12px rgba(0, 0, 0, 0.35);
  background: rgba(255, 255, 255, 0.12);
}

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

.stage-bottom-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.primary-btn,
.secondary-btn {
  border-radius: 999px;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.2s ease;
}

.primary-btn {
  border: 1px solid rgba(255, 224, 150, 0.65);
  background: linear-gradient(135deg, #c9333e, #8f1b24);
  color: #fff6e6;
  box-shadow: 0 10px 26px rgba(184, 41, 52, 0.38);
}

.secondary-btn {
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.primary-btn:hover,
.secondary-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.full-width {
  width: 100%;
}

/* Reveal View & Envelope */
.reveal-layout {
  position: relative;
  z-index: 5;
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 20px 44px;
}

.reveal-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.envelope-scene {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.envelope-wrapper {
  position: relative;
  width: min(440px, 90vw);
  height: 290px;
  perspective: 1100px;
  cursor: pointer;
  animation: floatEnvelope 4s ease-in-out infinite;
}

@keyframes floatEnvelope {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

.envelope-back {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: var(--env-bg, #7a1622);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 225, 160, 0.25);
}

.envelope-card-peek {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 22px;
  height: 210px;
  border-radius: 12px;
  background: #fff8ed;
  color: #4a1b1f;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 26px;
  font-weight: 700;
  font-size: 20px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  transition: transform 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.28s;
}

.envelope-pocket {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: linear-gradient(170deg, transparent 42%, var(--env-bg, #7a1622) 42.5%);
  z-index: 3;
  display: flex;
  align-items: flex-end;
  padding: 26px 28px;
  border: 1px solid rgba(255, 225, 160, 0.22);
}

.envelope-pocket::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.08) 0%, transparent 55%);
  pointer-events: none;
}

.envelope-address {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  color: #ffefd2;
  font-size: 14px;
}

.env-to,
.env-from {
  margin: 0;
  background: rgba(0, 0, 0, 0.24);
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 225, 160, 0.28);
}

.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 165px;
  background: var(--env-flap, #65111b);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 4;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  box-shadow: inset 0 -2px 0 var(--env-liner, #d8ab54);
}

.wax-seal {
  position: absolute;
  left: 50%;
  top: 148px;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid rgba(255, 232, 175, 0.65);
  background: radial-gradient(circle at 32% 30%, #d94352, var(--seal-bg, #a41d2d) 72%);
  color: #fff2cc;
  font-size: 28px;
  display: grid;
  place-items: center;
  z-index: 5;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45), inset 0 2px 6px rgba(255, 255, 255, 0.35);
  transition: transform 0.25s ease, opacity 0.3s ease;
}

.wax-seal:hover {
  transform: translate(-50%, -50%) scale(1.08);
}

.wax-seal-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 224, 150, 0.5);
  animation: pulseRing 2.2s ease-out infinite;
}

@keyframes pulseRing {
  0% { transform: scale(0.95); opacity: 0.85; }
  100% { transform: scale(1.28); opacity: 0; }
}

.envelope-wrapper.is-opening {
  animation: none;
}

.envelope-wrapper.is-opening .wax-seal {
  transform: translate(-50%, -50%) scale(1.35);
  opacity: 0;
  pointer-events: none;
}

.envelope-wrapper.is-opening .envelope-flap {
  transform: rotateX(175deg);
  z-index: 1;
}

.envelope-wrapper.is-opening .envelope-card-peek {
  transform: translateY(-135px);
}

.reveal-prompt {
  margin: 0;
  font-size: 15px;
  color: #ffe7b2;
  letter-spacing: 0.5px;
}

.opened-card-scene {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  animation: riseIn 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(28px) scale(0.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.reveal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Modal */
.modal-dialog {
  border: none;
  border-radius: var(--radius-lg);
  padding: 0;
  background: transparent;
  color: var(--text-main);
  max-width: 520px;
  width: 92vw;
}

.modal-dialog::backdrop {
  background: rgba(5, 8, 15, 0.72);
  backdrop-filter: blur(6px);
}

.modal-box {
  background: #141c2d;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-header h3 {
  margin: 0;
  font-size: 16px;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
}

.modal-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.draft-save-bar {
  display: flex;
  gap: 10px;
}

.draft-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 300px;
  overflow-y: auto;
}

.draft-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
}

.draft-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.draft-name {
  font-size: 14px;
  font-weight: 600;
}

.draft-date {
  font-size: 11px;
  color: var(--text-muted);
}

.draft-btns {
  display: flex;
  gap: 8px;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(20, 28, 46, 0.95);
  border: 1px solid rgba(227, 184, 100, 0.5);
  color: #ffedc2;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  z-index: 60;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Social Share Modal */
.social-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.social-btn {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.social-btn:hover {
  background: rgba(227, 184, 100, 0.16);
  border-color: var(--accent);
}

.export-format-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.export-format-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
}

.export-format-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.export-format-name {
  font-size: 13px;
  font-weight: 600;
}

.export-format-desc {
  font-size: 11px;
  color: var(--text-muted);
}

/* Badges, Media Panel, Photo Frames, Voice Recorder & Watermark */
.badge-pro {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  background: rgba(242, 204, 126, 0.2);
  border: 1px solid rgba(242, 204, 126, 0.55);
  color: #ffe39c;
  vertical-align: middle;
}

.media-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border-subtle);
}

.photo-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
}

.field-hint {
  margin: 4px 0 0;
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.45;
}

.voice-recorder-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.voice-meter-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.voice-meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #5ee09b, #f2cc7e, #e85d68);
  transition: width 0.08s linear;
}

.voice-preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.voice-duration-label {
  font-size: 12px;
  color: var(--text-muted);
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  transition: background 0.2s ease;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* Photo Frames on Card Cover */
.photo-frame-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 250px;
  margin: 4px auto;
  transition: transform 0.25s ease;
}

.photo-frame-box img {
  display: block;
  width: 224px;
  height: 168px;
  object-fit: cover;
}

.photo-frame-box.frame-polaroid {
  background: #fffdf8;
  padding: 10px 10px 14px;
  border-radius: 4px;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.4);
  transform: rotate(-1.5deg);
}

.photo-frame-box.frame-polaroid .photo-caption {
  margin-top: 8px;
  font-size: 12px;
  color: #3a2323;
  font-weight: 600;
  text-align: center;
}

.photo-frame-box.frame-oval {
  padding: 6px;
  border-radius: 50%;
  border: 3px solid var(--card-accent, #e3b864);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
}

.photo-frame-box.frame-oval img {
  width: 186px;
  height: 186px;
  border-radius: 50%;
}

.photo-frame-box.frame-oval .photo-caption,
.photo-frame-box.frame-stamp .photo-caption,
.photo-frame-box.frame-clean .photo-caption {
  margin-top: 8px;
  font-size: 12px;
  color: var(--card-accent, #e3b864);
}

.photo-frame-box.frame-stamp {
  padding: 10px;
  background: #fff9ef;
  border: 3px dashed var(--card-accent, #e3b864);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.photo-frame-box.frame-clean img {
  border-radius: 16px;
  border: 2px solid var(--card-accent, #e3b864);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

/* Voice Player inside Card */
.inside-voice-slot {
  margin-bottom: 10px;
}

.voice-card-btn {
  width: 100%;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--card-accent, #e3b864);
  background: rgba(0, 0, 0, 0.06);
  color: var(--card-inside-text, #4a1b1f);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.voice-card-btn:hover {
  background: rgba(227, 184, 100, 0.2);
}

.card-watermark {
  margin-top: 8px;
  text-align: center;
  font-size: 10.5px;
  letter-spacing: 0.6px;
  color: var(--card-inside-text, #4a1b1f);
  opacity: 0.55;
}

/* Pro Upgrade Modal */
.pro-hero {
  padding: 14px;
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(227, 184, 100, 0.16), rgba(184, 41, 52, 0.16));
  border: 1px solid rgba(227, 184, 100, 0.4);
}

.pro-price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}

.pro-price {
  font-size: 28px;
  font-weight: 800;
  color: #ffe59e;
}

.pro-cycle {
  font-size: 12.5px;
  color: var(--text-muted);
}

.pro-perks {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-main);
}

.checkout-link-btn {
  display: block;
  text-align: center;
  text-decoration: none;
}

@media (max-width: 960px) {
  .studio-layout {
    grid-template-columns: 1fr;
  }

  .editor-body {
    max-height: none;
  }

  .social-grid {
    grid-template-columns: 1fr;
  }
}
