:root {
  --paper: #fbf8f4;
  --paper-soft: #f7f1ec;
  --surface: #fffdfa;
  --surface-strong: #ffffff;
  --ink: #352b32;
  --ink-soft: #74666f;
  --muted: #9d8e96;
  --line: #eadfdf;
  --line-strong: #ddcdd1;
  --rose: #bd5e79;
  --rose-deep: #8f3f59;
  --rose-soft: #f4dfe6;
  --blush: #f8e9ed;
  --lilac: #8d779e;
  --lilac-soft: #eee7f1;
  --sage: #6f8978;
  --sage-soft: #e4ece6;
  --gold: #a97841;
  --gold-soft: #f2e7d5;
  --danger: #a64b4b;
  --shadow-sm: 0 5px 18px rgba(72, 45, 57, 0.07);
  --shadow-md: 0 16px 45px rgba(72, 45, 57, 0.11);
  --shadow-float: 0 24px 80px rgba(61, 39, 49, 0.2);
  --radius: 8px;
  --radius-pill: 999px;
  --header-height: 76px;
  --page-width: 1160px;
  --font-body: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --font-display: "STKaiti", "KaiTi", "Songti SC", "Noto Serif SC", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, #fbf5f1 0, var(--paper) 340px, #f8f4f0 100%);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.modal-open {
  overflow: hidden;
}

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

button {
  color: inherit;
}

button,
label[for] {
  -webkit-tap-highlight-color: transparent;
}

button:not(:disabled),
label[for] {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.6;
}

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

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

[hidden] {
  display: none !important;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

#particle-canvas {
  position: fixed;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.42;
}

.brand-mark {
  display: inline-grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, var(--rose), var(--rose-deep));
  border-radius: 50%;
  box-shadow: 0 8px 22px rgba(143, 63, 89, 0.25);
}

.brand-mark svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  stroke-width: 1.2;
}

.brand-mark-large {
  width: 54px;
  height: 54px;
  flex-basis: 54px;
}

.brand-mark-large svg {
  width: 24px;
  height: 24px;
}

.brand-copy {
  display: grid;
  min-width: 0;
  text-align: left;
  line-height: 1.3;
}

.brand-copy strong {
  max-width: 310px;
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--rose);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.primary-button,
.soft-button,
.danger-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius);
  font-weight: 650;
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.primary-button {
  color: #fff;
  background: var(--rose-deep);
  box-shadow: 0 8px 20px rgba(143, 63, 89, 0.18);
}

.primary-button:hover {
  background: #7f344c;
  box-shadow: 0 10px 26px rgba(143, 63, 89, 0.24);
  transform: translateY(-1px);
}

.primary-button.is-loading .spin-icon {
  animation: spin 900ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.primary-button:active,
.soft-button:active,
.danger-button:active {
  transform: translateY(1px);
}

.primary-button svg,
.soft-button svg,
.danger-button svg {
  width: 17px;
  height: 17px;
}

.soft-button {
  color: var(--ink);
  background: var(--paper-soft);
  border: 1px solid var(--line);
}

.soft-button:hover {
  background: #f1e8e4;
}

.danger-button {
  color: #fff;
  background: var(--danger);
}

.icon-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  padding: 0;
  place-items: center;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 50%;
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease;
}

.icon-button:hover {
  color: var(--rose-deep);
  background: var(--blush);
  border-color: var(--line);
}

.icon-button svg {
  width: 19px;
  height: 19px;
}

.boot-screen {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 15px;
  color: var(--ink-soft);
  background: var(--paper);
  transition: opacity 420ms ease, visibility 420ms ease;
}

body:not(.is-booting) .boot-screen {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.boot-screen p {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.08em;
}

.boot-line {
  width: 100px;
  height: 2px;
  overflow: hidden;
  background: var(--line);
  border-radius: var(--radius-pill);
}

.boot-line i {
  display: block;
  width: 45%;
  height: 100%;
  background: var(--rose);
  border-radius: inherit;
  animation: boot-slide 1.1s ease-in-out infinite;
}

@keyframes boot-slide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(240%); }
}

.login-screen {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 28px;
}

.login-backdrop {
  position: fixed;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(116deg, rgba(244, 223, 230, 0.9) 0%, rgba(251, 248, 244, 0.94) 51%, rgba(232, 237, 229, 0.82) 100%);
}

.login-backdrop::after {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(123, 91, 105, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(123, 91, 105, 0.045) 1px, transparent 1px);
  background-size: 34px 34px;
  content: "";
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.36), transparent 75%);
}

.login-shell {
  display: grid;
  width: min(1060px, 100%);
  min-height: calc(100vh - 56px);
  margin: 0 auto;
  overflow: hidden;
  background: rgba(255, 253, 250, 0.9);
  border: 1px solid rgba(218, 199, 204, 0.75);
  border-radius: var(--radius);
  box-shadow: var(--shadow-float);
  grid-template-columns: minmax(0, 1.08fr) minmax(370px, 0.92fr);
  backdrop-filter: blur(18px);
}

.login-story {
  position: relative;
  display: flex;
  min-height: 640px;
  flex-direction: column;
  justify-content: space-between;
  padding: 44px 46px;
  overflow: hidden;
  color: #fff9f6;
  background: #4e3a43;
}

.login-story::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.08), transparent 42%),
    linear-gradient(0deg, rgba(47, 25, 34, 0.38), transparent 55%);
  content: "";
}

.login-story::after {
  position: absolute;
  right: -48px;
  bottom: 104px;
  width: 205px;
  height: 205px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  content: "";
}

.login-story-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 13px;
}

.login-story-top > span:last-child {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
}

.login-story .brand-mark {
  color: var(--rose-deep);
  background: #fff8f5;
  box-shadow: none;
}

.login-photo {
  position: relative;
  z-index: 1;
  width: min(82%, 420px);
  margin: 30px auto;
  padding: 12px 12px 38px;
  background: #fffaf6;
  border-radius: 4px;
  box-shadow: 0 30px 60px rgba(22, 9, 16, 0.28);
  transform: rotate(-3deg);
}

.login-photo img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 2px;
  object-fit: cover;
}

.photo-label {
  position: absolute;
  right: 16px;
  bottom: 8px;
  color: #73565f;
  font-family: var(--font-display);
  font-size: 16px;
  transform: rotate(2deg);
}

.login-story blockquote {
  position: relative;
  z-index: 1;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(18px, 2.2vw, 25px);
  line-height: 1.7;
}

.login-story blockquote > span {
  position: absolute;
  top: -31px;
  left: -13px;
  color: rgba(255, 255, 255, 0.2);
  font-family: Georgia, serif;
  font-size: 74px;
  line-height: 1;
}

.login-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 54px clamp(34px, 5vw, 72px) 32px;
}

.login-panel-inner {
  width: 100%;
  max-width: 390px;
  margin: auto;
}

.login-eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
  color: var(--rose);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.2em;
}

.login-eyebrow i {
  width: 24px;
  height: 1px;
  background: currentColor;
}

.login-panel h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(29px, 4vw, 39px);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.015em;
  overflow-wrap: anywhere;
}

.login-intro {
  margin: 15px 0 32px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.85;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 650;
}

.password-field {
  position: relative;
}

.password-field input {
  width: 100%;
  height: 52px;
  padding: 0 50px 0 45px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  outline: none;
  transition: border 180ms ease, box-shadow 180ms ease;
}

.password-field input:focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 4px rgba(189, 94, 121, 0.11);
}

.field-icon {
  position: absolute;
  top: 50%;
  left: 15px;
  width: 18px;
  height: 18px;
  color: var(--muted);
  transform: translateY(-50%);
}

.field-action {
  position: absolute;
  top: 50%;
  right: 7px;
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 50%;
  transform: translateY(-50%);
}

.field-action svg {
  width: 18px;
  height: 18px;
}

.field-action .eye-closed,
.field-action.is-visible .eye-open {
  display: none;
}

.field-action.is-visible .eye-closed {
  display: block;
}

.form-message {
  min-height: 22px;
  margin: 7px 0;
  color: var(--danger);
  font-size: 12px;
}

.form-message.is-success {
  color: var(--sage);
}

.login-submit {
  width: 100%;
  min-height: 52px;
  margin-top: 4px;
  font-size: 15px;
}

.login-submit > span {
  flex: 1;
  text-align: center;
}

.login-submit svg {
  fill: currentColor;
}

.privacy-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.privacy-note svg {
  width: 13px;
  height: 13px;
}

.login-footer {
  margin: 50px 0 0;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-align: center;
}

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.app-header {
  position: sticky;
  z-index: 20;
  top: 0;
  background: rgba(251, 248, 244, 0.88);
  border-bottom: 1px solid rgba(226, 212, 214, 0.9);
  backdrop-filter: blur(17px);
}

.header-inner {
  display: grid;
  width: min(var(--page-width), calc(100% - 44px));
  height: var(--header-height);
  margin: 0 auto;
  align-items: center;
  gap: 25px;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
  padding: 0;
  background: transparent;
  border: 0;
}

.brand .brand-mark {
  width: 36px;
  height: 36px;
  flex-basis: 36px;
}

.brand .brand-mark svg {
  width: 16px;
  height: 16px;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  background: rgba(245, 239, 235, 0.88);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.nav-item {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 13px;
  white-space: nowrap;
}

.nav-item svg {
  width: 15px;
  height: 15px;
}

.nav-item:hover {
  color: var(--rose-deep);
}

.nav-item.is-active {
  color: var(--rose-deep);
  background: var(--surface);
  box-shadow: 0 2px 9px rgba(66, 43, 53, 0.09);
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.new-post-button {
  min-height: 40px;
  margin-right: 3px;
  padding: 0 15px;
  font-size: 13px;
}

.app-main {
  min-height: calc(100vh - var(--header-height));
}

.app-page {
  padding: 52px 0 80px;
}

.page-width {
  width: min(var(--page-width), calc(100% - 44px));
  margin: 0 auto;
}

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

.welcome-row h1,
.page-heading h1 {
  max-width: 740px;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(27px, 3.2vw, 38px);
  font-weight: 700;
  line-height: 1.38;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}

.page-heading > div > p:last-child {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
}

.mobile-new-post {
  display: none;
}

.together-banner {
  position: relative;
  display: grid;
  min-height: 176px;
  margin-bottom: 28px;
  padding: 29px 34px;
  align-items: center;
  overflow: hidden;
  background:
    linear-gradient(112deg, #efd8df 0%, #f7ece7 53%, #e5ece5 100%);
  border: 1px solid rgba(221, 197, 202, 0.85);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  grid-template-columns: minmax(0, 1fr) 1px minmax(250px, 0.54fr);
  gap: 34px;
}

.together-banner::after {
  position: absolute;
  top: 0;
  right: 0;
  width: 42%;
  height: 100%;
  background-image: linear-gradient(90deg, transparent 49%, rgba(255, 255, 255, 0.35) 50%, transparent 51%);
  background-size: 20px 20px;
  content: "";
  opacity: 0.5;
  pointer-events: none;
}

.together-copy,
.anniversary-mini {
  position: relative;
  z-index: 1;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  color: var(--rose-deep);
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-pill);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.live-pill i {
  width: 5px;
  height: 5px;
  background: var(--rose);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(189, 94, 121, 0.12);
}

.together-copy > p {
  margin: 12px 0 3px;
  color: var(--ink-soft);
  font-size: 13px;
}

.duration-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
}

.duration-row strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 4.2vw, 50px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.duration-row span {
  margin-right: 9px;
  color: var(--ink-soft);
  font-size: 12px;
}

.together-copy > small {
  color: var(--ink-soft);
  font-size: 11px;
}

.together-divider {
  width: 1px;
  height: 96px;
  background: rgba(120, 89, 101, 0.18);
}

.anniversary-mini {
  display: flex;
  align-items: center;
  gap: 16px;
}

.round-icon {
  display: inline-grid;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  place-items: center;
  color: var(--rose-deep);
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
}

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

.anniversary-mini p {
  margin: 0 0 3px;
  color: var(--ink-soft);
  font-size: 12px;
}

.anniversary-mini strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  font-weight: 500;
  line-height: 1.2;
}

.anniversary-mini strong em {
  font-family: var(--font-body);
  font-size: 12px;
  font-style: normal;
  font-weight: 500;
}

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

.banner-heart {
  position: absolute;
  z-index: 0;
  color: rgba(143, 63, 89, 0.07);
}

.banner-heart svg {
  fill: currentColor;
  stroke: none;
}

.banner-heart-left {
  top: 10px;
  left: 43%;
}

.banner-heart-left svg {
  width: 70px;
  height: 70px;
  transform: rotate(-18deg);
}

.banner-heart-right {
  right: 35px;
  bottom: -14px;
}

.banner-heart-right svg {
  width: 100px;
  height: 100px;
  transform: rotate(13deg);
}

.content-grid {
  display: grid;
  align-items: start;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) 292px;
}

.feed-column {
  min-width: 0;
}

.composer-entry {
  display: flex;
  width: 100%;
  min-height: 72px;
  align-items: center;
  gap: 13px;
  padding: 12px 15px;
  color: var(--muted);
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: border-color 180ms ease, transform 180ms ease;
}

.composer-entry:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.avatar-heart {
  display: inline-grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  color: var(--rose);
  background: var(--blush);
  border-radius: 50%;
}

.avatar-heart svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.composer-entry > span:nth-child(2) {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-camera {
  display: inline-grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  color: var(--rose);
  background: var(--paper-soft);
  border-radius: 50%;
}

.composer-camera svg {
  width: 17px;
  height: 17px;
}

.section-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 28px 1px 13px;
  color: var(--muted);
  font-size: 11px;
}

.section-line > span:first-child {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
}

.post-list {
  display: grid;
  gap: 15px;
}

.post-card {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  animation: card-in 320ms ease both;
}

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

.post-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.post-avatar {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  color: var(--rose);
  background: linear-gradient(145deg, var(--blush), var(--surface));
  border: 1px solid var(--line);
  border-radius: 50%;
}

.post-avatar svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  stroke-width: 1.2;
}

.post-header > div {
  display: grid;
  min-width: 0;
  flex: 1;
}

.post-header strong {
  font-size: 13px;
  font-weight: 700;
}

.post-header time {
  color: var(--muted);
  font-size: 10px;
}

.post-menu {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 150ms ease, color 150ms ease, background 150ms ease;
}

.post-card:hover .post-menu,
.post-menu:focus-visible {
  opacity: 1;
}

.post-menu:hover {
  color: var(--danger);
  background: #f7eaea;
}

.post-menu svg {
  width: 16px;
  height: 16px;
}

.post-content {
  margin: 14px 0 0;
  color: #4a3d44;
  font-size: 14px;
  line-height: 1.85;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.post-content:empty {
  display: none;
}

.post-photos {
  display: grid;
  margin-top: 14px;
  gap: 5px;
  overflow: hidden;
  border-radius: 6px;
}

.post-photos[data-count="1"] {
  grid-template-columns: 1fr;
}

.post-photos[data-count="2"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.post-photos[data-count="3"],
.post-photos[data-count="4"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.post-photos[data-count="5"],
.post-photos[data-count="6"],
.post-photos[data-count="7"],
.post-photos[data-count="8"],
.post-photos[data-count="9"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.post-photo {
  position: relative;
  display: block;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  background: var(--paper-soft);
  border: 0;
}

.post-photo img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  transition: transform 260ms ease;
}

.post-photos[data-count="1"] .post-photo img {
  max-height: 520px;
  aspect-ratio: 4 / 3;
}

.post-photos[data-count="2"] .post-photo img,
.post-photos[data-count="4"] .post-photo img {
  aspect-ratio: 0.88 / 1;
}

.post-photo:hover img {
  transform: scale(1.018);
}

.post-footer {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 4px;
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.like-button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 12px;
}

.like-button:hover {
  color: var(--rose);
  background: var(--blush);
}

.like-button svg {
  width: 17px;
  height: 17px;
  transition: fill 180ms ease, transform 180ms ease;
}

.like-button.is-liked {
  color: var(--rose-deep);
}

.like-button.is-liked svg {
  fill: currentColor;
  transform: scale(1.08);
}

.like-count {
  color: var(--muted);
  font-size: 11px;
}

.like-count:empty {
  display: none;
}

.feed-aside {
  position: sticky;
  top: calc(var(--header-height) + 24px);
  display: grid;
  gap: 14px;
}

.aside-card {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.aside-icon,
.settings-icon {
  display: inline-grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  color: var(--rose-deep);
  background: var(--rose-soft);
  border-radius: 50%;
}

.aside-icon.lilac,
.settings-icon.lilac {
  color: #6e587f;
  background: var(--lilac-soft);
}

.settings-icon.gold {
  color: var(--gold);
  background: var(--gold-soft);
}

.aside-icon svg,
.settings-icon svg {
  width: 18px;
  height: 18px;
}

.memory-count {
  display: flex;
  align-items: center;
  gap: 12px;
}

.memory-count > div {
  display: grid;
  min-width: 0;
  flex: 1;
}

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

.memory-count strong {
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.35;
}

.memory-count button,
.aside-card-head button {
  padding: 4px;
  color: var(--rose);
  background: transparent;
  border: 0;
  font-size: 10px;
}

.quote-card {
  position: relative;
  overflow: hidden;
  background: #43343c;
  border-color: #43343c;
}

.quote-card::after {
  position: absolute;
  right: -25px;
  bottom: -34px;
  width: 105px;
  height: 105px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  content: "";
}

.quote-mark {
  width: 22px;
  height: 22px;
  color: #e6b8c5;
}

.quote-card p {
  position: relative;
  z-index: 1;
  margin: 12px 0 14px;
  color: #f9eff0;
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.85;
}

.quote-card > span {
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, 0.5);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.aside-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 700;
}

.aside-milestones {
  display: grid;
  gap: 12px;
}

.aside-milestone {
  display: grid;
  align-items: start;
  gap: 10px;
  grid-template-columns: 8px minmax(0, 1fr);
}

.aside-milestone > i {
  width: 7px;
  height: 7px;
  margin-top: 7px;
  background: var(--rose);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--blush);
}

.aside-milestone strong {
  display: block;
  overflow: hidden;
  font-size: 11px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.aside-milestone small {
  color: var(--muted);
  font-size: 9px;
}

.aside-empty {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.empty-state {
  display: grid;
  min-height: 390px;
  padding: 50px 24px;
  place-items: center;
  align-content: center;
  text-align: center;
  background: rgba(255, 253, 250, 0.7);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

.empty-illustration {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  color: var(--rose);
  background: var(--blush);
  border-radius: 50%;
}

.empty-illustration svg {
  width: 28px;
  height: 28px;
}

.empty-state h2 {
  margin: 17px 0 5px;
  font-family: var(--font-display);
  font-size: 23px;
}

.empty-state p {
  margin: 0 0 18px;
  color: var(--ink-soft);
  font-size: 13px;
}

.count-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  flex: 0 0 auto;
  padding: 8px 13px;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 11px;
}

.count-badge strong {
  color: var(--rose-deep);
  font-family: Georgia, serif;
  font-size: 20px;
  font-weight: 500;
}

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

.gallery-item {
  position: relative;
  display: block;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  background: var(--paper-soft);
  border: 0;
  border-radius: 6px;
}

.gallery-item:nth-child(7n + 1) {
  grid-column: span 2;
  grid-row: span 2;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  transition: transform 300ms ease, filter 300ms ease;
}

.gallery-item::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(43, 24, 32, 0.6), transparent 55%);
  content: "";
  opacity: 0;
  transition: opacity 220ms ease;
}

.gallery-item span {
  position: absolute;
  z-index: 1;
  right: 13px;
  bottom: 10px;
  left: 13px;
  overflow: hidden;
  color: #fff;
  font-size: 11px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 220ms ease;
}

.gallery-item:hover img {
  transform: scale(1.025);
  filter: saturate(1.04);
}

.gallery-item:hover::after,
.gallery-item:hover span {
  opacity: 1;
}

.milestone-heading {
  align-items: center;
}

.anniversary-hero {
  display: flex;
  min-height: 130px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 42px;
  padding: 25px 29px;
  color: #fff7f1;
  background: #493741;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.anniversary-hero-copy {
  display: flex;
  align-items: center;
  gap: 16px;
}

.round-icon.light {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
}

.anniversary-hero-copy p {
  margin: 0 0 2px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 11px;
}

.anniversary-hero-copy strong {
  font-family: Georgia, serif;
  font-size: 37px;
  font-weight: 500;
  line-height: 1.2;
}

.anniversary-hero-copy em {
  font-family: var(--font-body);
  font-size: 12px;
  font-style: normal;
}

.anniversary-hero-copy small {
  display: block;
  color: rgba(255, 255, 255, 0.52);
  font-size: 9px;
}

.anniversary-total {
  display: grid;
  justify-items: end;
  color: rgba(255, 255, 255, 0.65);
  font-size: 10px;
}

.anniversary-total strong {
  margin-top: 2px;
  color: #fff;
  font-family: var(--font-display);
  font-size: 22px;
}

.timeline-layout {
  display: grid;
  align-items: start;
  gap: 42px;
  grid-template-columns: minmax(0, 1fr) 270px;
}

.timeline-list {
  position: relative;
  display: grid;
  gap: 0;
  padding-left: 28px;
}

.timeline-list::before {
  position: absolute;
  top: 12px;
  bottom: 0;
  left: 7px;
  width: 1px;
  background: var(--line-strong);
  content: "";
}

.timeline-item {
  position: relative;
  display: grid;
  gap: 18px;
  padding: 0 0 34px;
  grid-template-columns: minmax(0, 1fr) 160px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  top: 8px;
  left: -27px;
  width: 13px;
  height: 13px;
  background: var(--paper);
  border: 3px solid var(--rose);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--paper);
}

.timeline-copy {
  min-width: 0;
  padding-top: 5px;
}

.timeline-date {
  color: var(--rose);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
}

.timeline-copy h2 {
  margin: 5px 0 6px;
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.timeline-copy p {
  max-width: 620px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.85;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.timeline-photo {
  width: 160px;
  aspect-ratio: 1 / 1;
  padding: 0;
  overflow: hidden;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
}

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

.timeline-actions {
  display: flex;
  gap: 3px;
  margin-top: 10px;
  opacity: 0;
  transition: opacity 160ms ease;
}

.timeline-item:hover .timeline-actions,
.timeline-actions:focus-within {
  opacity: 1;
}

.mini-action {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 4px;
  padding: 0 7px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 10px;
}

.mini-action:hover {
  color: var(--rose-deep);
  background: var(--surface);
  border-color: var(--line);
}

.mini-action.danger:hover {
  color: var(--danger);
  background: #f9eded;
  border-color: #efdada;
}

.mini-action svg {
  width: 13px;
  height: 13px;
}

.timeline-aside {
  position: sticky;
  top: calc(var(--header-height) + 25px);
}

.timeline-aside .aside-card {
  padding: 23px;
}

.timeline-aside h3 {
  margin: 15px 0 6px;
  font-family: var(--font-display);
  font-size: 19px;
}

.timeline-aside p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.8;
}

.settings-width {
  max-width: 880px;
}

.settings-form {
  display: grid;
  gap: 16px;
}

.settings-card {
  display: grid;
  padding: 24px;
  gap: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  grid-template-columns: 220px minmax(0, 1fr);
}

.settings-card-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.settings-card-heading h2 {
  margin: 1px 0 4px;
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.4;
}

.settings-card-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

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

.field-span-2 {
  grid-column: span 2;
}

.form-field {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
}

.form-field > span {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 650;
}

.form-field input,
.form-field textarea,
.form-field select,
.composer-modal textarea {
  width: 100%;
  color: var(--ink);
  background: #fdfaf7;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  outline: none;
  transition: border-color 170ms ease, box-shadow 170ms ease, background 170ms ease;
}

.form-field input,
.form-field select {
  height: 44px;
  padding: 0 12px;
}

.form-field textarea,
.composer-modal textarea {
  min-height: 112px;
  padding: 11px 12px;
  line-height: 1.75;
  resize: vertical;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus,
.composer-modal textarea:focus {
  background: #fff;
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(189, 94, 121, 0.1);
}

.form-field small {
  color: var(--muted);
  font-size: 9px;
}

.switch-field {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.switch-field > span {
  display: grid;
}

.switch-field strong {
  font-size: 11px;
}

.switch-field small {
  color: var(--muted);
  font-size: 9px;
}

.switch-field input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch-field i {
  position: relative;
  width: 42px;
  height: 24px;
  flex: 0 0 42px;
  background: #d8cfd1;
  border-radius: var(--radius-pill);
  transition: background 180ms ease;
}

.switch-field i::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(49, 30, 38, 0.2);
  content: "";
  transition: transform 180ms ease;
}

.switch-field input:checked + i {
  background: var(--rose);
}

.switch-field input:checked + i::after {
  transform: translateX(18px);
}

.settings-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding: 3px 0;
}

.settings-actions .form-message {
  flex: 1;
  margin: 0;
  text-align: right;
}

.storage-note {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-top: 22px;
  padding: 18px 20px;
  color: var(--ink-soft);
  background: var(--sage-soft);
  border: 1px solid #d9e4dc;
  border-radius: var(--radius);
}

.storage-note .round-icon {
  width: 37px;
  height: 37px;
  flex-basis: 37px;
  color: var(--sage);
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(255, 255, 255, 0.7);
}

.storage-note strong {
  font-size: 11px;
}

.storage-note p {
  margin: 2px 0 0;
  font-size: 10px;
}

.storage-note code {
  padding: 1px 4px;
  color: #4e6857;
  background: rgba(255, 255, 255, 0.58);
  border-radius: 3px;
}

.mobile-nav {
  display: none;
}

.modal {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: grid;
  padding: 20px;
  place-items: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(46, 32, 39, 0.5);
  backdrop-filter: blur(6px);
  animation: fade-in 180ms ease both;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(620px, 100%);
  max-height: calc(100vh - 40px);
  padding: 25px;
  overflow: auto;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: var(--radius);
  box-shadow: var(--shadow-float);
  animation: modal-in 240ms ease both;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

.modal-header .eyebrow {
  margin-bottom: 2px;
}

.modal-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 25px;
  line-height: 1.4;
}

.modal-close {
  margin: -5px -5px 0 0;
}

.composer-modal textarea {
  min-height: 180px;
  padding: 15px;
  background: #fcf8f5;
  font-size: 15px;
}

.upload-preview {
  display: grid;
  margin-top: 13px;
  gap: 6px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.upload-preview-item {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: var(--paper-soft);
  border-radius: 5px;
}

.upload-preview-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.upload-preview-item button {
  position: absolute;
  top: 5px;
  right: 5px;
  display: grid;
  width: 24px;
  height: 24px;
  padding: 0;
  place-items: center;
  color: #fff;
  background: rgba(41, 25, 33, 0.68);
  border: 0;
  border-radius: 50%;
  backdrop-filter: blur(5px);
}

.upload-preview-item button svg {
  width: 12px;
  height: 12px;
}

.compose-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.compose-tools {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.photo-picker {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  color: var(--rose-deep);
  background: var(--blush);
  border: 1px solid var(--rose-soft);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 650;
}

.photo-picker svg {
  width: 16px;
  height: 16px;
}

.compose-tools > span {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.milestone-modal .field-span-2:nth-last-of-type(1) {
  margin-bottom: 0;
}

.lightbox {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  padding: 54px 74px;
  place-items: center;
  color: #fff;
  background: rgba(27, 18, 23, 0.94);
  backdrop-filter: blur(12px);
}

.lightbox figure {
  display: grid;
  width: 100%;
  height: 100%;
  margin: 0;
  justify-items: center;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 14px;
}

.lightbox img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
}

.lightbox figcaption {
  display: flex;
  width: min(760px, 100%);
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 11px;
}

.lightbox figcaption > span {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.lightbox figcaption small {
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.45);
}

.lightbox-close,
.lightbox-arrow {
  position: absolute;
  z-index: 1;
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
  backdrop-filter: blur(8px);
}

.lightbox-close:hover,
.lightbox-arrow:hover {
  background: rgba(255, 255, 255, 0.15);
}

.lightbox-close {
  top: 18px;
  right: 18px;
}

.lightbox-prev {
  top: 50%;
  left: 18px;
  transform: translateY(-50%);
}

.lightbox-next {
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
}

.lightbox-arrow[disabled] {
  visibility: hidden;
}

.lightbox-arrow svg,
.lightbox-close svg {
  width: 20px;
  height: 20px;
}

.confirm-modal {
  width: min(390px, 100%);
  padding: 30px;
  text-align: center;
}

.confirm-icon {
  display: grid;
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  place-items: center;
  color: var(--danger);
  background: #f8e8e8;
  border-radius: 50%;
}

.confirm-icon svg {
  width: 21px;
  height: 21px;
}

.confirm-modal h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 23px;
}

.confirm-modal p {
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.confirm-modal .modal-actions {
  justify-content: center;
}

.toast-region {
  position: fixed;
  z-index: 110;
  top: 20px;
  left: 50%;
  display: grid;
  width: min(360px, calc(100% - 32px));
  gap: 8px;
  pointer-events: none;
  transform: translateX(-50%);
}

.toast {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  color: #fff;
  background: rgba(58, 43, 51, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  box-shadow: var(--shadow-md);
  font-size: 12px;
  animation: toast-in 220ms ease both;
  backdrop-filter: blur(10px);
}

.toast::before {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  background: #deb1c0;
  border-radius: 50%;
  content: "";
}

.toast.is-error::before {
  background: #e18989;
}

.toast.is-success::before {
  background: #9fc0a8;
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(-5px);
  transition: opacity 180ms ease, transform 180ms ease;
}

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

.skeleton {
  position: relative;
  overflow: hidden;
  background: #f0e9e5;
}

.skeleton::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.56), transparent);
  content: "";
  transform: translateX(-100%);
  animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
  to { transform: translateX(100%); }
}

:focus-visible {
  outline: 2px solid var(--rose);
  outline-offset: 3px;
}

@media (max-width: 1050px) {
  .header-inner {
    gap: 14px;
    grid-template-columns: minmax(180px, 1fr) auto minmax(170px, 1fr);
  }

  .nav-item {
    padding: 0 9px;
  }

  .brand-copy strong {
    max-width: 210px;
  }

  .content-grid {
    grid-template-columns: minmax(0, 1fr) 260px;
  }

  .settings-card {
    grid-template-columns: 190px minmax(0, 1fr);
  }
}

@media (max-width: 880px) {
  :root {
    --header-height: 66px;
  }

  .login-screen {
    padding: 20px;
  }

  .login-shell {
    min-height: calc(100vh - 40px);
    grid-template-columns: 1fr;
  }

  .login-story {
    min-height: 235px;
    padding: 22px 24px;
  }

  .login-story::after {
    display: none;
  }

  .login-story-top {
    position: absolute;
    top: 22px;
    left: 24px;
  }

  .login-story .brand-mark {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .login-photo {
    width: min(66%, 330px);
    margin: 17px auto 15px;
    padding: 8px 8px 30px;
  }

  .login-story blockquote {
    display: none;
  }

  .login-panel {
    justify-content: flex-start;
    padding: 34px clamp(24px, 8vw, 60px) 24px;
  }

  .login-panel-inner {
    max-width: 440px;
  }

  .login-footer {
    margin-top: 30px;
  }

  .desktop-nav {
    display: none;
  }

  .header-inner {
    display: flex;
    width: calc(100% - 28px);
    justify-content: space-between;
  }

  .brand-copy strong {
    max-width: 42vw;
  }

  .new-post-button {
    display: none;
  }

  .app-page {
    padding: 32px 0 104px;
  }

  .page-width {
    width: calc(100% - 28px);
  }

  .content-grid {
    display: block;
  }

  .feed-aside {
    position: static;
    display: none;
  }

  .mobile-new-post {
    display: inline-flex;
    min-height: 40px;
    padding: 0 13px;
    flex: 0 0 auto;
  }

  .welcome-row h1,
  .page-heading h1 {
    font-size: clamp(25px, 5vw, 32px);
  }

  .together-banner {
    grid-template-columns: minmax(0, 1fr) 1px 210px;
    gap: 22px;
    padding: 24px;
  }

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

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

  .timeline-aside {
    display: none;
  }

  .settings-width {
    max-width: 720px;
  }

  .settings-card {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .mobile-nav {
    position: fixed;
    z-index: 30;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    height: calc(64px + env(safe-area-inset-bottom));
    padding: 5px 10px env(safe-area-inset-bottom);
    align-items: center;
    background: rgba(255, 253, 250, 0.94);
    border-top: 1px solid var(--line);
    box-shadow: 0 -10px 35px rgba(68, 43, 54, 0.08);
    grid-template-columns: repeat(5, 1fr);
    backdrop-filter: blur(16px);
  }

  .mobile-nav-item {
    display: grid;
    height: 52px;
    padding: 4px;
    place-content: center;
    justify-items: center;
    gap: 2px;
    color: var(--muted);
    background: transparent;
    border: 0;
    font-size: 9px;
  }

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

  .mobile-nav-item.is-active {
    color: var(--rose-deep);
  }

  .mobile-nav-item.is-active svg {
    fill: currentColor;
    stroke-width: 1.4;
  }

  .mobile-compose {
    display: grid;
    width: 48px;
    height: 48px;
    margin: -24px auto 0;
    padding: 0;
    place-items: center;
    color: #fff;
    background: var(--rose-deep);
    border: 5px solid var(--paper);
    border-radius: 50%;
    box-shadow: 0 8px 22px rgba(143, 63, 89, 0.28);
  }

  .mobile-compose svg {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 14px;
  }

  .login-screen {
    padding: 0;
  }

  .login-shell {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .login-story {
    min-height: 205px;
    padding: 19px;
  }

  .login-story-top {
    top: 18px;
    left: 19px;
  }

  .login-photo {
    width: 55%;
    min-width: 200px;
    margin: 46px auto 9px;
  }

  .login-panel {
    padding: 29px 22px 25px;
  }

  .login-panel h1 {
    font-size: 28px;
  }

  .login-intro {
    margin: 12px 0 25px;
  }

  .header-inner {
    width: calc(100% - 20px);
  }

  .brand {
    gap: 8px;
  }

  .brand .brand-mark {
    width: 33px;
    height: 33px;
    flex-basis: 33px;
  }

  .brand-copy strong {
    max-width: 46vw;
    font-size: 15px;
  }

  .brand-copy small {
    display: none;
  }

  #logout-button {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .page-width {
    width: calc(100% - 24px);
  }

  .app-page {
    padding-top: 26px;
  }

  .welcome-row {
    align-items: center;
    margin-bottom: 20px;
  }

  .welcome-row h1,
  .page-heading h1 {
    font-size: 26px;
    line-height: 1.45;
  }

  .welcome-row .eyebrow {
    margin-bottom: 4px;
  }

  .page-heading {
    display: grid;
    align-items: start;
    gap: 16px;
    margin-bottom: 22px;
  }

  .page-heading .primary-button {
    justify-self: start;
  }

  .count-badge {
    justify-self: start;
  }

  .together-banner {
    display: block;
    min-height: 0;
    margin-bottom: 17px;
    padding: 20px;
  }

  .duration-row strong {
    font-size: 38px;
  }

  .together-divider {
    width: 100%;
    height: 1px;
    margin: 16px 0;
  }

  .anniversary-mini {
    gap: 12px;
  }

  .anniversary-mini strong {
    font-size: 29px;
  }

  .round-icon {
    width: 41px;
    height: 41px;
    flex-basis: 41px;
  }

  .composer-entry {
    min-height: 65px;
    padding: 10px 12px;
  }

  .composer-entry > span:nth-child(2) {
    font-size: 12px;
  }

  .avatar-heart {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .section-line {
    margin-top: 22px;
  }

  .post-card {
    padding: 15px;
  }

  .post-menu {
    opacity: 1;
  }

  .post-content {
    margin-top: 12px;
    font-size: 13px;
  }

  .post-photos {
    margin-top: 12px;
  }

  .post-photos[data-count="2"] .post-photo img {
    aspect-ratio: 0.82 / 1;
  }

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

  .gallery-item:nth-child(7n + 1) {
    grid-column: span 2;
    grid-row: span 1;
  }

  .gallery-item span,
  .gallery-item::after {
    display: none;
  }

  .anniversary-hero {
    display: grid;
    margin-bottom: 29px;
    padding: 20px;
    gap: 17px;
  }

  .anniversary-total {
    justify-items: start;
    padding-top: 13px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

  .timeline-list {
    padding-left: 22px;
  }

  .timeline-list::before {
    left: 5px;
  }

  .timeline-dot {
    left: -23px;
  }

  .timeline-item {
    grid-template-columns: minmax(0, 1fr) 92px;
    gap: 12px;
    padding-bottom: 28px;
  }

  .timeline-copy h2 {
    font-size: 19px;
  }

  .timeline-copy p {
    font-size: 12px;
  }

  .timeline-photo {
    width: 92px;
    align-self: start;
  }

  .timeline-actions {
    opacity: 1;
  }

  .mini-action {
    padding: 0 5px;
  }

  .mini-action span {
    display: none;
  }

  .settings-card {
    padding: 19px;
    gap: 18px;
  }

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

  .field-span-2 {
    grid-column: span 1;
  }

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

  .settings-actions .form-message {
    text-align: left;
  }

  .settings-actions .primary-button {
    width: 100%;
  }

  .storage-note {
    padding: 15px;
  }

  .modal {
    padding: 0;
    align-items: end;
  }

  .modal-card {
    width: 100%;
    max-height: 92vh;
    padding: 21px 17px calc(20px + env(safe-area-inset-bottom));
    border: 0;
    border-radius: var(--radius) var(--radius) 0 0;
  }

  .modal-header h2 {
    font-size: 23px;
  }

  .composer-modal textarea {
    min-height: 150px;
  }

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

  .compose-footer {
    align-items: flex-end;
    gap: 10px;
  }

  .compose-tools {
    display: grid;
    gap: 5px;
  }

  .compose-tools > span {
    max-width: 165px;
  }

  .compose-footer .primary-button {
    padding: 0 14px;
  }

  .modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .lightbox {
    padding: 54px 12px 72px;
  }

  .lightbox-close {
    top: 10px;
    right: 10px;
  }

  .lightbox-arrow {
    top: auto;
    bottom: 15px;
    transform: none;
  }

  .lightbox-prev {
    left: calc(50% - 55px);
  }

  .lightbox-next {
    right: calc(50% - 55px);
  }

  .lightbox figcaption {
    align-self: end;
    padding: 0 62px;
    justify-content: center;
    text-align: center;
  }

  .lightbox figcaption > span {
    display: none;
  }

  .confirm-modal {
    width: calc(100% - 30px);
    margin-bottom: 18vh;
    padding: 26px 20px;
    border-radius: var(--radius);
  }
}

@media (max-width: 380px) {
  .brand-copy strong {
    max-width: 42vw;
  }

  .duration-row strong {
    font-size: 34px;
  }

  .duration-row span {
    margin-right: 5px;
  }

  .welcome-row h1,
  .page-heading h1 {
    font-size: 23px;
  }

  .mobile-new-post {
    width: 40px;
    padding: 0;
    font-size: 0;
  }

  .post-photos[data-count="5"],
  .post-photos[data-count="6"],
  .post-photos[data-count="7"],
  .post-photos[data-count="8"],
  .post-photos[data-count="9"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  #particle-canvas {
    display: none;
  }
}
