:root {
  --paper: #f7f5f0;
  --surface: #ffffff;
  --surface-soft: #eeece6;
  --ink: #18221d;
  --muted: #66706b;
  --line: #d9d8d2;
  --forest: #20352c;
  --forest-2: #355c4a;
  --coral: #d7775f;
  --coral-soft: #f3ded7;
  --gold: #c39a4a;
  --blue: #547486;
  --success: #2f7452;
  --warning: #9b6b23;
  --danger: #b54f4f;
  --shadow: 0 16px 45px rgba(26, 39, 32, 0.1);
  --shadow-sm: 0 5px 18px rgba(26, 39, 32, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 66px;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 0 24px;
  background: rgba(247, 245, 240, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  cursor: pointer;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--forest);
  border-radius: 7px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 19px;
  font-weight: 700;
}

.brand-name {
  font-family: Georgia, "Songti SC", serif;
  font-size: 22px;
  font-weight: 700;
}

.brand-sub {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0;
}

.main-nav {
  display: flex;
  justify-content: center;
  gap: 4px;
}

.nav-button,
.icon-button,
.ghost-button,
.primary-button,
.secondary-button,
.danger-button,
.seg-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  cursor: pointer;
  border-radius: 6px;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.nav-button {
  padding: 0 13px;
  color: var(--muted);
  background: transparent;
  white-space: nowrap;
}

.nav-button:hover,
.nav-button.active {
  color: var(--ink);
  background: var(--surface-soft);
}

.nav-button svg,
.icon-button svg,
.ghost-button svg,
.primary-button svg,
.secondary-button svg,
.danger-button svg,
.seg-button svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

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

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--coral);
  font-weight: 700;
  cursor: pointer;
}

.icon-button {
  width: 38px;
  min-width: 38px;
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
}

.icon-button:hover {
  background: var(--surface-soft);
}

.primary-button {
  padding: 0 16px;
  color: #fff;
  background: var(--forest);
  font-weight: 700;
}

.primary-button:hover {
  background: #2b4a3c;
  transform: translateY(-1px);
}

.secondary-button,
.ghost-button {
  padding: 0 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  font-weight: 650;
}

.ghost-button {
  background: transparent;
}

.secondary-button:hover,
.ghost-button:hover {
  background: var(--surface-soft);
}

.danger-button {
  padding: 0 14px;
  color: #fff;
  background: var(--danger);
  font-weight: 700;
}

.button-sm {
  min-height: 32px;
  padding: 0 11px;
  font-size: 13px;
}

.page {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 32px 28px 52px;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--coral);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
.display-title {
  margin-bottom: 8px;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.15;
  letter-spacing: 0;
}

h2 {
  font-size: 21px;
  line-height: 1.3;
  letter-spacing: 0;
}

h3 {
  font-size: 16px;
  line-height: 1.35;
  letter-spacing: 0;
}

.page-description,
.muted {
  color: var(--muted);
}

.page-description {
  margin: 0;
  max-width: 680px;
  line-height: 1.7;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-bottom: 30px;
  border: 1px solid var(--line);
  background: var(--line);
  border-radius: var(--radius);
}

.stat-item {
  min-height: 106px;
  padding: 20px;
  background: var(--surface);
}

.stat-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.stat-label svg {
  width: 16px;
  height: 16px;
}

.stat-value {
  margin-top: 10px;
  font-family: Georgia, serif;
  font-size: 28px;
  font-weight: 700;
}

.stat-trend {
  margin-left: 8px;
  color: var(--success);
  font-family: Inter, sans-serif;
  font-size: 12px;
  font-weight: 700;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.filter-row,
.action-row,
.segmented {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-row {
  flex-wrap: wrap;
}

.filter-chip {
  min-height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  cursor: pointer;
}

.filter-chip.active,
.filter-chip:hover {
  color: #fff;
  background: var(--forest);
  border-color: var(--forest);
}

.search-box {
  position: relative;
  min-width: 260px;
}

.search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 17px;
  height: 17px;
  color: var(--muted);
  transform: translateY(-50%);
}

.search-box input,
.field input,
.field textarea,
.field select,
.inline-input {
  width: 100%;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
}

.search-box input {
  height: 40px;
  padding: 0 12px 0 38px;
}

.search-box input:focus,
.field input:focus,
.field textarea:focus,
.field select:focus,
.inline-input:focus {
  border-color: var(--forest-2);
  box-shadow: 0 0 0 3px rgba(53, 92, 74, 0.12);
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.template-card {
  position: relative;
  overflow: hidden;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.template-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.template-cover {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--surface-soft);
}

.template-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 380ms ease;
}

.envelope-card-cover {
  background: #e9e1d4;
}

.envelope-card-cover > img {
  filter: saturate(0.5) sepia(0.24) brightness(1.08);
  opacity: 0.42;
}

.envelope-card-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(239, 233, 222, 0.38);
  pointer-events: none;
}

.mini-envelope {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  width: 76%;
  aspect-ratio: 1.35;
  padding: 22% 16px 0;
  color: #4c443b;
  background: #f4f0e7;
  border: 1px solid rgba(93, 79, 62, 0.28);
  box-shadow: 0 18px 38px rgba(53, 44, 35, 0.22);
  text-align: center;
  transform: translate(-50%, -50%);
}

.mini-envelope::before,
.mini-envelope::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  pointer-events: none;
}

.mini-envelope::before {
  top: 0;
  height: 58%;
  background: #e8e0d2;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.mini-envelope::after {
  bottom: 0;
  height: 55%;
  background: #f9f6ef;
  clip-path: polygon(0 0, 50% 66%, 100% 0, 100% 100%, 0 100%);
}

.mini-envelope-name,
.mini-envelope-line {
  position: relative;
  z-index: 1;
}

.mini-envelope-name {
  font-family: Georgia, "Songti SC", serif;
  font-size: 18px;
  font-weight: 700;
}

.mini-envelope-name span {
  margin: 0 7px;
  color: #9f6b52;
  font-style: italic;
}

.mini-envelope-line {
  width: 28px;
  height: 1px;
  margin: 8px auto;
  background: #9f6b52;
}

.mini-wax-seal {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 50%;
  width: 45px;
  height: 45px;
  display: grid;
  place-items: center;
  color: #f6e7d7;
  background: #985442;
  border: 4px double rgba(255, 235, 214, 0.45);
  border-radius: 50%;
  box-shadow: 0 4px 9px rgba(69, 39, 31, 0.3);
  font-family: "Songti SC", serif;
  transform: translate(-50%, -50%);
}

.template-card:hover .template-cover img {
  transform: scale(1.025);
}

.template-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 18px;
  background: linear-gradient(to bottom, transparent 52%, rgba(12, 18, 15, 0.48));
  opacity: 0;
  transition: opacity 180ms ease;
}

.template-card:hover .template-overlay {
  opacity: 1;
}

.template-overlay .primary-button {
  width: 100%;
  background: white;
  color: var(--ink);
}

.template-card-body {
  padding: 15px;
}

.template-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.template-meta h3 {
  margin-bottom: 5px;
}

.template-meta p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.badge.coral {
  color: #7c3425;
  background: var(--coral-soft);
}

.badge.green {
  color: #20533b;
  background: #dceddf;
}

.badge.gold {
  color: #72531d;
  background: #f4e8cb;
}

.badge.gray {
  color: #505b56;
  background: var(--surface-soft);
}

.empty-state {
  grid-column: 1 / -1;
  padding: 64px 24px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.empty-state svg {
  width: 34px;
  height: 34px;
  color: var(--muted);
  margin-bottom: 12px;
}

/* Dashboard */
.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
}

.dashboard-layout > *,
.admin-grid > * {
  min-width: 0;
}

.section-block {
  min-width: 0;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-heading h2,
.section-heading h3 {
  margin: 0;
}

.event-list {
  display: grid;
  gap: 12px;
}

.event-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.event-thumb {
  width: 82px;
  height: 68px;
  object-fit: cover;
  border-radius: 5px;
}

.event-row h3 {
  margin: 0 0 5px;
}

.event-row p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.progress-bar {
  height: 7px;
  overflow: hidden;
  background: var(--surface-soft);
  border-radius: 99px;
}

.progress-fill {
  height: 100%;
  background: var(--coral);
  border-radius: inherit;
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  margin: 7px 0 15px;
  color: var(--muted);
  font-size: 12px;
}

.task-list {
  display: grid;
  gap: 2px;
}

.task-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  border-bottom: 1px solid var(--line);
}

.task-item:last-child {
  border-bottom: 0;
}

.task-item input {
  width: 17px;
  height: 17px;
  accent-color: var(--forest);
}

.task-item.done span {
  color: var(--muted);
  text-decoration: line-through;
}

.deadline {
  color: var(--warning);
  font-size: 12px;
}

.activity-list {
  position: relative;
  display: grid;
  gap: 20px;
}

.activity-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
}

.activity-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--forest);
  background: #dfe9e3;
  border-radius: 50%;
}

.activity-icon svg {
  width: 15px;
  height: 15px;
}

.activity-item p {
  margin: 0 0 4px;
  line-height: 1.45;
}

.activity-item time {
  color: var(--muted);
  font-size: 11px;
}

/* Editor */
.editor-page {
  height: calc(100vh - 66px);
  display: grid;
  grid-template-columns: 340px minmax(420px, 1fr) 300px;
  overflow: hidden;
}

.editor-sidebar,
.editor-inspector {
  overflow-y: auto;
  background: var(--surface);
}

.editor-sidebar {
  border-right: 1px solid var(--line);
}

.editor-inspector {
  border-left: 1px solid var(--line);
}

.editor-mobile-actions {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 18px 18px;
}

.editor-panel-header {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 18px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
}

.editor-panel-header h2 {
  margin-bottom: 4px;
  font-size: 18px;
}

.editor-panel-header p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.editor-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 14px 14px 0;
  padding: 4px;
  background: var(--surface-soft);
  border-radius: 7px;
}

.seg-button {
  min-height: 34px;
  padding: 0 8px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
}

.seg-button.active {
  color: var(--ink);
  background: white;
  box-shadow: 0 1px 4px rgba(25, 34, 29, 0.1);
}

.panel-content {
  padding: 18px;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
}

.field label {
  font-size: 12px;
  font-weight: 750;
}

.field input,
.field select {
  height: 40px;
  padding: 0 11px;
}

.field textarea {
  min-height: 90px;
  padding: 10px 11px;
  resize: vertical;
  line-height: 1.5;
}

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

.palette-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.color-swatch {
  position: relative;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid white;
  box-shadow: 0 0 0 1px var(--line);
}

.color-swatch.active::after {
  content: "";
  position: absolute;
  inset: -6px;
  border: 2px solid var(--ink);
  border-radius: 50%;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 48px;
  border-bottom: 1px solid var(--line);
}

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

.switch-copy span {
  color: var(--muted);
  font-size: 11px;
}

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

.switch input {
  position: absolute;
  opacity: 0;
}

.switch-track {
  position: absolute;
  inset: 0;
  background: #c7cbc8;
  border-radius: 999px;
  cursor: pointer;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform 160ms ease;
}

.switch input:checked + .switch-track {
  background: var(--forest-2);
}

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

.block-list {
  display: grid;
  gap: 8px;
}

.block-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.block-item svg {
  width: 17px;
  height: 17px;
  color: var(--muted);
}

.block-drag {
  cursor: grab;
}

.editor-canvas {
  position: relative;
  overflow: auto;
  display: grid;
  justify-items: center;
  align-content: start;
  padding: 30px 20px 70px;
  background-color: #e9e7e2;
  background-image: radial-gradient(#c9c8c2 0.7px, transparent 0.7px);
  background-size: 14px 14px;
}

.canvas-toolbar {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
  padding: 5px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: var(--shadow-sm);
}

.canvas-toolbar .seg-button {
  min-width: 36px;
}

.invitation-phone {
  width: min(390px, 100%);
  min-height: 760px;
  overflow: hidden;
  background: white;
  border: 8px solid #171c19;
  border-radius: 36px;
  box-shadow: 0 24px 70px rgba(26, 34, 30, 0.26);
}

.invitation-preview {
  position: relative;
  overflow: hidden;
  min-height: 744px;
  color: var(--invite-ink, #243129);
  background: var(--invite-paper, #f5efe6);
  text-align: center;
}

.envelope-opening {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 12;
  height: 744px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 52px 22px 38px;
  color: #534c42;
  background-color: #ece5d9;
  background-image: radial-gradient(rgba(91, 76, 57, 0.09) 0.6px, transparent 0.6px);
  background-size: 7px 7px;
}

.envelope-intro {
  position: relative;
  z-index: 2;
  margin-bottom: 42px;
  color: #7b6b59;
  font-family: Georgia, serif;
  font-size: 10px;
  font-weight: 700;
}

.digital-envelope {
  position: relative;
  z-index: 2;
  width: min(310px, 92%);
  height: 218px;
  perspective: 900px;
  filter: drop-shadow(0 20px 24px rgba(60, 50, 40, 0.22));
}

.envelope-letter {
  position: absolute;
  z-index: 1;
  left: 8%;
  right: 8%;
  top: 8px;
  height: 176px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 18px;
  background: #fffdf8;
  border: 1px solid rgba(88, 73, 55, 0.18);
  transition: transform 900ms cubic-bezier(0.2, 0.75, 0.2, 1);
}

.envelope-letter small {
  color: #9a6a54;
  font-size: 10px;
}

.envelope-letter strong {
  font-family: Georgia, "Songti SC", serif;
  font-size: 22px;
}

.envelope-letter span {
  color: #7b746b;
  font-size: 11px;
}

.envelope-pocket {
  position: absolute;
  z-index: 3;
  inset: 38% 0 0;
  background: #f5f0e6;
  border: 1px solid rgba(89, 74, 57, 0.22);
  clip-path: polygon(0 0, 50% 52%, 100% 0, 100% 100%, 0 100%);
}

.envelope-flap {
  position: absolute;
  z-index: 4;
  left: 0;
  right: 0;
  top: 0;
  height: 58%;
  background: #e4dacb;
  border-top: 1px solid rgba(89, 74, 57, 0.22);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: center top;
  transition: transform 900ms cubic-bezier(0.2, 0.75, 0.2, 1);
}

.wax-seal-button {
  position: absolute;
  z-index: 6;
  left: 50%;
  top: 54%;
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #f8e9d8;
  background: #985442;
  border: 6px double rgba(255, 230, 205, 0.42);
  border-radius: 50%;
  box-shadow: 0 8px 18px rgba(66, 35, 28, 0.34), inset 0 0 0 2px rgba(90, 41, 31, 0.2);
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: transform 220ms ease, opacity 220ms ease;
}

.wax-seal-button:hover {
  transform: translate(-50%, -50%) scale(1.06);
}

.wax-seal-button span {
  font-family: Georgia, "Songti SC", serif;
  font-size: 13px;
  font-weight: 700;
}

.envelope-hint {
  position: relative;
  z-index: 2;
  margin: 36px 0 0;
  color: #766b5e;
  font-size: 11px;
}

.envelope-botanical {
  position: absolute;
  z-index: 1;
  width: 140px;
  height: 250px;
  opacity: 0.28;
  transform: rotate(-24deg);
}

.envelope-botanical::before {
  content: "";
  position: absolute;
  left: 68px;
  top: 12px;
  width: 1px;
  height: 220px;
  background: #7f8b78;
}

.envelope-botanical span {
  position: absolute;
  left: 65px;
  width: 48px;
  height: 22px;
  background: #8b967f;
  border-radius: 90% 0 90% 0;
  transform-origin: left center;
}

.envelope-botanical span:nth-child(1) { top: 42px; transform: rotate(-34deg); }
.envelope-botanical span:nth-child(2) { top: 94px; transform: rotate(28deg) scale(0.9); }
.envelope-botanical span:nth-child(3) { top: 146px; transform: rotate(-30deg) scale(0.76); }

.botanical-left {
  left: -40px;
  bottom: -20px;
}

.botanical-right {
  right: -30px;
  top: -24px;
  transform: rotate(154deg);
}

.envelope-opening.opened {
  pointer-events: none;
  animation: envelope-overlay-away 1500ms ease forwards;
}

.envelope-opening.opened .envelope-flap {
  transform: rotateX(178deg);
}

.envelope-opening.opened .envelope-letter {
  transform: translateY(-58px);
}

.envelope-opening.opened .wax-seal-button {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.7);
}

.ivory-invite-hero {
  height: 520px;
  background-position: center 38%;
}

@keyframes envelope-overlay-away {
  0%, 66% { opacity: 1; }
  100% { opacity: 0; visibility: hidden; }
}

.invite-hero {
  position: relative;
  height: 490px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding: 42px 24px;
  color: white;
  background-size: cover;
  background-position: center;
}

.invite-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(15, 20, 17, 0.05) 35%, rgba(15, 20, 17, 0.74));
}

.invite-hero > * {
  position: relative;
  z-index: 1;
}

.invite-kicker {
  margin-bottom: 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.invite-names {
  margin-bottom: 12px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 38px;
  line-height: 1.16;
  letter-spacing: 0;
}

.invite-date {
  font-size: 13px;
}

.invite-section {
  padding: 36px 27px;
  border-bottom: 1px solid rgba(30, 47, 38, 0.12);
}

.invite-section h3 {
  margin-bottom: 10px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 23px;
}

.invite-section p {
  color: color-mix(in srgb, var(--invite-ink, #243129) 74%, transparent);
  line-height: 1.75;
}

.invite-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  margin: 0 auto 13px;
  color: var(--invite-accent, #a05744);
  border: 1px solid currentColor;
  border-radius: 50%;
}

.invite-icon svg {
  width: 17px;
  height: 17px;
}

.invite-rsvp {
  margin-top: 15px;
  min-height: 40px;
  padding: 0 20px;
  color: white;
  background: var(--invite-accent, #a05744);
  border-radius: 999px;
  cursor: pointer;
}

.inspector-score {
  padding: 14px;
  margin-bottom: 18px;
  background: #eef5f0;
  border: 1px solid #d2e4d8;
  border-radius: 7px;
}

.inspector-score strong {
  display: block;
  margin-bottom: 6px;
}

.inspector-score p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.share-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.share-link .inline-input {
  height: 38px;
  padding: 0 10px;
  font-size: 12px;
}

/* Guests and tables */
.tab-bar {
  display: flex;
  gap: 18px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.tab-link {
  position: relative;
  min-height: 42px;
  padding: 0 2px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.tab-link.active {
  color: var(--ink);
  font-weight: 750;
}

.tab-link.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--coral);
}

.data-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.data-table th {
  color: var(--muted);
  background: #f2f1ed;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.person-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mini-avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: var(--forest);
  background: #dfe9e3;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.status-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
}

.status-label.confirmed { color: var(--success); }
.status-label.pending { color: var(--warning); }
.status-label.declined { color: var(--danger); }

.table-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.seating-table {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.seating-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.seat-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.seat-pill {
  padding: 6px 9px;
  color: var(--muted);
  background: var(--surface-soft);
  border-radius: 999px;
  font-size: 11px;
}

/* Admin */
.admin-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  margin: -32px -28px 28px;
  padding: 24px 28px;
  color: white;
  background: var(--forest);
}

.admin-banner h1 {
  margin-bottom: 5px;
  font-size: 27px;
}

.admin-banner p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 20px;
}

.admin-template-cell {
  display: flex;
  align-items: center;
  gap: 11px;
}

.admin-template-cell img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 5px;
}

.ops-task {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 11px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.ops-task:last-child {
  border-bottom: 0;
}

.priority-marker {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--coral);
}

.ops-task p {
  margin: 0 0 4px;
  font-weight: 700;
}

.ops-task span {
  color: var(--muted);
  font-size: 11px;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 150px;
  padding-top: 14px;
}

.bar-col {
  flex: 1;
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: end;
  gap: 7px;
  height: 100%;
  text-align: center;
  color: var(--muted);
  font-size: 10px;
}

.bar {
  width: 100%;
  min-height: 8px;
  background: var(--blue);
  border-radius: 4px 4px 0 0;
}

/* Modal and toast */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(14, 20, 17, 0.62);
}

.modal {
  width: min(520px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.modal-header,
.modal-body,
.modal-footer {
  padding: 18px 20px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin: 0;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--line);
}

.qr-wrap {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
}

.fake-qr {
  aspect-ratio: 1;
  padding: 12px;
  background-color: white;
  background-image:
    repeating-linear-gradient(0deg, transparent 0 8px, #18221d 8px 12px),
    repeating-linear-gradient(90deg, transparent 0 7px, #18221d 7px 11px);
  border: 8px solid white;
  outline: 1px solid var(--line);
}

#toast-root {
  position: fixed;
  z-index: 350;
  right: 20px;
  bottom: 20px;
  display: grid;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 250px;
  padding: 13px 15px;
  color: white;
  background: var(--forest);
  border-radius: 7px;
  box-shadow: var(--shadow);
  animation: toast-in 180ms ease-out;
}

.toast svg {
  width: 17px;
  height: 17px;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.mobile-nav {
  display: none;
}

/* Standalone guest invitation */
.public-invite {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  color: var(--invite-ink);
  background: var(--invite-paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
}

.public-invite h1,
.public-invite h2,
.public-invite h3 {
  font-family: Georgia, "Songti SC", serif;
  font-weight: 500;
}

.public-invite-controls {
  position: fixed;
  z-index: 180;
  top: 18px;
  right: 18px;
  display: flex;
  gap: 7px;
}

.public-control-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(33, 48, 40, 0.18);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
  cursor: pointer;
}

.public-control-button svg {
  width: 18px;
  height: 18px;
}

.public-envelope-opening {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  min-height: 620px;
  z-index: 200;
}

.public-envelope-opening .digital-envelope {
  width: min(440px, 82vw);
  height: 305px;
}

.public-envelope-opening .envelope-letter {
  height: 246px;
}

.public-envelope-opening .envelope-letter strong {
  font-size: 30px;
}

.public-envelope-opening .wax-seal-button {
  width: 76px;
  height: 76px;
}

.public-envelope-opening .envelope-intro {
  margin-bottom: 48px;
  font-size: 11px;
}

.public-envelope-opening .envelope-botanical {
  transform: scale(1.45) rotate(-24deg);
}

.public-envelope-opening .botanical-right {
  transform: scale(1.45) rotate(154deg);
}

.public-invite-hero {
  position: relative;
  min-height: 92vh;
  display: grid;
  place-items: end center;
  padding: 72px 24px;
  color: white;
  background-position: center;
  background-size: cover;
}

.public-invite-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(16, 20, 17, 0.04) 28%, rgba(16, 20, 17, 0.78));
}

.public-hero-content {
  position: relative;
  z-index: 1;
  max-width: 860px;
  text-align: center;
}

.public-hero-content > span,
.public-overline {
  font-size: 11px;
  font-weight: 800;
}

.public-hero-content h1 {
  margin: 18px 0 14px;
  font-size: 62px;
  line-height: 1.08;
}

.public-hero-content p {
  margin-bottom: 24px;
  font-size: 16px;
}

.public-scroll-cue {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin: 0 auto;
  color: white;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  cursor: pointer;
  animation: public-cue 1800ms ease-in-out infinite;
}

@keyframes public-cue {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

.public-section-inner {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 104px 0;
  text-align: center;
}

.public-section-inner.narrow {
  width: min(680px, calc(100% - 48px));
}

.public-section-inner h2,
.public-story-copy h2 {
  margin: 12px 0 22px;
  font-size: 40px;
  line-height: 1.25;
}

.public-overline {
  margin-bottom: 0;
  color: var(--invite-accent);
  font-family: Georgia, serif;
}

.public-ornament {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin: 0 auto 26px;
  color: var(--invite-accent);
  border: 1px solid currentColor;
  border-radius: 50%;
}

.public-ornament svg {
  width: 20px;
  height: 20px;
}

.public-lead,
.public-story-copy p,
.public-dress-band .public-section-inner > p,
.public-rsvp-band .public-section-inner > p {
  font-size: 16px;
  line-height: 2;
}

.public-signature {
  margin-top: 32px;
  color: var(--invite-accent);
  font-family: Georgia, "Songti SC", serif;
  font-size: 24px;
}

.public-signature span {
  padding: 0 12px;
  font-style: italic;
}

.public-countdown-band {
  color: #f8f4eb;
  background: #263d33;
}

.public-countdown-band .public-overline {
  color: #e0b9a9;
}

.public-countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: 760px;
  margin: 48px auto 0;
}

.public-countdown > div {
  display: grid;
  gap: 10px;
  padding: 8px 24px;
  border-right: 1px solid rgba(255, 255, 255, 0.22);
}

.public-countdown > div:last-child {
  border-right: 0;
}

.public-countdown strong {
  font-family: Georgia, serif;
  font-size: 46px;
  font-weight: 500;
}

.public-countdown span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 11px;
}

.public-details-band {
  background: #eee7db;
}

.public-details-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 80px;
  align-items: center;
  text-align: left;
}

.public-detail-copy h2 {
  margin-bottom: 14px;
}

.public-detail-copy > p:not(.public-overline) {
  color: #5f665f;
  font-size: 16px;
  line-height: 1.9;
}

.public-outline-button,
.public-rsvp-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  padding: 0 20px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 750;
}

.public-outline-button {
  color: var(--invite-ink);
  background: transparent;
  border: 1px solid rgba(37, 54, 46, 0.34);
}

.public-outline-button svg {
  width: 17px;
  height: 17px;
}

.public-date-seal {
  width: 250px;
  height: 250px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  color: #f5eadc;
  background: #995541;
  border: 10px double rgba(255, 234, 215, 0.42);
  border-radius: 50%;
  box-shadow: 0 18px 40px rgba(83, 51, 39, 0.2);
}

.public-date-seal span,
.public-date-seal small {
  font-size: 12px;
  font-weight: 800;
}

.public-date-seal strong {
  font-family: Georgia, serif;
  font-size: 72px;
  font-weight: 500;
  line-height: 1;
}

.public-timeline-band {
  background: #faf8f3;
}

.public-timeline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-top: 54px;
}

.public-timeline.compact {
  grid-template-columns: repeat(2, 1fr);
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
}

.public-timeline::before {
  content: "";
  position: absolute;
  left: 12.5%;
  right: 12.5%;
  top: 28px;
  height: 1px;
  background: #c9c4b9;
}

.public-timeline-item {
  position: relative;
  z-index: 1;
  padding: 0 18px;
  text-align: center;
}

.public-timeline-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  color: var(--invite-accent);
  background: #faf8f3;
  border: 1px solid #c9c4b9;
  border-radius: 50%;
}

.public-timeline-icon svg {
  width: 20px;
  height: 20px;
}

.public-timeline-item time {
  color: var(--invite-accent);
  font-family: Georgia, serif;
  font-size: 15px;
  font-weight: 700;
}

.public-timeline-item h3 {
  margin: 9px 0 7px;
  font-size: 19px;
}

.public-timeline-item p {
  margin: 0;
  color: #70756f;
  font-size: 12px;
  line-height: 1.65;
}

.public-story-band {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  min-height: 680px;
  background: #ded8cc;
}

.public-story-media {
  min-height: 680px;
}

.public-story-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.public-story-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 76px;
}

.public-story-copy p:not(.public-overline) {
  color: #515a54;
  font-size: 15px;
}

.public-dress-band {
  background: #f6f1e9;
}

.dress-swatches {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 34px;
}

.dress-swatches span {
  width: 38px;
  height: 38px;
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(42, 54, 48, 0.18);
}

.public-gallery-band {
  background: #faf9f6;
}

.public-gallery {
  display: grid;
  grid-template-columns: 0.9fr 1.2fr 0.9fr;
  gap: 14px;
  margin-top: 42px;
}

.public-gallery img {
  width: 100%;
  height: 430px;
  object-fit: cover;
}

.public-gallery img:nth-child(2) {
  height: 500px;
  margin-top: -35px;
}

.public-rsvp-band {
  color: #fff9f1;
  background: #985442;
}

.public-rsvp-band .public-overline,
.public-ornament.light {
  color: #f2cbb8;
}

.public-rsvp-band .public-section-inner > p {
  color: rgba(255, 255, 255, 0.76);
}

.public-rsvp-button {
  min-width: 190px;
  color: #5b2d25;
  background: #fff8ed;
}

.public-invite-footer {
  display: grid;
  justify-items: center;
  padding: 54px 20px;
  color: #dfe7e1;
  background: #20352c;
  text-align: center;
}

.public-invite-footer p {
  margin: 16px 0 5px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 17px;
}

.public-invite-footer small {
  color: rgba(255, 255, 255, 0.52);
}

.file-button {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-stack {
  display: grid;
  gap: 8px;
}

.invite-bg-video,
.public-bg-video {
  position: absolute !important;
  inset: 0;
  z-index: 0 !important;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.font-modern h1,
.font-modern h2,
.font-modern h3,
.font-modern .invite-names,
.font-modern .public-signature {
  font-family: Inter, "PingFang SC", sans-serif;
  font-weight: 650;
}

.font-hand .invite-names,
.font-hand .public-hero-content h1,
.font-hand .public-signature {
  font-family: "Kaiti SC", "STKaiti", cursive;
}

.public-menu-band {
  color: #f7f0e7;
  background: #33443d;
}

.public-menu-band .public-overline {
  color: #e5bca9;
}

.public-menu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 920px;
  margin: 50px auto 0;
}

.public-menu-grid > div {
  padding: 12px 30px;
  border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.public-menu-grid > div:last-child {
  border-right: 0;
}

.public-menu-grid span {
  color: #e5bca9;
  font-family: Georgia, serif;
  font-size: 12px;
}

.public-menu-grid h3 {
  margin: 12px 0 8px;
  font-size: 21px;
}

.public-menu-grid p {
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  line-height: 1.7;
}

.public-travel-band {
  background: #ece8de;
}

.public-travel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 48px;
  background: #cbc5b9;
  border: 1px solid #cbc5b9;
}

.public-travel-item {
  padding: 36px 28px;
  background: #f8f5ef;
  text-align: left;
}

.public-travel-item > span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  color: var(--invite-accent);
  border: 1px solid currentColor;
  border-radius: 50%;
}

.public-travel-item svg {
  width: 18px;
  height: 18px;
}

.public-travel-item small {
  color: var(--invite-accent);
  font-weight: 800;
}

.public-travel-item h3 {
  margin: 9px 0 11px;
  font-size: 20px;
}

.public-travel-item p {
  margin: 0;
  color: #697069;
  font-size: 13px;
  line-height: 1.75;
}

.public-gift-band {
  background: #f8f3eb;
}

.public-gift-band .public-section-inner > p {
  color: #666d67;
  font-size: 15px;
  line-height: 1.9;
}

.public-faq-band {
  background: #fffdf9;
}

.public-faq-list {
  max-width: 760px;
  margin: 42px auto 0;
  border-top: 1px solid #d6d2c8;
}

.public-faq-item {
  text-align: left;
  border-bottom: 1px solid #d6d2c8;
}

.public-faq-item summary {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  cursor: pointer;
  font-family: Georgia, "Songti SC", serif;
  font-size: 17px;
  list-style: none;
}

.public-faq-item summary::-webkit-details-marker {
  display: none;
}

.public-faq-item summary svg {
  width: 18px;
  height: 18px;
  transition: transform 160ms ease;
}

.public-faq-item[open] summary svg {
  transform: rotate(180deg);
}

.public-faq-item p {
  margin: -4px 0 24px;
  color: #687069;
  line-height: 1.75;
}

.more-menu-grid {
  display: grid;
  gap: 7px;
}

.more-menu-grid > button {
  min-height: 68px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
}

.more-menu-grid > button > span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--forest);
  background: #dfe9e3;
  border-radius: 50%;
}

.more-menu-grid svg {
  width: 17px;
  height: 17px;
}

.more-menu-grid strong,
.more-menu-grid small {
  display: block;
}

.more-menu-grid small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.guest-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.guest-detail-grid > div,
.guest-note {
  padding: 13px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.guest-detail-grid small,
.guest-note small {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
}

.guest-note {
  margin-top: 12px;
}

.guest-note p {
  margin: 0;
}

.budget-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  margin-bottom: 14px;
  color: white;
  background: var(--forest);
  border-radius: 7px;
}

.budget-total-row span,
.budget-total-row strong {
  display: block;
}

.budget-total-row span {
  color: rgba(255, 255, 255, 0.68);
}

.budget-total-row strong {
  margin-top: 8px;
  font-family: Georgia, serif;
  font-size: 30px;
}

.budget-ring {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--coral) var(--budget), rgba(255, 255, 255, 0.16) 0);
  border-radius: 50%;
}

.budget-ring::before {
  content: "";
  grid-area: 1 / 1;
  width: 62px;
  height: 62px;
  background: var(--forest);
  border-radius: 50%;
}

.budget-ring span {
  z-index: 1;
  grid-area: 1 / 1;
  color: white;
  font-weight: 800;
}

.budget-input {
  width: 130px;
  height: 36px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.budget-under { color: var(--success); font-weight: 750; }
.budget-over { color: var(--danger); font-weight: 750; }

.seating-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.seating-board article {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 130px;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.seating-board strong,
.seating-board small {
  display: block;
}

.seating-board small {
  margin-top: 3px;
  color: var(--muted);
}

.seating-board select {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.save-date-layout {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: 24px;
}

.save-date-preview {
  position: relative;
  min-height: 650px;
  display: grid;
  place-items: center;
  padding: 40px;
  color: white;
  background-position: center;
  background-size: cover;
  text-align: center;
}

.save-date-preview::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(19, 29, 24, 0.58);
}

.save-date-preview > div {
  position: relative;
  z-index: 1;
}

.save-date-preview span {
  font-size: 11px;
  font-weight: 800;
}

.save-date-preview h2 {
  margin: 24px 0 15px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 50px;
}

.save-date-preview p {
  font-family: Georgia, "Songti SC", serif;
  font-size: 24px;
}

.save-date-preview strong,
.save-date-preview small {
  display: block;
}

.save-date-preview strong {
  margin-top: 38px;
  font-size: 18px;
}

.save-date-preview small {
  margin-top: 9px;
}

.memories-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 24px;
}

.memories-qr-panel {
  position: sticky;
  top: 90px;
  height: fit-content;
  padding: 24px;
  background: var(--forest);
  color: white;
  border-radius: 7px;
  text-align: center;
}

.memories-qr-panel h2 {
  margin: 20px 0;
}

.memories-qr-panel .fake-qr {
  width: 190px;
  margin: 0 auto;
}

.memories-qr-panel p {
  margin: 20px 0;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
}

.memories-gallery {
  columns: 3 210px;
  column-gap: 12px;
}

.memories-gallery figure {
  break-inside: avoid;
  margin: 0 0 12px;
  overflow: hidden;
  background: white;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.memories-gallery img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

.memories-gallery figcaption {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 11px;
}

.planner-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: -32px -28px 28px;
  padding: 28px;
  color: white;
  background: #4f6170;
}

.planner-banner h1 {
  margin-bottom: 6px;
  font-size: 30px;
}

.planner-banner p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
}

.planner-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
}

.planner-client-list {
  display: grid;
  gap: 10px;
}

.planner-client-list article {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.planner-client-date {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  align-content: center;
  color: white;
  background: #4f6170;
  border-radius: 6px;
}

.planner-client-date strong,
.planner-client-date span {
  display: block;
}

.planner-client-date strong {
  font-family: Georgia, serif;
  font-size: 22px;
}

.planner-client-date span {
  font-size: 10px;
}

.planner-client-list h3 {
  margin: 0 0 5px;
}

.planner-client-list p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.white-label-preview {
  display: grid;
  justify-items: center;
  margin-bottom: 16px;
  padding: 28px 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.white-label-preview strong {
  margin-top: 10px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 17px;
}

.white-label-preview small {
  margin-top: 5px;
  color: var(--muted);
}

/* Refined product system */
:root {
  --paper: #f5f4f0;
  --surface-soft: #ebeae5;
  --ink: #15211b;
  --muted: #68716c;
  --line: #d8d7d1;
  --forest: #18382c;
  --forest-2: #315c48;
  --coral: #bb654f;
  --gold: #b58a3e;
  --shadow: 0 24px 60px rgba(20, 33, 27, 0.13);
  --shadow-sm: 0 8px 24px rgba(20, 33, 27, 0.07);
}

body {
  background: #f5f4f0;
}

.topbar {
  height: 72px;
  padding-inline: 30px;
  background: rgba(250, 249, 246, 0.94);
}

.brand-mark {
  background: #17362b;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.main-nav {
  gap: 12px;
}

.nav-button {
  position: relative;
  padding-inline: 8px;
  border-radius: 0;
}

.nav-button:hover,
.nav-button.active {
  background: transparent;
}

.nav-button.active::after {
  content: "";
  position: absolute;
  left: 9px;
  right: 9px;
  bottom: -18px;
  height: 2px;
  background: var(--gold);
}

.page {
  padding-top: 44px;
}

.page-header {
  min-height: 148px;
  align-items: center;
  margin-bottom: 22px;
  padding: 8px 0 24px;
  border-bottom: 1px solid var(--line);
}

.page-header h1,
.planner-banner h1,
.admin-banner h1 {
  max-width: 820px;
  font-size: 42px;
  font-weight: 500;
}

.eyebrow,
.modal-eyebrow {
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 0;
}

.stat-strip {
  margin-bottom: 38px;
  border-width: 0 0 1px;
  border-radius: 0;
  background: transparent;
}

.stat-item {
  min-height: 82px;
  padding: 12px 20px 18px;
  background: transparent;
  border-left: 1px solid var(--line);
}

.stat-item:first-child {
  border-left: 0;
}

.stat-value {
  margin-top: 7px;
  font-size: 24px;
  font-weight: 500;
}

.toolbar {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.filter-chip {
  border-radius: 5px;
}

.template-grid {
  gap: 24px 18px;
}

.template-card {
  border-color: #d2d1ca;
  box-shadow: none;
}

.template-card:first-child {
  grid-column: span 2;
}

.template-card:first-child .template-cover {
  aspect-ratio: 8 / 5;
}

.template-card:first-child .template-meta h3 {
  font-family: Georgia, "Songti SC", serif;
  font-size: 22px;
  font-weight: 500;
}

.template-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 44px rgba(20, 33, 27, 0.12);
}

.template-card-body {
  padding: 17px 16px 18px;
}

.template-meta h3 {
  font-family: Georgia, "Songti SC", serif;
  font-weight: 500;
}

.section-block {
  box-shadow: 0 6px 22px rgba(20, 33, 27, 0.045);
}

.activity-filter-label {
  margin: 4px 0 0;
  font-size: 11px;
}

.empty-inline {
  padding: 30px 12px;
  color: var(--muted);
  text-align: center;
}

.block-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.block-actions .icon-button {
  width: 30px;
  min-width: 30px;
  min-height: 30px;
  color: var(--danger);
  background: transparent;
}

.invitation-phone.preview-tablet {
  width: min(620px, 100%);
  border-radius: 24px;
}

.invitation-phone.preview-desktop {
  width: min(900px, 100%);
  border-width: 6px;
  border-radius: 12px;
}

.invitation-phone.preview-desktop .invitation-preview,
.invitation-phone.preview-desktop .envelope-opening {
  min-height: 620px;
}

.public-custom-band {
  padding: 0;
  color: var(--invite-ink);
  background: #f7f4ed;
  border-top: 1px solid rgba(35, 42, 38, 0.08);
}

.modal {
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 28px 80px rgba(10, 18, 14, 0.3);
}

.modal-header {
  padding-top: 22px;
  padding-bottom: 16px;
}

.modal-eyebrow {
  margin: 0 0 5px;
  font-weight: 800;
  text-transform: uppercase;
}

.profile-summary {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.profile-summary p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.avatar-large {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  font-size: 18px;
}

.brand-modal-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  padding: 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 7px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 17px;
}

.brand-modal-preview span {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: white;
  border-radius: 7px;
}

input[type="color"] {
  min-height: 42px;
  padding: 4px;
}

@media (max-width: 760px) {
  .public-invite-controls {
    top: 12px;
    right: 12px;
  }

  .public-control-button {
    width: 38px;
    height: 38px;
  }

  .public-envelope-opening .digital-envelope {
    width: min(330px, 88vw);
    height: 230px;
  }

  .public-envelope-opening .envelope-letter {
    height: 184px;
  }

  .public-envelope-opening .envelope-letter strong {
    font-size: 22px;
  }

  .public-envelope-opening .wax-seal-button {
    width: 66px;
    height: 66px;
  }

  .public-invite-hero {
    min-height: 88vh;
    padding: 64px 20px;
  }

  .public-hero-content h1 {
    font-size: 40px;
  }

  .public-section-inner,
  .public-section-inner.narrow {
    width: min(100% - 36px, 680px);
    padding: 76px 0;
  }

  .public-section-inner h2,
  .public-story-copy h2 {
    font-size: 31px;
  }

  .public-countdown > div {
    padding: 6px 8px;
  }

  .public-countdown strong {
    font-size: 31px;
  }

  .public-details-grid {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 48px;
    text-align: center;
  }

  .public-date-seal {
    width: 190px;
    height: 190px;
  }

  .public-date-seal strong {
    font-size: 55px;
  }

  .public-timeline {
    grid-template-columns: 1fr;
    gap: 32px;
    max-width: 430px;
    margin: 44px auto 0;
  }

  .public-timeline.compact {
    grid-template-columns: 1fr;
  }

  .public-timeline::before {
    left: 28px;
    right: auto;
    top: 28px;
    bottom: 28px;
    width: 1px;
    height: auto;
  }

  .public-timeline-item {
    display: grid;
    grid-template-columns: 56px 62px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 0;
    text-align: left;
  }

  .public-timeline-icon {
    margin: 0;
  }

  .public-timeline-item h3 {
    margin-top: 0;
  }

  .public-story-band {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .public-story-media {
    min-height: 480px;
  }

  .public-story-copy {
    padding: 70px 28px;
  }

  .public-gallery {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .public-gallery img {
    height: 260px;
  }

  .public-gallery img:nth-child(2) {
    height: 260px;
    margin-top: 0;
  }

  .public-gallery img:nth-child(3) {
    grid-column: 1 / -1;
    height: 230px;
  }

  .public-menu-grid,
  .public-travel-grid {
    grid-template-columns: 1fr;
  }

  .public-menu-grid > div,
  .public-travel-item {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  }
}

@media (max-width: 1120px) {
  .topbar {
    grid-template-columns: 180px minmax(0, 1fr) auto;
    padding: 0 16px;
  }

  .nav-button {
    padding: 0 9px;
    font-size: 12px;
  }

  .template-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .editor-page {
    grid-template-columns: 320px minmax(390px, 1fr);
  }

  .editor-inspector {
    display: none;
  }

  .editor-mobile-actions {
    display: grid;
  }
}

@media (max-width: 860px) {
  body {
    padding-bottom: 64px;
  }

  body:has(.public-invite) {
    padding-bottom: 0;
  }

  .topbar {
    height: 58px;
    grid-template-columns: 1fr auto;
  }

  .brand-sub,
  .main-nav,
  .top-actions .secondary-button,
  .top-actions .icon-button {
    display: none;
  }

  .page {
    padding: 24px 16px 38px;
  }

  .page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .stat-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .dashboard-layout,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .save-date-layout,
  .memories-layout,
  .planner-layout {
    grid-template-columns: 1fr;
  }

  .memories-qr-panel {
    position: static;
  }

  .seating-board {
    grid-template-columns: 1fr;
  }

  .planner-banner {
    align-items: flex-start;
    flex-direction: column;
    margin: -24px -16px 24px;
    padding: 22px 16px;
  }

  .table-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-nav {
    position: fixed;
    z-index: 80;
    left: 0;
    right: 0;
    bottom: 0;
    height: 64px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(255, 255, 255, 0.97);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(12px);
  }

  .mobile-nav button {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 3px;
    color: var(--muted);
    background: transparent;
    font-size: 10px;
  }

  .mobile-nav button.active {
    color: var(--coral);
  }

  .mobile-nav svg {
    width: 19px;
    height: 19px;
  }

  .editor-page {
    height: auto;
    min-height: calc(100vh - 58px);
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .editor-sidebar {
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .editor-canvas {
    min-height: 800px;
  }

  .admin-banner {
    margin: -24px -16px 24px;
    padding: 20px 16px;
  }
}

@media (max-width: 560px) {
  .page-header h1,
  .planner-banner h1,
  .admin-banner h1 {
    font-size: 31px;
  }

  .page-header {
    min-height: 0;
    padding-top: 0;
  }

  .stat-item {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .stat-item:nth-child(odd) {
    border-right: 1px solid var(--line);
  }

  .stat-item:nth-child(-n + 2) {
    border-top: 0;
  }

  .template-card:first-child {
    grid-column: 1 / -1;
  }

  .template-card:first-child .template-meta h3 {
    font-size: 19px;
  }

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

  .top-actions .primary-button {
    min-width: 38px;
    width: 38px;
    padding: 0;
    font-size: 0;
  }

  .top-actions .primary-button svg {
    width: 18px;
    height: 18px;
  }

  h1,
  .display-title {
    font-size: 29px;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .search-box {
    min-width: 0;
    width: 100%;
  }

  .stat-item {
    min-height: 94px;
    padding: 15px;
  }

  .stat-value {
    font-size: 24px;
  }

  .template-grid {
    gap: 10px;
  }

  .template-card-body {
    padding: 11px;
  }

  .template-meta {
    display: block;
  }

  .template-meta .badge {
    margin-top: 9px;
  }

  .template-overlay {
    display: flex;
    padding: 10px;
    background: transparent;
    opacity: 1;
  }

  .template-overlay .primary-button {
    min-height: 34px;
    font-size: 12px;
  }

  .event-row {
    grid-template-columns: 68px minmax(0, 1fr);
  }

  .event-thumb {
    width: 68px;
    height: 62px;
  }

  .event-row .action-row {
    grid-column: 1 / -1;
  }

  .table-grid {
    grid-template-columns: 1fr;
  }

  .admin-banner {
    grid-template-columns: 1fr;
  }

  .save-date-preview {
    min-height: 520px;
    padding: 24px;
  }

  .save-date-preview h2 {
    font-size: 36px;
  }

  .guest-detail-grid {
    grid-template-columns: 1fr;
  }

  .seating-board article {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .seating-board select {
    grid-column: 1 / -1;
  }

  .planner-client-list article {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .planner-client-list article > .badge,
  .planner-client-list article > button {
    grid-column: 2;
    justify-self: start;
  }

  .admin-banner .primary-button {
    width: 100%;
    background: white;
    color: var(--forest);
  }

  .qr-wrap {
    grid-template-columns: 1fr;
  }

  .fake-qr {
    width: 170px;
    margin: 0 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
