/* Invitation & site: tabs next to a live preview (classes prefixed si-). Loaded last. */
:root {
  --si-ink: #1d2b36;
  --si-muted: #5b6b78;
  --si-line: #e3e9ee;
  --si-soft: #f4f8fb;
  --si-accent: #2f6687;
  --si-yes: #1f7a5a;
  --si-yes-bg: #e3f3ec;
  --si-wait: #94570a;
  --si-wait-bg: #fdf0d8;
}

/* Header: title, state and the two page-level actions */
.si-state {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 10px 0 0;
  color: var(--si-muted);
  font-size: 14px;
}
.si-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.si-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.5;
}
.si-pill-live,
.si-pill-draft {
  padding-left: 10px;
}
.si-pill-live::before,
.si-pill-draft::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.si-pill-live {
  background: var(--si-yes-bg);
  color: var(--si-yes);
}
.si-pill-draft {
  background: var(--si-wait-bg);
  color: var(--si-wait);
}
.si-pill-plain {
  background: var(--si-soft);
  color: var(--si-muted);
}

.si-btn:focus-visible,
.si-template:focus-visible,
.si-file:focus-within {
  outline: 3px solid #39799f;
  outline-offset: 2px;
}
.si-panel {
  padding: 24px;
}
.si-panel[hidden] {
  display: none;
}
.si-h {
  margin: 0 0 6px;
  font-family: Manrope, sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--si-ink);
}
.si-h2 {
  margin: 28px 0 14px;
  padding-top: 24px;
  border-top: 1px solid var(--si-line);
  font-family: Manrope, sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--si-ink);
}
.si-hint {
  max-width: 62ch;
  margin: 0 0 18px;
  color: var(--si-muted);
  font-size: 13.5px;
  line-height: 1.6;
}
.si-form {
  display: grid;
  gap: 20px;
}
.si-form .si-hint {
  margin: 0;
}
.si-form-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.si-form-top .si-h {
  margin: 0;
}

/* Fields */
.si-group {
  display: grid;
  gap: 16px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.si-group + .si-group {
  padding-top: 20px;
  border-top: 1px solid var(--si-line);
}
.si-group legend {
  float: left;
  width: 100%;
  margin: 0;
  padding: 0;
  font-family: Manrope, sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--si-ink);
}
.si-group legend + * {
  clear: both;
}
.si-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.si-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--si-ink);
}
.si-field input:not([type='file']),
.si-field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #c8d4dc;
  border-radius: 8px;
  background: #fff;
  color: var(--si-ink);
  font-size: 14px;
  line-height: 1.5;
}
.si-field textarea {
  resize: vertical;
}
.si-field input:focus-visible,
.si-field textarea:focus-visible {
  outline: 3px solid #39799f55;
  border-color: #39799f;
}
.si-field small {
  color: var(--si-muted);
  font-size: 12.5px;
  line-height: 1.5;
}
.si-panel .address-input {
  display: flex;
  align-items: center;
}
.si-panel .address-input input {
  flex: 1;
  min-width: 0;
  border-radius: 8px 0 0 8px;
}
.si-panel .address-input span {
  display: grid;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #c8d4dc;
  border-left: 0;
  border-radius: 0 8px 8px 0;
  background: var(--si-soft);
  color: var(--si-muted);
  font-size: 14px;
}
.si-panel .address-status {
  margin: 0;
}
.si-url {
  margin: 0;
  color: var(--si-muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

/* Buttons and file pickers */
.si-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #c8dce9;
  border-radius: 8px;
  background: #fff;
  color: #214c68;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 0.15s;
}
.si-btn:hover:not(:disabled) {
  background: #eef7fc;
}
.si-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.si-btn-quiet {
  border-color: transparent;
  background: transparent;
  color: var(--si-accent);
}
.si-file input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.si-media-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.si-thumb {
  width: 100%;
  max-width: 220px;
  max-height: 140px;
  object-fit: cover;
  border: 1px solid var(--si-line);
  border-radius: 8px;
}
.si-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 12px;
}
.si-gallery > div {
  position: relative;
  min-width: 0;
}
.si-gallery img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--si-line);
  border-radius: 8px;
}
.si-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: #1d2b36cc;
  color: #fff;
  font-size: 18px;
  line-height: 1;
}
.si-gallery-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.si-gallery-tools .si-btn {
  min-height: 34px;
  padding: 0 9px;
  font-size: 12px;
}
.si-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}
.si-foot #editor-save-status {
  margin: 0;
  color: var(--si-muted);
  font-size: 13px;
}

/* Templates */
.si-templates {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px 10px;
}
.si-template {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--si-line);
  border-radius: 10px;
  background: #fff;
  text-align: left;
  transition: background-color 0.15s;
}
.si-template:hover {
  background: var(--si-soft);
}
.si-template[aria-pressed='true'] {
  border-color: #39799f;
  box-shadow: inset 0 0 0 1px #39799f;
  background: #f3f9fd;
}
.si-swatch {
  display: grid;
  place-items: center;
  width: 64px;
  height: 48px;
  border-radius: 6px;
  font-family: Georgia, serif;
  font-size: 22px;
}
.si-swatch-celebration {
  border-radius: 32px 32px 6px 6px;
  font-style: italic;
}
.si-swatch-minimal {
  border-radius: 4px;
  font-family: Manrope, sans-serif;
  font-weight: 800;
}
.si-template-text b {
  display: block;
  color: var(--si-ink);
  font-size: 14.5px;
}
.si-template-text small {
  display: block;
  margin-top: 2px;
  color: var(--si-muted);
  font-size: 12.5px;
}
.si-check {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: #39799f;
}
.si-check .icon,
.si-check svg {
  width: 100%;
  height: 100%;
}

/* After publication */
.si-actions-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.si-actions-list li {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: center;
  gap: 8px 16px;
}
.si-actions-list span {
  color: var(--si-muted);
  font-size: 13px;
  line-height: 1.5;
}

/* Preview */
.si-preview {
  position: sticky;
  top: calc(var(--app-bar-h, 0px) + 88px);
  max-height: calc(100vh - var(--app-bar-h, 0px) - 104px);
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--si-line);
  border-radius: 12px;
  background: var(--si-soft);
}
.si-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 14px;
}
.si-preview-head h2 {
  margin: 0;
  font-family: Manrope, sans-serif;
  font-size: 15px;
  font-weight: 700;
}
.si-preview .preview-switch {
  margin: 0;
}
.si-preview .preview-switch .si-btn {
  min-height: 36px;
}
.si-preview .preview-switch [aria-pressed='true'] {
  background: #dff2fc;
  border-color: #7dbbde;
}

@media (max-width: 640px) {
  .si-panel {
    padding: 18px 16px;
  }
  .si-head-actions {
    width: 100%;
  }
  .si-head-actions .btn {
    flex: 1;
  }
  .si-actions-list li {
    grid-template-columns: 1fr;
  }
  .si-btn {
    min-height: 44px;
  }
  .si-preview {
    padding: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .si-btn,
  .si-template {
    transition: none;
  }
}

/* Previous / next between the tabs */
.si-step-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--si-line);
}
.si-step-nav .btn {
  gap: 8px;
}
.si-step-nav .icon {
  width: 18px;
  height: 18px;
}
.si-step-nav .icon svg {
  width: 100%;
  height: 100%;
}
.si-prev .icon {
  transform: rotate(180deg);
}
.si-next {
  margin-left: auto;
}
@media (max-width: 640px) {
  .si-step-nav .btn {
    flex: 1;
  }
}

/* Studio: palettes, colours, fonts, layouts */
.si-palettes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.si-palette {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--si-line);
  border-radius: 10px;
  background: #fff;
  color: var(--si-ink);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}
.si-palette:hover {
  background: var(--si-soft);
}
.si-palette:focus-visible,
.si-icon:focus-visible,
.si-slot summary:focus-visible,
.si-choice input:focus-visible + .si-choice-body,
.si-switch input:focus-visible + span {
  outline: 3px solid #39799f;
  outline-offset: 2px;
}
.si-dots {
  display: flex;
  height: 26px;
  overflow: hidden;
  border: 1px solid var(--si-line);
  border-radius: 6px;
}
.si-dots i {
  flex: 1;
}
.si-colors {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.si-color {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.si-color-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.si-color input[type='color'] {
  width: 48px;
  height: 44px;
  padding: 3px;
  border: 1px solid #c8d4dc;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}
.si-color output {
  color: var(--si-muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-transform: uppercase;
}
.si-contrast {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}
.si-contrast[data-state='ok'] {
  color: var(--si-yes);
}
.si-contrast[data-state='warn'] {
  color: var(--si-wait);
}
.si-choices {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.si-choice {
  position: relative;
  display: block;
  cursor: pointer;
}
.si-choice input {
  position: absolute;
  opacity: 0;
}
.si-choice-body {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
  padding: 10px 12px;
  border: 1px solid var(--si-line);
  border-radius: 10px;
  background: #fff;
}
.si-choice:hover .si-choice-body {
  background: var(--si-soft);
}
.si-choice input:checked + .si-choice-body {
  border-color: #39799f;
  box-shadow: inset 0 0 0 1px #39799f;
  background: #f3f9fd;
}
.si-choice b {
  display: block;
  color: var(--si-ink);
  font-size: 14px;
}
.si-choice small {
  display: block;
  margin-top: 2px;
  color: var(--si-muted);
  font-size: 12px;
  line-height: 1.4;
}
.si-font-sample {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--si-soft);
  color: var(--si-ink);
  font-size: 24px;
}
/* Font tiles that are not plain "Aa": script size, italic, capitals */
.si-fs-vibes,
.si-fs-handwritten {
  font-size: 30px;
  font-weight: 400;
}
.si-fs-engraved,
.si-fs-fine {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.si-fs-calligraphy {
  font-size: 30px;
  font-weight: 400;
}
.si-fs-classic-italic {
  font-size: 28px;
  font-style: italic;
  font-weight: 600;
}
.si-fs-caps,
.si-fs-deco {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.si-fs-geometric,
.si-fs-contemporary {
  font-weight: 700;
}
.si-layout-sample {
  display: grid;
  align-content: center;
  gap: 4px;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 8px;
  border-radius: 8px;
  background: var(--si-soft);
}
.si-layout-sample i {
  height: 4px;
  border-radius: 2px;
  background: #7d93a3;
}
.si-layout-romantic i,
.si-layout-celebration i {
  margin-inline: auto;
}
.si-layout-romantic i:nth-child(1) {
  width: 40%;
}
.si-layout-romantic i:nth-child(2) {
  width: 80%;
}
.si-layout-romantic i:nth-child(3) {
  width: 60%;
}
.si-layout-celebration i:nth-child(1) {
  width: 60%;
  transform: skewX(-20deg);
}
.si-layout-celebration i:nth-child(2) {
  width: 90%;
}
.si-layout-celebration i:nth-child(3) {
  width: 50%;
}
.si-layout-minimal i:nth-child(1) {
  width: 70%;
}
.si-layout-minimal i:nth-child(2) {
  width: 90%;
}
.si-layout-minimal i:nth-child(3) {
  width: 45%;
}

/* Studio: sections list */
.si-sections {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.si-section {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--si-line);
  border-radius: 10px;
  background: #fff;
}
.si-section.is-locked {
  background: var(--si-soft);
}
.si-section-text b {
  display: block;
  color: var(--si-ink);
  font-size: 14.5px;
}
.si-section-text small {
  display: block;
  margin-top: 2px;
  color: var(--si-muted);
  font-size: 12.5px;
  line-height: 1.45;
}
.si-section-text .si-warn {
  color: var(--si-wait);
}
.si-section-actions {
  display: flex;
  gap: 4px;
}
.si-icon {
  width: 36px;
  height: 36px;
  border: 1px solid #c8dce9;
  border-radius: 8px;
  background: #fff;
  color: #214c68;
  font-size: 16px;
}
.si-icon:hover:not(:disabled) {
  background: #eef7fc;
}
.si-icon:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.si-switch {
  position: relative;
  display: inline-block;
  flex: none;
  width: 44px;
  height: 26px;
  cursor: pointer;
}
.si-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.si-switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #c8d4dc;
  transition: background-color 0.15s;
}
.si-switch span::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s;
}
.si-switch input:checked + span {
  background: #285e7d;
}
.si-switch input:checked + span::after {
  transform: translateX(18px);
}
.si-switch input:disabled {
  cursor: not-allowed;
}
.si-switch input:disabled + span {
  opacity: 0.45;
}

/* Studio: venue, contacts and free blocks in the content form */
.si-contact {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--si-line);
  border-radius: 10px;
}
.si-contact b {
  color: var(--si-ink);
  font-size: 13.5px;
}
.si-slot {
  border: 1px solid var(--si-line);
  border-radius: 10px;
}
.si-slot summary {
  padding: 12px 14px;
  color: var(--si-ink);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.si-slot[open] summary {
  border-bottom: 1px solid var(--si-line);
}
.si-slot > .si-field {
  margin: 14px;
}
.si-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.si-field select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #c8d4dc;
  border-radius: 8px;
  background: #fff;
  color: var(--si-ink);
  font-size: 14px;
}
/* A moment of the ceremony: a summary (what, where, when) and a compact form */
.si-moment > summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.si-moment-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.si-moment > summary small {
  flex: none;
  max-width: 55%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--si-muted);
  font-size: 12.5px;
  font-weight: 500;
}
.si-moment-body {
  display: grid;
  gap: 12px;
  padding: 14px;
}
.si-chips {
  display: flex;
  gap: 6px;
}
.si-chip {
  flex: 1;
  cursor: pointer;
}
.si-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.si-chip span {
  display: block;
  padding: 8px 6px;
  border: 1px solid #c8d4dc;
  border-radius: 999px;
  background: #fff;
  color: var(--si-ink);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}
.si-chip input:checked + span {
  border-color: var(--accent, #2f6687);
  background: var(--accent, #2f6687);
  color: #fff;
}
.si-chip input:focus-visible + span {
  outline: 3px solid #39799f55;
  outline-offset: 1px;
}

@media (max-width: 640px) {
  .si-colors {
    grid-template-columns: minmax(0, 1fr);
  }
  .si-section {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .si-section-actions {
    grid-column: 2;
  }
  .si-icon {
    width: 44px;
    height: 44px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .si-switch span,
  .si-switch span::after {
    transition: none;
  }
}

/* Programme steps and dress-code colours in the content form */
.si-steps {
  display: grid;
  gap: 8px;
}
.si-step {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    'times actions'
    'title title';
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--si-line);
  border-radius: 10px;
  background: var(--si-soft);
}
.si-step-times {
  display: flex;
  grid-area: times;
  align-items: flex-end;
  gap: 8px;
}
.si-step-time {
  display: grid;
  flex: 1;
  gap: 3px;
  min-width: 0;
}
.si-step-time small {
  color: var(--si-muted);
  font-size: 11.5px;
  font-weight: 600;
}
.si-step-time input {
  width: 100%;
  min-width: 0;
}
.si-step > [data-step-title] {
  grid-area: title;
}
.si-step-actions {
  grid-area: actions;
}
.si-step input {
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid #c8d4dc;
  border-radius: 8px;
  background: #fff;
  color: var(--si-ink);
  font-size: 14px;
}
.si-step input:focus-visible {
  outline: 3px solid #39799f55;
  border-color: #39799f;
}
.si-step-actions {
  display: flex;
  gap: 4px;
}
.si-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.si-swatch {
  position: relative;
  display: inline-block;
}
.si-swatch input {
  display: block;
  width: 48px;
  height: 48px;
  padding: 3px;
  border: 1px solid #c8d4dc;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}
.si-swatch button {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: #1d2b36;
  color: #fff;
  font-size: 14px;
  line-height: 1;
}
.si-swatch button:focus-visible,
.si-swatch input:focus-visible {
  outline: 3px solid #39799f;
  outline-offset: 2px;
}

/* Checklist before publishing */
.si-prepub {
  margin-bottom: 22px;
  padding: 16px;
  border: 1px solid var(--si-line);
  border-radius: 10px;
  background: var(--si-soft);
}
.si-check-title {
  margin: 0 0 10px;
  font-family: Manrope, sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--si-ink);
}
.si-checklist {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.si-check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  font-size: 14px;
}
.si-check-label {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.si-check-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
}
.is-ok .si-check-icon {
  background: var(--si-yes-bg);
  color: var(--si-yes);
}
.is-warn .si-check-icon {
  background: var(--si-wait-bg);
  color: var(--si-wait);
}
.is-warn .si-check-label {
  color: var(--si-wait);
}

/* Full-screen preview */
.modal-box:has(.preview-device) {
  width: min(980px, 96vw);
  max-width: min(980px, 96vw);
}
.preview-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.preview-toolbar [aria-pressed='true'] {
  background: #dff2fc;
  border-color: #7dbbde;
}
.preview-stage {
  display: flex;
  justify-content: center;
  padding: 16px;
  border-radius: 10px;
  background: var(--si-soft);
}
.preview-stage .pv-slot {
  flex: none;
}
.preview-stage .pv-frame {
  height: min(70vh, 760px);
}
.preview-device {
  overflow: auto;
  background: #fff;
}
.preview-device .invitation {
  border-radius: 0;
}

@media (max-width: 640px) {
  .si-step {
    grid-template-columns: 96px minmax(0, 1fr);
  }
  .si-step-actions {
    grid-column: 1 / -1;
  }
  .si-step .si-icon {
    width: 44px;
    height: 44px;
  }
}

/* Gift box rows in the content form */
.si-gifts {
  display: grid;
  gap: 12px;
}
.si-gift {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--si-line);
  border-radius: 10px;
}
.si-gift-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.si-gift-head .si-field {
  flex: 1;
  max-width: 260px;
}
.si-gift-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.si-gift-fields[hidden] {
  display: none;
}
.si-gift-holder {
  grid-template-columns: minmax(0, 1fr);
}
.si-gift[data-type='link'] .si-gift-holder {
  display: none;
}
.si-gift select {
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid #c8d4dc;
  border-radius: 8px;
  background: #fff;
  color: var(--si-ink);
  font-size: 14px;
}
@media (max-width: 640px) {
  .si-gift-fields {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Questions asked to guests */
.si-questions {
  display: grid;
  gap: 12px;
}
.si-question {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--si-line);
  border-radius: 10px;
}
.si-question-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
}
.si-question-row .si-field {
  flex: 1 1 200px;
}
.si-question select,
.si-question textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #c8d4dc;
  border-radius: 8px;
  background: #fff;
  color: var(--si-ink);
  font-size: 14px;
}
.si-question [hidden] {
  display: none;
}
.si-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--si-ink);
  font-size: 14px;
  cursor: pointer;
}
.si-inline input {
  width: 18px;
  height: 18px;
  accent-color: #285e7d;
}

/* Ornament choices in the style panel */
.si-orn-sample {
  display: grid;
  place-items: center;
  width: 54px;
  height: 36px;
  color: var(--si-accent);
}
.si-orn-sample .invite-orn-art {
  width: 100%;
  max-width: none;
  margin: 0;
  color: var(--si-accent);
}
.si-orn-sample .invite-orn-art.invite-orn-arch {
  width: 28px;
}
.si-orn-frame {
  display: block;
  width: 36px;
  height: 26px;
  border: 1px solid currentColor;
  border-radius: 3px;
  box-shadow:
    inset 0 0 0 3px #fff,
    inset 0 0 0 4px currentColor;
}

/* Decor and opening choices in the style panel */
.si-decor-sample {
  position: relative;
  width: 54px;
  height: 36px;
  border: 1px solid var(--si-line);
  border-radius: 6px;
  background: #fff;
}
.si-decor-default {
  border-style: dashed;
}
.si-opening-default {
  border-style: dashed;
}
.si-opening-card {
  background:
    linear-gradient(#efece5, #efece5) 12px 7px / 30px 22px no-repeat,
    #00224c;
  border-color: #00224c;
}

/* Decor samples in the style panel: the shape that stands for each decor */
.si-decor-sample[data-k]::after {
  content: '';
  position: absolute;
  inset: 5px;
  background: var(--si-accent);
  -webkit-mask: var(--m) center / contain no-repeat;
  mask: var(--m) center / contain no-repeat;
}
.si-decor-bleu-nuit {
  --m: url('/art/forme/etoile.svg');
}
.si-decor-enveloppe {
  --m: url('/art/forme/timbre.svg');
}
.si-decor-coeurs {
  --m: url('/art/forme/coeur.svg');
}
.si-decor-album {
  --m: url('/art/forme/arche-contour.svg');
}
.si-decor-planche {
  --m: url('/art/forme/guirlande-coeurs.svg');
}
.si-decor-arche {
  --m: url('/art/forme/arche.svg');
}
.si-decor-tropical {
  --m: url('/art/forme/palme-g.svg');
}
.si-decor-pagne {
  --m: url('/art/forme/pagne.svg');
}
.si-decor-artdeco {
  --m: url('/art/forme/artdeco-ligne.svg');
}
.si-decor-aquarelle {
  --m: url('/art/forme/etoile.svg');
}
.si-opening-envelope {
  background: linear-gradient(135deg, #e4e8ee 50%, #cdd3dc 50%);
}
.si-opening-curtain {
  background: linear-gradient(90deg, #2f6687 49%, #fff 49% 51%, #2f6687 51%);
}

/* 3 by 3 grid to choose which part of the cover photo stays visible */
.si-focus {
  display: grid;
  grid-template-columns: repeat(3, 34px);
  gap: 4px;
  width: max-content;
  padding: 6px;
  border: 1px solid var(--si-line);
  border-radius: 10px;
  background: var(--si-soft);
}
.si-focus-cell {
  position: relative;
  display: block;
  width: 34px;
  height: 34px;
  cursor: pointer;
}
.si-focus-cell input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.si-focus-cell span {
  display: block;
  width: 100%;
  height: 100%;
  border: 1px solid var(--si-line);
  border-radius: 6px;
  background: #fff;
}
.si-focus-cell input:checked + span {
  border-color: var(--si-accent);
  background: var(--si-accent);
  box-shadow: inset 0 0 0 4px #fff;
}
.si-focus-cell input:focus-visible + span {
  outline: 3px solid #86b6d2;
  outline-offset: 2px;
}

/* Content cards: one collapsible card per part of the invitation, with its own on/off switch */
.si-card {
  position: relative;
  margin: 0 0 10px;
  border: 1px solid var(--si-line);
  border-radius: 12px;
  background: #fff;
}
.si-card[open] {
  border-color: #b8cddb;
}
.si-card > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 10px 76px 10px 16px;
  cursor: pointer;
  list-style: none;
}
.si-card > summary::-webkit-details-marker {
  display: none;
}
.si-card > summary::before {
  content: '';
  flex: none;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--si-muted);
  border-bottom: 2px solid var(--si-muted);
  transform: rotate(-45deg);
  transition: transform 0.15s;
}
.si-card[open] > summary::before {
  transform: rotate(45deg);
}
.si-card > summary:focus-visible {
  outline: 3px solid #86b6d2;
  outline-offset: -3px;
  border-radius: 12px;
}
.si-card-title {
  flex: 1;
  color: var(--si-ink);
  font-size: 15px;
  font-weight: 700;
}
.si-card-chip {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--si-soft);
  color: var(--si-muted);
  font-size: 12px;
  font-weight: 700;
}
.si-card-chip[data-state='ok'] {
  background: var(--si-yes-bg);
  color: var(--si-yes);
}
.si-card-chip[data-state='todo'] {
  background: var(--si-wait-bg);
  color: var(--si-wait);
}
.si-card-switch {
  position: absolute;
  top: 12px;
  right: 14px;
}
.si-card-body {
  display: grid;
  gap: 14px;
  padding: 4px 16px 18px;
}
.si-card.is-flash {
  animation: si-flash 1.4s ease;
}
@keyframes si-flash {
  0%,
  60% {
    box-shadow: 0 0 0 4px #86b6d2;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}
.si-display {
  gap: 0;
}
.si-display > .si-hint {
  margin: 0 0 8px;
}
.si-display-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 4px;
  border-top: 1px solid var(--si-line);
  cursor: pointer;
}
.si-display-row:hover .si-display-text b {
  color: var(--si-accent);
}
.si-display-row:focus-within {
  outline: 3px solid #86b6d2;
  outline-offset: -2px;
  border-radius: 8px;
}
.si-display-text b {
  display: block;
  font-size: 14.5px;
}
.si-display-text small {
  display: block;
  margin-top: 2px;
  color: var(--si-muted);
  font-size: 13px;
}
/* The switch keeps its own box: its track is positioned against it. */
.si-display-row .si-card-switch {
  position: relative;
  top: auto;
  right: auto;
}

/* Preview: sections are clickable in the editor frame */
.invite-slot {
  position: relative;
  cursor: pointer;
}
.invite-slot:hover,
.invite-slot:focus-visible {
  outline: 2px solid #39799f;
  outline-offset: -2px;
}
.invite-slot[data-label]:hover::after,
.invite-slot[data-label]:focus-visible::after {
  content: 'Modifier : ' attr(data-label);
  position: absolute;
  z-index: 5;
  top: 6px;
  left: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #1f4f6e;
  color: #fff;
  font:
    700 11px/1.4 system-ui,
    sans-serif;
  letter-spacing: 0;
  text-transform: none;
  pointer-events: none;
}
.invite-slot.is-empty {
  margin: 10px 16px;
  padding: 18px;
  border: 2px dashed color-mix(in srgb, var(--invite-accent) 55%, transparent);
  border-radius: 12px;
  color: var(--invite-accent);
  font:
    700 14px/1.4 system-ui,
    sans-serif;
  text-align: center;
}

/* Grip that moves a section from the preview (drag with a mouse, a finger or a pen) */
.invite-handle {
  position: absolute;
  z-index: 6;
  top: 6px;
  right: 6px;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #1f4f6e;
  box-shadow: 0 2px 8px rgb(0 0 0 / 30%);
  cursor: grab;
  opacity: 0;
  touch-action: none;
  transition: opacity 0.15s;
}
.invite-handle::before {
  content: '';
  position: absolute;
  inset: 7px 9px;
  background: radial-gradient(circle, #fff 1.5px, transparent 2px) 0 0 / 6px 6px;
}
.invite-slot:hover > .invite-handle,
.invite-slot:focus-visible > .invite-handle,
.invite-slot:focus-within > .invite-handle,
.invite-slot.is-dragging > .invite-handle,
.invite-handle:focus-visible {
  opacity: 1;
}
@media (hover: none) {
  .invite-handle {
    opacity: 0.85;
    width: 36px;
    height: 36px;
  }
  .invite-handle::before {
    inset: 10px 12px;
  }
}
.invite-slot.is-empty > .invite-handle {
  top: 50%;
  transform: translateY(-50%);
}
.invite-slot.is-dragging {
  opacity: 0.45;
  outline: 2px dashed #39799f;
  outline-offset: -2px;
}
body.is-section-dragging,
body.is-section-dragging * {
  cursor: grabbing !important;
  user-select: none;
  -webkit-user-select: none;
}
.invite-drop-line {
  position: fixed;
  z-index: 200;
  height: 4px;
  border-radius: 2px;
  background: #e8890c;
  box-shadow: 0 0 0 2px rgb(255 255 255 / 70%);
  pointer-events: none;
}
.invite-drop-line::before,
.invite-drop-line::after {
  content: '';
  position: absolute;
  top: -4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #e8890c;
}
.invite-drop-line::before {
  left: -2px;
}
.invite-drop-line::after {
  right: -2px;
}
.invite-drag-chip {
  position: fixed;
  z-index: 201;
  top: 0;
  left: 0;
  max-width: 220px;
  padding: 5px 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #1f4f6e;
  color: #fff;
  font:
    700 12px/1.4 system-ui,
    sans-serif;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgb(0 0 0 / 30%);
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .invite-handle {
    transition: none;
  }
}

/* ===================================================================================================
   Page layout: sticky bar, steps on the left, panel, live preview on the right.
   Small screens: steps move to a bottom bar and the preview opens full screen.
   =================================================================================================== */
.sx-bar {
  position: sticky;
  top: var(--app-bar-h, 0px);
  z-index: 8;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  margin: 0 0 16px;
  padding: 12px 16px;
  border: 1px solid var(--si-line);
  border-radius: 12px;
  background: rgb(255 255 255 / 95%);
  backdrop-filter: blur(6px);
}
.sx-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
}
.sx-title h1 {
  margin: 0;
  font-size: 22px;
}
.sx-domain {
  color: var(--si-muted);
  font-size: 14px;
}
.sx-progress {
  display: grid;
  gap: 5px;
  flex: 1;
  min-width: 150px;
  max-width: 260px;
}
.sx-progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e3e9ee;
}
.sx-progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--si-yes);
  transition: width 0.3s;
}
.sx-progress small {
  color: var(--si-muted);
  font-size: 12.5px;
  font-weight: 600;
}
.sx-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}
.sx-body {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr) minmax(340px, 420px);
  gap: 20px;
  align-items: start;
  margin-bottom: 24px;
}
.sx-steps {
  position: sticky;
  top: calc(var(--app-bar-h, 0px) + 88px);
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--si-line);
  border-radius: 12px;
  background: #fff;
}
.sx-step {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--si-ink);
  text-align: left;
  cursor: pointer;
}
.sx-step:hover {
  background: var(--si-soft);
}
.sx-step[aria-selected='true'] {
  background: #e6f1f8;
}
.sx-step:focus-visible,
.sx-dock-step:focus-visible,
.sx-peek:focus-visible {
  outline: 3px solid #86b6d2;
  outline-offset: 1px;
}
.sx-num {
  display: grid;
  flex: none;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #edf1f4;
  color: var(--si-muted);
  font:
    700 14px/1 system-ui,
    sans-serif;
}
[data-state='done'] > .sx-num {
  background: var(--si-yes);
  color: #fff;
}
[aria-selected='true'] > .sx-num,
[aria-current='step'] > .sx-num {
  background: var(--si-accent);
  color: #fff;
}
.sx-text b {
  display: block;
  font-size: 15px;
}
.sx-text small {
  display: block;
  margin-top: 1px;
  color: var(--si-muted);
  font-size: 12.5px;
}
.sx-step[data-state='todo'] .sx-text small {
  color: var(--si-wait);
  font-weight: 600;
}
.sx-main {
  min-width: 0;
  border: 1px solid var(--si-line);
  border-radius: 12px;
  background: #fff;
}
.si-step-nav {
  position: sticky;
  bottom: var(--sx-dock, 0px);
  z-index: 3;
  margin: 28px -24px -24px;
  padding: 14px 24px;
  border-top: 1px solid var(--si-line);
  border-radius: 0 0 12px 12px;
  background: rgb(255 255 255 / 96%);
  backdrop-filter: blur(6px);
}
.si-step-nav .si-next {
  margin-left: auto;
}
.sx-tip {
  margin: -4px 0 12px;
  color: var(--si-muted);
  font-size: 13px;
}
.sx-close,
.sx-dock,
.sx-peek {
  display: none;
}

/* Tablet: steps in a row above the panel */
@media (max-width: 1199px) {
  .sx-body {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
  }
  .sx-steps {
    position: static;
    display: flex;
    grid-column: 1 / -1;
    overflow-x: auto;
  }
  .sx-step {
    flex: 1 0 auto;
    min-height: 52px;
  }
  .sx-step[aria-selected='true'] {
    box-shadow: inset 0 -3px 0 var(--si-accent);
  }
}
/* Phone: bottom bar, full-screen preview on demand */
@media (max-width: 899px) {
  .sx {
    --sx-dock: 64px;
    padding-bottom: 84px;
  }
  .sx-bar {
    position: static;
    padding: 10px 12px;
  }
  .sx-progress small {
    display: none;
  }
  .sx-progress-track {
    height: 4px;
  }
  .sx-title h1 {
    font-size: 19px;
  }
  .sx-progress {
    max-width: none;
    flex-basis: 100%;
    order: 3;
  }
  .sx-actions {
    width: 100%;
    margin-left: 0;
  }
  .sx-actions .btn {
    flex: 1;
  }
  .sx-body {
    grid-template-columns: minmax(0, 1fr);
  }
  .sx-steps {
    display: none;
  }
  .si-step-nav {
    margin: 24px -16px -18px;
    padding: 12px 16px;
  }
  .sx-dock {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 30;
    display: flex;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--si-line);
    background: #fff;
    box-shadow: 0 -4px 16px rgb(20 40 60 / 8%);
  }
  .sx-dock-step {
    display: grid;
    flex: 1;
    justify-items: center;
    gap: 3px;
    min-height: 52px;
    padding: 4px 2px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--si-muted);
    font-size: 11.5px;
    font-weight: 700;
  }
  .sx-dock-step[aria-current='step'] {
    background: #e6f1f8;
    color: var(--si-ink);
  }
  .sx-peek {
    position: fixed;
    right: 14px;
    bottom: 142px;
    z-index: 31;
    display: inline-flex;
    min-height: 48px;
    padding: 0 20px;
    border-radius: 999px;
    box-shadow: 0 6px 18px rgb(20 40 60 / 30%);
  }
  .sx-preview {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: none;
    max-height: none;
    padding: 12px;
    overflow: auto;
    border: 0;
    border-radius: 0;
  }
  .sx-preview.is-open {
    display: block;
  }
  .sx-close {
    display: inline-flex;
    width: 100%;
    margin-top: 8px;
    justify-content: center;
  }
  body.sx-peek-open {
    overflow: hidden;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sx-progress-track i {
    transition: none;
  }
}

/* On this page the application header scrolls away: the studio bar takes the top of the screen. */
body:has(.sx) {
  --app-bar-h: 0px;
}
body:has(.sx) .app-header {
  position: static;
}

/* Samples of the 3D and animated decors, openings, motions, particles and gallery styles */
.si-decor-carte3d {
  --m: url('/art/forme/etoile.svg');
}
.si-decor-cube {
  --m: url('/art/forme/cube.svg');
}
.si-decor-paysage {
  --m: url('/art/forme/collines-1.svg');
}
.si-decor-neon {
  --m: url('/art/forme/eclair.svg');
}
.si-decor-fete {
  --m: url('/art/forme/ballon.svg');
}
.si-opening-book {
  background: linear-gradient(90deg, var(--si-accent) 50%, #fff 50%);
  border-radius: 3px 8px 8px 3px;
}
.si-opening-doors {
  background: linear-gradient(90deg, #2f4a63 48%, #f6dc8e 48% 52%, #2f4a63 52%);
}
.si-motion-sample,
.si-gal-sample {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.si-motion-sample i,
.si-gal-sample i {
  display: block;
  width: 10px;
  height: 16px;
  border-radius: 3px;
  background: var(--si-accent);
  opacity: 0.35;
}
.si-motion-reveal i:nth-child(2),
.si-motion-lively i:nth-child(2) {
  opacity: 0.65;
  transform: translateY(2px);
}
.si-motion-lively i:nth-child(3) {
  opacity: 1;
  transform: translateY(4px) rotate(8deg);
}
.si-gal-ring i:nth-child(1) {
  transform: perspective(60px) rotateY(40deg);
}
.si-gal-ring i:nth-child(3) {
  transform: perspective(60px) rotateY(-40deg);
}
.si-gal-tilt i {
  transform: rotate(-8deg);
  opacity: 0.7;
}
.si-gal-tilt i:nth-child(2) {
  transform: rotate(6deg);
}
.si-particle-sample {
  background:
    radial-gradient(circle at 20% 25%, var(--si-accent) 0 3px, transparent 4px),
    radial-gradient(circle at 60% 55%, var(--si-accent) 0 3px, transparent 4px),
    radial-gradient(circle at 85% 20%, var(--si-accent) 0 2px, transparent 3px),
    radial-gradient(circle at 35% 85%, var(--si-accent) 0 2px, transparent 3px);
}
.si-particle-none,
.si-particle-default {
  background: none;
}
.si-particle-default {
  border-style: dashed;
}

/* ===================================================================================================
   Simple Style step: three numbered questions, compact choices, the rest folded under "Plus d'options"
   =================================================================================================== */
.st-block {
  display: grid;
  gap: 12px;
  padding: 18px 0;
  border-top: 1px solid var(--si-line);
}
.st-block:first-of-type {
  border-top: 0;
  padding-top: 6px;
}
.st-h {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 16px;
}
.st-h span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--si-accent);
  color: #fff;
  font:
    700 13px/1 system-ui,
    sans-serif;
}
.st-block .si-hint {
  margin: 0;
}
.si-palettes {
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 8px;
}
.si-palette {
  gap: 6px;
  padding: 8px;
  font-size: 12.5px;
}
.si-palette[aria-pressed='true'] {
  border-color: var(--si-accent);
  box-shadow: inset 0 0 0 2px var(--si-accent);
  background: #f3f9fd;
}
.st-custom,
.st-more {
  border: 1px solid var(--si-line);
  border-radius: 10px;
  background: #fff;
}
.st-custom {
  padding: 0 14px;
}
.st-custom > summary,
.st-more > summary {
  min-height: 46px;
  padding: 12px 0;
  color: var(--si-accent);
  font-weight: 700;
  cursor: pointer;
}
.st-custom[open] {
  padding-bottom: 14px;
}
.st-more {
  margin-top: 18px;
}
.st-more > summary {
  display: grid;
  gap: 2px;
  padding: 12px 16px;
}
.st-more > summary small {
  color: var(--si-muted);
  font-size: 12.5px;
  font-weight: 500;
}
.st-more-body {
  display: grid;
  gap: 8px;
  padding: 0 16px 16px;
}
.st-more .si-group {
  padding: 12px 0 0;
  border: 0;
}
.si-choices-compact {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.si-choices-compact .si-choice-body {
  gap: 8px;
  min-height: 44px;
  padding: 5px 14px 5px 6px;
  border-radius: 999px;
}
.si-choices-compact .si-choice b {
  font-size: 13.5px;
  font-weight: 650;
  white-space: nowrap;
}
.si-choices-compact .si-choice small {
  display: none;
}
.si-choices-compact [class*='-sample'] {
  width: 34px;
  height: 32px;
  padding: 4px;
  border-radius: 999px;
}
/* The save button only shows when something is waiting or went wrong: saving is automatic. */
.si-form[data-autosave] .si-save-now {
  display: none;
}
.si-form[data-autosave][data-save='error'] .si-save-now,
.si-form[data-autosave][data-save='dirty'] .si-save-now {
  display: inline-flex;
}
.si-save-status[data-state='saving'] {
  color: var(--si-muted);
}
.si-save-status[data-state='saved']::before {
  content: '✓ ';
  color: var(--si-yes);
  font-weight: 700;
}
.si-save-status[data-state='error'] {
  color: #b3261e;
  font-weight: 700;
}

/* Content step: cards grouped by importance */
.ct-zone {
  display: grid;
  gap: 10px;
  margin: 0 0 22px;
}
.ct-head,
.ct-zone > summary {
  display: grid;
  gap: 2px;
  padding: 2px 2px 4px;
}
.ct-title {
  color: var(--si-ink);
  font-size: 16px;
  font-weight: 700;
}
.ct-hint {
  color: var(--si-muted);
  font-size: 13px;
}
.ct-body {
  display: grid;
  gap: 10px;
}
.ct-zone .si-card {
  margin: 0;
}
.ct-folded {
  border: 1px dashed #b8cddb;
  border-radius: 12px;
  background: var(--si-soft);
}
.ct-folded > summary {
  padding: 14px 16px;
  cursor: pointer;
}
.ct-folded > summary .ct-title::after {
  content: ' ▾';
  color: var(--si-accent);
}
.ct-folded[open] > summary .ct-title::after {
  content: ' ▴';
}
.ct-folded > .ct-body {
  padding: 0 12px 14px;
}

/* --- Easier cards: folded presentation, hidden-section note, "+ Add" rows ------------------------------------------ */
.si-lookbox {
  margin: 0 0 14px;
  border: 1px solid var(--si-line);
  border-radius: 10px;
  background: var(--si-soft);
}
.si-lookbox > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 0 12px;
  font-size: 14px;
  cursor: pointer;
  list-style: none;
}
.si-lookbox > summary::-webkit-details-marker {
  display: none;
}
.si-lookbox-text b {
  color: var(--si-ink);
}
.si-lookbox-change {
  color: var(--si-accent, #285e7d);
  font-size: 13px;
  font-weight: 700;
}
.si-lookbox[open] .si-lookbox-change::after {
  content: ' ▴';
}
.si-lookbox:not([open]) .si-lookbox-change::after {
  content: ' ▾';
}
.si-lookbox > summary:focus-visible {
  outline: 3px solid #86b6d2;
  outline-offset: 2px;
  border-radius: 10px;
}
.si-card-body > .si-lookbox:last-child {
  margin: 16px 0 0;
}
.si-lookbox > fieldset {
  margin: 0;
  padding: 4px 10px 12px;
  border: 0;
}
.si-off-note {
  display: none;
  margin: 0 0 12px;
  padding: 9px 12px;
  border-radius: 8px;
  background: #fff6e0;
  color: #6b4a00;
  font-size: 13px;
  line-height: 1.45;
}
.si-card[data-off] .si-off-note {
  display: block;
}
.si-display-item {
  border-top: 1px solid var(--si-line);
  padding-top: 4px;
}
.si-display-item:first-of-type {
  border-top: 0;
}
.si-display-item .si-lookbox {
  margin: 0 0 10px;
}
[data-more-add] {
  justify-self: start;
  margin-top: 4px;
}
.si-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--si-accent, #285e7d);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}
/* The "order" card already has its title: no second heading inside it */
.si-card #sections-form .si-form-top {
  display: none;
}

/* --- One list of sections, one editor per section ----------------------------------------------------------------- */
.si-card[data-card='order'] {
  display: none;
}
#customization-form[data-sn-view='list'] #sn-cards,
#customization-form[data-sn-view='list'] #sn-plain,
#customization-form[data-sn-view='detail'] #sn-list-view {
  display: none;
}
#sn-cards > details.si-card {
  display: none;
}
#customization-form[data-sn-view='detail'] #sn-cards > details.si-card.is-current {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}
#sn-cards > details.si-card > summary,
#sn-cards > details.si-card > .si-card-switch {
  display: none;
}
#sn-cards > details.si-card > .si-card-body {
  padding: 0;
}
.sn-intro {
  margin: 0 0 12px;
}
.sn-list,
.sn-add-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.sn-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 4px 10px;
  border: 1px solid var(--si-line);
  border-radius: 12px;
  background: #fff;
}
.sn-row:hover,
.sn-row:focus-within {
  border-color: #7dbbde;
}
.sn-row.is-off {
  background: var(--si-soft);
}
.sn-row.is-dragging {
  opacity: 0.5;
  outline: 2px dashed #39799f;
}
.sn-handle {
  flex: none;
  width: 22px;
  align-self: stretch;
  min-height: 32px;
  border-radius: 6px;
  background: radial-gradient(circle, #9bb0be 1.6px, transparent 2px) center / 7px 8px;
  cursor: grab;
  touch-action: none;
}
.sn-handle:hover {
  background-color: var(--si-soft);
}
.sn-main {
  display: grid;
  flex: 1;
  gap: 2px;
  min-width: 0;
  padding: 6px 4px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--si-ink);
  text-align: left;
  cursor: pointer;
}
.sn-main:focus-visible {
  outline: 3px solid #86b6d2;
  outline-offset: 1px;
}
.sn-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  font-size: 15px;
}
.sn-main small {
  color: var(--si-muted);
  font-size: 12.5px;
  line-height: 1.35;
}
.sn-eye {
  flex: none;
}
.sn-moves {
  display: flex;
  flex: none;
  gap: 4px;
}
/* With a mouse the arrows take no room until the row is hovered or reached with the keyboard; on touch they stay. */
@media (hover: hover) and (pointer: fine) {
  .sn-moves {
    max-width: 0;
    margin-left: -10px;
    overflow: hidden;
    opacity: 0;
    transition:
      max-width 0.14s,
      margin 0.14s,
      opacity 0.14s;
  }
  .sn-row:hover .sn-moves,
  .sn-row:focus-within .sn-moves {
    max-width: 96px;
    margin-left: 0;
    opacity: 1;
  }
}
.sn-add {
  flex: none;
  min-height: 40px;
  padding: 0 14px;
}
.sn-sub {
  margin: 22px 0 2px;
  font-size: 15px;
}
.sn-reset {
  margin-top: 16px;
}
.sn-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.sn-pager {
  display: flex;
  gap: 6px;
}
.sn-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.sn-title h3 {
  margin: 0;
  font-size: 20px;
}
.sn-title h3:focus {
  outline: none;
}
.sn-show {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
}
#sn-detail-head {
  margin-bottom: 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--si-line);
}
.sn-plain {
  padding: 14px;
  border-radius: 10px;
  background: var(--si-soft);
}
/* The section being edited (or hovered in the list) is marked in the preview */
.invite-slot.is-linked {
  outline: 3px solid #e8890c;
  outline-offset: -3px;
}
/* In the editor of the countdown or the guest book, the header switch already shows or hides it */
#sn-cards .si-display-item .si-display-row {
  display: none;
}
#sn-cards .si-display-item {
  border-top: 0;
  padding-top: 0;
}
@media (max-width: 560px) {
  /* On a phone the row keeps to name, state and controls: the description would be squeezed into three lines. */
  .sn-main small {
    display: none;
  }
  .sn-row {
    min-height: 60px;
    gap: 8px;
  }
  .sn-moves .si-icon {
    width: 40px;
    height: 40px;
  }
}

/* --- Undo and redo in the header of the studio ----------------------------------------------------------------- */
.sx-history {
  display: flex;
  gap: 6px;
}
.sx-hbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  min-height: 44px;
  padding: 0 12px;
}
.sx-hbtn:disabled {
  opacity: 0.4;
  cursor: default;
}
.sx-hlabel {
  font-size: 13px;
  font-weight: 700;
}
@media (max-width: 1240px) {
  .sx-hlabel {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .sx-hbtn {
    padding: 0 10px;
  }
}

/* Introduction texts typed straight in the preview (inline-edit.js) */
.invite-slot [data-inline] {
  cursor: text;
  border-radius: 4px;
  outline: none;
  transition: box-shadow 0.15s ease;
}
.invite-slot [data-inline]:hover {
  box-shadow: 0 0 0 2px rgba(57, 121, 159, 0.4);
}
.invite-slot [data-inline]:focus {
  box-shadow: 0 0 0 2px #39799f;
  /* Only the colour: a title with a shimmering gradient keeps its gradient (the shorthand erased it, and the text with it) */
  background-color: rgba(255, 255, 255, 0.4);
}
.invite-slot [data-inline]:empty::before {
  content: attr(data-placeholder);
  opacity: 0.55;
}

/* Photo fields that follow the design: one tile for each frame (photo-slots.js) */
.ph-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px;
}
.ph-tile {
  position: relative;
}
.ph-pick {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 1.5px dashed #b4c3cf;
  border-radius: 10px;
  background: var(--si-soft);
  color: var(--si-muted);
  cursor: pointer;
}
.ph-tile.has-photo .ph-pick {
  border-style: solid;
  border-color: var(--si-line);
}
.ph-pick:hover,
.ph-pick:focus-within {
  border-color: var(--si-accent);
}
.ph-pick img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ph-plus .icon {
  width: 26px;
  height: 26px;
}
.ph-name {
  position: absolute;
  inset: auto 0 0;
  padding: 18px 8px 7px;
  background: linear-gradient(transparent, rgb(10 20 30 / 62%));
  color: #fff;
  font-size: 12.5px;
  font-weight: 650;
  text-align: center;
}
.ph-tile:not(.has-photo) .ph-name {
  background: none;
  color: var(--si-ink);
}
.ph-pick input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.ph-pick input:disabled {
  cursor: not-allowed;
}
.ph-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(10 20 30 / 70%);
  color: #fff;
  cursor: pointer;
}
.ph-remove:hover {
  background: #b3261e;
}
.ph-remove .icon {
  width: 14px;
  height: 14px;
}
.ph-field + .ph-field {
  margin-top: 18px;
}

/* The fields of a card, folded once the section is filled (editor-guide.js) */
.si-fields {
  margin-top: 8px;
  border-top: 1px solid var(--si-line);
}
.si-fields > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
  padding: 10px 0;
  color: var(--si-accent);
  font-weight: 650;
  cursor: pointer;
}
.si-fields > summary small {
  color: var(--si-muted);
  font-weight: 400;
}
.si-fields[open] > summary {
  margin-bottom: 8px;
}
/* The fields of a card are not glued to each other */
.si-fields > :not(summary) ~ :not(summary) {
  margin-top: 14px;
}

/* --- The preview frame stays where it is: the content scrolls inside it (studio of a signed-in organiser) ---------
   Computer: the preview is as tall as the screen under the bars. Phone: the full-screen preview fills the screen. */
@media (min-width: 900px) {
  .sx-body > .sx-preview {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--app-bar-h, 0px) - 104px);
    max-height: none;
    overflow: hidden;
  }
  .sx-preview #invitation-live {
    flex: 1 1 0;
    width: 100%;
    min-height: 0;
    margin: 0 auto;
    overflow: auto;
    overscroll-behavior: contain;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 0 0 1px rgb(20 40 60 / 14%);
  }
  .sx-preview #invitation-live.mobile-preview {
    width: min(100%, 390px);
    max-height: 820px;
    border-radius: 30px;
    box-shadow: 0 0 0 8px #0d151c;
  }
}
@media (max-width: 899px) {
  .sx-preview.is-open {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .sx-preview #invitation-live {
    flex: 1 1 0;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    border-radius: 14px;
  }
}

/* --- Steps with icons instead of numbers (addStepIcons in guest-studio.js): side menu and bottom bar --------------- */
.sx-step .sx-num,
.sx-dock-step .sx-num {
  display: none;
}
.sx-step .gs-ico {
  display: grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #edf1f4;
  color: var(--si-muted);
}
.sx-step[data-state='done'] .gs-ico {
  background: var(--si-yes);
  color: #fff;
}
.sx-step[aria-selected='true'] .gs-ico {
  background: var(--si-accent);
  color: #fff;
}
.sx-step .gs-ico .icon {
  width: 17px;
  height: 17px;
}
.sx-dock-step {
  position: relative;
}
.sx-dock-step .gs-ico {
  display: grid;
  place-items: center;
  color: var(--si-muted);
}
.sx-dock-step .gs-ico .icon {
  width: 22px;
  height: 22px;
}
.sx-dock-step[aria-current='step'] .gs-ico {
  color: var(--si-accent);
}
.sx-dock-step[data-state='done']::after {
  content: '';
  position: absolute;
  top: 6px;
  left: calc(50% + 8px);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--si-yes);
}

/* --- Inside a section: an obvious way back ------------------------------------------------------------------------ */
#sn-detail-head {
  position: sticky;
  top: calc(var(--app-bar-h, 0px) + 88px);
  z-index: 5;
  margin-inline: -4px;
  padding: 8px 4px 10px;
  background: #fff;
}
.gs-body #sn-detail-head {
  top: 0;
}
.sn-bar {
  align-items: stretch;
}
.sn-back {
  min-height: 44px;
  padding: 0 16px 0 12px;
  border-color: #39799f;
  background: #eef6fb;
  color: #174563;
  font-size: 14px;
  font-weight: 700;
}
.sn-back:hover {
  background: #dcecf7;
}
.sn-ic {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sn-pager .si-icon {
  width: 44px;
  height: 44px;
}
.sn-where {
  margin: 6px 0 0;
  color: var(--si-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
#sn-done {
  display: grid;
  gap: 6px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--si-line);
  text-align: center;
}
#sn-done .sn-done-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
}
#sn-done small {
  color: var(--si-muted);
  font-size: 12px;
}
#customization-form:not([data-sn-view='detail']) #sn-done {
  display: none;
}

/* The names, date and place are hidden inside a section: the hidden attribute must win over the form's own display. */
#event-facts-form[hidden] {
  display: none;
}

/* The photo row of a design: a clear call to action on the right */
.sn-row.is-fixed {
  cursor: pointer;
}
.sn-go {
  flex: none;
  color: var(--si-accent, #285e7d);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.sn-row.is-fixed[data-state='todo'] {
  border-color: #e9c46a;
  background: #fffaf0;
}
/* In the preview the picture of the design is clickable; an empty frame invites to add a photo */
#invitation-live .dc-hero.is-editable {
  cursor: pointer;
}
#invitation-live .dc-hero.is-editable:hover {
  outline: 2px dashed #e8890c;
  outline-offset: 4px;
}
#invitation-live .dc-hero.is-empty [class*='-photo']:empty::before {
  content: '+ Ajouter une photo';
  position: absolute;
  top: 52%;
  left: 50%;
  z-index: 4;
  width: max-content;
  max-width: 70%;
  transform: translate(-50%, -50%);
  padding: 6px 10px;
  border-radius: 999px;
  background: rgb(255 255 255 / 88%);
  color: #174563;
  font: 700 13px/1.2 sans-serif;
  text-align: center;
  text-shadow: none;
  box-shadow: 0 2px 8px rgb(0 0 0 / 15%);
}

/* The fixed photo row is a list of its own: leave room before the list of sections */
#sn-fixed:not(:empty) {
  margin-bottom: 12px;
}

/* The button that shows the opening screens on a large phone, above their small previews */
.st-play-opening {
  grid-column: 1 / -1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ef-demo {
  display: block;
  margin: 6px 0 0;
  padding: 6px 10px;
  border-radius: 8px;
  background: #fff6df;
  color: #6d4c00;
}
.ef-demo[hidden] {
  display: none;
}
