.account-wrap {
  position: relative;
  z-index: 3;
  max-width: 40rem;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3rem;
}

.account-wrap--wide {
  max-width: 52rem;
}

.account-card {
  background: var(--card);
  background-image: linear-gradient(180deg, #fff 0%, var(--cream) 100%);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.35rem 1.25rem 1.5rem;
  box-shadow: var(--shadow-card);
  margin-bottom: 1rem;
}

.account-card h1,
.account-card h2,
.account-top h1 {
  font-family: 'Cormorant Garamond', serif;
  color: #fff;
  font-weight: 600;
}

.account-card h1,
.account-card h2 {
  color: var(--navy);
  margin-bottom: 0.35rem;
}

.account-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 1.25rem;
}

.account-top p,
.lede {
  color: rgba(255, 255, 255, 0.78);
}

.account-nav {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.25rem;
}

.account-nav a,
.btn-text {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

.account-nav a:hover,
.btn-text:hover {
  color: var(--accent);
}

.account-nav a[aria-current="page"] {
  color: var(--accent);
}

.form-grid {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.year-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.year-pair__hint {
  grid-column: 1 / -1;
  margin-top: -0.35rem;
}

.form-grid label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.form-grid input[type="text"],
.form-grid input[type="email"],
.form-grid input[type="password"],
.form-grid input[type="url"],
.form-grid input[type="number"],
.form-grid input[type="datetime-local"],
.form-grid input[type="file"],
.form-grid textarea,
.form-grid select,
.share-row input,
.invite-form input[type="email"] {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  font: inherit;
  color: var(--text-on-light);
  background: #fff;
}

.form-grid textarea {
  min-height: 5.5rem;
  resize: vertical;
}

.hint {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}

[hidden] {
  display: none !important;
}

.btn-primary,
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 0.8rem 1.3rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(180deg, var(--navy) 0%, #152d45 100%);
  color: #fff;
}

.btn-danger {
  background: transparent;
  color: #8d3a3a;
  border: 1px solid #e4c7c7;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.page-save {
  margin-top: 1.25rem;
}

.save-status {
  margin: 0;
  min-height: 1.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

.save-status.is-error {
  color: #8d2a2a;
}

.save-status.is-saved {
  color: #1b5e20;
}

.flash {
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.flash-success {
  background: #e8f5e9;
  color: #1b5e20;
}

.flash-error {
  background: #fdecea;
  color: #8d2a2a;
}

.memorial-list {
  display: flex;
  flex-direction: column;
}

.memorial-item + .memorial-item {
  border-top: 1px solid var(--border);
}

.memorial-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.9rem 0;
  border-top: 0;
}

.memorial-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.memorial-actions .btn-primary,
.memorial-actions .btn-secondary {
  padding: 0.5rem 0.9rem;
  font-size: 0.92rem;
}

.memorial-qr {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  padding: 0 0 0.95rem;
}

.memorial-qr[hidden] {
  display: none;
}

.memorial-qr canvas {
  width: 148px;
  height: 148px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  image-rendering: pixelated;
}

.memorial-qr-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
}

.memorial-qr .hint {
  margin: 0;
}

.invite-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.invite-form > div > label,
.invite-pages legend {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.invite-pages {
  border: 0;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.invite-pages label,
.editor-row {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  color: var(--text-on-light);
}

.editor-list {
  display: flex;
  flex-direction: column;
}

.editor-row {
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 0;
}

.editor-row + .editor-row {
  border-top: 1px solid var(--border);
}

.editor-row p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 400;
}

.editor-row .editor-pending {
  color: #8a5a2a;
  font-size: 0.82rem;
  font-weight: 600;
}

.editor-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.editor-actions form {
  margin: 0;
}

.editor-actions .btn-secondary {
  padding: 0.5rem 0.9rem;
  font-size: 0.92rem;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .editor-row {
    flex-direction: column;
    align-items: stretch;
  }

  .editor-actions {
    justify-content: flex-start;
  }
}

.memorial-row h2 {
  font-size: 1.35rem;
  margin: 0;
}

.memorial-row p,
.status {
  color: var(--muted);
  font-size: 0.9rem;
}

.status-published {
  color: #1b5e20;
  font-weight: 600;
}

.share-row {
  display: flex;
  gap: 0.5rem;
}

.share-qr {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.share-qr[hidden] {
  display: none;
}

.share-qr canvas {
  width: 168px;
  height: 168px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  image-rendering: pixelated;
}

.share-qr-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.share-qr-status {
  margin: 0;
  min-height: 1.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1b5e20;
}

.share-qr-status.is-error {
  color: #8d2a2a;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 0.6rem;
}

.photo-grid figure {
  margin: 0;
}

.photo-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}

.photo-grid figure.is-hidden img {
  opacity: 0.38;
}

.photo-visibility {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.7rem;
  margin-top: 0.35rem;
}

.photo-visibility label {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  margin: 0;
  letter-spacing: 0;
  text-transform: none;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--navy);
}

.photo-visibility input {
  margin: 0;
  accent-color: var(--navy);
}

.portrait-frame.is-layout-boxed {
  box-sizing: border-box;
  padding: 11%;
  background-color: #152d45;
  background-image: none;
}

.portrait-frame.is-layout-boxed img {
  border-radius: 8px;
}

.portrait-frame.is-layout-banner {
  aspect-ratio: 2.15 / 1;
}

.portrait-crop:has(.portrait-frame.is-layout-banner) {
  max-width: 100%;
}

.portrait-frame.is-tone-blur img,
.portrait-frame.is-tone-blur.is-repeat::before {
  filter: var(--colour-filter, none) blur(2.5px);
}

.portrait-frame.is-motion-parallax img {
  animation: portrait-parallax 5.5s ease-in-out infinite;
}

.portrait-crop.is-dragging .portrait-frame img {
  animation: none;
}

@keyframes portrait-parallax {
  50% { translate: 0 -7%; }
}

.portrait-selection {
  position: absolute;
  left: 0.45rem;
  right: 0.45rem;
  bottom: 0.45rem;
  z-index: 2;
  margin: 0;
  padding: 0.28rem 0.45rem;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  pointer-events: none;
}

.photo-zoom {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}

.photo-zoom img {
  width: 100%;
}

.js-use-portrait,
.js-use-background {
  display: inline-block;
  margin-top: 0.35rem;
  margin-right: 0.65rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--navy);
  font: inherit;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
}

.js-use-portrait[hidden],
.js-use-background[hidden],
.background-preview[hidden] {
  display: none;
}

.admin-zoom {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 1rem 1rem;
  background: rgba(12, 20, 32, 0.88);
}

.admin-zoom[hidden] {
  display: none;
}

.admin-zoom img {
  max-width: min(920px, 100%);
  max-height: calc(100vh - 5rem);
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

.admin-zoom__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  border: 0;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  background: #fff;
  color: var(--navy);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.file-preview img,
.upload-preview img {
  max-width: 140px;
  border-radius: 10px;
  margin-top: 0.4rem;
}

.portrait-studio {
  display: grid;
  grid-template-columns: minmax(0, 240px) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.55);
}

.portrait-stage .hint {
  margin-bottom: 0.75rem;
}

.portrait-crop {
  width: 100%;
  max-width: 240px;
  touch-action: none;
  user-select: none;
  outline: none;
}

.portrait-crop.is-ready {
  cursor: grab;
}

.portrait-crop.is-dragging {
  cursor: grabbing;
}

.portrait-crop:focus-visible .portrait-frame {
  box-shadow: 0 0 0 3px rgba(21, 45, 69, 0.28);
}

.portrait-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border: 3px solid var(--accent-soft);
  background:
    linear-gradient(45deg, #e7dfd4 25%, transparent 25%),
    linear-gradient(-45deg, #e7dfd4 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e7dfd4 75%),
    linear-gradient(-45deg, transparent 75%, #e7dfd4 75%);
  background-size: 18px 18px;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
  background-color: #f6f1ea;
}

.portrait-frame.is-circle {
  border-radius: 50%;
}

.portrait-frame.is-rounded {
  border-radius: 18px;
}

.portrait-frame.is-square {
  border-radius: 4px;
}

.portrait-frame img {
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  object-fit: cover;
  object-position: var(--crop-x, 50%) var(--crop-y, 0%);
  transform: scale(var(--crop-zoom, 1));
  transform-origin: var(--crop-x, 50%) var(--crop-y, 0%);
  pointer-events: none;
  opacity: var(--image-opacity, 1);
  filter: var(--colour-filter, none);
}

.portrait-frame.is-colour-clear,
.background-preview.is-colour-clear { --colour-filter: none; }
.portrait-frame.is-colour-grayscale,
.background-preview.is-colour-grayscale { --colour-filter: grayscale(1); }
.portrait-frame.is-colour-sepia,
.background-preview.is-colour-sepia { --colour-filter: sepia(0.9); }
.portrait-frame.is-colour-warm,
.background-preview.is-colour-warm { --colour-filter: sepia(0.45) saturate(1.25); }
.portrait-frame.is-colour-cool,
.background-preview.is-colour-cool { --colour-filter: hue-rotate(18deg) saturate(0.8); }
.portrait-frame.is-colour-vintage,
.background-preview.is-colour-vintage { --colour-filter: sepia(0.55) contrast(1.08) saturate(0.85); }

.portrait-frame.is-repeat::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image: var(--portrait-url);
  background-repeat: repeat;
  background-size: 120px auto;
  background-position: center top;
  opacity: var(--image-opacity, 1);
  filter: var(--colour-filter, none);
  pointer-events: none;
}

.portrait-frame.is-repeat img {
  opacity: 0;
}

.background-preview {
  position: relative;
  height: 140px;
  margin: 0.55rem 0 0.75rem;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background-color: #152a42;
}

.background-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--bg-image);
  background-position: center;
  background-repeat: no-repeat;
  opacity: var(--bg-opacity, 1);
  filter: var(--colour-filter, none);
  transform: scale(var(--bg-zoom, 1));
  transform-origin: center center;
}

.background-preview.is-fit-cover::after { background-size: cover; }
.background-preview.is-fit-contain::after { background-size: contain; }
.background-preview.is-fit-repeat::after {
  background-repeat: repeat;
  background-size: calc(88px * var(--bg-zoom, 1)) auto;
  transform: none;
}

.portrait-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
}

.portrait-empty[hidden],
.uploader-remove[hidden] {
  display: none;
}

.portrait-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.55) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.55) 1px, transparent 1px);
  background-size: 33.333% 33.333%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.portrait-crop.is-ready:hover .portrait-grid,
.portrait-crop.is-dragging .portrait-grid,
.portrait-crop:focus-visible .portrait-grid {
  opacity: 1;
}

.portrait-tools {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-width: 0;
}

.portrait-tools-label,
.portrait-zoom-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.portrait-zoom-label span {
  letter-spacing: 0;
  text-transform: none;
  color: var(--navy);
}

.portrait-styles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.portrait-style {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--navy);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.portrait-style[aria-pressed="true"] {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.portrait-swatch {
  width: 0.85rem;
  height: 0.85rem;
  border: 2px solid currentColor;
  display: inline-block;
  box-sizing: border-box;
}

.portrait-swatch.is-circle,
.portrait-swatch.is-grayscale {
  border-radius: 50%;
}

.portrait-swatch.is-rounded {
  border-radius: 4px;
}

.portrait-swatch.is-square {
  border-radius: 1px;
}

.portrait-swatch.is-grayscale {
  background: linear-gradient(#d5d5d5, #6d6d6d);
  border-color: transparent;
}

.portrait-tools input[type="range"] {
  width: 100%;
  accent-color: var(--navy);
  margin: 0;
}

.portrait-reset {
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: none;
  color: var(--navy);
  font: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
}

.portrait-nobg {
  justify-content: center;
}

.portrait-nobg:disabled {
  opacity: 0.65;
  cursor: progress;
}

.portrait-upload-btn {
  width: 100%;
}

.image-settings {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.55);
}

.image-settings .portrait-tools-label {
  margin-top: 0.45rem;
}

.image-settings .portrait-tools-label:first-child {
  margin-top: 0;
}

.image-settings .hint {
  margin-top: 0.35rem;
}

.form-grid input.portrait-file {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

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

  .portrait-crop {
    max-width: 280px;
  }
}

.upload-progress {
  height: 6px;
  margin-top: 0.45rem;
  background: #efe8df;
  border-radius: 999px;
  overflow: hidden;
}

.upload-progress__bar {
  height: 100%;
  width: 0;
  background: var(--navy);
}

.upload-status {
  min-height: 1.1rem;
  margin-top: 0.35rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.upload-status.is-error {
  color: #8d2a2a;
}

.uploader-remove {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0;
  border: 0;
  background: none;
  color: #8d3a3a;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.portrait-tools .uploader-remove {
  align-self: flex-start;
  margin-top: 0.15rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  background: #9b2c2c;
  color: #fff;
}

.portrait-tools .uploader-remove:hover {
  background: #7d2222;
}

.photo-grid .uploader-remove {
  font-size: 0.78rem;
}

.check {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  color: var(--text-on-light);
}

.page-home footer a {
  color: inherit;
}

.page-gallery button.thumb {
  width: 100%;
  display: block;
  padding: 0;
  appearance: none;
  font: inherit;
}

.preview-banner {
  position: relative;
  z-index: 5;
  background: #fff3cd;
  color: #6b4f1a;
  text-align: center;
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
}

.album-block {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.85rem;
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.55);
}

.album-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.album-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
}

.album-block.is-hidden {
  border-style: dashed;
  background: rgba(255, 255, 255, 0.35);
}

.album-delete {
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: none;
  color: #8d2a2a;
  font: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
}

.editor-tabs {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  margin: -0.35rem 0 1.1rem;
  padding-bottom: 0.15rem;
}

.editor-tab {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
}

.editor-tab[aria-selected="true"] {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.editor-panel[hidden] {
  display: none;
}

.landing-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.btn-secondary,
.btn-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  border-radius: 999px;
  padding: 0.8rem 1.3rem;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.btn-secondary {
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--border);
}

.btn-google {
  background: #fff;
  color: #1f1f1f;
  border: 1px solid #dadce0;
}

.btn-google svg {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0.35rem 0 0.15rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.feature-list {
  margin: 1rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.feature-block {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, #fff 0%, rgba(255, 252, 247, 0.9) 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.feature-switch__input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.form-grid .feature-switch {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 0;
  padding: 0.15rem 0.1rem 0.15rem 0;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  font-size: 1rem;
  color: var(--text-on-light);
  cursor: pointer;
}

.feature-switch__track {
  position: relative;
  flex: 0 0 auto;
  width: 2.85rem;
  height: 1.6rem;
  border-radius: 999px;
  background: #e4ddd4;
  box-shadow: inset 0 0 0 1px rgba(26, 47, 75, 0.08);
  transition: background 0.2s ease;
}

.feature-switch__thumb {
  position: absolute;
  top: 0.16rem;
  left: 0.16rem;
  width: 1.28rem;
  height: 1.28rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(26, 47, 75, 0.28);
  transition: transform 0.2s ease;
}

.feature-switch__copy {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  flex: 1;
}

.feature-switch__title {
  font-weight: 650;
  color: var(--navy);
}

.feature-switch__hint {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.35;
}

.feature-switch__badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #f3eee8;
  color: #8a7b6c;
}

.feature-switch__badge::before {
  content: 'Hidden';
}

.feature-switch__input:checked + .feature-switch .feature-switch__track {
  background: var(--navy);
}

.feature-switch__input:checked + .feature-switch .feature-switch__thumb {
  transform: translateX(1.22rem);
}

.feature-switch__input:checked + .feature-switch .feature-switch__badge {
  background: rgba(184, 149, 106, 0.18);
  color: #7a5b32;
}

.feature-switch__input:checked + .feature-switch .feature-switch__badge::before {
  content: 'Shown';
}

.feature-switch__input:focus-visible + .feature-switch {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 12px;
}

.feature-block:has(.feature-switch__input:not(:checked)) .feature-block__body {
  opacity: 0.5;
}

.feature-block__body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: opacity 0.2s ease;
}

.condolence-compose {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.condolence-compose h2 {
  margin: 0 0 0.2rem;
}

.form-grid .label-hint {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
}

.condolence-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  padding: 0.35rem 0.55rem 0.7rem;
}

.condolence-table-wrap table.dataTable {
  font-family: 'Source Sans 3', sans-serif;
  color: var(--text-on-light);
}

.condolence-table-wrap table.dataTable thead th {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.condolence-table-wrap td.condolence-message {
  white-space: normal;
  min-width: 12rem;
  max-width: 22rem;
}

.condolence-delete {
  border: 1px solid #e4c7c7;
  background: transparent;
  color: #8d3a3a;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.condolence-table-wrap .dt-search input,
.condolence-table-wrap .dt-length select {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.4rem 0.55rem;
  font: inherit;
}

body:has(#live-preview):not(.preview-collapsed) .account-wrap.account-wrap--wide {
  max-width: none;
  margin-left: 0;
  margin-right: calc(min(400px, 38vw) + 1.6rem);
  padding-right: 0.35rem;
}

body.preview-on-left:has(#live-preview):not(.preview-collapsed) .account-wrap.account-wrap--wide {
  margin-left: calc(min(400px, 38vw) + 1.6rem);
  margin-right: 0;
  padding-right: 1.25rem;
  padding-left: 0.35rem;
}

body.preview-collapsed:has(#live-preview) .account-wrap.account-wrap--wide {
  max-width: 52rem;
  margin-left: auto;
  margin-right: auto;
}

.live-preview {
  position: fixed;
  z-index: 30;
  top: 0.75rem;
  right: 0.75rem;
  width: min(400px, 38vw);
  height: calc(100vh - 1.5rem);
  display: flex;
  flex-direction: column;
  background: #122338;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(8, 16, 28, 0.45);
  overflow: hidden;
}

body.preview-on-left .live-preview {
  right: auto;
  left: 0.75rem;
}

.live-preview__bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.7rem;
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
}

.live-preview__title {
  margin-right: auto;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.2;
}

.live-preview__title span {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.72rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.68);
}

.live-preview__sides {
  display: flex;
  gap: 0.25rem;
}

.live-preview__side,
.live-preview__hide {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: transparent;
  color: #fff;
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.live-preview__side[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #122338;
}

.live-preview__stage {
  flex: 1;
  min-height: 0;
  background: #152a42;
}

.live-preview__stage iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #152a42;
}

body.preview-collapsed .live-preview {
  width: auto;
  height: auto;
}

body.preview-collapsed .live-preview__stage,
body.preview-collapsed .live-preview__sides {
  display: none;
}

@media (max-width: 960px) {
  body:has(#live-preview):not(.preview-collapsed) .account-wrap.account-wrap--wide,
  body.preview-on-left:has(#live-preview):not(.preview-collapsed) .account-wrap.account-wrap--wide {
    max-width: 52rem;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
    padding-bottom: calc(min(42vh, 380px) + 1.25rem);
  }

  .live-preview,
  body.preview-on-left .live-preview {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: auto;
    height: min(42vh, 380px);
    border-radius: 16px 16px 0 0;
  }

  .live-preview__sides {
    display: none;
  }

  body.preview-collapsed .live-preview,
  body.preview-collapsed.preview-on-left .live-preview {
    top: 0.75rem;
    right: 0.75rem;
    bottom: auto;
    left: auto;
    width: auto;
    height: auto;
    border-radius: 16px;
  }
}

.form-grid .text-shadow-controls {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.form-grid .shadow-colour {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0;
}

.form-grid .shadow-colour input[type="color"] {
  width: 2.75rem;
  height: 2rem;
  padding: 0.15rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.text-shadow-preview {
  margin-top: 0.15rem;
  padding: 1.15rem 1rem 1rem;
  border-radius: 12px;
  background: #1a2f4b;
  text-align: center;
}

.text-shadow-preview p {
  margin: 0;
  color: #fffefb;
}

#name-shadow-preview {
  font-family: 'Playfair Display', 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1.7rem, 4vw, 2.2rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.18;
  white-space: pre-line;
}

#life-years-preview {
  margin-top: 0.35rem;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.92);
}

.theme-block .hint {
  display: block;
  margin: 0.2rem 0 0.7rem;
}

.theme-templates {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 0.65rem;
}

.theme-template,
.theme-font,
.theme-colour {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--navy);
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.theme-template {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.5rem;
  border-radius: 14px;
}

.theme-template[aria-pressed="true"],
.theme-font[aria-pressed="true"],
.theme-colour[aria-pressed="true"] {
  border-color: var(--navy);
  box-shadow: 0 0 0 2px var(--navy);
}

.theme-template__stage {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.28rem;
  height: 72px;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  background: linear-gradient(160deg, #152a42, #1a2f4b 55%, #122338);
}

.theme-template__stage.is-paper {
  background: linear-gradient(180deg, #faf6f0, #efe6da);
}

.theme-template__stage.is-garden {
  background: linear-gradient(160deg, #24362c, #2c4034 50%, #1b2c24);
}

.theme-template__stage.is-chapel {
  background: linear-gradient(160deg, #3d1e2a, #4a2430 50%, #2e1520);
}

.theme-template__stage.is-night {
  background: linear-gradient(180deg, #161616, #1c1c1c 40%, #0e0e0e);
}

.theme-template__line {
  width: 1.7rem;
  height: 1px;
  margin-bottom: 0.15rem;
  background: #c4a574;
}

.theme-template__bar {
  height: 6px;
  width: 72%;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.88);
}

.theme-template__bar--short {
  width: 46%;
  height: 4px;
  opacity: 0.7;
}

.theme-template__stage.is-paper .theme-template__bar {
  background: #3e342c;
}

.theme-template__label {
  font-size: 0.92rem;
  font-weight: 600;
}

.theme-template__hint {
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.35;
  color: var(--muted);
}

.theme-fonts,
.theme-colours {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.theme-font,
.theme-colour {
  border-radius: 12px;
  padding: 0.55rem 0.8rem;
}

.theme-font__sample {
  display: block;
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.15;
}

.theme-font__label {
  display: block;
  margin-top: 0.15rem;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.theme-colour {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.domain-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.domain-step {
  background: var(--card);
  background-image: linear-gradient(180deg, #fff 0%, var(--cream) 100%);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.35rem 1.25rem 1.5rem;
  box-shadow: var(--shadow-card);
}

.domain-step h2 {
  font-family: 'Cormorant Garamond', serif;
  color: var(--navy);
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.domain-step.is-done {
  border-top-color: #1b5e20;
}

.editor-panel .domain-steps {
  gap: 0;
}

.editor-panel .domain-step {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 1.1rem 0;
  border-top: 1px solid var(--border);
}

.editor-panel .domain-step:first-child {
  border-top: 0;
  padding-top: 0;
}

.editor-panel .domain-step.is-done {
  border-top-color: var(--border);
}

.editor-panel .domain-step.is-done h2 {
  color: #1b5e20;
}

.domain-verify {
  margin-top: 0.85rem;
}

.domain-name-display {
  margin: 0.15rem 0 0.75rem;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 2.6rem;
  line-height: 1.05;
  font-weight: 600;
  color: var(--navy);
  overflow-wrap: anywhere;
}

.domain-name-display:focus {
  outline: 2px solid var(--accent);
  outline-offset: 6px;
  border-radius: 8px;
}

#domain-change {
  margin-top: 0.35rem;
}

.domain-status {
  min-height: 1.2rem;
  margin: 0.7rem 0 0;
  font-size: 0.92rem;
}

.domain-status.is-success {
  color: #1b5e20;
}

.domain-status.is-pending {
  color: #8a5a2a;
}

.domain-status.is-error {
  color: #8d2a2a;
}

.domain-admin {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.85rem 0;
}

.domain-admin + .domain-admin {
  border-top: 1px solid var(--border);
}

.domain-admin p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.domain-bind {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.domain-bind label {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.domain-bind input {
  min-width: 10rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  font: inherit;
  color: var(--text-on-light);
  background: #fff;
}

.domain-admin .domain-host {
  flex-basis: 100%;
  margin: 0;
  color: var(--navy);
  font-size: 0.95rem;
  font-weight: 600;
}

.domain-bind .btn-primary,
.domain-bind .btn-secondary {
  padding: 0.5rem 0.9rem;
  font-size: 0.92rem;
}

.nameserver-list {
  list-style: none;
  margin: 0.8rem 0 0;
  padding: 0;
}

.nameserver-list li + li {
  margin-top: 0.45rem;
}

.nameserver-list code {
  display: inline-block;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--border);
  font-size: 0.95rem;
}

.theme-colour__swatch {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: var(--swatch, #1a2f4b);
  box-shadow: inset 0 0 0 3px var(--swatch-accent, #b8956a);
}

#subtitle-shadow-preview {
  margin-top: 0.35rem;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.05rem;
  font-style: italic;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.88);
}
