:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --soft: #f3ece2;
  --maroon: #6b1d2f;
  --maroon-dark: #4d1220;
  --gold: #c59b27;
  --gold-soft: #e6d4a3;
  --text: #241b1e;
  --muted: #66585c;
  --border: #e7ddd0;
  --ok: #1b6b43;
  --warn: #9a5b00;
  --font-serif: "Cormorant Garamond", Georgia, serif;
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    radial-gradient(circle at 10% 5%, rgba(197, 155, 39, 0.13), transparent 36%),
    radial-gradient(circle at 90% 90%, rgba(107, 29, 47, 0.08), transparent 40%);
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

.studio-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

/* Header */
.studio-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 24px;
}

.studio-badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(107, 29, 47, 0.08);
  border: 1px solid var(--gold-soft);
  color: var(--maroon);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.studio-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4.8vw, 3rem);
  font-weight: 700;
  line-height: 1.08;
  color: var(--maroon);
  margin: 0 0 8px;
}

.studio-subtitle {
  font-size: 0.98rem;
  color: var(--muted);
  margin: 0;
}

/* Two-Column Grid */
.studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 22px;
  align-items: start;
}

.panel-card {
  background: var(--surface);
  border: 1px solid var(--gold-soft);
  border-radius: 22px;
  padding: 22px;
  box-shadow: 0 16px 42px rgba(58, 22, 30, 0.07);
}

.panel-sticky {
  position: sticky;
  top: 16px;
}

.form-section + .form-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 12px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--maroon);
}

.section-tag {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--muted);
}

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

.field-group {
  margin-bottom: 11px;
}

.field-group:last-child {
  margin-bottom: 0;
}

.field-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
}

.input,
.textarea {
  width: 100%;
  min-height: 44px;
  border-radius: 11px;
  border: 1.5px solid var(--border);
  background: #ffffff;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  padding: 9px 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

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

.input:focus,
.textarea:focus {
  outline: none;
  border-color: var(--maroon);
  box-shadow: 0 0 0 3px rgba(107, 29, 47, 0.09);
}

.status-text {
  font-size: 0.76rem;
  margin: 5px 0 0;
  color: var(--muted);
}

.status-text.ok {
  color: var(--ok);
  font-weight: 600;
}

.status-text.warn {
  color: var(--warn);
  font-weight: 600;
}

/* Segmented Controls & Swatches */
.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.seg-btn {
  min-height: 46px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.seg-btn strong {
  display: block;
  font-size: 0.86rem;
  color: var(--maroon);
}

.seg-btn.active {
  background: rgba(107, 29, 47, 0.07);
  border-color: var(--maroon);
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.theme-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 11px;
  border: 1.5px solid var(--border);
  background: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.theme-btn.active {
  border-color: var(--maroon);
  background: var(--bg);
}

.swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  flex-shrink: 0;
}

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

.format-btn {
  min-height: 48px;
  padding: 8px 6px;
  border-radius: 11px;
  border: 1.5px solid var(--border);
  background: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  text-align: center;
}

.format-btn span {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--muted);
}

.format-btn.active {
  border-color: var(--maroon);
  background: var(--maroon);
  color: #ffffff;
}

.format-btn.active span {
  color: rgba(255, 255, 255, 0.85);
}

.photo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.file-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 7px 13px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--maroon);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

/* Preview Panel */
.preview-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.tab-btn {
  flex: 1;
  min-height: 40px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.83rem;
  font-weight: 700;
  cursor: pointer;
}

.tab-btn.active {
  background: var(--maroon);
  border-color: var(--maroon);
  color: #ffffff;
}

.canvas-stage {
  background: #efeae2;
  border-radius: 16px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 360px;
}

#card-preview-canvas {
  max-width: 100%;
  max-height: 520px;
  width: auto;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.14);
}

/* Mobile Web Page Preview Mockup */
.web-preview-box {
  background: var(--bg);
  border: 1px solid var(--gold-soft);
  border-radius: 18px;
  padding: 18px 16px;
  text-align: center;
}

.web-preview-names {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--maroon);
  margin: 0 0 4px;
}

.web-preview-meta {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 0 10px;
}

.web-preview-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 12px 0;
}

.web-preview-pill {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--maroon);
}

.web-preview-cta {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--maroon);
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 700;
  margin-top: 6px;
}

/* Download Actions */
.export-actions {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn-download-pdf {
  grid-column: 1 / -1;
  min-height: 52px;
  border-radius: 13px;
  border: none;
  background: linear-gradient(135deg, var(--maroon), var(--maroon-dark));
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(107, 29, 47, 0.24);
}

.btn-download-pdf:hover {
  opacity: 0.95;
}

.btn-outline {
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 11px;
  border: 1.5px solid var(--border);
  background: #ffffff;
  color: var(--maroon);
  font-family: var(--font-sans);
  font-size: 0.83rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-outline:hover {
  border-color: var(--gold);
  background: var(--bg);
}

.btn-full {
  grid-column: 1 / -1;
}

.tips-box {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--soft);
  font-size: 0.78rem;
  color: var(--muted);
}

.footer-row {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--muted);
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--maroon);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(24, 12, 16, 0.62);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 200;
}

.modal-dialog {
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  background: #ffffff;
  border: 2px solid var(--gold-soft);
  border-radius: 22px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.modal-header h3 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: var(--maroon);
  margin: 0;
}

.guide-steps {
  margin: 0 0 14px;
  padding-left: 18px;
  font-size: 0.85rem;
  color: var(--text);
}

.guide-steps li + li {
  margin-top: 5px;
}

.code-box {
  background: #1d1719;
  color: #f8f2e9;
  border-radius: 12px;
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.74rem;
  line-height: 1.45;
  overflow-x: auto;
  max-height: 230px;
  margin: 0 0 12px;
}

.print-only {
  display: none;
}

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

@media (max-width: 480px) {
  .two-col,
  .segmented,
  .theme-grid,
  .format-grid,
  .export-actions {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: #ffffff !important;
  }
  .no-print {
    display: none !important;
  }
  .print-only {
    display: block !important;
    text-align: center;
  }
  .print-only img {
    max-width: 100%;
    max-height: 98vh;
  }
}

.studio-home-link {
  display: inline-block;
  margin: 0 0 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--maroon);
  text-decoration: none;
}
.studio-home-link:hover {
  text-decoration: underline;
}
.studio-home-link + .studio-badge {
  margin-left: 8px;
}

/* Shader7 site bar (removed from exported wedding sites) */
.s7-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 16px 0;
  font-family: var(--font-sans);
  font-size: 0.85rem;
}
.s7-brand {
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--maroon);
  text-decoration: none;
}
.s7-mark {
  color: var(--gold);
}
.s7-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}
.s7-links a {
  color: var(--maroon);
  font-weight: 600;
  text-decoration: none;
}
.s7-links a:hover {
  text-decoration: underline;
}
.s7-links .s7-all {
  border: 1px solid var(--gold);
  border-radius: 999px;
  padding: 5px 12px;
}
@media print {
  .s7-bar {
    display: none !important;
  }
}

#card-preview-canvas[data-banner="1"] {
  max-height: 640px;
}

.closing-suggest {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 8px;
}
.closing-suggest select {
  font-size: 0.85rem;
}
.closing-suggest .btn-outline {
  white-space: nowrap;
}
