/* ==========================================================================
   Atelier Vow — Luxury Wedding Invitation Customization Studio UI
   ========================================================================== */

:root {
  --studio-bg: #f6f3ee;
  --studio-panel: #ffffff;
  --studio-border: #e6e0d6;
  --studio-border-strong: #d4cabd;
  --studio-ink: #1f1d1a;
  --studio-muted: #6c655c;
  --studio-accent: #8c6d46;
  --studio-accent-soft: #f4ede3;
  --studio-dark: #1d2420;
  --studio-radius: 12px;
  --studio-shadow: 0 18px 48px rgba(34, 28, 22, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--studio-bg);
  color: var(--studio-ink);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

button,
a,
label {
  touch-action: manipulation;
}

/* ==========================================================================
   STUDIO SHELL LAYOUT
   ========================================================================== */
.studio-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.studio-topbar {
  height: 62px;
  padding: 0 22px;
  background: var(--studio-panel);
  border-bottom: 1px solid var(--studio-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
  z-index: 20;
}

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

.brand-monogram {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--studio-dark);
  color: #f4ece0;
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px;
  font-style: italic;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.04em;
}

.brand-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
}

.brand-sub {
  font-size: 11px;
  color: var(--studio-muted);
  margin-top: 2px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--studio-border-strong);
  background: var(--studio-panel);
  color: var(--studio-ink);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn:hover {
  border-color: var(--studio-ink);
  background: #faf8f5;
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--studio-muted);
}

.btn-ghost:hover {
  background: var(--studio-bg);
  border-color: transparent;
  color: var(--studio-ink);
}

.btn-primary {
  background: var(--studio-dark);
  border-color: var(--studio-dark);
  color: #faf6f0;
}

.btn-primary:hover {
  background: #2b3630;
  border-color: #2b3630;
}

.btn-accent {
  background: var(--studio-accent);
  border-color: var(--studio-accent);
  color: #fff;
}

.btn-accent:hover {
  background: #775b39;
  border-color: #775b39;
}

.btn-sm {
  height: 30px;
  padding: 0 11px;
  font-size: 11.5px;
}

/* Main split workspace */
.studio-workspace {
  display: grid;
  grid-template-columns: 430px 1fr;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ==========================================================================
   LEFT CUSTOMIZATION INSPECTOR
   ========================================================================== */
.inspector-pane {
  display: flex;
  flex-direction: column;
  background: var(--studio-panel);
  border-right: 1px solid var(--studio-border);
  min-height: 0;
  overflow: hidden;
}

.inspector-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 10px 14px 0;
  gap: 4px;
  border-bottom: 1px solid var(--studio-border);
  background: #fcfaf7;
  flex-shrink: 0;
}

.tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 9px 4px 10px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--studio-muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.tab-btn svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.7;
}

.tab-btn:hover {
  color: var(--studio-ink);
}

.tab-btn.is-active {
  color: var(--studio-ink);
  border-bottom-color: var(--studio-accent);
}

.inspector-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 20px 44px;
}

.tab-panel {
  display: none;
  flex-direction: column;
  gap: 22px;
}

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

/* Inspector Form Groups & Cards */
.control-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.control-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.control-title {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--studio-muted);
  margin: 0;
}

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

/* Theme Preset Cards */
.preset-grid {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.preset-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--studio-radius);
  border: 1.5px solid var(--studio-border);
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preset-card:hover {
  border-color: var(--studio-border-strong);
  background: #fcfaf7;
}

.preset-card.is-selected {
  border-color: var(--studio-accent);
  background: var(--studio-accent-soft);
}

.preset-meta strong {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--studio-ink);
}

.preset-meta span {
  font-size: 11.5px;
  color: var(--studio-muted);
}

.preset-swatches {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.preset-swatches i {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #fff;
  margin-left: -5px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16);
}

/* Opening Style Cards */
.option-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.choice-card {
  padding: 11px 13px;
  border-radius: 10px;
  border: 1.5px solid var(--studio-border);
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.choice-card:hover {
  border-color: var(--studio-border-strong);
}

.choice-card.is-selected {
  border-color: var(--studio-accent);
  background: var(--studio-accent-soft);
}

.choice-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}

.choice-card-top strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--studio-ink);
}

.choice-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(140, 109, 70, 0.14);
  color: var(--studio-accent);
}

.choice-card p {
  margin: 0;
  font-size: 11.5px;
  color: var(--studio-muted);
  line-height: 1.4;
}

/* Background Visual Grid & Category Filter */
.bg-filter-bar {
  display: inline-flex;
  gap: 3px;
  padding: 2px;
  border-radius: 999px;
  background: var(--studio-bg);
  border: 1px solid var(--studio-border);
}

.bg-filter-btn {
  padding: 3px 9px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--studio-muted);
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.bg-filter-btn:hover {
  color: var(--studio-ink);
}

.bg-filter-btn.is-active {
  background: var(--studio-dark);
  color: #faf6f0;
}

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

.bg-tile {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--studio-border);
  aspect-ratio: 3 / 4;
  cursor: pointer;
  padding: 0;
  background-size: 100% 100%;
  background-position: center;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.bg-tile:hover {
  transform: translateY(-2px);
}

.bg-tile.is-selected {
  border-color: var(--studio-accent);
  box-shadow: 0 0 0 2px rgba(140, 109, 70, 0.24);
}

.bg-tile-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 6px 6px;
  background: linear-gradient(to top, rgba(16, 15, 14, 0.78), transparent);
  color: #fff;
  font-size: 10.5px;
  font-weight: 500;
  text-align: center;
}

/* Falling Petals Controls */
.petal-style-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.petal-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 9px;
  border: 1.5px solid var(--studio-border);
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.petal-pill:hover {
  border-color: var(--studio-border-strong);
  background: #fcfaf7;
}

.petal-pill.is-selected {
  border-color: var(--studio-accent);
  background: var(--studio-accent-soft);
}

.petal-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50% 0 50% 50%;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.petal-pill strong {
  display: block;
  font-size: 12px;
  color: var(--studio-ink);
  line-height: 1.2;
}

.petal-pill span {
  display: block;
  font-size: 10px;
  color: var(--studio-muted);
  margin-top: 2px;
  line-height: 1.25;
}

.petal-density-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid var(--studio-border);
  background: #fcfaf7;
  margin-top: 2px;
}

.petal-density-label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--studio-muted);
}

.petal-density-pills {
  display: flex;
  gap: 4px;
}

.petal-density-btn {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--studio-border-strong);
  background: #fff;
  color: var(--studio-ink);
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.petal-density-btn.is-selected {
  background: var(--studio-dark);
  border-color: var(--studio-dark);
  color: #faf6f0;
}

/* Celebration Band Palette & Arch Vignette Pickers */
.celeb-palette-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.celeb-palette-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border-radius: 9px;
  border: 1.5px solid var(--studio-border);
  background: #fff;
  color: var(--studio-ink);
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.celeb-palette-btn:hover {
  border-color: var(--studio-border-strong);
}

.celeb-palette-btn.is-selected {
  border-color: var(--studio-accent);
  background: var(--studio-accent-soft);
}

.celeb-swatch {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.14);
  flex-shrink: 0;
}

.celeb-vignette-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 4px;
}

.celeb-vignette-tile {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 40px 40px 8px 8px;
  overflow: hidden;
  border: 2px solid var(--studio-border);
  background: #f6f1e8;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--studio-muted);
  font-family: inherit;
  font-size: 11px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.celeb-vignette-tile.crop-bottom {
  background-position: center 92%;
}

.celeb-vignette-tile.crop-top {
  background-position: center 12%;
}

.celeb-vignette-tile:hover {
  transform: translateY(-2px);
}

.celeb-vignette-tile.is-selected {
  border-color: var(--studio-accent);
  box-shadow: 0 0 0 2px rgba(140, 109, 70, 0.24);
}

/* Paper Texture Pills */
.pill-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.texture-pill {
  padding: 9px 11px;
  border-radius: 9px;
  border: 1.5px solid var(--studio-border);
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.texture-pill.is-selected {
  border-color: var(--studio-accent);
  background: var(--studio-accent-soft);
}

.texture-pill strong {
  display: block;
  font-size: 12px;
  color: var(--studio-ink);
}

.texture-pill span {
  font-size: 10.5px;
  color: var(--studio-muted);
}

/* Color Pickers */
.color-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.color-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--studio-border);
  border-radius: 9px;
  background: #fcfaf7;
}

.color-field label {
  font-size: 11.5px;
  color: var(--studio-ink);
}

.color-field input[type='color'] {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 50%;
  padding: 0;
  background: none;
  cursor: pointer;
  overflow: hidden;
}

.color-field input[type='color']::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-field input[type='color']::-webkit-color-swatch {
  border: none;
  border-radius: 50%;
}

/* Font Selector Cards */
.font-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.font-card {
  padding: 10px 11px;
  border-radius: 10px;
  border: 1.5px solid var(--studio-border);
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.font-card.is-selected {
  border-color: var(--studio-accent);
  background: var(--studio-accent-soft);
}

.font-card-sample {
  display: block;
  font-size: 19px;
  line-height: 1.2;
  color: var(--studio-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.font-card-name {
  display: block;
  font-size: 10.5px;
  color: var(--studio-muted);
  margin-top: 3px;
}

/* Standard Inputs */
.field-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--studio-muted);
}

.field input[type='text'],
.field input[type='date'],
.field input[type='time'],
.field input[type='url'],
.field textarea,
.field select {
  width: 100%;
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid var(--studio-border-strong);
  background: #fff;
  color: var(--studio-ink);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field textarea {
  resize: vertical;
  min-height: 86px;
  line-height: 1.5;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--studio-accent);
  box-shadow: 0 0 0 3px rgba(140, 109, 70, 0.14);
}

/* Sliders */
.range-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.range-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--studio-ink);
}

.range-row input[type='range'] {
  width: 100%;
  accent-color: var(--studio-accent);
  cursor: pointer;
}

/* Toggle Switches */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 11px;
  border-radius: 9px;
  border: 1px solid var(--studio-border);
  background: #fcfaf7;
}

.toggle-row span {
  font-size: 12.5px;
  font-weight: 500;
}

.switch {
  position: relative;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
}

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

.switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #d5cec4;
  cursor: pointer;
  transition: background 0.2s ease;
}

.switch-track::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
  transition: transform 0.2s ease;
}

.switch input:checked + .switch-track {
  background: var(--studio-accent);
}

.switch input:checked + .switch-track::after {
  transform: translateX(16px);
}

/* Collapsible Text Accordions */
.accordion {
  border: 1px solid var(--studio-border);
  border-radius: 11px;
  overflow: hidden;
  background: #fff;
}

.accordion summary {
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fcfaf7;
}

.accordion summary::-webkit-details-marker {
  display: none;
}

.accordion summary::after {
  content: '+';
  font-size: 16px;
  color: var(--studio-muted);
}

.accordion[open] summary::after {
  content: '−';
}

.accordion-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  border-top: 1px solid var(--studio-border);
}

/* Program Timeline & Multi-Day Editor */
.link-action-btn {
  border: none;
  background: transparent;
  padding: 0;
  color: var(--studio-accent);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.link-action-btn:hover {
  color: var(--studio-ink);
}

.day-count-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.day-count-pills {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  flex: 1;
}

.day-count-btn {
  height: 34px;
  border-radius: 8px;
  border: 1.5px solid var(--studio-border);
  background: #fff;
  color: var(--studio-ink);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.day-count-btn:hover {
  border-color: var(--studio-border-strong);
  background: #fcfaf7;
}

.day-count-btn.is-selected {
  border-color: var(--studio-accent);
  background: var(--studio-accent);
  color: #fff;
}

.day-count-input {
  width: 54px !important;
  height: 34px;
  text-align: center;
  padding: 4px 6px !important;
  font-weight: 600;
}

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

.day-date-card {
  padding: 9px 10px;
  border-radius: 10px;
  border: 1.5px solid var(--studio-border);
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.day-date-card.is-selected {
  border-color: var(--studio-accent);
  background: var(--studio-accent-soft);
}

.day-date-card-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 7px;
  align-items: center;
}

.day-select-pill {
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--studio-border-strong);
  background: #fcfaf7;
  color: var(--studio-ink);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.day-date-card.is-selected .day-select-pill {
  background: var(--studio-dark);
  border-color: var(--studio-dark);
  color: #faf6f0;
}

.day-heart-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--studio-border-strong);
  background: #fff;
  color: #b8aea0;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.day-heart-btn:hover {
  border-color: var(--studio-accent);
  color: var(--studio-accent);
}

.day-heart-btn.is-wedding-day {
  background: var(--studio-accent);
  border-color: var(--studio-accent);
  color: #fff;
}

.day-date-card input[type='date'],
.day-date-card input[type='text'] {
  padding: 6px 9px;
  font-size: 12px;
}

.active-day-timeline-header {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--studio-ink);
  margin-top: 2px;
}

.timeline-editor-item {
  padding: 10px;
  border-radius: 9px;
  border: 1px solid var(--studio-border);
  background: #fcfaf7;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.timeline-editor-row {
  display: grid;
  grid-template-columns: 92px 1fr 28px;
  gap: 6px;
  align-items: center;
}

.icon-delete-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: #a64949;
  cursor: pointer;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-delete-btn:hover {
  background: #fae8e8;
}

/* Upload Dropzone */
.upload-box {
  position: relative;
  border: 1.5px dashed var(--studio-border-strong);
  border-radius: 11px;
  padding: 18px 14px;
  text-align: center;
  background: #fcfaf7;
  cursor: pointer;
  transition: all 0.2s ease;
}

.upload-box:hover {
  border-color: var(--studio-accent);
  background: var(--studio-accent-soft);
}

.upload-box input[type='file'] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-box strong {
  display: block;
  font-size: 13px;
  margin-bottom: 3px;
}

.upload-box span {
  font-size: 11.5px;
  color: var(--studio-muted);
}

.upload-preview-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--studio-border);
  background: #fff;
}

.upload-preview-row img {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
}

/* ==========================================================================
   RIGHT LIVE PREVIEW STAGE & REALISTIC SMARTPHONE FRAME
   ========================================================================== */
.preview-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 20px 18px;
  background:
    radial-gradient(circle at 20% 20%, rgba(206, 189, 166, 0.24), transparent 45%),
    radial-gradient(circle at 82% 80%, rgba(164, 178, 166, 0.22), transparent 50%),
    #efeae1;
  overflow-y: auto;
  overflow-x: hidden;
  gap: 12px;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(212, 202, 189, 0.7);
  box-shadow: 0 8px 24px rgba(34, 28, 22, 0.06);
  flex-wrap: wrap;
  justify-content: center;
  z-index: 5;
}

.section-jump-btn {
  padding: 5px 10px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--studio-muted);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.section-jump-btn:hover {
  background: var(--studio-bg);
  color: var(--studio-ink);
}

.toolbar-divider {
  width: 1px;
  height: 16px;
  background: var(--studio-border-strong);
  margin: 0 2px;
}

/* Smartphone Device Bezel — Balanced 9:16 Mobile Browser Viewport Ratio */
.phone-frame {
  position: relative;
  height: clamp(560px, calc(100dvh - 156px), 710px);
  width: auto;
  max-width: 100%;
  aspect-ratio: 9 / 16;
  padding: 10px;
  border-radius: 42px;
  background: linear-gradient(145deg, #2d2b2a 0%, #151414 45%, #2a2725 100%);
  box-shadow:
    0 34px 70px rgba(24, 20, 16, 0.28),
    0 8px 20px rgba(24, 20, 16, 0.14),
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
}

.phone-notch {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 24%;
  min-width: 76px;
  max-width: 96px;
  height: 22px;
  border-radius: 999px;
  background: #0d0d0e;
  z-index: 80;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 33px;
  overflow: hidden;
  background: #f3f1ee;
}

.phone-screen .card-floating-bar {
  top: 42px;
}

/* ==========================================================================
   FULL-SCREEN GUEST MODE OVERLAY / ROUTE
   ========================================================================== */
.guest-mode-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #141312;
  display: none;
  align-items: center;
  justify-content: center;
}

.guest-mode-overlay.is-active {
  display: flex;
}

.guest-ambient-bg {
  position: absolute;
  inset: -40px;
  background-size: cover;
  background-position: center;
  filter: blur(32px) brightness(0.42);
  transform: scale(1.1);
}

.guest-card-viewport {
  position: relative;
  z-index: 5;
  height: min(88dvh, 740px);
  width: auto;
  max-width: 100vw;
  aspect-ratio: 9 / 16;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 32px 84px rgba(0, 0, 0, 0.55);
}

.guest-exit-btn {
  position: fixed;
  top: 18px;
  right: 20px;
  z-index: 220;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(20, 19, 18, 0.68);
  backdrop-filter: blur(10px);
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
}

.guest-exit-btn:hover {
  background: rgba(20, 19, 18, 0.92);
}

body.is-guest-route .studio-shell {
  display: none;
}

body.is-guest-route .guest-exit-btn {
  display: none;
}

/* ==========================================================================
   MODALS & TOAST NOTIFICATIONS
   ========================================================================== */
.studio-modal {
  border: none;
  border-radius: 16px;
  padding: 0;
  max-width: 460px;
  width: calc(100% - 32px);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.25);
  background: #fff;
  color: var(--studio-ink);
}

.studio-modal::backdrop {
  background: rgba(20, 18, 16, 0.52);
  backdrop-filter: blur(4px);
}

.modal-inner {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-inner h3 {
  margin: 0;
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
}

.modal-inner p {
  margin: 0;
  font-size: 13px;
  color: var(--studio-muted);
  line-height: 1.5;
}

.share-url-box {
  display: flex;
  gap: 8px;
}

.share-url-box input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--studio-border-strong);
  font-size: 12px;
  color: var(--studio-muted);
  background: #fcfaf7;
}

.studio-toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--studio-dark);
  color: #faf6f0;
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
  opacity: 0;
  pointer-events: none;
  z-index: 300;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

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

/* ==========================================================================
   GOOGLE SHEETS RSVP TRACKER & GUEST LIST MODAL
   ========================================================================== */
.rsvp-topbar-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  margin-left: 6px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  background: var(--studio-accent);
  color: #fff;
}

.rsvp-sheet-card {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(47, 94, 65, 0.22);
  background: linear-gradient(180deg, #f6faf7 0%, #fcfaf7 100%);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rsvp-sheet-status {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: #254f36;
}

.rsvp-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2e8555;
  box-shadow: 0 0 0 3px rgba(46, 133, 85, 0.16);
}

.rsvp-sheet-desc {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--studio-muted);
}

.rsvp-sheet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rsvp-modal {
  max-width: 680px;
}

.rsvp-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

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

.rsvp-stat-box {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--studio-border);
  background: #fcfaf7;
  text-align: center;
}

.rsvp-stat-box strong {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px;
  line-height: 1.05;
  color: var(--studio-ink);
}

.rsvp-stat-box span {
  display: block;
  margin-top: 3px;
  font-size: 10.5px;
  color: var(--studio-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.rsvp-table-wrap {
  max-height: 310px;
  overflow: auto;
  border: 1px solid var(--studio-border);
  border-radius: 10px;
  background: #fff;
}

.rsvp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.rsvp-table th {
  position: sticky;
  top: 0;
  background: #f6f2eb;
  color: var(--studio-muted);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--studio-border);
}

.rsvp-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #f2ede6;
  color: var(--studio-ink);
  vertical-align: top;
}

.rsvp-table tr:last-child td {
  border-bottom: none;
}

.rsvp-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.rsvp-pill.is-yes {
  background: rgba(46, 133, 85, 0.12);
  color: #24613f;
}

.rsvp-pill.is-no {
  background: rgba(168, 72, 66, 0.12);
  color: #8c3530;
}

.rsvp-side-breakdown {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: #f8f5f0;
  border: 1px solid var(--studio-border);
  font-size: 11.5px;
  color: var(--studio-muted);
}

.rsvp-side-breakdown strong {
  color: var(--studio-ink);
}

.rsvp-side-sep {
  opacity: 0.45;
}

.rsvp-side-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  background: #f3efe8;
  color: var(--studio-ink);
}

.rsvp-side-tag.is-bride {
  background: rgba(191, 126, 138, 0.14);
  color: #7d3e4b;
}

.rsvp-side-tag.is-groom {
  background: rgba(84, 114, 146, 0.14);
  color: #2f4d6c;
}

.rsvp-side-tag.is-both {
  background: rgba(140, 109, 70, 0.14);
  color: #694e2d;
}

.rsvp-empty-state {
  padding: 28px 16px;
  text-align: center;
  font-size: 12.5px;
  color: var(--studio-muted);
}

/* ==========================================================================
   WEDDING SOUNDTRACK & MUSIC SELECTOR (MEDIA TAB)
   ========================================================================== */
.music-track-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.music-track-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 11px;
  border-radius: 10px;
  border: 1.5px solid var(--studio-border);
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.music-track-card:hover {
  border-color: var(--studio-border-strong);
  background: #fdfbf8;
}

.music-track-card.is-selected {
  border-color: var(--studio-accent);
  background: var(--studio-accent-soft);
}

.music-play-chip {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  background: #f3efe8;
  color: var(--studio-ink);
  border: 1px solid var(--studio-border-strong);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.music-track-card.is-selected .music-play-chip {
  background: var(--studio-accent);
  color: #fff;
  border-color: var(--studio-accent);
}

.music-track-card.is-playing .music-play-chip {
  box-shadow: 0 0 0 4px rgba(140, 109, 70, 0.18);
}

.music-track-info {
  flex: 1;
  min-width: 0;
}

.music-track-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.music-track-top strong {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--studio-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.music-track-info p {
  margin: 2px 0 0;
  font-size: 11px;
  line-height: 1.38;
  color: var(--studio-muted);
}

.audio-file-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--studio-accent-soft);
  color: var(--studio-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  flex-shrink: 0;
}

.audio-file-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.audio-file-meta strong {
  font-size: 12px;
  color: var(--studio-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audio-file-meta span {
  font-size: 11px;
  color: var(--studio-muted);
}

/* ==========================================================================
   MOBILE VIEW SWITCHER & RESPONSIVE BREAKPOINTS
   ========================================================================== */
.mobile-view-switcher {
  display: none;
}

@media (max-width: 960px) {
  .studio-shell {
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
  }

  .studio-topbar {
    height: auto;
    padding: max(10px, env(safe-area-inset-top, 10px)) 14px 10px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .topbar-actions {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }

  .topbar-actions::-webkit-scrollbar {
    display: none;
  }

  .topbar-actions .btn {
    height: 34px;
    padding: 0 12px;
    font-size: 12px;
    flex-shrink: 0;
  }

  .mobile-view-switcher {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 8px 14px;
    background: var(--studio-panel);
    border-bottom: 1px solid var(--studio-border);
    flex-shrink: 0;
  }

  .mobile-view-btn {
    height: 38px;
    border-radius: 999px;
    border: 1px solid var(--studio-border);
    background: #f8f5f0;
    color: var(--studio-muted);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .mobile-view-btn.is-active {
    background: var(--studio-dark);
    border-color: var(--studio-dark);
    color: #faf6f0;
    box-shadow: 0 4px 12px rgba(29, 36, 32, 0.16);
  }

  .studio-workspace {
    display: block;
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }

  .studio-workspace[data-mobile-view='preview'] .inspector-pane {
    display: none;
  }

  .studio-workspace[data-mobile-view='preview'] .preview-stage {
    display: flex;
    height: 100%;
    padding: 12px 14px max(16px, env(safe-area-inset-bottom, 16px));
    gap: 10px;
  }

  .studio-workspace[data-mobile-view='edit'] .preview-stage {
    display: none;
  }

  .studio-workspace[data-mobile-view='edit'] .inspector-pane {
    display: flex;
    height: 100%;
    border-right: none;
    border-top: none;
  }

  .inspector-body {
    -webkit-overflow-scrolling: touch;
    padding-bottom: max(28px, calc(env(safe-area-inset-bottom, 0px) + 20px));
  }

  .preview-toolbar {
    width: 100%;
    max-width: 100%;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 5px 8px;
  }

  .preview-toolbar::-webkit-scrollbar {
    display: none;
  }

  .preview-toolbar > * {
    flex-shrink: 0;
  }

  .phone-frame {
    height: 100%;
    min-height: 0;
    max-height: 700px;
    width: auto;
    max-width: 100%;
    aspect-ratio: 9 / 16;
    flex: 1;
  }
}

@media (max-width: 540px) {
  .studio-topbar {
    padding: max(8px, env(safe-area-inset-top, 8px)) 12px 8px;
  }

  .brand-monogram {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }

  .brand-title {
    font-size: 19px;
  }

  .brand-sub {
    display: none;
  }

  .studio-workspace[data-mobile-view='preview'] .preview-stage {
    padding: 10px 10px max(12px, env(safe-area-inset-bottom, 12px));
    gap: 8px;
  }

  /* On real phones, render a clean sleek card frame without double phone bezel/notch */
  .phone-frame {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: none;
    aspect-ratio: auto;
    padding: 0;
    border-radius: 20px;
    background: transparent;
    box-shadow: 0 12px 34px rgba(24, 20, 16, 0.16);
  }

  .phone-notch {
    display: none;
  }

  .phone-screen {
    border-radius: 20px;
  }

  .phone-screen .card-floating-bar {
    top: 14px;
  }

  /* Prevent iOS Safari input auto-zoom when typing in Studio forms */
  .field input[type='text'],
  .field input[type='date'],
  .field input[type='time'],
  .field input[type='url'],
  .field textarea,
  .field select,
  .day-count-input,
  .day-date-row input {
    font-size: 16px;
  }

  .field-grid-2 {
    gap: 8px;
  }

  .studio-modal {
    width: calc(100% - 20px);
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
  }

  .modal-inner {
    padding: 18px;
    gap: 12px;
  }

  .rsvp-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .share-url-box {
    flex-direction: column;
  }

  .share-url-box .btn {
    width: 100%;
  }

  .guest-card-viewport {
    width: 100vw;
    height: 100dvh;
    aspect-ratio: auto;
    border-radius: 0;
  }

  .guest-exit-btn {
    top: max(12px, env(safe-area-inset-top, 12px));
    right: 12px;
  }
}
