:root {
  color-scheme: light;
  --ink: #18231f;
  --muted: #647067;
  --line: #dde4de;
  --paper: #f7f6f2;
  --surface: #ffffff;
  --cypress: #203d34;
  --cypress-2: #2f5b4a;
  --rose: #b85d65;
  --marigold: #d39c43;
  --violet: #7b6fb0;
  --terracotta: #c87148;
  --danger: #b53a35;
  --shadow: 0 20px 60px rgba(18, 35, 30, 0.12);
  --soft-shadow: 0 10px 28px rgba(18, 35, 30, 0.08);
  --radius: 8px;
  --focus: 0 0 0 4px rgba(32, 61, 52, 0.16);
  font-family:
    "Avenir Next", "Helvetica Neue", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(231, 242, 237, 0.82), rgba(247, 246, 242, 0.96) 42%),
    var(--paper);
  font-weight: 400;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

button,
input,
textarea {
  letter-spacing: 0;
}

button {
  border: 0;
  color: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

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

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  outline: none;
}

input:focus,
textarea:focus,
button:focus-visible {
  box-shadow: var(--focus);
  outline: none;
}

textarea {
  min-height: 112px;
  resize: vertical;
}

.noscript {
  margin: 24px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.app-shell {
  min-height: 100vh;
  padding: 18px clamp(14px, 3vw, 32px) 24px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1480px, 100%);
  margin: 0 auto 18px;
  padding: 10px;
  border: 1px solid rgba(221, 228, 222, 0.82);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
  box-shadow: var(--soft-shadow);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
  padding: 4px 8px 4px 4px;
  border-radius: var(--radius);
  background: transparent;
  text-align: left;
}

.brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.brand span {
  display: grid;
  min-width: 0;
}

.brand strong {
  overflow: hidden;
  font-size: 1rem;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-actions,
.detail-actions,
.modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.primary-action,
.secondary-action,
.icon-button,
.text-link,
.pay-button {
  min-height: 42px;
  border-radius: var(--radius);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  font-weight: 750;
}

.primary-action {
  background: var(--cypress);
  color: #fff;
  box-shadow: 0 12px 28px rgba(32, 61, 52, 0.22);
}

.primary-action:hover {
  background: var(--cypress-2);
  transform: translateY(-1px);
}

.secondary-action {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--cypress);
}

.secondary-action:hover,
.icon-button:hover {
  border-color: rgba(32, 61, 52, 0.26);
  box-shadow: var(--soft-shadow);
  transform: translateY(-1px);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  min-width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--cypress);
}

.icon-button:disabled {
  opacity: 0.38;
}

.icon-button.danger {
  color: var(--danger);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
  gap: 18px;
  width: min(1480px, 100%);
  margin: 0 auto;
}

.list-pane,
.detail-surface,
.empty-detail {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--soft-shadow);
}

.list-pane {
  align-self: start;
  padding: 18px;
}

.pane-header {
  display: grid;
  gap: 10px;
}

.pane-header h1,
.hero-copy h2,
.empty-detail h2,
.modal h2 {
  margin: 0;
  line-height: 1.02;
  color: var(--ink);
}

.pane-header h1 {
  font-size: 2.15rem;
}

.pane-header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--rose);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search-box {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin: 18px 0 12px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.search-box svg {
  color: var(--muted);
}

.search-box input {
  min-height: 46px;
  padding: 0;
  border: 0;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.stat-grid div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfa;
}

.stat-grid strong {
  display: block;
  font-size: 1.28rem;
  line-height: 1;
}

.stat-grid span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.78rem;
}

.memory-list {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 328px);
  min-height: 230px;
  overflow: auto;
  padding-right: 2px;
}

.memory-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 82px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: left;
}

.memory-card.active {
  border-color: rgba(32, 61, 52, 0.55);
  background: #eff8f3;
  box-shadow: inset 4px 0 0 var(--cypress);
}

.memory-card-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.memory-card-copy strong,
.memory-card-copy small,
.memory-card-copy em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memory-card-copy strong {
  font-size: 0.98rem;
}

.memory-card-copy small {
  color: var(--muted);
  font-size: 0.82rem;
}

.memory-card-copy em {
  color: var(--cypress-2);
  font-size: 0.78rem;
  font-style: normal;
}

.portrait {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(32, 61, 52, 0.12), rgba(184, 93, 101, 0.12)),
    #edf2ee;
}

.portrait:has(.initials) {
  background:
    linear-gradient(135deg, rgba(32, 61, 52, 0.48), rgba(184, 93, 101, 0.2)),
    url("/static/assets/flowers-generated/giglio-alba.png") center / contain no-repeat;
}

.portrait:has(.initials)::after {
  position: absolute;
  inset: 0;
  content: "";
  background: rgba(250, 252, 249, 0.58);
}

.portrait.small {
  width: 58px;
  height: 58px;
}

.portrait.large {
  width: min(34vw, 312px);
  min-width: 220px;
  aspect-ratio: 4 / 5;
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.initials {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: clamp(54px, 32%, 108px);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  color: var(--cypress);
  font-size: 1.6rem;
  font-weight: 850;
}

.detail-surface {
  min-height: calc(100vh - 132px);
  padding: clamp(16px, 2vw, 24px);
}

.detail-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(18px, 3vw, 36px);
  align-items: stretch;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.hero-copy h2 {
  font-size: clamp(2rem, 4vw, 4.5rem);
  letter-spacing: 0;
}

.date-line,
.meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.date-line {
  margin: 14px 0;
  color: var(--cypress-2);
  font-weight: 750;
}

.memory-message {
  max-width: 760px;
  margin: 0 0 22px;
  color: #31443c;
  font-size: 1.08rem;
  line-height: 1.65;
}

.meta-row span {
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfcfa;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 720;
}

.detail-actions {
  flex-wrap: wrap;
  margin: 22px 0;
}

.flower-wall {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

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

.section-heading.compact {
  margin-bottom: 8px;
}

.section-heading h3 {
  margin: 0;
  font-size: 1.55rem;
}

.share-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -10px 0 20px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfa;
}

.share-panel a,
.share-panel button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--cypress);
  font-weight: 800;
  text-decoration: none;
}

.share-panel a:hover,
.share-panel button:hover {
  border-color: rgba(32, 61, 52, 0.26);
  box-shadow: var(--soft-shadow);
}

.text-link {
  min-height: auto;
  padding: 6px 0;
  background: transparent;
  color: var(--cypress);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.tribute-stage {
  position: relative;
  display: flex;
  gap: 10px;
  min-height: 104px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(32, 61, 52, 0.08), rgba(211, 156, 67, 0.12)),
    #fbfcfa;
}

.tribute-stage img {
  flex: 0 0 78px;
  width: 78px;
  height: 82px;
  border-radius: var(--radius);
  object-fit: contain;
}

.tribute-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.tribute-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.tribute-item img {
  width: 64px;
  height: 64px;
  border-radius: var(--radius);
  object-fit: contain;
}

.tribute-item div {
  min-width: 0;
}

.tribute-item strong,
.tribute-item p,
.tribute-item small {
  overflow-wrap: anywhere;
}

.tribute-item strong {
  display: block;
}

.tribute-item p {
  margin: 3px 0 5px;
  color: #41564d;
  line-height: 1.4;
}

.tribute-item small {
  color: var(--muted);
}

.empty-list,
.empty-detail {
  color: var(--muted);
}

.empty-list {
  padding: 18px;
  border: 1px dashed #cfd8d1;
  border-radius: var(--radius);
  background: #fbfcfa;
  line-height: 1.5;
}

.empty-detail {
  display: grid;
  place-items: center;
  gap: 12px;
  min-height: calc(100vh - 132px);
  padding: 36px;
  text-align: center;
}

.empty-detail img {
  width: 96px;
  height: 96px;
  object-fit: contain;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: min(1480px, 100%);
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(14, 25, 21, 0.5);
  backdrop-filter: blur(10px);
}

.modal {
  width: min(100%, 980px);
  max-height: min(860px, calc(100vh - 36px));
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.flower-modal {
  width: min(100%, 1280px);
}

.modal-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.modal h2 {
  font-size: clamp(1.35rem, 2.2vw, 2.2rem);
}

.memory-form,
.flower-layout {
  padding: 20px;
}

.photo-picker {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfa;
  cursor: pointer;
}

.photo-preview {
  display: block;
  width: 96px;
  height: 96px;
  border-radius: var(--radius);
  background-position: center;
  background-size: cover;
}

.photo-picker strong {
  display: block;
  margin-bottom: 4px;
}

.photo-picker small,
label span + small {
  color: var(--muted);
}

.photo-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

label span {
  color: #33453d;
  font-size: 0.88rem;
  font-weight: 800;
}

input,
textarea {
  padding: 12px 13px;
}

.wide {
  grid-column: 1 / -1;
}

#message-count,
#dedication-count {
  justify-self: end;
  color: var(--muted);
  font-size: 0.78rem;
}

.modal-actions {
  justify-content: end;
  flex-wrap: wrap;
  margin-top: 18px;
}

.flower-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
  gap: 18px;
  align-items: start;
}

.flower-picker {
  display: grid;
  gap: 14px;
}

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

.category-tabs button {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 60px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: left;
}

.category-tabs button.active {
  border-color: color-mix(in srgb, var(--accent) 70%, #ffffff);
  background: color-mix(in srgb, var(--accent) 12%, #ffffff);
  box-shadow: inset 4px 0 0 var(--accent);
}

.category-tabs img {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  object-fit: contain;
}

.category-tabs span {
  overflow: hidden;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-story {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 140px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 10%, #ffffff);
}

.category-story img {
  width: 120px;
  height: 116px;
  border-radius: var(--radius);
  object-fit: contain;
}

.category-story strong {
  display: block;
  font-size: 1.28rem;
}

.category-story p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

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

.flower-option {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  min-height: 126px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: left;
}

.flower-option.selected {
  border-color: color-mix(in srgb, var(--accent) 70%, #ffffff);
  box-shadow:
    inset 0 0 0 2px color-mix(in srgb, var(--accent) 38%, #ffffff),
    var(--soft-shadow);
}

.flower-option img {
  width: 96px;
  height: 106px;
  border-radius: var(--radius);
  object-fit: contain;
}

.flower-option span {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 6px;
}

.flower-option strong,
.flower-option small {
  overflow-wrap: anywhere;
}

.flower-option small {
  color: var(--muted);
  line-height: 1.35;
}

.flower-option em {
  margin-top: auto;
  color: var(--cypress);
  font-style: normal;
  font-weight: 850;
}

.checkout-panel {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfa;
}

.checkout-summary {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.checkout-summary img {
  width: 86px;
  height: 86px;
  border-radius: var(--radius);
  object-fit: contain;
}

.checkout-summary h3 {
  margin: 0 0 4px;
  font-size: 1.25rem;
}

.checkout-summary span {
  color: var(--muted);
}

.checkout-form {
  display: grid;
  gap: 12px;
}

.stripe-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #d9e0dc;
  border-radius: var(--radius);
  background: #fff;
}

.stripe-head img {
  width: 64px;
  height: auto;
}

.stripe-head span {
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef4ff;
  color: #3b5aa8;
  font-size: 0.76rem;
  font-weight: 850;
}

.payment-grid {
  display: grid;
  grid-template-columns: 1fr 0.7fr;
  gap: 10px;
}

.test-card {
  justify-self: start;
  color: #3b5aa8;
  font-size: 0.9rem;
}

.payment-error {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 0.86rem;
  line-height: 1.4;
}

.pay-button {
  min-height: 48px;
  background: #635bff;
  color: #fff;
  font-weight: 850;
}

.pay-button:hover {
  background: #5147f2;
}

.pay-button:disabled {
  opacity: 0.72;
}

.bloom-particle {
  position: absolute;
  bottom: -40px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-position: center;
  background-size: cover;
  pointer-events: none;
  animation: bloom-rise 2.45s ease-in forwards;
}

@keyframes bloom-rise {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(0deg) scale(0.7);
  }
  18% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--drift), -220px, 0) rotate(210deg) scale(1.2);
  }
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  max-width: min(420px, calc(100vw - 36px));
  padding: 13px 15px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: var(--radius);
  background: var(--cypress);
  color: #fff;
  box-shadow: var(--shadow);
  line-height: 1.45;
}

.toast.error {
  background: var(--danger);
}

@media (max-width: 1120px) {
  .workspace {
    grid-template-columns: 360px minmax(0, 1fr);
  }

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

  .portrait.large {
    width: 100%;
    min-width: 0;
    max-height: 360px;
    aspect-ratio: 16 / 10;
  }

  .flower-layout {
    grid-template-columns: 1fr;
  }

  .checkout-panel {
    position: static;
  }
}

@media (max-width: 860px) {
  .app-shell {
    padding: 10px;
  }

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

  .top-actions {
    justify-content: stretch;
  }

  .top-actions .primary-action {
    flex: 1;
  }

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

  .list-pane {
    padding: 14px;
  }

  .pane-header h1 {
    font-size: 1.82rem;
  }

  .memory-list {
    max-height: none;
    min-height: 0;
  }

  .detail-surface,
  .empty-detail {
    min-height: auto;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

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

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

  .footer {
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .top-actions {
    display: grid;
    grid-template-columns: 42px 42px minmax(0, 1fr);
  }

  .primary-action,
  .secondary-action {
    padding-inline: 12px;
  }

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

  .detail-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 42px 42px;
  }

  .detail-actions .primary-action,
  .detail-actions .secondary-action {
    min-width: 0;
  }

  .hero-copy h2 {
    font-size: 2.35rem;
  }

  .form-grid,
  .payment-grid {
    grid-template-columns: 1fr;
  }

  .modal-backdrop {
    padding: 0;
  }

  .modal {
    width: 100%;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
  }

  .modal-header,
  .memory-form,
  .flower-layout {
    padding: 14px;
  }

  .photo-picker,
  .category-story,
  .flower-option,
  .checkout-summary,
  .tribute-item {
    grid-template-columns: 1fr;
  }

  .photo-preview,
  .category-story img,
  .flower-option img,
  .checkout-summary img {
    width: 100%;
  }

  .photo-preview {
    height: 180px;
  }

  .category-story img,
  .flower-option img {
    height: 160px;
  }

  .checkout-summary img {
    height: 180px;
  }

  .toast {
    right: 10px;
    bottom: 10px;
    max-width: calc(100vw - 20px);
  }
}

:root {
  color-scheme: dark;
  --legacy-purple: #c9a15b;
  --legacy-purple-dark: #a98043;
  --legacy-purple-rgb: 201, 161, 91;
  --legacy-ink: #fff8ea;
  --legacy-muted: #c9beaa;
  --legacy-line: rgba(243, 221, 172, 0.2);
  --legacy-bg: #070605;
  --legacy-card: rgba(255, 248, 234, 0.075);
  --legacy-danger: #e08c7f;
  --legacy-soft: rgba(255, 248, 234, 0.1);
  --legacy-shadow: 0 22px 54px rgba(0, 0, 0, 0.34);
}

body {
  background: var(--legacy-bg);
  color: var(--legacy-ink);
}

input,
textarea,
button {
  letter-spacing: 0;
}

#app {
  min-height: 100vh;
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px 18px;
  background: #fff;
}

.auth-panel {
  display: grid;
  width: min(100%, 390px);
  gap: 16px;
  justify-items: center;
}

.auth-logo {
  width: 168px;
  height: 168px;
  object-fit: contain;
}

.auth-title {
  margin: 0 0 4px;
  color: var(--legacy-ink);
  font-size: 2rem;
  font-weight: 650;
  line-height: 1.05;
  text-align: center;
}

.auth-form {
  display: grid;
  width: 100%;
  gap: 14px;
}

.auth-form input,
.legacy-field input,
.legacy-field textarea {
  min-height: 52px;
  border: 1px solid #ded8e8;
  border-radius: 14px;
  background: #fff;
  color: var(--legacy-ink);
  font-size: 1rem;
}

.auth-form input:focus,
.legacy-field input:focus,
.legacy-field textarea:focus {
  border-color: var(--legacy-purple);
  box-shadow: 0 0 0 3px rgba(var(--legacy-purple-rgb), 0.12);
}

.auth-options,
.auth-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.remember-row {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  color: var(--legacy-ink);
  font-size: 0.92rem;
}

.remember-row input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--legacy-purple);
}

.remember-row span {
  font-weight: 500;
}

.link-button,
.auth-switch button {
  min-height: auto;
  padding: 0;
  background: transparent;
  color: var(--legacy-purple);
  font-weight: 650;
}

.auth-divider {
  color: #dad5e4;
  font-size: 0.95rem;
  line-height: 1;
  text-align: center;
}

.auth-switch {
  justify-content: center;
  font-size: 0.95rem;
}

.social-row {
  display: flex;
  justify-content: center;
  gap: 18px;
  width: 100%;
  padding-top: 4px;
}

.social-button {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid var(--legacy-line);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 8px 18px rgba(32, 27, 44, 0.06);
}

.social-button img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.auth-policy {
  max-width: 340px;
  margin: 6px 0 0;
  color: #777;
  font-size: 0.78rem;
  line-height: 1.45;
  text-align: center;
}

.auth-policy a {
  color: var(--legacy-purple);
  font-weight: 650;
}

.mobile-shell {
  position: relative;
  min-height: 100vh;
  margin: 0 auto;
  background: #fff;
  color: var(--legacy-ink);
}

.app-screen {
  min-height: 100vh;
  padding: 18px 18px 28px;
}

.app-screen.with-tabbar {
  padding-bottom: 100px;
}

.cover-screen {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  padding: 34px 24px 28px;
  background:
    linear-gradient(180deg, #fff 0%, #fbfafc 100%);
}

.cover-main {
  display: grid;
  flex: 1;
  align-content: center;
  gap: 24px;
}

.cover-logo {
  width: 118px;
  height: 118px;
  object-fit: contain;
}

.cover-copy {
  display: grid;
  gap: 12px;
}

.cover-copy h1 {
  margin: 0;
  color: var(--legacy-ink);
  font-size: 2.35rem;
  font-weight: 620;
  line-height: 1;
}

.cover-copy p {
  max-width: 34ch;
  margin: 0;
  color: #54505c;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
}

.cover-points {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--legacy-line);
  border-bottom: 1px solid var(--legacy-line);
  list-style: none;
}

.cover-points li {
  padding: 13px 0;
  color: #3c3745;
  font-size: 0.93rem;
  font-weight: 400;
  line-height: 1.42;
}

.cover-points li + li {
  border-top: 1px solid var(--legacy-line);
}

.cover-actions {
  display: grid;
  gap: 12px;
}

.cover-actions .legacy-primary,
.cover-actions .legacy-secondary {
  width: 100%;
}

.cover-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

.cover-links button {
  min-height: auto;
  padding: 0;
  background: transparent;
  color: var(--legacy-purple);
  font-size: 0.82rem;
  font-weight: 650;
}

.loading-screen {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
}

.loading-screen img {
  width: 128px;
  height: 128px;
  object-fit: contain;
}

.loading-screen h1 {
  margin: 0;
  color: var(--legacy-purple);
  font-size: 1.45rem;
  font-weight: 620;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 54px;
  margin-bottom: 18px;
}

.app-header h1 {
  margin: 0;
  color: var(--legacy-ink);
  font-size: 1.55rem;
  font-weight: 680;
  line-height: 1.08;
}

.app-header.centered-title {
  justify-content: center;
  text-align: center;
}

.nav-header {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  text-align: center;
}

.nav-header h1 {
  align-self: center;
  overflow: hidden;
  font-size: 1.25rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.back-button,
.floating-create {
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #fff;
}

.back-button {
  width: 44px;
  height: 44px;
}

.header-spacer {
  width: 44px;
  height: 44px;
}

.back-button {
  color: var(--legacy-purple);
  box-shadow: inset 0 0 0 1px rgba(var(--legacy-purple-rgb), 0.08);
}

.legacy-search {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 0 14px;
  border: 1px solid var(--legacy-line);
  border-radius: 14px;
  background: #fff;
}

.legacy-search svg {
  color: var(--legacy-purple);
}

.legacy-search input {
  min-height: 52px;
  padding: 0;
  border: 0;
  background: transparent;
}

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

.legacy-memory-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  min-height: 92px;
  padding: 0 12px 0 0;
  border: 1px solid #eeebf3;
  border-radius: 14px;
  background: #fff;
  text-align: left;
  box-shadow: 0 10px 24px rgba(32, 27, 44, 0.045);
}

.legacy-photo {
  overflow: hidden;
  align-self: stretch;
  width: 92px;
  min-height: 92px;
  height: 100%;
  border-radius: 13px 0 0 13px;
  background: #eeeaf5;
}

.legacy-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.legacy-memory-copy {
  display: grid;
  min-width: 0;
  align-content: center;
  gap: 4px;
}

.legacy-memory-copy strong {
  overflow: hidden;
  color: var(--legacy-ink);
  font-size: 1.05rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legacy-memory-copy small {
  color: var(--legacy-purple);
  font-size: 0.8rem;
  font-weight: 620;
}

.legacy-memory-copy em {
  display: block;
  overflow: hidden;
  color: var(--legacy-muted);
  font-size: 0.84rem;
  font-style: normal;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legacy-empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 48px 16px;
  color: var(--legacy-muted);
  text-align: center;
}

.legacy-empty img {
  width: 116px;
  height: 116px;
  object-fit: contain;
  opacity: 0.65;
}

.floating-create {
  position: fixed;
  right: max(20px, calc((100vw - 480px) / 2 + 20px));
  bottom: 88px;
  z-index: 12;
  width: 58px;
  height: 58px;
  background: var(--legacy-purple);
  color: #fff;
  box-shadow: 0 14px 30px rgba(var(--legacy-purple-rgb), 0.2);
}

.legacy-tabbar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 11;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: 480px;
  min-height: 74px;
  margin: 0 auto;
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  border-radius: 18px 18px 0 0;
  background: var(--legacy-purple);
  box-shadow: 0 -12px 34px rgba(32, 27, 44, 0.12);
}

.legacy-tabbar button {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  min-width: 0;
  min-height: 58px;
  padding: 4px 2px;
  border-radius: 14px;
  background: transparent;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 620;
}

.legacy-tabbar button.active {
  background: rgba(255, 255, 255, 0.14);
}

.legacy-tabbar svg {
  width: 21px;
  height: 21px;
}

.legacy-tabbar span {
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: normal;
  line-height: 1.02;
}

.create-form {
  display: grid;
  gap: 14px;
}

.create-form h2 {
  margin: 4px 0 2px;
  color: var(--legacy-ink);
  font-size: 2rem;
  font-weight: 620;
  line-height: 1.05;
  text-align: center;
}

.legacy-image-picker {
  display: block;
  cursor: pointer;
}

.legacy-image-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.create-photo-preview {
  display: grid;
  place-items: center;
  width: min(100%, 250px);
  aspect-ratio: 1;
  margin: 0 auto 4px;
  border-radius: 14px;
  overflow: hidden;
  background-color: var(--legacy-soft);
  border: 1px solid rgba(var(--legacy-purple-rgb), 0.18);
  box-shadow: inset 0 0 44px rgba(var(--legacy-purple-rgb), 0.08);
}

.create-photo-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.create-photo-preview img[src$="profile-placeholder.png"] {
  width: 58%;
  height: 58%;
  object-fit: contain;
  opacity: 0.92;
}

.legacy-field {
  display: block;
}

.legacy-field textarea {
  min-height: 116px;
}

.legacy-field.compact input {
  min-height: 48px;
}

.legacy-field.compact textarea {
  min-height: 78px;
}

.post-count {
  justify-self: end;
  margin-top: -8px;
  color: var(--legacy-muted);
  font-size: 0.8rem;
}

.form-section-title {
  margin: 4px 0 -4px;
  color: var(--legacy-purple);
  font-size: 0.86rem;
  font-weight: 650;
}

.legal-check {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  color: var(--legacy-muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.legal-check input {
  width: 18px;
  min-height: 18px;
  margin-top: 1px;
  accent-color: var(--legacy-purple);
}

.legal-check span {
  color: var(--legacy-muted);
  font-size: inherit;
  font-weight: 500;
}

.optional-check span {
  color: #555;
}

.legacy-primary,
.legacy-secondary,
.legacy-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  width: 100%;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 680;
}

.legacy-primary {
  background: var(--legacy-purple);
  color: #fff;
  box-shadow: 0 12px 24px rgba(var(--legacy-purple-rgb), 0.18);
}

.legacy-secondary {
  min-height: 42px;
  border: 1px solid rgba(var(--legacy-purple-rgb), 0.18);
  background: #fff;
  color: var(--legacy-purple);
  box-shadow: none;
}

.legacy-primary:hover {
  background: var(--legacy-purple-dark);
}

.legacy-primary:disabled {
  opacity: 0.68;
}

.legacy-danger {
  border: 1px solid rgba(189, 45, 45, 0.18);
  background: #fff7f7;
  color: var(--legacy-danger);
}

.legacy-detail {
  display: grid;
  gap: 14px;
}

.detail-name-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.detail-name-row h2 {
  margin: 0;
  color: var(--legacy-ink);
  font-size: 2rem;
  font-weight: 620;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.detail-share-button {
  align-self: start;
  min-width: 82px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--legacy-purple);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 650;
}

.share-menu {
  position: absolute;
  top: 44px;
  right: 0;
  z-index: 20;
  display: grid;
  gap: 4px;
  width: min(232px, calc(100vw - 36px));
  padding: 8px;
  border: 1px solid rgba(var(--legacy-purple-rgb), 0.12);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(32, 27, 44, 0.12);
}

.share-menu a,
.share-menu button {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 10px;
  background: transparent;
  color: var(--legacy-purple);
  font-size: 0.78rem;
  font-weight: 650;
  text-decoration: none;
  text-align: left;
}

.share-menu a:hover,
.share-menu button:hover {
  background: var(--legacy-soft);
}

.share-menu svg {
  width: 18px;
  height: 18px;
}

.share-menu span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-meta-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--legacy-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(32, 27, 44, 0.04);
}

.detail-meta-card span {
  display: block;
  margin-bottom: 4px;
  color: var(--legacy-muted);
  font-size: 0.78rem;
  font-weight: 620;
}

.detail-meta-card strong {
  display: block;
  color: var(--legacy-purple);
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.2;
}

.detail-meta-card button {
  min-height: 36px;
  padding: 0 11px;
  border-radius: 10px;
  background: #fff;
  color: var(--legacy-purple);
  font-size: 0.78rem;
  font-weight: 650;
  box-shadow: inset 0 0 0 1px rgba(var(--legacy-purple-rgb), 0.18);
}

.anniversary-form {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--legacy-line);
  border-radius: 14px;
  background: #fff;
}

.detail-created {
  margin: 0;
  color: var(--legacy-purple);
  font-weight: 560;
  line-height: 1.35;
}

.detail-created {
  margin-top: -8px;
  color: var(--legacy-muted);
  font-size: 0.88rem;
}

.detail-agency-link {
  display: grid;
  justify-items: start;
  gap: 3px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--legacy-line);
  border-radius: 12px;
  background: #fff;
  color: var(--legacy-ink);
  text-align: left;
}

.detail-agency-link span {
  color: var(--legacy-purple);
  font-size: 0.74rem;
  font-weight: 740;
  text-transform: uppercase;
}

.detail-agency-link strong {
  color: var(--legacy-ink);
  font-size: 0.96rem;
  font-weight: 680;
}

.detail-agency-link small {
  color: var(--legacy-muted);
  font-size: 0.8rem;
}

.legacy-tribute-stage {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  min-height: 252px;
  border-radius: 14px;
  background: var(--legacy-soft);
}

.detail-photo {
  width: 100%;
  max-height: 310px;
  object-fit: cover;
}

.detail-flower-action {
  margin-top: -2px;
}

.grave-placeholder {
  width: min(70%, 260px);
  object-fit: contain;
  opacity: 0.9;
}

.detail-memory-words {
  padding: 18px 16px;
  border-left: 2px solid rgba(var(--legacy-purple-rgb), 0.28);
  border-radius: 12px;
  background: #fff;
}

.detail-memory-words p {
  margin: 0;
  color: #3e3947;
  font-size: 1rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.condolence-strip {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--legacy-line);
}

.condolence-strip h2 {
  margin: 0 0 2px;
  color: var(--legacy-ink);
  font-size: 1.05rem;
  font-weight: 650;
  line-height: 1.2;
}

.condolence-strip > p {
  margin: 0;
  color: var(--legacy-muted);
  text-align: center;
}

.compact-tribute {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid #eeebf3;
  border-radius: 14px;
  background: #fff;
}

.compact-tribute img {
  width: 58px;
  height: 58px;
  border-radius: 10px;
  object-fit: contain;
}

.compact-tribute strong,
.compact-tribute small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-tribute small {
  margin-top: 3px;
  color: var(--legacy-muted);
}

.flower-screen,
.payment-screen {
  padding-bottom: 90px;
}

.flower-section-heading h2 {
  margin: 0 0 14px;
  font-size: 1.2rem;
  font-weight: 650;
}

.category-scroll-wrap {
  position: relative;
  display: grid;
  margin-bottom: 10px;
}

.category-scroll-wrap::after {
  content: none;
}

.legacy-category-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  overflow: visible;
  padding: 2px;
}

.legacy-category-row::-webkit-scrollbar {
  height: 5px;
}

.legacy-category-row::-webkit-scrollbar-track {
  border-radius: 999px;
  background: #eeeaf5;
}

.legacy-category-row::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--legacy-purple);
}

.category-scrollbar {
  display: block;
  overflow: hidden;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: #eeeaf5;
}

.category-scrollbar span {
  display: block;
  width: 34%;
  height: 100%;
  border-radius: inherit;
  background: var(--legacy-purple);
}

.legacy-category-row button {
  display: grid;
  gap: 6px;
  justify-items: center;
  min-height: 88px;
  padding: 9px 8px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: #fff;
  color: var(--legacy-ink);
  font-weight: 620;
  box-shadow: 0 8px 20px rgba(32, 27, 44, 0.04);
}

.legacy-category-row button.active,
.legacy-flower-item.selected {
  border-color: var(--legacy-purple);
  box-shadow: inset 0 0 0 1px rgba(var(--legacy-purple-rgb), 0.22), 0 10px 24px rgba(32, 27, 44, 0.05);
}

.legacy-category-row img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  transform: scale(1.18);
  transform-origin: center;
}

.legacy-category-row span {
  overflow: hidden;
  width: 100%;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legacy-flower-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.legacy-flower-item {
  display: grid;
  gap: 8px;
  overflow: hidden;
  min-height: 222px;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: #fff;
  text-align: left;
  box-shadow: 0 10px 24px rgba(32, 27, 44, 0.045);
}

.legacy-flower-item img {
  width: 100%;
  height: 150px;
  border-radius: 10px;
  object-fit: contain;
  transform: scale(1.7);
  transform-origin: center;
}

.legacy-flower-item span {
  display: grid;
  gap: 3px;
}

.legacy-flower-item strong,
.legacy-flower-item em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legacy-flower-item em {
  color: var(--legacy-purple);
  font-style: normal;
  font-weight: 680;
}

.sticky-action {
  position: fixed;
  bottom: 18px;
  left: 50%;
  z-index: 12;
  width: min(calc(100vw - 36px), 444px);
  transform: translateX(-50%);
}

.payment-form {
  display: grid;
  gap: 14px;
}

.flower-duration-note {
  margin: -2px 0 0;
  color: var(--legacy-muted);
  font-size: 0.84rem;
  line-height: 1.4;
  text-align: center;
}

.selected-flower-mini {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  overflow: hidden;
  padding: 10px;
  border: 1px solid #eeebf3;
  border-radius: 14px;
  background: #fff;
}

.selected-flower-mini img {
  width: 76px;
  height: 76px;
  object-fit: contain;
  transform: scale(1.45);
  transform-origin: center;
}

.selected-flower-mini strong,
.selected-flower-mini small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-flower-mini small {
  margin-top: 4px;
  color: var(--legacy-muted);
}

.stripe-payment-panel {
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 14px 12px;
  border: 1px solid rgba(var(--legacy-purple-rgb), 0.16);
  border-radius: 14px;
  background: #fff;
  text-align: center;
}

.stripe-payment-panel strong {
  color: var(--legacy-ink);
  font-size: 1rem;
  font-weight: 650;
}

.stripe-payment-panel p {
  max-width: 330px;
  margin: 0;
  color: var(--legacy-muted);
  font-size: 0.82rem;
  line-height: 1.38;
}

.payment-brand-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 34px;
}

.payment-brand-row img {
  width: auto;
  max-width: 74px;
  max-height: 30px;
  object-fit: contain;
}

.mastercard-mark {
  position: relative;
  display: inline-flex;
  width: 34px;
  height: 22px;
}

.mastercard-mark i {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
}

.mastercard-mark i:first-child {
  left: 0;
  background: #e84838;
}

.mastercard-mark i:last-child {
  right: 0;
  background: rgba(247, 158, 27, 0.92);
  mix-blend-mode: multiply;
}

.profile-card {
  display: grid;
  gap: 14px;
  justify-items: center;
  padding-top: 6px;
}

.profile-card h2 {
  margin: 8px 0 0;
  font-size: 1.6rem;
  font-weight: 650;
  overflow-wrap: anywhere;
  text-align: center;
}

.profile-card p {
  margin: -6px 0 12px;
  color: var(--legacy-muted);
  overflow-wrap: anywhere;
  text-align: center;
}

.profile-purchases {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--legacy-line);
  border-radius: 14px;
  background: #fff;
}

.profile-section-heading {
  display: grid;
  gap: 4px;
}

.profile-section-heading span {
  color: var(--legacy-purple);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
}

.profile-section-heading h2 {
  margin: 0;
  color: var(--legacy-ink);
  font-size: 1.1rem;
  font-weight: 680;
  overflow-wrap: anywhere;
}

.profile-section-heading p,
.profile-empty {
  margin: 0;
  color: var(--legacy-muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

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

.profile-purchase-head {
  display: grid;
  grid-template-columns: 5.4rem minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 8px;
  color: var(--legacy-purple);
  font-size: 0.72rem;
  font-weight: 740;
  text-transform: uppercase;
}

.profile-purchase-head span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-purchase-item {
  display: grid;
  grid-template-columns: 5.4rem minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: 8px;
  padding: 11px;
  border: 1px solid var(--legacy-line);
  border-radius: 12px;
  background: #fbfafc;
}

.profile-purchase-item time,
.profile-purchase-item strong,
.profile-purchase-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-purchase-item time {
  color: var(--legacy-muted);
  font-size: 0.76rem;
  font-weight: 650;
}

.profile-purchase-item strong {
  color: var(--legacy-ink);
  font-size: 0.86rem;
}

.profile-purchase-item span {
  color: var(--legacy-muted);
  font-size: 0.8rem;
}

.profile-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 14px;
}

.profile-links button,
.profile-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 12px;
  background: rgba(255, 248, 234, 0.075);
  color: var(--legacy-ink);
  font-size: 0.86rem;
  font-weight: 620;
  text-align: center;
  text-decoration: none;
  box-shadow: inset 0 0 0 1px rgba(243, 221, 172, 0.16);
}

.agency-screen {
  background: #fff;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.agency-hero {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 18px;
  border: 1px solid var(--legacy-line);
  border-radius: 14px;
  background: #fff;
  text-align: center;
}

.agency-hero svg {
  width: 42px;
  height: 42px;
  color: var(--legacy-purple);
}

.agency-list {
  display: grid;
  gap: 9px;
  padding-bottom: 18px;
}

.agency-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 68px;
  padding: 9px;
  border: 1px solid #eeebf3;
  border-radius: 12px;
  background: #fff;
}

.agency-card.focused {
  border-color: var(--legacy-purple);
  box-shadow: inset 0 0 0 1px rgba(var(--legacy-purple-rgb), 0.22), 0 12px 26px rgba(32, 27, 44, 0.08);
}

.agency-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  overflow: hidden;
  border-radius: 11px;
  background: #fff;
  color: var(--legacy-purple);
}

.agency-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}

.agency-card strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agency-card strong {
  font-size: 0.94rem;
  font-weight: 650;
}

.agency-contact {
  display: grid;
  gap: 2px;
  margin: 4px 0 0;
  color: var(--legacy-muted);
  font-size: 0.8rem;
  line-height: 1.3;
}

.agency-contact span,
.agency-contact a {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agency-contact a {
  color: var(--legacy-purple);
  font-weight: 650;
  text-decoration: none;
}

.help-screen,
.legal-screen {
  background: #fff;
}

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

.support-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--legacy-line);
  border-radius: 14px;
  background: #fff;
}

.support-card .legacy-secondary {
  margin-top: 4px;
}

.support-link {
  text-decoration: none;
}

.help-card,
.legal-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid #eeebf3;
  border-radius: 14px;
  background: #fff;
}

.help-card strong {
  font-size: 1rem;
  font-weight: 650;
}

.help-card p,
.legal-card p {
  margin: 0;
  color: var(--legacy-muted);
  line-height: 1.45;
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.legal-links button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--legacy-soft);
  color: var(--legacy-purple);
  font-weight: 650;
}

.legal-card small {
  color: var(--legacy-muted);
  line-height: 1.4;
}

.company-card {
  display: grid;
  gap: 5px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #eeebf3;
  border-radius: 14px;
  background: #fff;
  color: var(--legacy-muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.company-card strong {
  color: var(--legacy-ink);
  font-size: 0.94rem;
  font-weight: 650;
}

.company-card a {
  color: var(--legacy-purple);
  font-weight: 650;
  text-decoration: none;
}

.mobile-shell {
  background:
    radial-gradient(circle at 50% -12%, rgba(var(--legacy-purple-rgb), 0.2), transparent 28rem),
    linear-gradient(155deg, #050403 0%, #0b0907 46%, #17120d 100%);
}

.app-screen,
.cover-screen,
.agency-screen,
.help-screen,
.legal-screen {
  background: transparent;
}

.cover-screen {
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 248, 234, 0.08), transparent 24rem),
    linear-gradient(180deg, rgba(255, 248, 234, 0.025), transparent 42%);
}

.cover-logo,
.auth-logo,
.loading-screen img,
.legacy-empty img {
  filter: sepia(1) saturate(0.9) hue-rotate(354deg) brightness(1.45) drop-shadow(0 1rem 2.4rem rgba(0, 0, 0, 0.44));
}

.cover-copy h1,
.app-header h1,
.create-form h2,
.detail-name-row h2,
.condolence-strip h2,
.flower-section-heading h2,
.profile-card h2,
.profile-section-heading h2,
.profile-purchase-item strong,
.detail-agency-link strong,
.auth-title,
.legacy-memory-copy strong,
.help-card strong,
.company-card strong,
.stripe-payment-panel strong,
.selected-flower-mini strong,
.compact-tribute strong {
  color: var(--legacy-ink);
}

.cover-copy p,
.cover-points li,
.legacy-memory-copy em,
.detail-memory-words p,
.condolence-strip > p,
.flower-duration-note,
.profile-card p,
.profile-section-heading p,
.profile-empty,
.profile-purchase-item time,
.profile-purchase-item span,
.detail-agency-link small,
.help-card p,
.legal-card p,
.company-card,
.stripe-payment-panel p,
.selected-flower-mini small,
.compact-tribute small,
.agency-contact,
.detail-created,
.detail-meta-card span,
.legal-check,
.legal-check span,
.optional-check span,
.post-count,
.auth-policy {
  color: var(--legacy-muted);
}

.legacy-memory-copy small,
.detail-meta-card strong,
.legacy-flower-item em,
.profile-section-heading span,
.profile-purchase-head,
.detail-agency-link span,
.form-section-title,
.agency-contact a,
.cover-links button,
.link-button,
.auth-switch button,
.profile-links a,
.legal-links button {
  color: var(--legacy-purple);
}

.auth-shell {
  background:
    radial-gradient(circle at 50% 0%, rgba(var(--legacy-purple-rgb), 0.18), transparent 28rem),
    #070605;
}

.auth-panel,
.legacy-search,
.legacy-memory-card,
.detail-meta-card,
.anniversary-form,
.detail-memory-words,
.compact-tribute,
.legacy-category-row button,
.legacy-flower-item,
.selected-flower-mini,
.profile-purchases,
.profile-purchase-item,
.detail-agency-link,
.stripe-payment-panel,
.agency-hero,
.agency-card,
.help-card,
.legal-card,
.company-card,
.support-form,
.share-menu,
.social-button {
  border-color: rgba(243, 221, 172, 0.18);
  background: rgba(255, 248, 234, 0.075);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 248, 234, 0.04);
  backdrop-filter: blur(18px);
}

.auth-form input,
.legacy-field input,
.legacy-field textarea,
.legacy-search input {
  border-color: rgba(243, 221, 172, 0.2);
  background: rgba(255, 248, 234, 0.08);
  color: var(--legacy-ink);
}

.auth-form input::placeholder,
.legacy-field input::placeholder,
.legacy-field textarea::placeholder,
.legacy-search input::placeholder {
  color: rgba(255, 248, 234, 0.48);
}

.legacy-search input {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none;
}

.auth-form input:focus,
.legacy-field input:focus,
.legacy-field textarea:focus {
  border-color: rgba(255, 248, 234, 0.68);
  box-shadow: 0 0 0 3px rgba(var(--legacy-purple-rgb), 0.2);
}

.legacy-primary,
.floating-create,
.detail-share-button,
.toast {
  background: linear-gradient(135deg, #f3ddac 0%, #c9a15b 48%, #9f7638 100%);
  color: #15100a;
  box-shadow: 0 16px 34px rgba(var(--legacy-purple-rgb), 0.24);
}

.legacy-primary:hover {
  background: linear-gradient(135deg, #fff1c8 0%, #d3aa63 52%, #a27a3f 100%);
}

.legacy-secondary,
.legacy-danger,
.detail-meta-card button {
  border-color: rgba(243, 221, 172, 0.22);
  background: rgba(255, 248, 234, 0.07);
  color: var(--legacy-purple);
}

.back-button {
  background: rgba(255, 248, 234, 0.07);
  color: var(--legacy-purple);
  box-shadow: inset 0 0 0 1px rgba(243, 221, 172, 0.16);
}

.legacy-tabbar {
  border-top: 1px solid rgba(243, 221, 172, 0.22);
  background: rgba(10, 8, 6, 0.92);
  box-shadow: 0 -18px 38px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(18px);
}

.legacy-tabbar button {
  color: rgba(255, 248, 234, 0.76);
}

.legacy-tabbar button.active {
  background: rgba(var(--legacy-purple-rgb), 0.18);
  color: #fff8ea;
}

.legacy-photo,
.legacy-tribute-stage,
.agency-icon,
.category-scrollbar,
.legacy-category-row::-webkit-scrollbar-track {
  background: rgba(255, 248, 234, 0.08);
}

.create-photo-preview {
  background-color: rgba(255, 248, 234, 0.08);
}

.legacy-tribute-stage {
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 248, 234, 0.14), transparent 14rem),
    rgba(255, 248, 234, 0.07);
}

.detail-memory-words {
  border-left-color: rgba(var(--legacy-purple-rgb), 0.72);
}

.share-menu a,
.share-menu button {
  color: var(--legacy-purple);
}

.share-menu a:hover,
.share-menu button:hover,
.legal-links button {
  background: rgba(var(--legacy-purple-rgb), 0.12);
}

.category-scroll-wrap::after {
  background: linear-gradient(90deg, rgba(7, 6, 5, 0), #0b0907 82%);
}

.legacy-category-row {
  scrollbar-color: var(--legacy-purple) rgba(255, 248, 234, 0.1);
}

.legacy-category-row::-webkit-scrollbar-thumb,
.category-scrollbar span {
  background: linear-gradient(90deg, #f3ddac, #c9a15b);
}

.legacy-category-row button.active,
.legacy-flower-item.selected {
  border-color: rgba(255, 248, 234, 0.78);
  box-shadow:
    inset 0 0 0 1px rgba(255, 248, 234, 0.22),
    0 0 34px rgba(var(--legacy-purple-rgb), 0.16),
    0 12px 28px rgba(0, 0, 0, 0.18);
}

.legacy-flower-item,
.selected-flower-mini,
.compact-tribute {
  position: relative;
}

.legacy-flower-item::before,
.selected-flower-mini::before,
.compact-tribute::before {
  content: "";
  position: absolute;
  pointer-events: none;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.42) 0%, rgba(243, 221, 172, 0.2) 34%, transparent 68%);
  filter: blur(2px);
}

.legacy-flower-item::before {
  top: 18px;
  left: 50%;
  width: min(84%, 12rem);
  height: 8.8rem;
  transform: translateX(-50%);
}

.selected-flower-mini::before,
.compact-tribute::before {
  top: 11px;
  left: 10px;
  width: 76px;
  height: 76px;
}

.legacy-flower-item img,
.legacy-category-row img,
.selected-flower-mini img,
.compact-tribute img {
  position: relative;
  z-index: 1;
  filter:
    drop-shadow(0 0 18px rgba(255, 248, 234, 0.52))
    drop-shadow(0 14px 24px rgba(var(--legacy-purple-rgb), 0.18));
}

.legacy-flower-item span,
.selected-flower-mini div,
.compact-tribute div {
  position: relative;
  z-index: 2;
}

.mastercard-mark {
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.26));
}

.payment-brand-row {
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(255, 248, 234, 0.9);
}

.bloom-particle {
  z-index: 2;
}

.toast {
  right: max(18px, calc((100vw - 480px) / 2 + 18px));
  bottom: 18px;
  border-radius: 14px;
  background: var(--legacy-purple);
}

@media (min-width: 760px) {
  .mobile-shell,
  .auth-panel {
    max-width: 480px;
  }

  .mobile-shell {
    box-shadow: var(--legacy-shadow);
  }

  .auth-shell {
    background: var(--legacy-bg);
  }

  .auth-panel {
    padding: 34px 28px;
    border-radius: 24px;
    background: #fff;
    box-shadow: var(--legacy-shadow);
  }
}

@media (max-width: 390px) {
  .app-screen {
    padding-inline: 14px;
  }

  .detail-meta-card {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
  }

  .auth-logo {
    width: 140px;
    height: 140px;
  }

  .legacy-memory-card {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .legacy-photo {
    width: 82px;
    min-height: 88px;
    height: 100%;
  }

  .legacy-tribute-stage {
    min-height: 228px;
  }

  .detail-photo {
    max-height: 280px;
  }

  .legacy-flower-grid {
    grid-template-columns: 1fr;
  }

  .legacy-tabbar button {
    font-size: 0.56rem;
  }
}
