:root {
  --paper: #fbf8f4;
  --paper-strong: #fffdf9;
  --ink: #2e2528;
  --muted: #8b777c;
  --line: rgba(77, 52, 58, .11);
  --rose: #d77e83;
  --rose-deep: #b95d65;
  --rose-soft: #f1d9d8;
  --cream: #f5ede2;
  --sage: #859b82;
  --gold: #bd8b52;
  --shadow: 0 16px 48px rgba(78, 49, 52, .10);
  --shadow-soft: 0 8px 28px rgba(78, 49, 52, .07);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-serif: "Songti SC", "STSong", "Noto Serif SC", serif;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body {
  min-height: 100dvh;
}

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

button {
  color: inherit;
}

button, [role="button"] {
  -webkit-tap-highlight-color: transparent;
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, .66);
  color: var(--ink);
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}

input, select {
  min-height: 50px;
  padding: 0 15px;
}

textarea {
  min-height: 104px;
  padding: 13px 15px;
  resize: vertical;
}

input:focus, textarea:focus, select:focus {
  border-color: rgba(215, 126, 131, .65);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(215, 126, 131, .11);
}

input::placeholder, textarea::placeholder {
  color: #b3a2a6;
}

.app-shell {
  position: relative;
  width: min(100%, 760px);
  min-height: 100dvh;
  margin: 0 auto;
  background:
    radial-gradient(circle at 100% 0%, rgba(241, 217, 216, .55), transparent 31rem),
    radial-gradient(circle at 0% 36%, rgba(225, 232, 217, .35), transparent 24rem),
    var(--paper);
}

.boot-screen {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  min-height: 100dvh;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: .08em;
}

.boot-mark {
  position: relative;
  width: 58px;
  height: 58px;
}

.boot-mark span {
  position: absolute;
  inset: 7px 19px 7px 9px;
  border: 1.5px solid var(--rose);
  border-radius: 60% 40% 60% 40%;
  transform: rotate(-38deg);
  animation: breathe 1.7s ease-in-out infinite;
}

.boot-mark span:last-child {
  inset: 7px 9px 7px 19px;
  transform: rotate(38deg);
  animation-delay: .35s;
}

@keyframes breathe {
  0%, 100% { opacity: .28; transform: scale(.94) rotate(-38deg); }
  50% { opacity: .9; transform: scale(1.05) rotate(-38deg); }
}

.boot-mark span:last-child {
  animation-name: breatheReverse;
}

@keyframes breatheReverse {
  0%, 100% { opacity: .28; transform: scale(.94) rotate(38deg); }
  50% { opacity: .9; transform: scale(1.05) rotate(38deg); }
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: calc(64px + var(--safe-top));
  padding: calc(14px + var(--safe-top)) 22px 10px;
  background: linear-gradient(180deg, rgba(251, 248, 244, .96), rgba(251, 248, 244, .82) 72%, transparent);
  backdrop-filter: blur(18px);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-lockup strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: .08em;
}

.brand-lockup small {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .14em;
}

.mini-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(215, 126, 131, .28);
  border-radius: 50%;
  background: rgba(255, 253, 249, .72);
}

.mini-mark svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: var(--rose);
  stroke-width: 1.7;
}

.avatar-button {
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  font-family: var(--font-serif);
  font-size: 15px;
}

.screen {
  min-height: calc(100dvh - 128px);
  padding: 12px 18px calc(120px + var(--safe-bottom));
}

.page-enter {
  animation: pageIn .42s cubic-bezier(.2, .75, .25, 1) both;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: none; }
}

.tabbar {
  position: fixed;
  z-index: 30;
  bottom: calc(8px + var(--safe-bottom));
  left: 50%;
  display: grid;
  width: min(calc(100% - 28px), 500px);
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 7px;
  border: 1px solid rgba(74, 49, 55, .08);
  border-radius: 22px;
  background: rgba(255, 253, 249, .91);
  box-shadow: 0 12px 40px rgba(74, 49, 55, .14);
  transform: translateX(-50%);
  backdrop-filter: blur(22px);
}

.tab-button {
  display: grid;
  min-height: 54px;
  place-items: center;
  align-content: center;
  gap: 3px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: #9d898e;
  font-size: 10px;
  transition: color .2s, background .2s, transform .2s;
}

.tab-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
}

.tab-button.is-active {
  background: var(--rose-soft);
  color: var(--rose-deep);
}

.tab-button:active {
  transform: scale(.96);
}

.quick-add {
  position: fixed;
  z-index: 35;
  right: max(22px, calc((100vw - 700px) / 2));
  bottom: calc(88px + var(--safe-bottom));
  display: grid;
  width: 55px;
  height: 55px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  box-shadow: 0 14px 34px rgba(46, 37, 40, .24);
  transition: transform .2s, box-shadow .2s;
}

.quick-add svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.quick-add:active {
  transform: scale(.93);
}

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

.section-heading:first-child {
  margin-top: 8px;
}

.section-heading h2, .section-heading h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: .03em;
}

.section-heading p, .section-heading span {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.text-button {
  padding: 8px 0;
  border: 0;
  background: none;
  color: var(--rose-deep);
  font-size: 12px;
}

.hero-card {
  position: relative;
  overflow: hidden;
  padding: 26px 24px 24px;
  border-radius: var(--radius-xl);
  background: var(--ink);
  color: #fffaf4;
  box-shadow: var(--shadow);
}

.hero-card::before {
  position: absolute;
  top: -58px;
  right: -42px;
  width: 180px;
  height: 180px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 47% 53% 55% 45%;
  content: "";
  transform: rotate(28deg);
}

.hero-card::after {
  position: absolute;
  right: 22px;
  bottom: 18px;
  width: 48px;
  height: 24px;
  border-top: 1px solid rgba(255, 255, 255, .22);
  border-radius: 50%;
  content: "";
  transform: rotate(-14deg);
}

.hero-eyebrow {
  margin: 0 0 10px;
  color: rgba(255, 250, 244, .64);
  font-size: 11px;
  letter-spacing: .14em;
}

.hero-days {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  font-family: var(--font-serif);
}

.hero-days strong {
  font-size: clamp(45px, 15vw, 68px);
  font-weight: 500;
  letter-spacing: -.04em;
  line-height: .95;
}

.hero-days span {
  color: rgba(255, 250, 244, .72);
  font-size: 13px;
}

.hero-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, .12);
}

.hero-foot p {
  margin: 0;
  color: rgba(255, 250, 244, .68);
  font-size: 11px;
  line-height: 1.6;
}

.hero-countdown {
  flex: 0 0 auto;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
  font-size: 11px;
}

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

.moment-card {
  position: relative;
  overflow: hidden;
  min-height: 210px;
  border: 0;
  border-radius: var(--radius-lg);
  background: #e8dfd6;
  box-shadow: var(--shadow-soft);
  text-align: left;
}

.moment-card:nth-child(5n + 1) {
  grid-column: span 2;
  min-height: 275px;
}

.moment-card img, .moment-card video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .45s cubic-bezier(.2, .75, .25, 1);
}

.moment-card:active img, .moment-card:active video {
  transform: scale(1.025);
}

.moment-card::after {
  position: absolute;
  inset: 42% 0 0;
  background: linear-gradient(transparent, rgba(27, 20, 22, .72));
  content: "";
  pointer-events: none;
}

.moment-copy {
  position: absolute;
  z-index: 2;
  right: 14px;
  bottom: 13px;
  left: 14px;
  color: white;
}

.moment-copy strong {
  display: block;
  overflow: hidden;
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.moment-copy small {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, .72);
  font-size: 10px;
}

.moment-type {
  position: absolute;
  z-index: 3;
  top: 11px;
  left: 11px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(31, 23, 25, .46);
  color: white;
  font-size: 9px;
  backdrop-filter: blur(8px);
}

.moment-type svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.empty-state {
  display: grid;
  min-height: 300px;
  place-items: center;
  align-content: center;
  padding: 30px;
  border: 1px dashed rgba(77, 52, 58, .17);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, .35);
  text-align: center;
}

.empty-state .empty-heart {
  display: grid;
  width: 68px;
  height: 68px;
  margin-bottom: 16px;
  place-items: center;
  border-radius: 50%;
  background: var(--rose-soft);
  color: var(--rose-deep);
}

.empty-state svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
}

.empty-state h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
}

.empty-state p {
  max-width: 260px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.anniversary-list {
  display: grid;
  gap: 11px;
}

.anniversary-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 249, .78);
  box-shadow: var(--shadow-soft);
}

.date-tile {
  display: grid;
  width: 70px;
  height: 74px;
  place-items: center;
  align-content: center;
  border-radius: 18px;
  background: var(--cream);
  color: var(--rose-deep);
}

.date-tile strong {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
}

.date-tile span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.anniversary-info {
  min-width: 0;
}

.anniversary-info h3 {
  overflow: hidden;
  margin: 0;
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.anniversary-info p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.anniversary-count {
  color: var(--rose-deep);
  font-size: 11px;
  white-space: nowrap;
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .58);
}

.icon-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.icon-button.danger {
  color: #ac5558;
}

.profile-hero {
  display: grid;
  place-items: center;
  padding: 28px 20px 22px;
  text-align: center;
}

.couple-marks {
  position: relative;
  width: 112px;
  height: 70px;
  margin-bottom: 18px;
}

.initial-bubble {
  position: absolute;
  top: 4px;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 3px solid var(--paper);
  border-radius: 50%;
  font-family: var(--font-serif);
  font-size: 19px;
}

.initial-bubble:first-child {
  left: 5px;
  background: var(--rose-soft);
  color: var(--rose-deep);
}

.initial-bubble:last-child {
  right: 5px;
  background: #dfe8dc;
  color: #5f765d;
}

.profile-hero h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 600;
}

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

.settings-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 249, .78);
  box-shadow: var(--shadow-soft);
}

.settings-row {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 58px;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}

.settings-row:last-child {
  border-bottom: 0;
}

.settings-row strong {
  display: block;
  font-size: 13px;
  font-weight: 500;
}

.settings-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.settings-row svg {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.copy-code {
  padding: 8px 11px;
  border: 0;
  border-radius: 10px;
  background: var(--cream);
  color: var(--rose-deep);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  letter-spacing: .12em;
}

.button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  border: 0;
  border-radius: 16px;
  background: var(--ink);
  color: white;
  font-size: 13px;
  font-weight: 500;
  transition: transform .2s, opacity .2s, box-shadow .2s;
}

.button:active {
  transform: scale(.97);
}

.button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.button.full {
  width: 100%;
}

.button.secondary {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .66);
  color: var(--ink);
}

.button.rose {
  background: var(--rose);
}

.button.ghost {
  min-height: 42px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.onboarding {
  min-height: 100dvh;
  padding: calc(34px + var(--safe-top)) 24px calc(32px + var(--safe-bottom));
  background:
    radial-gradient(circle at 50% 2%, rgba(241, 217, 216, .85), transparent 22rem),
    var(--paper);
}

.onboarding-wrap {
  width: min(100%, 440px);
  margin: 0 auto;
}

.onboarding-logo {
  display: grid;
  place-items: center;
  padding-top: 3vh;
  text-align: center;
}

.logo-orbit {
  position: relative;
  display: grid;
  width: 92px;
  height: 92px;
  margin-bottom: 19px;
  place-items: center;
  border: 1px solid rgba(215, 126, 131, .25);
  border-radius: 50%;
  background: rgba(255, 253, 249, .64);
  box-shadow: var(--shadow-soft);
}

.logo-orbit::before, .logo-orbit::after {
  position: absolute;
  width: 45px;
  height: 65px;
  border: 1.5px solid var(--rose);
  border-radius: 70% 30% 65% 35%;
  content: "";
  opacity: .8;
}

.logo-orbit::before { transform: translateX(-8px) rotate(-38deg); }
.logo-orbit::after { transform: translateX(8px) rotate(38deg); }

.onboarding-logo h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 31px;
  font-weight: 600;
  letter-spacing: .09em;
}

.onboarding-logo p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .06em;
}

.onboarding-card {
  margin-top: 30px;
  padding: 20px;
  border: 1px solid rgba(77, 52, 58, .08);
  border-radius: var(--radius-xl);
  background: rgba(255, 253, 249, .84);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 15px;
  background: rgba(235, 226, 217, .62);
}

.segmented button {
  min-height: 43px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.segmented button.is-active {
  background: var(--paper-strong);
  color: var(--ink);
  box-shadow: 0 4px 14px rgba(78, 49, 52, .08);
}

.form-stack {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  padding-left: 4px;
  color: #746267;
  font-size: 11px;
}

.field-note {
  margin: 6px 4px 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.form-error {
  display: none;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8e2e1;
  color: #9a464b;
  font-size: 11px;
  line-height: 1.5;
}

.form-error.is-visible {
  display: block;
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(33, 24, 27, .36);
  backdrop-filter: blur(5px);
  animation: fadeIn .22s ease both;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.sheet {
  width: min(100%, 720px);
  max-height: calc(94dvh - var(--safe-top));
  overflow: auto;
  padding: 10px 20px calc(24px + var(--safe-bottom));
  border-radius: 28px 28px 0 0;
  background: var(--paper);
  box-shadow: 0 -20px 60px rgba(36, 25, 28, .18);
  animation: sheetUp .34s cubic-bezier(.2, .8, .25, 1) both;
}

@keyframes sheetUp {
  from { transform: translateY(100%); }
  to { transform: none; }
}

.sheet-handle {
  width: 38px;
  height: 4px;
  margin: 0 auto 15px;
  border-radius: 999px;
  background: rgba(77, 52, 58, .15);
}

.sheet-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 19px;
}

.sheet-header h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
}

.sheet-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.close-button {
  display: grid;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, .6);
}

.close-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.picker-zone {
  position: relative;
  display: grid;
  min-height: 178px;
  place-items: center;
  align-content: center;
  gap: 8px;
  overflow: hidden;
  padding: 24px;
  border: 1px dashed rgba(185, 93, 101, .34);
  border-radius: var(--radius-lg);
  background: rgba(241, 217, 216, .26);
  text-align: center;
}

.picker-zone.has-preview {
  min-height: 225px;
  padding: 0;
  border-style: solid;
  border-color: transparent;
  background: #eadfd9;
}

.picker-zone input[type="file"] {
  position: absolute;
  z-index: 3;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.picker-zone img, .picker-zone video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.picker-zone.has-preview::after {
  position: absolute;
  inset: 50% 0 0;
  background: linear-gradient(transparent, rgba(32, 23, 25, .52));
  content: "";
}

.picker-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .75);
  color: var(--rose-deep);
  box-shadow: 0 6px 20px rgba(80, 49, 54, .08);
}

.picker-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.picker-zone strong {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 600;
}

.picker-zone small {
  color: var(--muted);
  font-size: 10px;
}

.picker-caption {
  position: absolute;
  z-index: 4;
  right: 15px;
  bottom: 13px;
  left: 15px;
  color: white;
  font-size: 11px;
  text-align: left;
}

.live-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.live-pair .picker-zone {
  min-height: 145px;
}

.live-pair .picker-zone.has-preview {
  min-height: 145px;
}

.upload-progress {
  display: none;
  margin-top: 14px;
  padding: 13px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .7);
}

.upload-progress.is-visible {
  display: block;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 10px;
}

.progress-track {
  overflow: hidden;
  height: 5px;
  border-radius: 999px;
  background: #eaded9;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--rose), #e3aaa3);
  transition: width .25s ease;
}

.media-viewer {
  position: fixed;
  z-index: 150;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: rgba(24, 18, 20, .96);
  color: white;
  animation: fadeIn .22s ease both;
}

.viewer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: calc(60px + var(--safe-top));
  padding: calc(10px + var(--safe-top)) 16px 8px;
}

.viewer-top strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 500;
}

.viewer-top small {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, .58);
  font-size: 10px;
}

.viewer-top .close-button {
  border-color: rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .08);
  color: white;
}

.viewer-stage {
  display: grid;
  min-height: 0;
  place-items: center;
  overflow: hidden;
  padding: 8px;
}

.viewer-stage img, .viewer-stage video {
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  object-fit: contain;
}

.viewer-foot {
  padding: 14px 20px calc(22px + var(--safe-bottom));
  background: linear-gradient(transparent, rgba(16, 12, 13, .88));
}

.viewer-note {
  margin: 0;
  color: rgba(255, 255, 255, .82);
  font-family: var(--font-serif);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.viewer-actions {
  display: flex;
  gap: 9px;
  margin-top: 13px;
}

.viewer-actions button {
  min-height: 39px;
  flex: 1;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 12px;
  background: rgba(255, 255, 255, .08);
  color: white;
  font-size: 11px;
}

.live-hint {
  position: absolute;
  z-index: 4;
  top: 12px;
  right: 12px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(22, 16, 18, .5);
  color: white;
  font-size: 9px;
  backdrop-filter: blur(8px);
}

.install-note {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(189, 139, 82, .18);
  border-radius: var(--radius-lg);
  background: rgba(245, 237, 226, .64);
}

.install-note h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 15px;
}

.install-note p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.toast-region {
  position: fixed;
  z-index: 200;
  top: calc(17px + var(--safe-top));
  left: 50%;
  display: grid;
  gap: 8px;
  width: min(calc(100% - 36px), 420px);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  padding: 12px 15px;
  border-radius: 14px;
  background: rgba(39, 29, 32, .93);
  color: white;
  box-shadow: 0 12px 32px rgba(30, 20, 23, .2);
  font-size: 12px;
  text-align: center;
  animation: toastIn .26s ease both;
  backdrop-filter: blur(12px);
}

.toast.is-leaving {
  animation: toastOut .22s ease both;
}

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

@keyframes toastOut {
  to { opacity: 0; transform: translateY(-8px); }
}

.offline-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--gold);
}

.offline-badge::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

@media (min-width: 620px) {
  .screen {
    padding-right: 28px;
    padding-left: 28px;
  }

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

  .moment-card:nth-child(5n + 1) {
    grid-column: span 2;
  }

  .onboarding-card {
    padding: 26px;
  }
}

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

[hidden] {
  display: none !important;
}

