.sl-app {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 26px;
  align-items: start;
}
.sl-controls {
  background: #FFFFFF;
  border: 1px solid #E4D7C0;
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 14px 36px rgba(20, 14, 10, 0.08);
}
.sl-section-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #9E1B24;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sl-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #9E1B24;
  color: #fff;
  font-size: 0.7rem;
  margin-right: 6px;
}
.sl-templates {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}
.sl-tpl-btn {
  border: 2px solid #E6DAC6;
  background: #FAF6EE;
  border-radius: 12px;
  padding: 8px 4px 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #231C17;
  transition: border-color 0.16s, transform 0.14s, box-shadow 0.16s;
}
.sl-tpl-btn:hover { border-color: #C89D3C; transform: translateY(-2px); }
.sl-tpl-btn.active { border-color: #9E1B24; background: #FFF8EE; box-shadow: 0 4px 12px rgba(158, 27, 36, 0.18); }
.sl-swatch {
  width: 34px;
  height: 24px;
  border-radius: 5px;
  border: 1.5px solid rgba(0,0,0,0.12);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.65);
}
.sl-tag-free, .sl-tag-pro {
  font-size: 0.58rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sl-tag-free { background: #DFF2E6; color: #143A2B; }
.sl-tag-pro { background: #F5E6BE; color: #7A5400; }

.sl-field { margin-bottom: 12px; }
.sl-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sl-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #3A3029;
  margin-bottom: 4px;
}
.sl-field input, .sl-field select, .sl-field textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #D9CCB7;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.89rem;
  color: #231C17;
  background: #FFFDF9;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.sl-field input:focus, .sl-field select:focus, .sl-field textarea:focus {
  outline: none;
  border-color: #9E1B24;
  box-shadow: 0 0 0 3px rgba(158, 27, 36, 0.12);
}
.sl-field textarea { min-height: 112px; resize: vertical; line-height: 1.55; }

.sl-quick-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.sl-mini-btn {
  background: #F3EAD8;
  border: 1px solid #DECFAF;
  color: #143A2B;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.sl-mini-btn:hover { background: #EAE0CA; }

.sl-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FAF5EC;
  border: 1px solid #E4D7C0;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 0.83rem;
  font-weight: 600;
  color: #143A2B;
}
.sl-toggle-row input { width: 18px; height: 18px; accent-color: #9E1B24; cursor: pointer; }

.sl-preview-col { display: flex; flex-direction: column; gap: 14px; }
.sl-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #FFFFFF;
  border: 1px solid #E4D7C0;
  border-radius: 14px;
  padding: 10px 14px;
  box-shadow: 0 6px 18px rgba(20, 14, 10, 0.05);
}
.sl-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.sl-tab {
  border: 1px solid #E4D7C0;
  background: #FAF5EC;
  color: #3A3029;
  font-weight: 600;
  font-size: 0.83rem;
  padding: 7px 13px;
  border-radius: 9px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.sl-tab.active { background: #143A2B; color: #fff; border-color: #143A2B; }
.sl-paper-toggle { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 600; color: #65594E; }
.sl-paper-toggle select {
  padding: 6px 9px;
  border: 1px solid #D9CCB7;
  border-radius: 8px;
  background: #FAF5EC;
  font-weight: 600;
  color: #231C17;
}

/* Luxury Evergreen Velvet Desk Stage */
.sl-stage {
  background:
    radial-gradient(circle at 20% 15%, rgba(200, 157, 60, 0.18) 0%, transparent 40%),
    radial-gradient(circle at 80% 85%, rgba(158, 27, 36, 0.2) 0%, transparent 45%),
    linear-gradient(145deg, #122E22 0%, #1B4232 52%, #10261D 100%);
  border-radius: 20px;
  padding: 28px 24px;
  display: flex;
  justify-content: center;
  border: 1px solid #2A5744;
  box-shadow: inset 0 2px 18px rgba(0, 0, 0, 0.35);
}

.sl-sheet {
  width: 100%;
  max-width: 650px;
  min-height: 810px;
  background: #FFFDF8;
  border-radius: 4px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42), 0 2px 6px rgba(0, 0, 0, 0.2);
  padding: 44px 48px 40px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #2A211B;
  font-family: 'Lora', Georgia, serif;
}

/* Outer Decorative Frame */
.sl-frame-outer {
  position: absolute;
  inset: 14px;
  border: 2.5px solid var(--tpl-border, #9E1B24);
  pointer-events: none;
  border-radius: 2px;
}
.sl-frame-inner {
  position: absolute;
  inset: 21px;
  border: 1px solid var(--tpl-accent, #C89D3C);
  pointer-events: none;
}

/* Special Patterned Borders for Candy Cane & Air Mail */
.sl-sheet[data-tpl="candy-cane"] {
  background: #FFFDF9;
  --tpl-border: #C1121F;
  --tpl-accent: #1B4332;
  --tpl-head: #B5121B;
  --tpl-seal: #C1121F;
}
.sl-sheet[data-tpl="candy-cane"] .sl-frame-outer {
  inset: 10px;
  border: 8px solid transparent;
  border-image: repeating-linear-gradient(45deg, #C1121F 0 10px, #FFFFFF 10px 20px, #1B4332 20px 23px, #FFFFFF 23px 32px) 10;
}
.sl-sheet[data-tpl="reindeer-express"] {
  background: #FCF8F0;
  --tpl-border: #7F4F24;
  --tpl-accent: #9E1B24;
  --tpl-head: #6B3E1B;
  --tpl-seal: #1B4332;
}
.sl-sheet[data-tpl="reindeer-express"] .sl-frame-outer {
  inset: 10px;
  border: 7px solid transparent;
  border-image: repeating-linear-gradient(-45deg, #9E1B24 0 12px, #FCF8F0 12px 20px, #1B4332 20px 32px, #FCF8F0 32px 40px) 10;
}
.sl-sheet[data-tpl="classic-red"] { background: #FFFDF8; --tpl-border: #9E1B24; --tpl-accent: #C89D3C; --tpl-head: #9E1B24; --tpl-seal: #9E1B24; }
.sl-sheet[data-tpl="evergreen-pine"] { background: #FAFDF9; --tpl-border: #143A2B; --tpl-accent: #C89D3C; --tpl-head: #143A2B; --tpl-seal: #143A2B; }
.sl-sheet[data-tpl="royal-gold"] { background: radial-gradient(circle at 50% 0%, #FFFDF5 0%, #F7E8C3 100%); --tpl-border: #B8860B; --tpl-accent: #9E1B24; --tpl-head: #7A1418; --tpl-seal: #B8860B; }
.sl-sheet[data-tpl="vintage-parchment"] { background: radial-gradient(circle at 50% 45%, #F9F0DF 35%, #E7D2AE 100%); --tpl-border: #6D4422; --tpl-accent: #9E1B24; --tpl-head: #593315; --tpl-seal: #8A241E; }
.sl-sheet[data-tpl="winter-frost"] { background: linear-gradient(180deg, #F5FAFE 0%, #E3EFFA 100%); --tpl-border: #1B4965; --tpl-accent: #62B6CB; --tpl-head: #163A59; --tpl-seal: #1B4965; }
.sl-sheet[data-tpl="elf-workshop"] { background: #F7FCF8; --tpl-border: #1F513D; --tpl-accent: #C1121F; --tpl-head: #143A2B; --tpl-seal: #C1121F; }

/* Corner Ornaments */
.sl-corner {
  position: absolute;
  width: 44px;
  height: 44px;
  color: var(--tpl-accent, #C89D3C);
  pointer-events: none;
  opacity: 0.85;
}
.sl-corner.tl { top: 23px; left: 23px; }
.sl-corner.tr { top: 23px; right: 23px; transform: scaleX(-1); }
.sl-corner.bl { bottom: 23px; left: 23px; transform: scaleY(-1); }
.sl-corner.br { bottom: 23px; right: 23px; transform: scale(-1); }

/* Top Holly Crown */
.sl-holly-crown {
  display: flex;
  justify-content: center;
  margin: -6px 0 8px;
}

.sl-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-bottom: 1.5px solid rgba(200, 157, 60, 0.45);
  padding-bottom: 14px;
  margin-bottom: 20px;
}
.sl-letterhead-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.52rem;
  font-weight: 800;
  color: var(--tpl-head, #9E1B24);
  margin: 0 0 3px;
  letter-spacing: 0.01em;
}
.sl-letterhead-sub {
  font-family: 'Inter', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #6B5D52;
  margin: 0;
}
.sl-postmark-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sl-date-line { font-size: 0.84rem; color: #6B5D52; margin: 0 0 12px; font-style: italic; }
.sl-greeting { font-family: 'Playfair Display', Georgia, serif; font-size: 1.32rem; font-weight: 700; color: var(--tpl-head, #9E1B24); margin: 0 0 14px; }
.sl-letter-body { font-size: 0.99rem; line-height: 1.82; white-space: pre-line; margin: 0 0 24px; color: #2D241E; }
.sl-blank-lines { display: flex; flex-direction: column; gap: 30px; margin: 22px 0 38px; }
.sl-blank-line { border-bottom: 1px dashed #B9A890; height: 1px; width: 100%; }

.sl-signoff-row {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.sl-signoff-warm { font-style: italic; margin: 0 0 4px; font-size: 0.94rem; color: #4A3E35; }
.sl-signature { font-family: 'Dancing Script', cursive; font-size: 2.55rem; font-weight: 700; color: var(--tpl-head, #9E1B24); line-height: 1.05; margin: 0; }
.sl-wax-seal { width: 76px; height: 76px; flex-shrink: 0; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.22)); }
.sl-ps { margin-top: 14px; font-size: 0.86rem; color: #52463D; border-top: 1px dotted #C8B89E; padding-top: 10px; font-style: italic; }

/* Envelope View */
.sl-envelope { min-height: 430px !important; justify-content: space-between; padding: 40px 46px; }
.sl-env-top { display: flex; justify-content: space-between; align-items: flex-start; }
.sl-env-from { font-size: 0.84rem; line-height: 1.55; color: #4A3F35; }
.sl-env-to { margin: 36px auto 22px; text-align: center; font-family: 'Playfair Display', Georgia, serif; }
.sl-env-to-name { font-size: 2rem; font-weight: 700; color: var(--tpl-head, #9E1B24); margin: 0 0 6px; }
.sl-env-to-addr { font-size: 1.08rem; color: #362E28; margin: 0; font-family: 'Lora', serif; }
.sl-env-airmail {
  text-align: center;
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  color: #143A2B;
  border-top: 2px solid #9E1B24;
  border-bottom: 2px solid #143A2B;
  padding: 7px;
}

/* Nice List Certificate View */
.sl-cert { min-height: 570px !important; text-align: center; justify-content: center; gap: 12px; }
.sl-cert-kicker { font-family: 'Inter', sans-serif; font-size: 0.74rem; font-weight: 800; letter-spacing: 0.2em; text-transform: uppercase; color: #B8860B; margin: 0; }
.sl-cert-title { font-family: 'Playfair Display', Georgia, serif; font-size: 2.2rem; font-weight: 800; color: var(--tpl-head, #9E1B24); margin: 0; }
.sl-cert-name { font-family: 'Dancing Script', cursive; font-size: 3.2rem; font-weight: 700; color: #143A2B; margin: 4px 0; border-bottom: 2px solid #C89D3C; display: inline-block; padding: 0 28px; }
.sl-cert-body { max-width: 490px; margin: 6px auto; font-size: 0.99rem; line-height: 1.75; }

.sl-lock-ribbon {
  position: absolute;
  top: 24px;
  right: -36px;
  background: linear-gradient(135deg, #9E1B24, #751118);
  color: #FFFDF8;
  font-family: 'Inter', sans-serif;
  font-size: 0.66rem;
  font-weight: 700;
  padding: 6px 42px;
  transform: rotate(35deg);
  letter-spacing: 0.08em;
  z-index: 4;
  box-shadow: 0 3px 10px rgba(0,0,0,0.22);
}
.sl-lock-ribbon.hidden { display: none; }

.sl-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.sl-actions .np-btn { flex: 1; min-width: 180px; }
.sl-upsell-bar {
  background: linear-gradient(135deg, #143A2B 0%, #1F513D 60%, #143A2B 100%);
  color: #FAF6EE;
  border-radius: 16px;
  padding: 18px 20px;
  border: 1px solid #C89D3C;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  box-shadow: 0 12px 28px rgba(20, 58, 43, 0.2);
}
.sl-upsell-copy h3 { margin: 0 0 4px; font-family: 'Playfair Display', Georgia, serif; font-size: 1.15rem; color: #F5E6BE; }
.sl-upsell-copy p { margin: 0; font-size: 0.85rem; color: #DCE9E1; max-width: 470px; }
.sl-upsell-cta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sl-status-msg {
  font-size: 0.85rem;
  color: #143A2B;
  background: #E8F5EC;
  border: 1px solid #B7DEC4;
  border-radius: 10px;
  padding: 10px 14px;
  display: none;
}
.sl-status-msg.show { display: block; }

@media (max-width: 960px) {
  .sl-app { grid-template-columns: 1fr; }
  .sl-stage { padding: 14px; }
  .sl-sheet { padding: 30px 24px; min-height: 640px; }
}