@font-face {
  font-family: "Nunito";
  src: url("fonts/nunito-variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  --ink: #2c251f;
  --muted: #766f67;
  --line: #e8e0d5;
  --paper: #fbf8f2;
  --accent: #a33b2f;
  --font-nunito: "Nunito";
  --font-geist-sans: "Nunito";
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: #f2ede5;
  color: var(--ink);
  font-family: var(--font-geist-sans), Arial, sans-serif;
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }

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

.topbar {
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid rgba(85, 64, 41, .12);
  background: rgba(255, 252, 247, .96);
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(16px);
}

.brand { display: flex; align-items: center; gap: 11px; color: #3b211c; text-decoration: none; }
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #f8ead7;
  background: #8f2e25;
  font-size: 24px;
  box-shadow: 0 7px 18px rgba(111, 36, 29, .17);
}
.brand strong { display: block; font-family: Georgia, serif; font-size: 25px; font-weight: 500; letter-spacing: -.02em; }
.brand small { display: block; color: #8a776b; font-size: 9px; letter-spacing: .14em; text-transform: uppercase; margin-top: 1px; }

.header-status { display: flex; align-items: center; gap: 10px; }
.saved-state { display: inline-flex; align-items: center; gap: 7px; margin-right: 10px; color: #776e66; font-size: 12px; }
.saved-state i { width: 7px; height: 7px; border-radius: 50%; background: #63a270; box-shadow: 0 0 0 4px #e6f3e8; }

.button { min-height: 42px; border-radius: 11px; padding: 0 18px; border: 1px solid transparent; font-size: 13px; font-weight: 650; transition: .2s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button-ghost { background: white; border-color: #d9cfc2; color: #423831; }
.button-primary { background: #8f2e25; color: white; box-shadow: 0 7px 18px rgba(143, 46, 37, .16); }

.studio {
  min-height: calc(100vh - 78px);
  display: grid;
  grid-template-columns: 270px 350px minmax(460px, 1fr);
  gap: 1px;
  background: #dfd7cc;
}

.panel { background: #fffdf9; padding: 28px 24px; }
.panel-heading { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 25px; }
.panel-heading p { margin: 1px 0 4px; color: #988b7e; font-size: 10px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.panel-heading h1, .panel-heading h2 { margin: 0; font-family: Georgia, serif; font-size: 23px; font-weight: 500; letter-spacing: -.02em; }
.step-number { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; background: #f2e4d9; color: #8f2e25; font-size: 11px; font-weight: 800; }

.theme-list { display: grid; gap: 10px; }
.theme-choice {
  width: 100%;
  min-height: 103px;
  display: grid;
  grid-template-columns: 70px 1fr 18px;
  align-items: center;
  gap: 11px;
  padding: 10px;
  border-radius: 15px;
  border: 1px solid #e7ded2;
  background: #fff;
  color: inherit;
  text-align: left;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.theme-choice:hover { transform: translateY(-1px); border-color: #cdb7a2; box-shadow: 0 8px 24px rgba(75, 55, 35, .07); }
.theme-choice.selected { border: 1.5px solid #9b3f33; box-shadow: 0 0 0 3px #f8eae4; }
.theme-thumb { width: 70px; height: 80px; display: grid; place-items: center; border-radius: 8px; overflow: hidden; font-family: Georgia, serif; font-size: 24px; box-shadow: 0 5px 15px rgba(46, 34, 24, .13); }
.thumb-royal { color: #c6a15d; border: 5px double #b88a3b; background: radial-gradient(circle at 50% 35%, #f7eddb 0 32%, transparent 33%), #4b0f1e; }
.thumb-editorial { color: #b63a2b; border: 1px solid #c5a46b; background: linear-gradient(145deg, transparent 55%, #ead2ca 55%), #fbf5ea; }
.thumb-garden { color: #174b3c; border: 4px solid #dcecb5; background: radial-gradient(circle at 18% 20%, #f39a2e 0 8%, transparent 9%), radial-gradient(circle at 83% 78%, #ef8d76 0 12%, transparent 13%), #f7f1df; }
.theme-copy strong { display: block; font-family: Georgia, serif; font-size: 14px; font-weight: 600; }
.theme-copy small { display: block; margin-top: 4px; color: #8c8177; font-size: 10px; }
.swatches { display: flex; gap: 4px; margin-top: 9px; }
.swatches i { width: 10px; height: 10px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .08); }
.radio-mark { width: 15px; height: 15px; border: 1.5px solid #c9bdb0; border-radius: 50%; position: relative; }
.selected .radio-mark { border-color: #9b3f33; }
.selected .radio-mark::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: #9b3f33; }

.theme-tip { display: flex; gap: 10px; margin-top: 18px; padding: 13px; border-radius: 12px; background: #f8f2e9; color: #665e56; }
.theme-tip > span { color: #bd7f36; }
.theme-tip p { margin: 0; font-size: 10px; line-height: 1.55; }
.theme-tip strong { color: #3b332d; }

.details-panel { overflow: auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px 12px; }
.form-grid label { display: grid; gap: 7px; }
.form-grid label > span { color: #625a52; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.form-grid input, .form-grid textarea {
  width: 100%;
  border: 1px solid #ddd3c7;
  border-radius: 10px;
  outline: none;
  background: #fff;
  color: #302923;
  padding: 11px 12px;
  font-size: 13px;
  transition: border-color .2s, box-shadow .2s;
}
.form-grid textarea { resize: vertical; line-height: 1.5; min-height: 88px; }
.form-grid input:focus, .form-grid textarea:focus { border-color: #a9574b; box-shadow: 0 0 0 3px #f5e6e1; }
.full-field { grid-column: 1 / -1; }

.preview-panel { min-width: 0; display: flex; flex-direction: column; background: #ebe2d7; position: relative; overflow: hidden; }
.preview-heading { height: 63px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; color: #6c6259; font-size: 10px; text-transform: uppercase; letter-spacing: .11em; position: relative; z-index: 3; }
.preview-heading > div { display: flex; align-items: center; gap: 8px; }
.preview-heading strong { color: #322b25; font-size: 11px; letter-spacing: 0; text-transform: none; border-left: 1px solid #c9beb1; padding-left: 10px; }
.preview-heading button { width: 34px; height: 34px; border: 1px solid rgba(64, 46, 30, .14); border-radius: 10px; background: rgba(255,255,255,.6); color: #483e35; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: #68a175; box-shadow: 0 0 0 4px rgba(104, 161, 117, .14); }
.preview-stage { flex: 1; min-height: 680px; display: grid; place-items: center; padding: 12px 36px 30px; position: relative; }
.preview-stage::before { content: ""; position: absolute; width: 570px; height: 570px; border-radius: 50%; background: rgba(255,255,255,.24); filter: blur(2px); }
.invitation-card {
  width: min(380px, 84%);
  aspect-ratio: 4 / 6;
  min-height: 570px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  box-shadow: 0 28px 58px rgba(54, 39, 27, .22), 0 4px 12px rgba(54, 39, 27, .12);
  animation: card-arrival .7s cubic-bezier(.2,.75,.22,1) both;
}
.invite-inner { position: relative; z-index: 3; height: 100%; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 53px 42px 34px; }
.invite-kicker { margin: 0; font-size: 9px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.invite-flourish { width: 120px; display: flex; align-items: center; gap: 9px; margin: 20px 0 14px; }
.invite-flourish span { height: 1px; flex: 1; background: currentColor; opacity: .45; }
.invite-flourish b { font-size: 12px; font-weight: 400; }
.couple-names { display: grid; margin: 0; font-family: Georgia, serif; font-size: 43px; line-height: .92; font-weight: 500; letter-spacing: -.04em; }
.couple-names em { margin: 6px 0 5px; font-size: 24px; line-height: 1; font-weight: 400; }
.invite-message { max-width: 265px; margin: 22px auto 20px; font-family: Georgia, serif; font-style: italic; font-size: 12px; line-height: 1.55; }
.event-details { margin-top: auto; font-size: 11px; line-height: 1.25; }
.event-details p { margin: 7px 0; }
.event-date, .event-venue { font-family: Georgia, serif; font-size: 14px; font-weight: 600; }
.tiny-divider { margin: 11px 0; font-size: 8px; }
.invite-footer { margin: auto 0 0; font-size: 8px; letter-spacing: .12em; text-transform: uppercase; }
.ornament-layer { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.particles { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.particle { position: absolute; display: block; }

.theme-royal { color: #4b0f1e; background: #f7f0e4; border: 8px double #b88a3b; }
.theme-royal::before { content: ""; position: absolute; inset: 13px; border: 1px solid rgba(184, 138, 59, .65); border-radius: 45% 45% 4px 4px; z-index: 0; }
.theme-royal .ornament-layer {
  background-image: url("assets/theme-assets/royal-ornament.png"), linear-gradient(135deg, rgba(75,15,30,.08), transparent 35%);
  background-repeat: no-repeat;
  background-position: center 20px, center;
  background-size: 96% auto, cover;
  opacity: .88;
}
.theme-royal .ornament-layer::before, .theme-royal .ornament-layer::after { content: "✦\A✧\A✦"; white-space: pre; position: absolute; top: 48px; color: #b88a3b; font-size: 11px; line-height: 3; }
.theme-royal .ornament-layer::before { left: 21px; }
.theme-royal .ornament-layer::after { right: 21px; }
.theme-royal .couple-names { color: #5a1020; }
.theme-royal .invite-footer { color: #9d7336; }
.theme-royal .particle { width: 8px; height: 12px; border-radius: 80% 15% 70% 25%; background: #b56b70; opacity: .65; animation: petal-drift 7s linear infinite; }
.theme-royal .p1 { left: 9%; top: -3%; }
.theme-royal .p2 { left: 78%; top: -8%; animation-delay: -2s; }
.theme-royal .p3 { left: 90%; top: 18%; animation-delay: -4s; }
.theme-royal .p4 { left: 23%; top: -5%; animation-delay: -5s; }
.theme-royal .p5 { left: 61%; top: -8%; animation-delay: -1s; }

.theme-editorial { color: #302522; background: #fbf5ea; border: 1px solid #c8aa72; }
.theme-editorial::before { content: ""; position: absolute; inset: 13px; border: 1px solid rgba(181, 154, 98, .58); z-index: 0; }
.theme-editorial .ornament-layer {
  background-image: url("assets/theme-assets/editorial-botanicals.png"), radial-gradient(ellipse at 8% 8%, rgba(231,200,191,.55) 0 6%, transparent 7%);
  background-repeat: no-repeat;
  background-position: center, center;
  background-size: 112% auto, cover;
  opacity: .72;
}
.theme-editorial .ornament-layer::before, .theme-editorial .ornament-layer::after { content: "❀"; position: absolute; color: #b59a62; font-family: Georgia, serif; font-size: 38px; opacity: .65; }
.theme-editorial .ornament-layer::before { left: 17px; bottom: 18px; }
.theme-editorial .ornament-layer::after { right: 18px; top: 18px; transform: scale(.7); }
.theme-editorial .couple-names { color: #b13b2d; font-size: 46px; }
.theme-editorial .invite-kicker { color: #b13b2d; }
.theme-editorial .invite-message { color: #695c55; }
.theme-editorial .particle { display: none; }

.theme-garden { color: #123f33; background: #fffaf0; border: 7px solid #dcecb5; border-radius: 28px 8px 28px 8px; }
.theme-garden::before { content: ""; position: absolute; inset: 13px; border: 1px solid rgba(80,124,73,.42); border-radius: 19px 5px 19px 5px; z-index: 0; }
.theme-garden .ornament-layer {
  background-image: url("assets/theme-assets/garden-florals.png"), linear-gradient(145deg, rgba(220,236,181,.65), transparent 32%);
  background-repeat: no-repeat;
  background-position: center, center;
  background-size: 108% auto, cover;
  opacity: .78;
  animation: garland-sway 6s ease-in-out infinite;
}
.theme-garden .ornament-layer::before, .theme-garden .ornament-layer::after { content: "❧"; position: absolute; color: #3d765a; font-size: 52px; opacity: .72; }
.theme-garden .ornament-layer::before { left: 16px; top: 67px; transform: rotate(-30deg); }
.theme-garden .ornament-layer::after { right: 12px; bottom: 45px; transform: rotate(155deg); }
.theme-garden .couple-names { color: #0e4f3d; }
.theme-garden .invite-kicker { color: #588043; }
.theme-garden .invite-footer { color: #a9601f; }
.theme-garden .particle { width: 5px; height: 5px; border-radius: 50%; background: #f39a2e; animation: sparkle 2.5s ease-in-out infinite; }
.theme-garden .p1 { left: 12%; top: 28%; }
.theme-garden .p2 { left: 84%; top: 34%; background: #d96553; animation-delay: -.5s; }
.theme-garden .p3 { left: 18%; top: 72%; background: #91aa78; animation-delay: -1s; }
.theme-garden .p4 { left: 76%; top: 77%; animation-delay: -1.5s; }
.theme-garden .p5 { left: 51%; top: 12%; background: #d96553; animation-delay: -2s; }

.preview-royal { background: radial-gradient(circle at 65% 35%, #ead3b5, transparent 40%), #d9c9b8; }
.preview-editorial { background: radial-gradient(circle at 65% 35%, #fff9ef, transparent 42%), #eee5d9; }
.preview-garden { background: radial-gradient(circle at 65% 35%, #eef4d3, transparent 44%), #dbe5c3; }

.preview-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 28px; background: rgba(30, 23, 18, .88); backdrop-filter: blur(18px); }
.preview-modal > p { position: fixed; bottom: 10px; left: 0; right: 0; color: rgba(255,255,255,.62); text-align: center; font-size: 10px; }
.modal-card-wrap { width: min(430px, 88vw); max-height: 88vh; display: grid; place-items: center; }
.modal-card-wrap .invitation-card { width: 100%; min-height: 0; max-height: 84vh; }
.modal-close { position: fixed; top: 22px; right: 24px; width: 42px; height: 42px; border: 1px solid rgba(255,255,255,.3); border-radius: 50%; background: rgba(255,255,255,.1); color: white; font-size: 25px; z-index: 2; }
.modal-royal { background: radial-gradient(circle, rgba(99,22,35,.85), rgba(25,8,12,.96)); }
.modal-editorial { background: radial-gradient(circle, rgba(247,241,232,.94), rgba(61,48,43,.9)); }
.modal-garden { background: radial-gradient(circle, rgba(46,91,68,.88), rgba(11,37,29,.97)); }

.loading-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #fbf7ef;
  color: #4b0f1e;
}
.loading-screen > strong { font-family: Georgia, serif; font-size: 28px; font-weight: 500; }

.share-overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(31, 23, 17, .58);
  backdrop-filter: blur(10px);
}
.share-sheet {
  width: min(480px, 94vw);
  position: relative;
  padding: 38px;
  border: 1px solid #e7d8c7;
  border-radius: 24px;
  background: #fffaf2;
  box-shadow: 0 35px 90px rgba(39, 25, 15, .32);
  animation: sheet-rise .35s cubic-bezier(.2,.78,.22,1) both;
}
.share-sheet::before { content: ""; position: absolute; inset: 10px; pointer-events: none; border: 1px solid rgba(181,154,98,.26); border-radius: 17px; }
.share-close { position: absolute; top: 15px; right: 16px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: #f2e7dc; color: #664a3e; font-size: 20px; z-index: 2; }
.share-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 15px; background: #8f2e25; color: white; font-size: 20px; box-shadow: 0 9px 22px rgba(143,46,37,.2); }
.share-kicker { margin: 24px 0 7px; color: #a56a3a; font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.share-sheet h2 { margin: 0; color: #3b211c; font-family: Georgia, serif; font-size: 33px; line-height: 1.08; font-weight: 500; letter-spacing: -.03em; }
.share-copy { margin: 14px 0 22px; color: #766b61; font-size: 13px; line-height: 1.6; }
.link-box { display: grid; gap: 7px; }
.link-box span { color: #75675c; font-size: 9px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.link-box input { width: 100%; min-height: 45px; border: 1px solid #d9ccbe; border-radius: 10px; background: white; color: #62574f; padding: 0 12px; font-size: 11px; outline: none; }
.link-box input:focus { border-color: #a9574b; box-shadow: 0 0 0 3px #f5e6e1; }
.share-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.share-actions .button { display: grid; place-items: center; text-decoration: none; }
.share-hint { margin: 16px 0 0; color: #998b7e; font-size: 10px; line-height: 1.5; text-align: center; }

.toast { position: fixed; z-index: 150; left: 50%; bottom: 24px; transform: translateX(-50%); padding: 11px 16px; border-radius: 30px; background: #213f32; color: white; font-size: 12px; box-shadow: 0 10px 30px rgba(16,38,29,.25); animation: toast-in .25s ease both; }

.guest-view { min-height: 100vh; position: relative; overflow: hidden; }
.guest-topbar { min-height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 14px 28px; position: relative; z-index: 10; }
.guest-brand small { letter-spacing: .1em; }
.guest-create { min-height: 40px; padding: 0 16px; border: 1px solid currentColor; border-radius: 12px; background: rgba(255,255,255,.36); color: inherit; font-size: 11px; font-weight: 700; backdrop-filter: blur(8px); }
.guest-content { min-height: calc(100vh - 76px); display: grid; grid-template-columns: minmax(230px, 360px) minmax(340px, 440px) minmax(210px, 310px); align-items: center; justify-content: center; gap: 52px; padding: 30px 46px 50px; position: relative; z-index: 2; }
.guest-content::before, .guest-content::after { content: ""; position: absolute; border: 1px solid currentColor; opacity: .08; border-radius: 50%; pointer-events: none; }
.guest-content::before { width: 620px; height: 620px; left: -300px; top: 10%; }
.guest-content::after { width: 470px; height: 470px; right: -210px; bottom: -120px; }
.guest-intro > p { margin: 0 0 15px; font-size: 10px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; }
.guest-intro h1 { margin: 0; font-family: Georgia, serif; font-size: clamp(44px, 4.5vw, 71px); line-height: .98; font-weight: 500; letter-spacing: -.045em; }
.guest-intro > span { display: block; max-width: 250px; margin-top: 18px; font-family: Georgia, serif; font-size: 17px; font-style: italic; line-height: 1.5; opacity: .72; }
.guest-card-wrap { width: min(420px, 88vw); margin: auto; filter: drop-shadow(0 28px 40px rgba(37,25,16,.18)); }
.guest-card-wrap .invitation-card { width: 100%; min-height: 0; }
.guest-actions { align-self: center; }
.guest-actions button { width: 100%; min-height: 52px; border: 0; border-radius: 14px; background: currentColor; font-size: 13px; font-weight: 750; box-shadow: 0 13px 30px rgba(30,20,13,.15); transition: transform .2s ease; }
.guest-actions button:hover { transform: translateY(-2px); }
.guest-actions p { margin: 13px 0 0; text-align: center; font-size: 9px; letter-spacing: .12em; text-transform: uppercase; opacity: .55; }

.guest-royal { color: #4b0f1e; background: radial-gradient(circle at 54% 44%, #f8ead2 0 24%, transparent 52%), linear-gradient(145deg, #f7f0e4, #dfc39f); }
.guest-royal .brand-mark { background: #4b0f1e; color: #dcb66a; }
.guest-royal .guest-actions button { color: #f8ead2; }
.guest-editorial { color: #302522; background: radial-gradient(circle at 52% 45%, #fffdf7 0 24%, transparent 51%), linear-gradient(140deg, #f7f1e8, #e9d4ca); }
.guest-editorial .brand-mark { background: #b63a2b; color: #fff7ed; }
.guest-editorial .guest-intro > p { color: #b63a2b; }
.guest-editorial .guest-actions button { color: #fff7ed; background: #b63a2b; }
.guest-garden { color: #123f33; background: radial-gradient(circle at 52% 44%, #fffaf0 0 24%, transparent 52%), linear-gradient(145deg, #f7f3df, #dcecb5); }
.guest-garden .brand-mark { background: #f39a2e; color: white; }
.guest-garden .guest-actions button { color: white; background: #123f33; }

@keyframes sheet-rise { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

@keyframes card-arrival { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes petal-drift { 0% { transform: translate3d(0,-30px,0) rotate(0); opacity: 0; } 15% { opacity: .7; } 100% { transform: translate3d(55px,650px,0) rotate(320deg); opacity: 0; } }
@keyframes sparkle { 0%, 100% { transform: scale(.6); opacity: .35; } 50% { transform: scale(1.6); opacity: 1; box-shadow: 0 0 9px currentColor; } }
@keyframes garland-sway { 0%, 100% { transform: scale(1.01) rotate(-.15deg); } 50% { transform: scale(1.025) rotate(.15deg); } }

@media (max-width: 1120px) {
  .studio { grid-template-columns: 250px 330px minmax(390px, 1fr); }
  .panel { padding: 24px 18px; }
  .preview-stage { padding-inline: 20px; }
  .invitation-card { width: min(350px, 90%); }
}

@media (max-width: 900px) {
  .topbar { padding: 0 16px; }
  .saved-state { display: none; }
  .studio { display: grid; grid-template-columns: 1fr 1.2fr; }
  .theme-panel { grid-column: 1; }
  .details-panel { grid-column: 2; }
  .preview-panel { grid-column: 1 / -1; min-height: 780px; }
  .theme-list { grid-template-columns: 1fr; }
  .guest-content { grid-template-columns: minmax(210px, .8fr) minmax(350px, 430px); gap: 38px; }
  .guest-actions { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(220px, 300px); justify-content: center; }
}

@media (max-width: 640px) {
  .topbar { height: 68px; }
  .brand strong { font-size: 20px; }
  .brand small { display: none; }
  .brand-mark { width: 36px; height: 36px; }
  .header-status .button-ghost { display: none; }
  .button { min-height: 39px; padding-inline: 13px; font-size: 11px; }
  .studio { grid-template-columns: 1fr; }
  .theme-panel, .details-panel, .preview-panel { grid-column: 1; }
  .theme-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  .theme-choice { grid-template-columns: 1fr; justify-items: center; padding: 8px 5px; min-height: 150px; text-align: center; }
  .theme-thumb { width: 58px; height: 67px; }
  .theme-copy small, .swatches, .radio-mark { display: none; }
  .theme-copy strong { font-size: 11px; line-height: 1.25; }
  .form-grid { grid-template-columns: 1fr; }
  .full-field { grid-column: 1; }
  .preview-panel { min-height: 690px; }
  .preview-stage { min-height: 590px; padding-inline: 12px; }
  .invitation-card { width: min(360px, 92%); min-height: 540px; }
  .invite-inner { padding-inline: 32px; }
  .couple-names { font-size: 39px; }
  .share-sheet { padding: 30px 24px; }
  .share-sheet h2 { font-size: 29px; }
  .share-actions { grid-template-columns: 1fr; }
  .guest-topbar { padding: 12px 15px; }
  .guest-content { grid-template-columns: 1fr; gap: 30px; padding: 36px 18px 54px; }
  .guest-intro { text-align: center; }
  .guest-intro h1 { font-size: 47px; }
  .guest-intro > span { margin-inline: auto; }
  .guest-card-wrap { width: min(380px, 94vw); }
  .guest-actions { grid-column: 1; width: min(320px, 90vw); margin: auto; }
}

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

/* Visual invitation designer */
.button-quiet { background: transparent; color: #756a61; border-color: transparent; }
.builder-studio { grid-template-columns: 282px 330px minmax(500px, 1fr); }
.library-panel, .inspector-panel { min-height: calc(100vh - 78px); max-height: calc(100vh - 78px); overflow: hidden; display: flex; flex-direction: column; }
.compact-heading { margin-bottom: 18px; }
.compact-heading h1, .compact-heading h2 { font-size: 22px; }
.library-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 10px; background: #f2ece4; }
.library-tabs button { min-height: 34px; border: 0; border-radius: 7px; background: transparent; color: #84786e; font-size: 9px; font-weight: 750; text-transform: capitalize; }
.library-tabs button.active { background: white; color: #8f2e25; box-shadow: 0 2px 8px rgba(68,45,29,.08); }
.designer-theme-list { margin-top: 16px; overflow: auto; padding: 2px; }
.designer-theme-list .theme-choice { min-height: 94px; grid-template-columns: 62px 1fr 16px; }
.designer-theme-list .theme-thumb { width: 62px; height: 70px; }
.library-help { margin: 16px 2px 12px; color: #877b70; font-size: 10px; line-height: 1.5; }
.component-library, .artwork-library { min-height: 0; overflow: auto; }
.component-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.component-grid button { min-height: 88px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: 12px; border: 1px solid #e5dbcf; border-radius: 12px; background: white; color: #443a32; text-align: left; transition: .2s ease; }
.component-grid button:hover, .artwork-grid button:hover { transform: translateY(-2px); border-color: #c9ab91; box-shadow: 0 7px 18px rgba(75,52,34,.08); }
.component-grid button strong, .artwork-grid button strong { font-size: 10px; font-weight: 700; }
.component-icon { color: #9d4a3d; font-size: 18px; letter-spacing: -.05em; }
.serif-icon { font-family: Georgia, serif; font-size: 27px; }
.artwork-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.artwork-grid button { min-height: 112px; display: grid; grid-template-rows: 80px auto; gap: 6px; padding: 8px; border: 1px solid #e5dbcf; border-radius: 12px; background: white; color: #443a32; text-align: left; transition: .2s ease; }
.artwork-grid button > span { display: grid; place-items: center; border-radius: 8px; background: linear-gradient(45deg, #f6f1e9 25%, #fffaf2 25% 50%, #f6f1e9 50% 75%, #fffaf2 75%); background-size: 12px 12px; overflow: hidden; }
.artwork-grid img { width: 76px; height: 76px; object-fit: contain; }
.drag-tip { display: flex; gap: 9px; margin-top: auto; padding: 12px; border-radius: 11px; background: #f8f2e9; color: #6e6259; }
.drag-tip > span { color: #a56632; font-size: 15px; }
.drag-tip p { margin: 0; font-size: 9px; line-height: 1.45; }

.inspector-scroll { min-height: 0; overflow: auto; padding-right: 3px; }
.selected-inspector { margin-bottom: 22px; padding: 14px; border: 1px solid #e7d9cc; border-radius: 14px; background: #fffaf3; }
.inspector-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.inspector-title span { color: #9a8b7d; font-size: 9px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.inspector-title strong { color: #4a3029; font-family: Georgia, serif; font-size: 14px; font-weight: 600; }
.inspector-field, .range-field { display: grid; gap: 7px; margin-top: 12px; }
.inspector-field > span, .range-field > span, .color-control > span { color: #675c54; font-size: 9px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.inspector-field textarea { width: 100%; resize: vertical; border: 1px solid #ded2c5; border-radius: 9px; background: white; padding: 10px; color: #392f29; font-size: 12px; outline: none; }
.range-field > span { display: flex; justify-content: space-between; }
.range-field b { color: #9e4b3e; font-weight: 700; letter-spacing: 0; text-transform: none; }
.range-field input { width: 100%; accent-color: #9b3f33; }
.color-control { margin-top: 14px; }
.color-control > div { display: flex; align-items: center; gap: 7px; margin-top: 8px; }
.color-control button, .color-control input { width: 22px; height: 22px; padding: 0; border: 2px solid white; border-radius: 50%; box-shadow: 0 0 0 1px #d4c8bc; }
.color-control button.active { box-shadow: 0 0 0 2px #9e4b3e; }
.color-control input { overflow: hidden; background: linear-gradient(135deg, #ef5757, #57b36b, #5777ef); }
.align-control { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 14px; padding: 4px; border-radius: 9px; background: #eee6dd; }
.align-control button { min-height: 29px; display: flex; align-items: center; border: 0; border-radius: 6px; background: transparent; color: #74685e; font-weight: 700; }
.align-control button:nth-child(1) { justify-content: flex-start; padding-left: 14px; }
.align-control button:nth-child(2) { justify-content: center; }
.align-control button:nth-child(3) { justify-content: flex-end; padding-right: 14px; }
.align-control button.active { background: white; color: #91362c; box-shadow: 0 2px 6px rgba(73,48,31,.08); }
.element-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 14px; }
.element-actions button { min-height: 34px; border: 1px solid #ddcfc2; border-radius: 8px; background: white; color: #554a42; font-size: 10px; font-weight: 700; }
.element-actions button:last-child { color: #a04037; }
.element-actions button:disabled { color: #9f9892; }
.core-note { margin: 10px 0 0; color: #978a7f; font-size: 9px; line-height: 1.4; }
.section-label { display: flex; align-items: center; gap: 10px; margin: 0 0 13px; }
.section-label span { color: #8d7d70; font-size: 9px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.section-label i { flex: 1; height: 1px; background: #e8ddd2; }

.designer-preview { min-height: calc(100vh - 78px); }
.canvas-status { display: flex; align-items: center; gap: 12px; }
.canvas-status > span { color: #8c8176; font-size: 9px; letter-spacing: 0; text-transform: none; }
.designer-stage { min-height: 670px; padding-bottom: 36px; }
.designer-stage .invitation-card { width: min(392px, 83%); }
.invitation-card.is-editable { user-select: none; animation: none; }
.canvas-kicker { position: absolute; z-index: 4; left: 50%; top: 7.5%; width: 76%; transform: translateX(-50%); margin: 0; text-align: center; font-size: 8px; font-weight: 750; letter-spacing: .17em; text-transform: uppercase; }
.canvas-elements { position: absolute; inset: 0; z-index: 3; }
.canvas-element { position: absolute; transform: translate(-50%, -50%); z-index: 4; line-height: 1.2; white-space: pre-wrap; }
.is-editable .canvas-element { cursor: grab; touch-action: none; border: 1px solid transparent; border-radius: 3px; }
.is-editable .canvas-element:active { cursor: grabbing; }
.is-editable .canvas-element:hover { border-color: rgba(143,46,37,.32); }
.is-editable .canvas-element.is-selected { border: 1px dashed #a33b2f; box-shadow: 0 0 0 2px rgba(255,250,242,.7); }
.drag-chip { position: absolute; left: 50%; top: -22px; transform: translateX(-50%); display: inline-flex; align-items: center; white-space: nowrap; padding: 3px 6px; border-radius: 5px; background: #8f2e25; color: white; font: 700 7px/1 var(--font-geist-sans), sans-serif; letter-spacing: .05em; text-transform: uppercase; pointer-events: none; }
.design-names { display: grid; font-family: Georgia, serif; font-size: inherit; line-height: .93; font-weight: 500; letter-spacing: -.045em; }
.design-names em { margin: .12em 0; font-size: .58em; line-height: 1; font-weight: 400; }
.design-message { margin: 0; font-family: Georgia, serif; font-size: inherit; font-style: italic; line-height: 1.5; }
.design-event { display: grid; gap: 5px; font-family: var(--font-geist-sans), sans-serif; font-size: .8em; }
.design-event strong { font-family: Georgia, serif; font-size: 1em; font-weight: 600; }
.design-event span { font-size: .78em; }
.design-heading { font-family: Georgia, serif; font-size: inherit; font-weight: 600; line-height: 1.05; }
.design-text { font-family: var(--font-geist-sans), sans-serif; font-size: inherit; line-height: 1.4; }
.element-text[style*="font-size: 8px"] .design-text { letter-spacing: .13em; text-transform: uppercase; }
.design-contact-link { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: center; gap: 6px; width: 100%; padding: 2px 0; border: 0; border-radius: 0; background: transparent; color: inherit; text-align: inherit; text-decoration: none; box-shadow: none; transition: opacity .18s ease; }
a.design-contact-link:hover { background: transparent; box-shadow: none; opacity: .72; }
.design-contact-icon { width: 18px; height: 18px; display: grid; place-items: center; border: 0; border-radius: 0; background: transparent; color: inherit; }
.design-contact-icon .editor-tool-icon { width: 15px; height: 15px; stroke-width: 1.9; }
.design-contact-copy { min-width: 0; overflow-wrap: anywhere; font-size: .8em; line-height: 1.25; }
a.design-contact-link .design-contact-copy { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.is-editable .design-contact-link { pointer-events: none; }
.design-divider { display: flex; align-items: center; justify-content: center; gap: 8px; }
.design-divider span { flex: 1; height: 1px; background: currentColor; opacity: .55; }
.design-divider b { font-size: 10px; font-weight: 400; }
.design-image { width: 100%; height: auto; display: block; object-fit: contain; pointer-events: none; }
.element-image { filter: drop-shadow(0 4px 8px rgba(53,35,22,.12)); }
.theme-royal .design-names { color: #5a1020; }
.theme-royal .canvas-kicker { color: #805e2a; }
.theme-editorial .design-names, .theme-editorial .canvas-kicker { color: #b13b2d; }
.theme-garden .design-names { color: #0e4f3d; }
.theme-garden .canvas-kicker { color: #588043; }

.modal-card-wrap .canvas-element { pointer-events: none; }

@media (max-width: 1150px) {
  .builder-studio { grid-template-columns: 258px 310px minmax(430px, 1fr); }
  .library-panel, .inspector-panel { padding-inline: 16px; }
}

@media (max-width: 930px) {
  .builder-studio { grid-template-columns: 270px 1fr; }
  .library-panel { grid-column: 1; max-height: none; }
  .inspector-panel { grid-column: 2; max-height: none; }
  .designer-preview { grid-column: 1 / -1; min-height: 770px; }
}

@media (max-width: 650px) {
  .designer-app .topbar .button-quiet { display: none; }
  .builder-studio { grid-template-columns: 1fr; }
  .library-panel, .inspector-panel, .designer-preview { grid-column: 1; min-height: auto; max-height: none; }
  .library-panel { padding-bottom: 20px; }
  .library-tabs { position: sticky; top: 68px; z-index: 8; }
  .designer-theme-list { display: grid; grid-template-columns: 1fr; }
  .component-grid, .artwork-grid { grid-template-columns: repeat(3, 1fr); }
  .component-grid button { min-height: 78px; }
  .artwork-grid button { min-height: 100px; }
  .drag-tip { margin-top: 16px; }
  .designer-preview { min-height: 690px; }
  .designer-stage { min-height: 600px; padding-inline: 6px; }
  .designer-stage .invitation-card { width: min(370px, 94%); }
  .canvas-status > span { display: none; }
}

/* Intuitive single-panel editor and fully movable template layers */
body, button, input, textarea, select { font-family: var(--font-nunito), "Arial Rounded MT Bold", sans-serif; }
.designer-app *, .guest-view *, .loading-screen * { font-family: var(--font-nunito), "Arial Rounded MT Bold", sans-serif !important; }
.design-names { font-weight: 700; letter-spacing: -.035em; }
.design-message { font-style: normal; font-weight: 500; }
.brand strong, .panel-heading h1, .panel-heading h2, .guest-intro h1, .share-sheet h2 { font-weight: 750; letter-spacing: -.035em; }

.add-actions { display: grid; grid-template-columns: 1fr 54px; gap: 8px; margin-bottom: 19px; }
.add-text-button { min-height: 64px; display: flex; align-items: center; gap: 11px; padding: 10px 13px; border: 0; border-radius: 16px; background: #8f2e25; color: white; text-align: left; box-shadow: 0 10px 22px rgba(143,46,37,.18); transition: transform .2s ease, box-shadow .2s ease; }
.add-text-button:hover { transform: translateY(-2px); box-shadow: 0 13px 28px rgba(143,46,37,.23); }
.add-text-button > span:first-child { width: 35px; height: 35px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: rgba(255,255,255,.17); font-size: 25px; font-weight: 400; }
.add-text-button strong, .add-text-button small { display: block; }
.add-text-button strong { font-size: 13px; font-weight: 800; }
.add-text-button small { margin-top: 2px; color: rgba(255,255,255,.7); font-size: 8px; }
.add-divider-button { border: 1px solid #dfd2c5; border-radius: 16px; background: white; color: #a15a45; font-size: 10px; transition: .2s ease; }
.add-divider-button:hover { border-color: #b98975; background: #fff8f2; transform: translateY(-2px); }
.contact-add-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.add-contact-button { min-height: 50px; display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid #dfd2c5; border-radius: 14px; background: white; color: #563c33; text-align: left; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.add-contact-button:hover { transform: translateY(-2px); border-color: #b98975; box-shadow: 0 7px 18px rgba(75,52,34,.08); }
.contact-add-icon { width: 29px; height: 29px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; background: #f5e5dc; color: #91362c; font-size: 17px; }
.add-contact-button strong, .add-contact-button small { display: block; }
.add-contact-button strong { font-size: 9px; font-weight: 850; }
.add-contact-button small { margin-top: 2px; color: #9a8275; font-size: 7px; }

.library-section { padding-top: 15px; border-top: 1px solid #eadfd4; }
.library-section + .library-section { margin-top: 17px; }
.library-section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.library-section-heading h2 { margin: 0; color: #3e352f; font-size: 11px; font-weight: 800; }
.library-section-heading span { color: #9b8d80; font-size: 8px; }
.artwork-category-tabs { display: flex; gap: 6px; margin: 0 -2px 9px; padding: 2px 2px 7px; overflow-x: auto; overscroll-behavior-inline: contain; scroll-snap-type: inline proximity; scrollbar-color: #d9c8ba transparent; scrollbar-width: thin; }
.artwork-category-tabs button { min-height: 30px; display: flex; align-items: center; gap: 6px; flex: 0 0 auto; padding: 6px 9px; border: 1px solid #e4d8cd; border-radius: 999px; background: white; color: #78675d; font-size: 8px; font-weight: 800; text-align: left; scroll-snap-align: start; transition: .18s ease; }
.artwork-category-tabs button > span { width: 18px; height: 18px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 6px; background: #f5ece3; color: #9b3f33; font-size: 10px; }
.artwork-category-tabs button:hover { border-color: #c9ab91; transform: translateY(-1px); }
.artwork-category-tabs button.active { border-color: #9b3f33; background: #fff7f3; color: #773027; box-shadow: 0 0 0 2px #f7e6e1; }
.artwork-group-tabs { margin-bottom: 7px; }
.artwork-group-tabs button { min-height: 34px; }
.artwork-function-picker {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(2, 31px);
  grid-auto-columns: max-content;
  gap: 6px;
  margin: 0 -2px 9px;
  padding: 2px 2px 8px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: inline proximity;
  scrollbar-color: #d9c8ba transparent;
  scrollbar-width: thin;
}
.artwork-function-picker button { min-height: 31px; display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border: 1px solid #e6dcd2; border-radius: 9px; background: #fff; color: #6f6158; font-size: 8px; font-weight: 800; scroll-snap-align: start; white-space: nowrap; }
.artwork-function-picker button span { min-width: 15px; color: #a44b3d; font-size: 10px; text-align: center; }
.artwork-function-picker button:hover { border-color: #c9ab91; }
.artwork-function-picker button.active { border-color: #9b3f33; background: #9b3f33; color: white; box-shadow: 0 4px 10px rgba(105,44,36,.18); }
.artwork-function-picker button.active span { color: #ffe8d8; }
.selected-function-summary { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; padding: 8px 9px; border-radius: 10px; background: linear-gradient(135deg,#f9eee7,#fff9f4); color: #713228; }
.selected-function-summary > span { width: 28px; height: 28px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; background: white; box-shadow: 0 3px 10px rgba(85,51,34,.08); font-size: 13px; font-weight: 900; }
.selected-function-summary p { min-width: 0; margin: 0; }
.selected-function-summary strong, .selected-function-summary small { display: block; }
.selected-function-summary strong { overflow: hidden; font-size: 9px; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.selected-function-summary small { margin-top: 1px; color: #9b7e70; font-size: 7px; }
.artwork-search { min-height: 34px; display: flex; align-items: center; gap: 6px; margin-bottom: 9px; padding: 0 9px; border: 1px solid #e1d6cb; border-radius: 11px; background: white; color: #9b8d80; }
.artwork-search:focus-within { border-color: #a9574b; box-shadow: 0 0 0 3px #f5e6e1; }
.artwork-search > span { font-size: 15px; line-height: 1; }
.artwork-search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: #443a32; font: inherit; font-size: 9px; }
.artwork-search input::placeholder { color: #a99a8f; }
.artwork-search button { width: 23px; height: 23px; display: grid; place-items: center; border: 0; border-radius: 50%; background: #f4ece5; color: #806d61; font-size: 15px; line-height: 1; }
.artwork-empty { display: grid; gap: 4px; padding: 22px 12px; border: 1px dashed #ddcec0; border-radius: 12px; background: #fffaf6; color: #76675e; text-align: center; }
.artwork-empty strong { font-size: 10px; }
.artwork-empty span { color: #9a897e; font-size: 8px; }
.edit-theme-art-button { padding: 5px 8px; border: 1px solid #dacabe; border-radius: 8px; background: white; color: #8f2e25; font-size: 8px; font-weight: 800; }
.theme-count { margin: -3px 0 8px; color: #9b8d80; font-size: 8px; }
.quick-theme-grid { display: grid; grid-auto-flow: column; grid-auto-columns: 74px; grid-template-columns: none; gap: 7px; overflow-x: auto; overscroll-behavior-inline: contain; scroll-snap-type: inline proximity; padding: 2px 2px 10px; scrollbar-color: #d9c8ba transparent; scrollbar-width: thin; }
.quick-theme-grid button { min-height: 91px; display: grid; grid-template-rows: 57px auto auto; justify-items: center; align-content: start; gap: 4px; padding: 6px 4px 7px; border: 1px solid #e5dbcf; border-radius: 12px; background: white; color: #554a42; scroll-snap-align: start; transition: .2s ease; }
.quick-theme-grid button:hover { transform: translateY(-2px); border-color: #c9ab91; }
.quick-theme-grid button.selected { border-color: #9b3f33; box-shadow: 0 0 0 2px #f7e6e1; }
.quick-theme-grid .theme-thumb { width: 49px; height: 57px; border: 3px solid; border-radius: 7px; font-size: 16px; box-shadow: 0 4px 10px rgba(46,34,24,.12); }
.quick-theme-grid button strong { max-width: 66px; overflow: hidden; font-size: 8px; line-height: 1.15; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.quick-theme-grid button small { max-width: 66px; overflow: hidden; color: #9b8d80; font-size: 6px; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.compact-artwork-grid { grid-template-columns: repeat(3, 1fr); gap: 7px; overflow: visible; }
.compact-artwork-grid button { min-height: 83px; grid-template-rows: 58px auto; gap: 4px; padding: 5px; }
.compact-artwork-grid img { width: 54px; height: 54px; }
.compact-artwork-grid button strong { font-size: 8px; }
.sprite-crop { position: relative; display: block; width: 100%; aspect-ratio: 4 / 5; overflow: hidden; pointer-events: none; }
.sprite-crop img { position: absolute; top: 0; left: 0; width: 500%; height: 400%; max-width: none; object-fit: fill; pointer-events: none; }
.library-sprite-crop { width: 46px; }
.design-sprite-crop { width: 100%; }

.inline-editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.inspector-field input { width: 100%; min-height: 38px; border: 1px solid #ded2c5; border-radius: 9px; background: white; padding: 8px 9px; color: #392f29; font-size: 11px; outline: none; }
.inspector-field input:focus, .inspector-field textarea:focus { border-color: #a9574b; box-shadow: 0 0 0 3px #f5e6e1; }
.smart-link-note { display: flex; align-items: flex-start; gap: 7px; margin: 10px 0 0; padding: 9px 10px; border-radius: 9px; background: #f3e9df; color: #77675d; font-size: 8px; line-height: 1.45; }
.smart-link-note span { color: #91362c; font-size: 12px; line-height: 1; }

.theme-royal .ornament-layer,
.theme-editorial .ornament-layer,
.theme-garden .ornament-layer { background-image: none; opacity: 1; animation: none; }
.theme-royal .ornament-layer::before,
.theme-royal .ornament-layer::after,
.theme-editorial .ornament-layer::before,
.theme-editorial .ornament-layer::after,
.theme-garden .ornament-layer::before,
.theme-garden .ornament-layer::after { content: none; }
.canvas-element.element-themeArt { z-index: 1; filter: none; }
.canvas-element.element-themeArt.is-selected { z-index: 6; }
.canvas-element.element-themeArt .theme-art-image { width: 100%; height: auto; opacity: .84; }
.canvas-element.element-image.has-custom-height .design-image,
.canvas-element.element-themeArt.has-custom-height .theme-art-image { height: 100%; object-fit: fill; }
.canvas-element.element-image.has-custom-height .design-sprite-crop { height: 100%; aspect-ratio: auto; }
.is-editable .canvas-element.element-themeArt.is-selected { border-color: #a33b2f; }
.canvas-element:not(.element-themeArt) { z-index: 4; }

.invitation-card.dynamic-theme:not(.theme-royal):not(.theme-editorial):not(.theme-garden) {
  color: var(--theme-ink);
  background: var(--theme-paper);
  border-color: var(--theme-accent);
  border-style: var(--theme-border-style);
  border-width: var(--theme-border-width);
  border-radius: var(--theme-radius);
}
.invitation-card.dynamic-theme:not(.theme-royal):not(.theme-editorial):not(.theme-garden)::before {
  content: "";
  position: absolute;
  inset: 12px;
  z-index: 0;
  border: 1px solid var(--theme-inner);
  border-radius: var(--theme-radius);
  pointer-events: none;
}
.dynamic-theme:not(.theme-royal):not(.theme-editorial):not(.theme-garden) .ornament-layer {
  background: radial-gradient(circle at 10% 12%, var(--theme-accent) 0 1.5px, transparent 2px), radial-gradient(circle at 90% 86%, var(--theme-accent) 0 1.5px, transparent 2px);
  background-size: 42px 42px, 54px 54px;
  opacity: .18;
  animation: none;
}
.dynamic-theme:not(.theme-royal):not(.theme-editorial):not(.theme-garden) .ornament-layer::before,
.dynamic-theme:not(.theme-royal):not(.theme-editorial):not(.theme-garden) .ornament-layer::after { content: none; }
.dynamic-theme .design-names { color: inherit; }
.dynamic-theme .theme-art-image { opacity: var(--theme-art-opacity); filter: var(--theme-art-filter); }
.dynamic-theme .design-contact-link { background: transparent; border-color: transparent; }
.dynamic-theme:not(.theme-royal):not(.theme-editorial):not(.theme-garden) .particle { display: block; width: 5px; height: 5px; border-radius: 50%; background: var(--theme-accent); opacity: .42; animation: sparkle 3.2s ease-in-out infinite; }
.dynamic-theme:not(.theme-royal):not(.theme-editorial):not(.theme-garden) .p1 { left: 11%; top: 20%; }
.dynamic-theme:not(.theme-royal):not(.theme-editorial):not(.theme-garden) .p2 { left: 86%; top: 31%; animation-delay: -.7s; }
.dynamic-theme:not(.theme-royal):not(.theme-editorial):not(.theme-garden) .p3 { left: 17%; top: 74%; animation-delay: -1.4s; }
.dynamic-theme:not(.theme-royal):not(.theme-editorial):not(.theme-garden) .p4 { left: 81%; top: 82%; animation-delay: -2.1s; }
.dynamic-theme:not(.theme-royal):not(.theme-editorial):not(.theme-garden) .p5 { left: 53%; top: 11%; animation-delay: -2.7s; }

@media (max-width: 650px) {
  .add-actions { grid-template-columns: 1fr 52px; }
  .compact-artwork-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Two-page card reader and on-canvas quick actions */
.invitation-book {
  width: min(380px, 84%);
  min-height: 570px;
  aspect-ratio: 4 / 6;
  position: relative;
  perspective: 1800px;
  transform-style: preserve-3d;
  transition: width .9s cubic-bezier(.2,.72,.22,1), aspect-ratio .9s cubic-bezier(.2,.72,.22,1), transform .9s cubic-bezier(.2,.72,.22,1);
}
.book-page {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  transform-origin: left center;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  transition: left .9s cubic-bezier(.2,.72,.22,1), width .9s cubic-bezier(.2,.72,.22,1), transform .9s cubic-bezier(.2,.72,.22,1), opacity .45s ease, filter .9s ease;
}
.book-page-one { z-index: 2; transform: rotateY(0deg); opacity: 1; }
.book-page-two { z-index: 1; transform: rotateY(180deg); opacity: 0; pointer-events: none; filter: brightness(.84); }
.invitation-book.show-page-two { width: min(760px, 96%); min-height: 0; aspect-ratio: 8 / 6; }
.invitation-book.show-page-two::after {
  content: "";
  position: absolute;
  z-index: 10;
  left: 50%;
  top: 1.5%;
  bottom: 1.5%;
  width: 1px;
  background: linear-gradient(transparent, rgba(72,45,29,.22) 8% 92%, transparent);
  box-shadow: -7px 0 14px rgba(45,27,17,.12), 7px 0 14px rgba(255,255,255,.35);
  pointer-events: none;
}
.invitation-book.show-page-two .book-page-one { left: 0; width: 50%; transform: rotateY(0deg); opacity: 1; filter: brightness(.96); }
.invitation-book.show-page-two .book-page-two { z-index: 3; left: 50%; width: 50%; transform: rotateY(0deg); opacity: 1; pointer-events: auto; filter: none; }
.invitation-book.show-page-two .book-page-one[role="button"] { cursor: pointer; }
.invitation-book .invitation-card { width: 100%; height: 100%; min-height: 100%; }
.invitation-book.show-page-two .book-page-one .invitation-card { box-shadow: -18px 25px 48px rgba(54,39,27,.18), inset -12px 0 18px rgba(67,43,27,.06); }
.invitation-book.show-page-two .book-page-two .invitation-card { box-shadow: 18px 25px 48px rgba(54,39,27,.18), inset 12px 0 18px rgba(67,43,27,.05); }

.page-turn-control {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 20;
  min-height: 31px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid rgba(80, 55, 35, .18);
  border-radius: 999px;
  background: rgba(255, 252, 246, .9);
  color: #56362e;
  box-shadow: 0 5px 16px rgba(50, 33, 20, .14);
  backdrop-filter: blur(8px);
  font-size: 9px;
  font-weight: 800;
}
.page-turn-control b { font-size: 13px; line-height: 1; }
.page-turn-control.is-prominent {
  right: 17px;
  bottom: 17px;
  min-height: 52px;
  gap: 11px;
  padding: 7px 9px 7px 14px;
  border-color: rgba(255,255,255,.2);
  background: #8f2e25;
  color: white;
  box-shadow: 0 10px 25px rgba(82,28,22,.28);
}
.page-turn-control.is-prominent .page-turn-copy { display: grid; gap: 1px; text-align: left; }
.page-turn-control.is-prominent .page-turn-copy small { color: rgba(255,255,255,.68); font-size: 7px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.page-turn-control.is-prominent .page-turn-copy strong { font-size: 11px; line-height: 1.1; font-weight: 850; white-space: nowrap; }
.page-turn-control.is-prominent b { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.16); font-size: 17px; }
.page-turn-control.is-prominent.is-next-page { animation: page-cue-pulse 1.8s ease-in-out infinite; }
.page-turn-control.is-prominent.is-next-page b { animation: page-cue-arrow 1.2s ease-in-out infinite; }
.page-turn-control.is-prominent.is-next-page::after {
  content: "2";
  position: absolute;
  top: -8px;
  right: -7px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 2px solid #fffaf2;
  border-radius: 50%;
  background: #f0a43b;
  color: #4b271e;
  font-size: 9px;
  font-weight: 900;
  box-shadow: 0 4px 10px rgba(58,32,20,.2);
}
.page-turn-control.is-prominent:not(.is-next-page) { border-color: rgba(80,55,35,.18); background: rgba(255,252,246,.94); color: #56362e; }
.page-turn-control.is-prominent:not(.is-next-page) .page-turn-copy small { color: #a08475; }
.page-turn-control.is-prominent:not(.is-next-page) b { background: rgba(143,46,37,.1); color: #8f2e25; }

.canvas-quick-actions {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 7px);
  z-index: 30;
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: #2f2722;
  box-shadow: 0 7px 20px rgba(34, 24, 17, .28);
  transform: translateX(-50%);
  cursor: default;
}
.canvas-quick-actions.quick-actions-below { top: calc(100% + 7px); bottom: auto; }
.canvas-quick-actions button {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: rgba(255,255,255,.1);
  color: white;
  font-size: 15px;
  line-height: 1;
  transition: background .18s ease, transform .18s ease;
}
.canvas-quick-actions button:hover { background: rgba(255,255,255,.22); transform: translateY(-1px); }
.canvas-quick-actions button.quick-delete { color: #ffd4cf; font-size: 13px; }
.canvas-quick-actions button.quick-delete span { transform: translateY(-.5px); }

.page-switcher {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border-radius: 10px;
  background: rgba(255,255,255,.48);
}
.preview-heading .page-switcher button {
  width: auto;
  height: 28px;
  min-width: 52px;
  padding: 0 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #776d64;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}
.preview-heading .page-switcher button.active { background: white; color: #8f2e25; box-shadow: 0 2px 7px rgba(64,43,28,.1); }
.preview-heading .page-switcher button.add-page-button { color: #8f2e25; }
.designer-stage .invitation-book { width: min(392px, 83%); }
.designer-stage .invitation-book.show-page-two { width: min(760px, 96%); }
.empty-page-hint {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 12;
  width: min(230px, 55%);
  display: grid;
  gap: 5px;
  padding: 13px 16px;
  border: 1px solid rgba(143,46,37,.22);
  border-radius: 14px;
  background: rgba(255,250,243,.9);
  color: #765e52;
  text-align: center;
  transform: translate(-50%, -50%);
  pointer-events: none;
  box-shadow: 0 10px 30px rgba(55,37,24,.11);
}
.empty-page-hint strong { color: #8f2e25; font-size: 11px; }
.empty-page-hint span { font-size: 8px; line-height: 1.45; }

.modal-card-wrap .invitation-book { width: 100%; min-height: 0; max-height: 84vh; }
.modal-card-wrap .invitation-card { max-height: 84vh; min-height: 0; }
.modal-card-wrap:has(.invitation-book.show-page-two) { width: min(860px, 94vw, calc(84vh * 1.3333)); }

.shared-card-only {
  width: 100%;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 2.5vh 12px;
  position: relative;
}
.shared-card-only::before {
  content: "";
  position: absolute;
  inset: -20%;
  background: radial-gradient(circle at 50% 45%, rgba(255,255,255,.5), transparent 44%);
  pointer-events: none;
}
.shared-card-only .invitation-book {
  width: min(430px, 94vw, calc(95svh * .6667));
  min-height: 0;
  z-index: 1;
  filter: drop-shadow(0 32px 48px rgba(35, 23, 15, .25));
}
.shared-card-only .invitation-book.show-page-two { width: min(860px, 96vw, calc(95svh * 1.3333)); }
.shared-card-only.guest-royal { background: linear-gradient(145deg, #f7f0e4, #d9b98e); }
.shared-card-only.guest-editorial { background: linear-gradient(140deg, #f7f1e8, #e7cfc4); }
.shared-card-only.guest-garden { background: linear-gradient(145deg, #f7f3df, #d4e4a8); }

@media (max-width: 650px) {
  .canvas-status { gap: 6px; }
  .preview-heading { padding-inline: 11px; }
  .preview-heading > div:first-child strong { display: none; }
  .preview-heading .page-switcher button { min-width: 47px; padding-inline: 7px; }
  .designer-stage .invitation-book { width: min(370px, 94%); min-height: 540px; }
  .shared-card-only { padding: 1.5vh 8px; }
  .shared-card-only .invitation-book { width: min(94vw, calc(97svh * .6667)); }
  .designer-stage .invitation-book.show-page-two,
  .modal-card-wrap .invitation-book.show-page-two {
    width: min(740px, calc(95svh * 1.3333));
    min-width: min(700px, calc(95svh * 1.3333));
    min-height: 0;
    transform: translateX(calc(-25% + 24px));
  }
}

@media (max-width: 700px) {
  .shared-card-only .invitation-book.show-page-two {
    width: min(94vw, calc(97svh * .6667));
    min-width: 0;
    min-height: 0;
    aspect-ratio: 4 / 6;
    transform: none;
  }
  .shared-card-only .invitation-book.show-page-two::after { display: none; }
  .shared-card-only .invitation-book.show-page-two .book-page-one {
    left: 0;
    width: 100%;
    transform: rotateY(-180deg);
    opacity: 0;
    pointer-events: none;
    filter: brightness(.8);
  }
  .shared-card-only .invitation-book.show-page-two .book-page-two {
    left: 0;
    width: 100%;
    transform: rotateY(0deg);
    opacity: 1;
    pointer-events: auto;
    filter: none;
  }
}

.inspector-empty {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 34px 22px;
  border: 1px dashed #decec0;
  border-radius: 16px;
  background: #fffaf3;
  color: #8f7d70;
  text-align: center;
}
.inspector-empty > span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: #f3e4da; color: #8f2e25; font-size: 18px; }
.inspector-empty strong { color: #4a3830; font-size: 12px; }
.inspector-empty p { max-width: 210px; margin: 0; font-size: 9px; line-height: 1.5; }

@keyframes page-cue-pulse {
  0%, 100% { box-shadow: 0 10px 25px rgba(82,28,22,.28), 0 0 0 0 rgba(143,46,37,.2); }
  50% { box-shadow: 0 14px 30px rgba(82,28,22,.36), 0 0 0 7px rgba(143,46,37,0); }
}

@keyframes page-cue-arrow {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(3px); }
}

/* Direct, on-card editing */
.builder-studio { grid-template-columns: 300px minmax(0, 1fr); }
.library-panel { min-height: calc(100vh - 78px); max-height: calc(100vh - 78px); }
.designer-preview { grid-column: 2; }

.insert-actions { display: grid; gap: 8px; margin-bottom: 19px; }
.insert-actions .add-divider-button { min-height: 42px; display: flex; align-items: center; justify-content: center; gap: 9px; padding: 0 12px; }
.insert-actions .add-divider-button strong { font-size: 9px; font-weight: 850; }
.insert-actions .contact-add-actions { grid-column: auto; }

.canvas-element.is-selected { z-index: 50; }
.canvas-element.is-editing { cursor: text; }
.canvas-direct-editor,
.canvas-direct-input { width: 100%; color: inherit; font: inherit; text-align: inherit; }
.canvas-direct-editor { display: grid; gap: 4px; }
.canvas-direct-input {
  min-width: 0;
  min-height: 1.35em;
  padding: .12em .28em;
  border: 1px solid rgba(143,46,37,.26);
  border-radius: 6px;
  outline: none;
  background: transparent;
  box-shadow: none;
  caret-color: #8f2e25;
  user-select: text;
  touch-action: manipulation;
}
.canvas-direct-input:focus { border-color: #9b3f33; background: transparent; box-shadow: 0 0 0 2px rgba(155,63,51,.13); }
.canvas-direct-textarea { display: block; overflow: hidden; resize: none; line-height: 1.35; }
.direct-names { font-size: inherit; line-height: .93; }
.direct-names input { font-size: inherit; font-weight: 750; letter-spacing: -.035em; line-height: .95; }
.direct-names em { font-size: .55em; line-height: 1; }
.direct-message { font-size: inherit; font-weight: 500; line-height: 1.45; }
.direct-heading { font-size: inherit; font-weight: 750; line-height: 1.05; }
.direct-text { font-size: inherit; line-height: 1.35; }
.direct-pair input { font-size: .8em; font-weight: 700; }
.direct-contact {
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.direct-contact input { width: 100%; min-width: 0; min-height: 23px; padding-block: 2px; font-size: .8em; }

.canvas-resize-handles { position: absolute; inset: 0; z-index: 91; pointer-events: none; }
.canvas-resize-handle {
  position: absolute;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: auto;
  touch-action: none;
}
.canvas-resize-handle::after { content: ""; width: 9px; height: 9px; border: 2px solid white; border-radius: 50%; background: #9b3f33; box-shadow: 0 1px 5px rgba(49,28,20,.42); }
.canvas-resize-handle.resize-nw { left: -14px; top: -14px; cursor: nwse-resize; }
.canvas-resize-handle.resize-ne { right: -14px; top: -14px; cursor: nesw-resize; }
.canvas-resize-handle.resize-sw { left: -14px; bottom: -14px; cursor: nesw-resize; }
.canvas-resize-handle.resize-se { right: -14px; bottom: -14px; cursor: nwse-resize; }
.canvas-resize-handle.resize-w { left: -14px; top: 50%; cursor: ew-resize; transform: translateY(-50%); }
.canvas-resize-handle.resize-e { right: -14px; top: 50%; cursor: ew-resize; transform: translateY(-50%); }
.canvas-resize-handle.resize-w::after,
.canvas-resize-handle.resize-e::after { width: 7px; height: 18px; border-radius: 5px; }
.canvas-resize-handle:focus-visible { outline: 2px solid #2d6cdf; outline-offset: -3px; border-radius: 50%; }

.canvas-context-toolbar {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 80;
  width: min(350px, calc(100vw - 16px));
  min-width: min(350px, calc(100vw - 16px));
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 4px;
  padding: 5px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 12px;
  background: rgba(42,34,29,.72);
  box-shadow: 0 9px 24px rgba(34,24,17,.32);
  backdrop-filter: blur(10px);
  transform: translateX(-50%);
  cursor: default;
  touch-action: manipulation;
}
.canvas-context-toolbar.toolbar-below { top: calc(100% + 8px); bottom: auto; }
.canvas-context-toolbar > button,
.canvas-color-button {
  min-width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0 6px;
  border: 0;
  border-radius: 7px;
  background: rgba(255,255,255,.1);
  color: white;
  line-height: 1;
}
.canvas-context-toolbar > button:hover,
.canvas-context-toolbar > button.active,
.canvas-color-button:hover { background: rgba(255,255,255,.23); }
.editor-tool-icon { width: 16px; height: 16px; display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.canvas-context-toolbar .canvas-drag-handle { cursor: grab; touch-action: none; }
.canvas-context-toolbar .canvas-drag-handle:active { cursor: grabbing; }
.canvas-context-toolbar .canvas-add-text-button { background: #9b3f33; }
.canvas-context-toolbar .toolbar-delete { color: #ffd4cf; }
.canvas-context-toolbar .toolbar-delete .editor-tool-icon { stroke-width: 1.9; }
.canvas-color-button { position: relative; overflow: hidden; cursor: pointer; color: #f1c65d; }
.canvas-color-button input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.toolbar-palette { flex: 1 0 100%; display: flex; justify-content: center; gap: 6px; padding-top: 1px; }
.toolbar-palette button { width: 18px; height: 18px; padding: 0; border: 2px solid rgba(255,255,255,.8); border-radius: 50%; box-shadow: 0 0 0 1px rgba(0,0,0,.22); }
.toolbar-palette button.active { box-shadow: 0 0 0 2px #f2b3a9; }

.canvas-add-text-fab {
  position: absolute;
  right: 18px;
  bottom: 22px;
  z-index: 60;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px 0 10px;
  border: 0;
  border-radius: 999px;
  background: #8f2e25;
  color: white;
  box-shadow: 0 10px 25px rgba(82,28,22,.26);
  font-size: 10px;
  font-weight: 850;
}
.canvas-add-text-fab span { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.16); font-size: 18px; }
.canvas-add-text-fab:hover { transform: translateY(-2px); }

/* Mobile canvas-first editor */
.mobile-editor-bar, .mobile-tool-overlay { display: none; }

@media (max-width: 1150px) {
  .builder-studio { grid-template-columns: 260px minmax(0, 1fr); }
  .library-panel { padding-inline: 16px; }
}

@media (max-width: 930px) {
  .builder-studio { grid-template-columns: 250px minmax(0, 1fr); }
  .library-panel { grid-column: 1; }
  .designer-preview { grid-column: 2; min-height: calc(100vh - 78px); }
}

@media (max-width: 650px) {
  .designer-app { min-height: 100svh; padding-bottom: 0; }
  .builder-studio { min-height: calc(100svh - 68px); display: grid; grid-template-columns: 1fr; }
  .designer-preview { grid-column: 1; grid-row: 1; min-height: 690px; }
  .designer-preview > .preview-heading { display: none; }
  .library-panel { display: none; }
  .designer-stage { min-height: 610px; padding: 6px 4px 42px; }
  .canvas-add-text-fab { display: none; }
  .canvas-context-toolbar {
    width: min(336px, calc(100vw - 20px));
    min-width: min(336px, calc(100vw - 20px));
    max-width: min(336px, calc(100vw - 20px));
    gap: 3px;
    padding: 4px;
    border-radius: 12px;
  }
  .canvas-resize-handle { width: 30px; height: 30px; }
  .canvas-resize-handle::after { width: 11px; height: 11px; }
  .canvas-resize-handle.resize-nw { left: -16px; top: -16px; }
  .canvas-resize-handle.resize-ne { right: -16px; top: -16px; }
  .canvas-resize-handle.resize-sw { left: -16px; bottom: -16px; }
  .canvas-resize-handle.resize-se { right: -16px; bottom: -16px; }
  .canvas-resize-handle.resize-w { left: -16px; }
  .canvas-resize-handle.resize-e { right: -16px; }
  .canvas-resize-handle.resize-w::after,
  .canvas-resize-handle.resize-e::after { width: 8px; height: 20px; }
  .canvas-context-toolbar > button, .canvas-color-button { min-width: 28px; height: 28px; padding-inline: 5px; }
  .canvas-context-toolbar .editor-tool-icon { width: 15px; height: 15px; }
  .toolbar-palette { display: none; }
  .canvas-direct-input { border-radius: 5px; }
  .artwork-function-picker { grid-template-rows: repeat(2, 35px); gap: 7px; }
  .artwork-function-picker button { min-height: 35px; padding-inline: 11px; font-size: 9px; }
  .artwork-group-tabs button { min-height: 38px; padding-inline: 11px; font-size: 9px; }

  .mobile-editor-bar {
    position: fixed;
    z-index: 105;
    left: 10px;
    right: 10px;
    bottom: calc(9px + env(safe-area-inset-bottom));
    min-height: 64px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 6px;
    border: 1px solid rgba(114,79,59,.16);
    border-radius: 20px;
    background: rgba(255,252,247,.96);
    box-shadow: 0 15px 42px rgba(52,32,22,.24);
    backdrop-filter: blur(16px);
  }
  .mobile-editor-bar button {
    min-width: 0;
    min-height: 50px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 4px;
    padding: 4px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: #706158;
    font-size: 9px;
    font-weight: 850;
  }
  .mobile-editor-bar button:first-child { background: #8f2e25; color: white; }
  .mobile-editor-bar button.active { background: #f3e4dc; color: #8f2e25; }
  .mobile-editor-bar button:first-child.active { background: #8f2e25; color: white; }
  .mobile-editor-bar .editor-tool-icon { width: 19px; height: 19px; }

  .mobile-tool-overlay {
    position: fixed;
    inset: 0;
    z-index: 140;
    display: flex;
    align-items: flex-end;
    background: rgba(35,24,18,.28);
    backdrop-filter: blur(2px);
    animation: mobile-overlay-in .2s ease both;
  }
  .mobile-tool-sheet {
    width: 100%;
    height: min(72dvh, 680px);
    max-height: calc(100dvh - 82px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0 13px calc(12px + env(safe-area-inset-bottom));
    border: 1px solid #eadbcf;
    border-bottom: 0;
    border-radius: 25px 25px 0 0;
    background: #fffaf5;
    box-shadow: 0 -20px 60px rgba(46,28,18,.24);
    animation: mobile-sheet-up .28s cubic-bezier(.2,.78,.22,1) both;
  }
  .mobile-sheet-handle { width: 42px; height: 5px; flex: 0 0 auto; margin: 9px auto 5px; border-radius: 999px; background: #dccbc0; }
  .mobile-sheet-header { display: flex; align-items: center; justify-content: space-between; flex: 0 0 auto; padding: 5px 2px 10px; }
  .mobile-sheet-header p { margin: 0 0 2px; color: #a16a51; font-size: 8px; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
  .mobile-sheet-header h2 { margin: 0; color: #352a24; font-size: 20px; line-height: 1.1; letter-spacing: -.03em; }
  .mobile-sheet-header > button { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 50%; background: #f0e5dc; color: #6f5c51; font-size: 23px; line-height: 1; }
  .mobile-sheet-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; flex: 0 0 auto; margin-bottom: 9px; padding: 4px; border-radius: 15px; background: #f1e7df; }
  .mobile-sheet-tabs button { min-height: 40px; display: flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 11px; background: transparent; color: #7b6a60; font-size: 9px; font-weight: 850; }
  .mobile-sheet-tabs button.active { background: white; color: #8f2e25; box-shadow: 0 3px 11px rgba(69,43,29,.1); }
  .mobile-sheet-tabs .editor-tool-icon { width: 16px; height: 16px; }
  .mobile-sheet-scroll { min-height: 0; flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 2px 2px 18px; scrollbar-width: thin; scrollbar-color: #d6c3b7 transparent; }

  .mobile-add-menu { display: grid; gap: 11px; }
  .mobile-page-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; padding: 4px; border-radius: 14px; background: #f1e7df; }
  .mobile-page-controls button { min-width: 0; min-height: 42px; display: flex; align-items: center; justify-content: center; gap: 5px; padding: 5px; border: 0; border-radius: 10px; background: transparent; color: #75645a; font-size: 9px; font-weight: 850; }
  .mobile-page-controls button.active { background: white; color: #8f2e25; box-shadow: 0 3px 10px rgba(69,43,29,.1); }
  .mobile-page-controls .editor-tool-icon { width: 15px; height: 15px; }
  .mobile-add-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
  .mobile-add-grid > button { min-height: 92px; display: grid; grid-template-columns: 38px 1fr; grid-template-rows: auto auto; align-content: center; column-gap: 10px; padding: 12px; border: 1px solid #e5d8cd; border-radius: 17px; background: white; color: #493b34; text-align: left; box-shadow: 0 5px 15px rgba(69,45,31,.05); }
  .mobile-add-grid > button > span { grid-row: 1 / 3; width: 38px; height: 38px; display: grid; place-items: center; align-self: center; border-radius: 13px; background: #f5e5dc; color: #91362c; }
  .mobile-add-grid .editor-tool-icon { width: 19px; height: 19px; }
  .mobile-add-grid strong { align-self: end; font-size: 11px; font-weight: 850; }
  .mobile-add-grid small { align-self: start; margin-top: 2px; color: #9b887d; font-size: 7px; line-height: 1.3; }
  .mobile-theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .mobile-theme-grid > button { min-width: 0; min-height: 88px; display: grid; grid-template-columns: 51px minmax(0,1fr); align-items: center; gap: 9px; padding: 8px; border: 1px solid #e4d7cb; border-radius: 15px; background: white; color: #51443d; text-align: left; }
  .mobile-theme-grid > button.selected { border-color: #9b3f33; box-shadow: 0 0 0 2px #f3dcd5; }
  .mobile-theme-grid .theme-thumb { width: 49px; height: 63px; border: 3px solid; border-radius: 8px; box-shadow: 0 4px 10px rgba(46,34,24,.12); }
  .mobile-theme-grid > button > span:last-child { min-width: 0; }
  .mobile-theme-grid strong, .mobile-theme-grid small { display: block; overflow: hidden; text-overflow: ellipsis; }
  .mobile-theme-grid strong { font-size: 9px; line-height: 1.25; }
  .mobile-theme-grid small { margin-top: 3px; color: #9a897e; font-size: 7px; line-height: 1.25; }

  .mobile-artwork-library .artwork-group-tabs { margin-bottom: 5px; }
  .mobile-artwork-library .artwork-function-picker { margin-bottom: 7px; }
  .mobile-artwork-search { position: sticky; top: 0; z-index: 2; margin-bottom: 10px; }
  .mobile-artwork-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .mobile-artwork-grid > button { min-width: 0; min-height: 104px; display: grid; grid-template-rows: 72px auto; gap: 5px; padding: 6px; border: 1px solid #e5d8cd; border-radius: 14px; background: white; color: #51443d; text-align: left; }
  .mobile-artwork-grid > button > span { display: grid; place-items: center; overflow: hidden; border-radius: 10px; background: linear-gradient(45deg,#f6f1e9 25%,#fffaf2 25% 50%,#f6f1e9 50% 75%,#fffaf2 75%); background-size: 12px 12px; }
  .mobile-artwork-grid img { width: 66px; height: 66px; object-fit: contain; }
  .mobile-artwork-grid strong { overflow: hidden; font-size: 8px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }

  .toast { bottom: calc(87px + env(safe-area-inset-bottom)); }
}

@keyframes mobile-overlay-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes mobile-sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* Portable PHP/vanilla edition */
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body, button, input, textarea, select { font-family: "Nunito", "Arial Rounded MT Bold", Arial, sans-serif; }
.designer-app *, .shared-card-only *, .preview-modal *, .share-overlay * { font-family: "Nunito", "Arial Rounded MT Bold", Arial, sans-serif !important; }
.button-quiet { border-color: transparent; background: transparent; color: #786d65; }
.library-panel { overflow-y: auto; }
.book-host { width: 100%; display: grid; place-items: center; position: relative; z-index: 2; }
.designer-stage .book-host .invitation-book { width: min(392px, 83%); }
.designer-stage .book-host .invitation-book.show-page-two { width: min(760px, 96%); }
.canvas-element { min-height: 1px; }
.canvas-element.element-themeArt { pointer-events: auto; }
.canvas-context-toolbar { max-width: min(350px, calc(100vw - 16px)); }
.canvas-resize-handle.resize-n { left: 50%; top: -14px; cursor: ns-resize; transform: translateX(-50%); }
.canvas-resize-handle.resize-s { left: 50%; bottom: -14px; cursor: ns-resize; transform: translateX(-50%); }
.canvas-resize-handle.resize-n::after,
.canvas-resize-handle.resize-s::after { width: 18px; height: 7px; border-radius: 5px; }
.mobile-icon { font-size: 19px; line-height: 1; }
.mobile-tool-sheet { touch-action: pan-y; }
.modal-card-wrap { display: grid; place-items: center; }
.modal-card-wrap > .invitation-book { width: min(430px, 88vw); }
.modal-card-wrap > .invitation-book.show-page-two { width: min(860px, 94vw, calc(84vh * 1.3333)); }
.preview-modal .page-turn-control { pointer-events: auto; }
.viewer-loading, .viewer-error {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 30px;
  color: #57382f;
  text-align: center;
}
.viewer-loading strong, .viewer-error strong { font-size: 18px; }
.viewer-error span { max-width: 320px; color: #796b62; font-size: 12px; line-height: 1.5; }
.share-actions a[aria-disabled="true"] { pointer-events: none; opacity: .5; }
.artwork-grid button strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.canvas-direct-editor input, .canvas-direct-editor textarea { user-select: text; }
.canvas-element .canvas-direct-editor { position: relative; z-index: 95; }

@media (max-width: 650px) {
  .designer-stage .book-host .invitation-book,
  .designer-stage .book-host .invitation-book.show-page-two {
    width: min(370px, 94%, calc(66.667svh - 102px));
    min-height: 0;
  }
  .designer-stage .book-host .invitation-book.show-page-two {
    min-width: min(700px, calc(95svh * 1.3333));
    transform: translateX(calc(-25% + 24px));
  }
  .canvas-resize-handle.resize-n { top: -16px; }
  .canvas-resize-handle.resize-s { bottom: -16px; }
  .canvas-resize-handle.resize-n::after,
  .canvas-resize-handle.resize-s::after { width: 20px; height: 8px; }
  .topbar { height: 68px; padding-inline: 13px; }
  .brand small, .saved-state, .topbar .button-quiet, .topbar .button-ghost { display: none; }
  .brand-mark { width: 37px; height: 37px; }
  .brand strong { font-size: 20px; }
  .header-status .button-primary { min-height: 39px; padding-inline: 13px; }
  .designer-preview { min-height: calc(100svh - 68px); }
  .designer-stage {
    min-height: calc(100svh - 68px);
    place-items: start center;
    padding-top: 6px;
  }
  .mobile-tool-overlay { display: flex; }
  .modal-card-wrap > .invitation-book.show-page-two {
    width: min(740px, calc(95svh * 1.3333));
    min-width: min(700px, calc(95svh * 1.3333));
    transform: translateX(calc(-25% + 24px));
  }
}

@media (max-width: 340px) {
  .canvas-context-toolbar { gap: 3px; padding: 4px; }
}

@media (max-width: 700px) {
  .shared-card-only .invitation-book.show-page-two {
    width: min(94vw, calc(97svh * .6667));
    min-width: 0;
    aspect-ratio: 4 / 6;
    transform: none;
  }
  .shared-card-only .invitation-book.show-page-two .book-page-one { left: 0; width: 100%; transform: rotateY(-180deg); opacity: 0; pointer-events: none; }
  .shared-card-only .invitation-book.show-page-two .book-page-two { left: 0; width: 100%; transform: rotateY(0deg); opacity: 1; pointer-events: auto; }
  .shared-card-only .invitation-book.show-page-two::after { display: none; }
}

/* Occasion starters, uploads, history, sharing and exports */
.history-actions { display: flex; gap: 4px; padding: 3px; border: 1px solid #e2d7cc; border-radius: 11px; background: #f8f2ec; }
.history-actions button { width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #65574f; font-size: 18px; line-height: 1; }
.history-actions button:hover:not(:disabled) { background: white; color: #8f2e25; }

.starter-card { display: grid; grid-template-columns: 35px minmax(0,1fr) auto; align-items: center; gap: 9px; margin: 0 0 12px; padding: 9px; border: 1px solid #e3d3c5; border-radius: 15px; background: linear-gradient(145deg,#fff8f2,#f4e7dc); color: #563c33; }
.starter-card > span { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 11px; background: #8f2e25; color: white; font-size: 16px; }
.starter-card strong, .starter-card small { display: block; }
.starter-card strong { overflow: hidden; font-size: 9px; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.starter-card small { margin-top: 2px; color: #8f7b6f; font-size: 7px; line-height: 1.25; }
.starter-card button { min-height: 31px; padding: 0 10px; border: 0; border-radius: 9px; background: white; color: #8f2e25; box-shadow: 0 3px 10px rgba(76,47,31,.09); font-size: 8px; font-weight: 850; }

.upload-image-button { min-height: 48px; display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 1px dashed #cdb7a7; border-radius: 14px; background: #fffaf5; color: #563c33; text-align: left; }
.upload-image-button > span:first-child { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; background: #f0e3da; color: #8f2e25; font-size: 16px; }
.upload-image-button strong, .upload-image-button small { display: block; }
.upload-image-button strong { font-size: 9px; font-weight: 850; }
.upload-image-button small { margin-top: 2px; color: #968276; font-size: 7px; }

.direct-names .is-optional { opacity: .55; }
.design-names.single-name { display: block; font-size: .8em; line-height: 1.05; }

.share-channel-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 9px; }
.share-channel-actions button { min-height: 42px; display: flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid #d9cfc2; border-radius: 11px; background: white; color: #423831; font-size: 12px; font-weight: 750; }
.share-channel-actions button:first-child { border-color: #b9ddc2; background: #eefaf1; color: #176b36; }

.export-overlay { position: fixed; inset: 0; z-index: 125; display: grid; place-items: center; padding: 20px; background: rgba(36,22,16,.62); backdrop-filter: blur(8px); }
.export-sheet { position: relative; width: min(470px, 100%); padding: 34px; overflow: hidden; border: 1px solid rgba(181,154,98,.34); border-radius: 22px; background: linear-gradient(145deg,#fffdf8,#f5e9dd); box-shadow: 0 28px 90px rgba(24,13,8,.35); }
.export-sheet h2 { margin: 0; color: #3b211c; font-size: 30px; line-height: 1.1; letter-spacing: -.04em; }
.export-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.export-actions button { min-height: 72px; padding: 13px; border: 1px solid #dfd1c5; border-radius: 14px; background: white; color: #49372f; text-align: left; }
.export-actions button:hover:not(:disabled) { border-color: #b98975; transform: translateY(-1px); box-shadow: 0 7px 18px rgba(75,52,34,.08); }
.export-actions button strong, .export-actions button small { display: block; }
.export-actions button strong { font-size: 12px; font-weight: 850; }
.export-actions button small { margin-top: 4px; color: #98867a; font-size: 8px; }
.export-actions .export-pdf { grid-column: 1 / -1; border-color: #b78e7a; background: #8f2e25; color: white; }
.export-actions .export-pdf small { color: rgba(255,255,255,.68); }
.export-status { min-height: 18px; margin: 12px 0 0; color: #7f6d62; font-size: 10px; text-align: center; }

.guest-share-dock { position: fixed; z-index: 80; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); display: flex; gap: 8px; padding: 6px; border: 1px solid rgba(255,255,255,.4); border-radius: 16px; background: rgba(255,255,255,.88); box-shadow: 0 12px 35px rgba(38,23,15,.2); backdrop-filter: blur(13px); }
.guest-share-dock button { min-height: 40px; display: flex; align-items: center; gap: 6px; padding: 0 13px; border: 0; border-radius: 11px; background: #8f2e25; color: white; font-size: 10px; font-weight: 850; }
.guest-share-dock button:first-child { background: #18733b; }
.mobile-starter-button { width: 100%; min-height: 62px; display: grid; grid-template-columns: 35px minmax(0,1fr) auto; align-items: center; gap: 9px; margin: 6px 0 10px; padding: 9px; border: 1px solid #dfcdbf; border-radius: 15px; background: #fff6ef; color: #50382f; text-align: left; }
.mobile-starter-button > span:first-child { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 11px; background: #8f2e25; color: white; }
.mobile-starter-button strong, .mobile-starter-button small { display: block; }
.mobile-starter-button strong { font-size: 10px; }
.mobile-starter-button small { margin-top: 2px; color: #917c70; font-size: 7px; }
.mobile-starter-button b { padding: 8px 10px; border-radius: 9px; background: white; color: #8f2e25; font-size: 8px; }

@media (max-width: 900px) and (min-width: 651px) {
  .header-status .button-ghost { display: none; }
}
@media (max-width: 650px) {
  .history-actions { margin-left: auto; }
  .history-actions button { width: 28px; height: 28px; }
  .header-status { gap: 6px; }
  .header-status .button-primary { font-size: 0; }
  .header-status .button-primary::after { content: "Share"; font-size: 11px; }
  .export-sheet { padding: 30px 22px 22px; }
  .export-sheet h2 { font-size: 26px; }
  .export-actions { grid-template-columns: 1fr; }
  .export-actions .export-pdf { grid-column: auto; }
  .share-channel-actions { grid-template-columns: 1fr; }
  .guest-share-dock { right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); }
  .guest-share-dock button { min-height: 38px; padding-inline: 11px; font-size: 9px; }
}
@media (max-width: 410px) {
  .brand strong { font-size: 17px; }
  .brand-mark { width: 32px; height: 32px; }
  .header-status .button-primary { padding-inline: 10px; }
}
