:root {
  --bg: #fffaf7;
  --surface: rgba(255, 255, 255, 0.82);
  --card: #ffffff;
  --ink: #342b2b;
  --muted: #8f8380;
  --line: #eee5e1;
  --rose: #e57976;
  --rose-dark: #ca5f60;
  --rose-soft: #fce8e4;
  --peach: #f6c4a8;
  --sage: #a9c4b1;
  --shadow: 0 18px 50px rgba(107, 76, 67, 0.1);
  --radius-lg: 30px;
  --radius-md: 22px;
  --radius-sm: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: "DM Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
.auth-locked { overflow: hidden; }
.auth-locked .app-shell,
.auth-locked .ambient { display: none; }

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

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  grid-template-rows: minmax(min-content, 1fr) auto;
  place-items: center;
  gap: 20px;
  padding: 22px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 80% 15%, rgba(246, 196, 168, .42), transparent 35%),
    radial-gradient(circle at 12% 88%, rgba(229, 121, 118, .2), transparent 38%),
    #fffaf7;
  transition: opacity .35s ease, visibility .35s ease;
}
.auth-screen.unlocked { opacity: 0; visibility: hidden; pointer-events: none; }
.auth-card {
  width: min(440px, 100%);
  padding: 40px;
  border: 1px solid rgba(238,229,225,.9);
  border-radius: 30px;
  background: rgba(255,255,255,.9);
  box-shadow: 0 30px 90px rgba(91,61,53,.14);
}
.auth-brand { margin-bottom: 24px; }
.auth-card h1 { margin: 9px 0; font-size: 30px; letter-spacing: -.04em; }
.auth-card > p { margin: 0 0 25px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.auth-card label, #profileForm label {
  display: block;
  margin-top: 14px;
  color: #655957;
  font-size: 10px;
  font-weight: 600;
}
.auth-card label > span, #profileForm label > span { display: block; margin-bottom: 7px; }
.auth-card input, #profileForm input {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: #fff;
  color: var(--ink);
}
.auth-card input:focus, #profileForm input:focus { border-color: #e8aaa3; box-shadow: 0 0 0 3px rgba(229,121,118,.09); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.auth-submit { width: 100%; margin-top: 22px; }
.auth-register { width: 100%; margin-top: 10px; }
.auth-note { display: block; margin-top: 16px; color: var(--muted); text-align: center; font-size: 9px; }
.site-footer { grid-column: 1 / -1; width: 100%; padding: 16px 20px; color: #796b67; font-size: 12px; line-height: 1.6; text-align: center; }
.site-footer a { display: inline-flex; align-items: center; min-height: 32px; padding: 4px 6px; color: inherit; text-decoration: underline; text-decoration-color: #c5b8b3; text-underline-offset: 3px; }
.site-footer a:hover { color: var(--rose-dark); text-decoration-color: currentColor; }
.site-footer a:focus-visible { outline: 2px solid var(--rose-dark); outline-offset: 3px; border-radius: 4px; }
.auth-footer { padding: 0; }
.form-error { margin: 12px 0 0 !important; padding: 9px 11px; border-radius: 10px; color: #b95353 !important; background: #fff0ee; font-size: 10px !important; }
#profileForm textarea { min-height: 80px; }
.profile-account-note { margin: 0 0 4px; padding: 11px 13px; border-radius: 12px; color: #786966; background: #fff5f2; font-size: 10px; line-height: 1.65; }
#profileForm input:disabled { color: #9b8e8a; background: #f7f3f1; cursor: not-allowed; }

.couple-setup-screen { position: fixed; inset: 0; z-index: 190; display: grid; place-items: center; padding: 22px; background: rgba(255,250,247,.96); backdrop-filter: blur(16px); }
.couple-setup-card { width: min(480px, 100%); padding: 38px; border: 1px solid var(--line); border-radius: 30px; background: #fff; box-shadow: var(--shadow); }
.couple-setup-card h1 { margin: 10px 0 8px; font-size: 28px; }
.couple-setup-card > p { color: var(--muted); font-size: 12px; line-height: 1.65; }
.couple-setup-card label { display: block; margin: 16px 0; color: #655957; font-size: 10px; font-weight: 600; }
.couple-setup-card label span { display: block; margin-bottom: 7px; }
.couple-setup-card input { width: 100%; padding: 12px 13px; border: 1px solid var(--line); border-radius: 12px; outline: none; }
.couple-setup-card input:focus { border-color: #e8aaa3; box-shadow: 0 0 0 3px rgba(229,121,118,.09); }
#createCouple, #joinCoupleForm button, #enterCoupleSpace { width: 100%; }
.setup-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0 2px; color: var(--muted); font-size: 10px; }
.setup-divider::before, .setup-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.invite-result { padding: 22px; border-radius: 18px; text-align: center; background: var(--rose-soft); }
.invite-result > span { color: var(--muted); font-size: 10px; }
.invite-result strong { display: block; margin: 10px 0; color: var(--rose-dark); font-size: 30px; letter-spacing: .18em; }
.invite-result p { margin: 0 0 16px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.setup-signout { width: 100%; margin-top: 12px; }
.sync-indicator { padding: 7px 10px; border-radius: 999px; color: #7b6e6a; background: #f7efeb; font-size: 9px; white-space: nowrap; }
.sync-indicator.syncing { color: #946d30; background: #fff4d9; }
.sync-indicator.synced { color: #52755e; background: #eaf5ed; }
.sync-indicator.failed { color: #a24e4e; background: #ffebe8; }
.entry-sync-status { display: inline-block; margin-left: 8px; color: var(--muted); font-size: 9px; }

.ambient {
  position: fixed;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
  z-index: -1;
}

.ambient-one {
  width: 420px;
  height: 420px;
  top: -160px;
  right: 8%;
  background: radial-gradient(circle, rgba(246, 196, 168, .35), transparent 70%);
}

.ambient-two {
  width: 460px;
  height: 460px;
  bottom: -200px;
  left: 12%;
  background: radial-gradient(circle, rgba(229, 121, 118, .16), transparent 70%);
}

.app-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  max-width: 1480px;
  margin: 0 auto;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 34px 24px;
  border-right: 1px solid rgba(221, 206, 201, .7);
  background: rgba(255, 250, 247, .72);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: inherit;
  text-decoration: none;
  padding: 0 8px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  color: #fff;
  border-radius: 15px 15px 15px 5px;
  background: linear-gradient(145deg, var(--rose), #ecaaa1);
  box-shadow: 0 8px 18px rgba(229, 121, 118, .25);
  font-weight: 700;
}

.brand strong, .brand small { display: block; }
.brand strong { font-size: 18px; letter-spacing: .08em; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 10px; }

.side-nav { display: grid; gap: 8px; margin-top: 68px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 13px 16px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  transition: .2s ease;
}
.nav-item:hover { background: rgba(255,255,255,.65); color: var(--ink); }
.nav-item.active {
  color: var(--rose-dark);
  background: var(--rose-soft);
  font-weight: 600;
}
.nav-icon { width: 24px; text-align: center; font-size: 21px; }

.couple-card {
  margin-top: auto;
  padding: 24px 18px 18px;
  border: 1px solid rgba(238, 229, 225, .9);
  border-radius: 22px;
  background: rgba(255,255,255,.7);
  text-align: center;
}
.avatar-pair { display: flex; justify-content: center; margin-bottom: 13px; }
.avatar-pair .avatar + .avatar { margin-left: -9px; border: 3px solid #fff; }
.avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.avatar-you { background: linear-gradient(145deg, #a6b7cb, #8295ad); }
.avatar-partner { background: linear-gradient(145deg, #efae9a, #da7d76); }
.couple-card strong, .couple-card > span { display: block; }
.couple-card > span { margin-top: 5px; color: var(--muted); font-size: 11px; }
.connection {
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  color: #7d9a84;
  font-size: 10px;
}
.connection.local-mode { color: #9a7b56; }
.connection.local-mode i { background: #d8a762; }
.connection i {
  display: inline-block;
  width: 6px; height: 6px;
  margin-right: 5px;
  border-radius: 50%;
  background: #7fb18a;
}

.main-content { padding: 32px 5vw 80px; min-width: 0; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 34px;
}
.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.topbar h1 { margin: 0; font-size: clamp(24px, 2.2vw, 34px); font-weight: 600; letter-spacing: -.04em; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.icon-button {
  position: relative;
  width: 42px; height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255,255,255,.7);
  cursor: pointer;
}
.notification-dot {
  position: absolute;
  top: 8px; right: 8px;
  width: 7px; height: 7px;
  border: 2px solid white;
  border-radius: 50%;
  background: var(--rose);
}
.profile-button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,.7);
}
.profile-copy { text-align: left; }
.profile-copy b, .profile-copy small { display: block; }
.profile-copy b { font-size: 12px; }
.profile-copy small { color: var(--muted); font-size: 9px; margin-top: 2px; }

.view { display: none; animation: enter .35s ease; }
.view.active { display: block; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }

.hero-card {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 295px;
  padding: 46px 55px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(110deg, rgba(255,255,255,.15), transparent),
    linear-gradient(135deg, #f9e4dc, #f5c7b8);
  box-shadow: var(--shadow);
}
.hero-card::before {
  content: "";
  position: absolute;
  width: 220px; height: 220px;
  left: -90px; bottom: -120px;
  border: 35px solid rgba(255,255,255,.25);
  border-radius: 50%;
}
.soft-label {
  color: var(--rose-dark);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.hero-copy { position: relative; z-index: 2; }
.hero-copy h2 {
  margin: 15px 0 12px;
  font-size: clamp(29px, 3vw, 43px);
  line-height: 1.3;
  letter-spacing: -.05em;
}
.hero-copy p { color: #806e69; font-size: 13px; }
.primary-button, .secondary-button, .ghost-button {
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 600;
  transition: transform .2s ease, box-shadow .2s ease;
}
.primary-button {
  padding: 13px 20px;
  color: #fff;
  background: var(--rose);
  box-shadow: 0 10px 22px rgba(195, 83, 82, .22);
}
.primary-button:hover { transform: translateY(-2px); box-shadow: 0 13px 28px rgba(195, 83, 82, .29); }
.hero-copy .primary-button { margin-top: 16px; background: #3f3432; box-shadow: 0 10px 22px rgba(63,52,50,.2); }

.mood-orbit {
  position: relative;
  width: 230px; height: 230px;
  margin-right: 30px;
}
.orbit-ring { position: absolute; border: 1px dashed rgba(112, 77, 68, .25); border-radius: 50%; }
.ring-one { inset: 20px; }
.ring-two { inset: 48px; }
.orbit-center {
  position: absolute; inset: 50%;
  display: grid; place-items: center;
  width: 78px; height: 78px;
  transform: translate(-50%,-50%) rotate(-8deg);
  border-radius: 30px 30px 30px 9px;
  color: #fff;
  background: rgba(218,112,105,.83);
  font-size: 30px;
  box-shadow: 0 18px 40px rgba(169,83,76,.25);
}
.orbit-mood {
  position: absolute;
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,.76);
  box-shadow: 0 8px 22px rgba(119,78,69,.12);
}
.mood-a { top: 6px; left: 98px; }
.mood-b { bottom: 27px; left: 11px; }
.mood-c { right: 5px; bottom: 48px; }

.status-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; margin: 20px 0 45px; }
.status-card {
  padding: 21px 23px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.status-head { display: flex; align-items: center; justify-content: space-between; }
.status-head > div { display: flex; align-items: center; gap: 10px; }
.status-head b { font-size: 12px; }
.status-head small { color: var(--muted); font-size: 9px; }
.current-mood { display: flex; gap: 14px; align-items: center; margin: 18px 0 15px; }
.mood-face { font-size: 32px; }
.current-mood b { font-size: 15px; }
.current-mood p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.hug-button {
  width: 100%;
  padding: 10px;
  border: 1px solid #f5d9d3;
  border-radius: 12px;
  color: var(--rose-dark);
  background: #fff7f5;
  cursor: pointer;
  font-size: 11px;
}
.hug-button.sent { color: #719178; background: #f2f8f3; border-color: #d9eadc; }
.week-dots { display: flex; gap: 8px; justify-content: space-between; margin: 22px 0 18px; }
.day-dot { text-align: center; }
.day-dot span {
  display: grid; place-items: center;
  width: 29px; height: 29px;
  margin-bottom: 6px;
  border-radius: 50%;
  color: var(--muted);
  background: #f7f2ef;
  font-size: 9px;
}
.day-dot small { color: var(--muted); font-size: 8px; }
.day-dot.done span { color: white; background: var(--rose); }
.day-dot.today span { outline: 2px solid #f1b1a9; outline-offset: 3px; }
.mini-calendar-card > p { margin: 0; color: var(--muted); font-size: 10px; }

.section-heading { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; }
.section-heading h2, .view-intro h2 { margin: 7px 0 0; font-size: 25px; letter-spacing: -.04em; }
.filter-pills { display: flex; gap: 6px; }
.filter-pill {
  padding: 7px 13px;
  border: 0;
  border-radius: 20px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 10px;
}
.filter-pill.active { color: var(--rose-dark); background: var(--rose-soft); font-weight: 600; }

.timeline { position: relative; display: grid; gap: 16px; }
.entry-card {
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,.86);
  box-shadow: 0 8px 30px rgba(109,79,69,.045);
}
.entry-card.with-photo { grid-template-columns: minmax(0, 1fr) 230px; }
.entry-body { padding: 23px 25px 18px; min-width: 0; }
.entry-author { display: flex; align-items: center; gap: 10px; }
.entry-author div { min-width: 0; }
.entry-author b, .entry-author small { display: block; }
.entry-author b { font-size: 12px; }
.entry-author small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.entry-mood { margin-left: auto; padding: 6px 10px; border-radius: 18px; background: #fff4f1; color: #a86963; font-size: 10px; white-space: nowrap; }
.entry-text { margin: 18px 0 15px; font-size: 14px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.response-tag { display: inline-block; padding: 6px 10px; border-radius: 8px; color: #83716c; background: #f8f3f0; font-size: 9px; }
.entry-photo { width: 100%; height: 100%; min-height: 210px; object-fit: cover; }
.entry-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 17px;
  padding-top: 14px;
  border-top: 1px solid #f3ece9;
}
.reaction-button, .comment-button {
  padding: 7px 11px;
  border: 0;
  border-radius: 10px;
  background: #faf6f4;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
}
.reaction-button.active { color: var(--rose-dark); background: var(--rose-soft); }
.kiss-reaction.active { color: #b14d69; background: #fff0f5; }
.reaction-button:disabled, .comment-button:disabled { opacity: .48; cursor: wait; }
.affection-pop { animation: affection-button-pop .62s cubic-bezier(.2,.8,.2,1); }
.affection-particle {
  position: fixed;
  z-index: 500;
  width: 24px;
  height: 24px;
  margin: -12px;
  pointer-events: none;
  display: grid;
  place-items: center;
  color: #de6f75;
  font-size: 17px;
  filter: drop-shadow(0 4px 8px rgba(185,83,94,.18));
  animation: affection-burst .9s cubic-bezier(.16,.78,.28,1) forwards;
}
.affection-particle.kiss { color: #b94e70; font-size: 19px; }
@keyframes affection-button-pop {
  0%,100% { transform: scale(1); }
  38% { transform: scale(1.18) rotate(-2deg); }
  68% { transform: scale(.96) rotate(1deg); }
}
@keyframes affection-burst {
  0% { opacity: 0; transform: translate(0,0) scale(.45) rotate(0); }
  14% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--burst-x),var(--burst-y)) scale(1.25) rotate(var(--burst-rotate)); }
}
@media (prefers-reduced-motion: reduce) {
  .affection-pop, .affection-particle { animation-duration: .01ms !important; }
}
.comments { display: grid; gap: 7px; margin-top: 12px; }
.comment {
  padding: 9px 11px;
  border-radius: 10px;
  background: #faf7f5;
  color: #736663;
  font-size: 10px;
}
.comment b { color: var(--rose-dark); margin-right: 5px; }

.view-intro { margin: 18px 0 28px; }
.view-intro h2 { max-width: 580px; font-size: clamp(27px,3vw,40px); line-height: 1.3; }
.memory-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-bottom: 30px; }
.memory-stats div {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}
.memory-stats span { grid-row: 1 / 3; align-self: center; font-size: 24px; }
.memory-stats b { font-size: 22px; }
.memory-stats small { color: var(--muted); font-size: 9px; }
.memory-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.memory-item { position: relative; overflow: hidden; min-height: 235px; border-radius: 20px; background: #f6e9e3; }
.memory-item img { width: 100%; height: 100%; object-fit: cover; position: absolute; }
.memory-overlay {
  position: absolute; inset: auto 0 0;
  padding: 50px 16px 16px;
  color: #fff;
  background: linear-gradient(transparent, rgba(43,31,28,.75));
}
.memory-overlay b, .memory-overlay small { display: block; }
.memory-overlay b { font-size: 12px; }
.memory-overlay small { margin-top: 3px; opacity: .75; font-size: 9px; }
.no-memories { grid-column: 1/-1; padding: 70px; border: 1px dashed var(--line); border-radius: 24px; text-align: center; color: var(--muted); }

.mood-dashboard { display: grid; grid-template-columns: .8fr 1.2fr; gap: 18px; }
.mood-summary, .mood-chart-card {
  min-height: 240px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
}
.mood-summary { background: linear-gradient(145deg, #fff1eb, #f8ded5); }
.summary-emoji { font-size: 46px; }
.mood-summary p { margin: 20px 0 5px; color: var(--muted); font-size: 10px; }
.mood-summary h3 { margin: 0 0 8px; font-size: 21px; }
.mood-summary small { color: #8e716a; font-size: 10px; }
.mood-chart { display: flex; align-items: end; justify-content: space-between; gap: 12px; height: 155px; padding-top: 24px; }
.chart-bar { flex: 1; text-align: center; }
.chart-bar i { display: block; width: 100%; max-width: 35px; margin: auto; border-radius: 12px 12px 5px 5px; background: linear-gradient(#f1afa3, #e57976); transition: height .3s; }
.chart-bar span, .chart-bar small { display: block; }
.chart-bar span { margin-top: 6px; font-size: 15px; }
.chart-bar small { color: var(--muted); font-size: 7px; }
.mood-chart-empty { width: 100%; align-self: center; padding: 28px 12px; border: 1px dashed var(--line); border-radius: 16px; color: var(--muted); text-align: center; font-size: 12px; line-height: 1.8; }
.mood-chart-empty small { font-size: 9px; }
.vent-box {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 20px;
  padding: 28px;
  border: 1px solid #dce9df;
  border-radius: 24px;
  background: #f4faf5;
}
.vent-icon { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 18px; background: #dfede2; color: #6f9378; font-size: 26px; }
.vent-box h3 { margin: 5px 0; font-size: 17px; }
.vent-box p { margin: 0; color: var(--muted); font-size: 10px; }
.secondary-button { margin-left: auto; padding: 11px 17px; color: #64836c; background: #dfede2; }

.us-hero { text-align: center; padding: 48px 20px 36px; }
.big-avatar {
  display: inline-grid; place-items: center;
  width: 92px; height: 92px;
  border: 5px solid white;
  border-radius: 50%;
  color: white;
  box-shadow: var(--shadow);
  font-size: 24px; font-weight: 700;
}
.heart-line { display: inline-flex; align-items: center; width: 110px; margin: 0 -8px; vertical-align: middle; }
.heart-line i { flex: 1; height: 1px; background: #e9b9b1; }
.heart-line span { margin: 0 8px; color: var(--rose); }
.us-hero h2 { margin: 25px 0 7px; font-size: 28px; }
.us-hero p { color: var(--muted); font-size: 11px; }
.settings-heading { max-width: 850px; margin: 30px auto 14px; }
.settings-heading h2 { margin: 7px 0 4px; font-size: 20px; }
.settings-heading p { margin: 0; color: var(--muted); font-size: 10px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; max-width: 850px; margin: auto; }
.settings-grid button {
  display: flex; align-items: center; gap: 14px;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  cursor: pointer;
  text-align: left;
}
.settings-grid button > span { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: #fff3ef; }
.settings-grid div { flex: 1; }
.settings-grid b, .settings-grid small { display: block; }
.settings-grid b { font-size: 12px; }
.settings-grid small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.settings-grid i { color: var(--muted); font-style: normal; font-size: 21px; }
.anniversary-detail { padding: 18px 0 8px; text-align: center; }
.anniversary-heart { display: block; color: var(--rose); font-size: 38px; }
.anniversary-detail b { display: block; margin-top: 5px; font-size: 48px; letter-spacing: -.06em; }
.anniversary-detail p { margin: 2px 0 10px; color: var(--ink); font-weight: 600; }
.anniversary-detail small { color: var(--muted); font-size: 10px; }
.privacy-notice { margin-bottom: 18px; padding: 14px; border-radius: 14px; color: #765f45; background: #fff5e8; }
.privacy-notice b { font-size: 11px; }
.privacy-notice p { margin: 6px 0 0; font-size: 9px; line-height: 1.6; }
#passwordForm label { display: block; margin-top: 12px; font-size: 10px; font-weight: 600; }
#passwordForm label span { display: block; margin-bottom: 6px; }
#passwordForm input { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 12px; outline: none; }
.confirm-modal { width: min(430px, 100%); text-align: center; }
.confirm-icon { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 15px; border-radius: 50%; color: #b95757; background: #ffebea; font-size: 22px; font-weight: 700; }
.confirm-modal h2 { margin: 0 0 8px; }
.confirm-modal > p { color: var(--muted); font-size: 11px; line-height: 1.7; }
.confirm-modal .form-actions { justify-content: center; }
.danger-button { padding: 12px 18px; border: 0; border-radius: 14px; color: white; background: #c95e5e; cursor: pointer; font-weight: 600; }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  padding: 22px;
  background: rgba(49,38,36,.36);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: .25s ease;
}
.modal-backdrop.open { opacity: 1; visibility: visible; }
.modal {
  width: min(670px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  padding: 30px;
  border-radius: 28px;
  background: #fffdfa;
  box-shadow: 0 30px 90px rgba(57,38,34,.25);
  transform: translateY(16px) scale(.98);
  transition: .25s ease;
}
.modal-backdrop.open .modal { transform: none; }
.compact-modal { width: min(550px, 100%); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; }
.modal-header h2 { margin: 6px 0 0; font-size: 24px; }
.close-button {
  width: 35px; height: 35px;
  border: 0; border-radius: 50%;
  background: #f5efec;
  color: var(--muted);
  cursor: pointer;
  font-size: 21px;
}
.field-label { display: block; margin: 18px 0 9px; font-size: 11px; font-weight: 600; }
.mood-picker, .response-picker, .quick-replies { display: flex; flex-wrap: wrap; gap: 8px; }
.mood-picker button, .response-picker button, .quick-replies button {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
}
.mood-picker button span { margin-right: 4px; font-size: 17px; vertical-align: middle; }
.mood-picker button.selected, .response-picker button.selected { border-color: #edb5ae; color: var(--rose-dark); background: #fff1ed; }
textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  color: var(--ink);
  background: #fff;
  line-height: 1.6;
  font-size: 12px;
}
textarea:focus { border-color: #e8aaa3; box-shadow: 0 0 0 3px rgba(229,121,118,.09); }
.text-meta { margin-top: 5px; color: var(--muted); text-align: right; font-size: 8px; }
.photo-upload {
  display: flex; align-items: center; gap: 13px;
  margin-top: 12px;
  padding: 14px;
  border: 1px dashed #e3d3ce;
  border-radius: 14px;
  background: #fcf8f6;
  cursor: pointer;
}
.photo-upload input { display: none; }
.photo-upload > span { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: #f5e8e3; color: var(--rose); }
.photo-upload b, .photo-upload small { display: block; }
.photo-upload b { font-size: 10px; }
.photo-upload small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.photo-preview { width: 100%; max-height: 220px; margin-top: 10px; border-radius: 14px; object-fit: cover; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 25px; }
.ghost-button { padding: 12px 17px; color: var(--muted); background: #f5efec; }
.quick-replies { margin-bottom: 12px; }

.toast {
  position: fixed; z-index: 80;
  left: 50%; bottom: 26px;
  display: flex; align-items: center; gap: 9px;
  padding: 11px 17px;
  border-radius: 30px;
  color: #fff;
  background: #3f3432;
  box-shadow: 0 12px 30px rgba(42,32,30,.2);
  opacity: 0; transform: translate(-50%, 20px);
  pointer-events: none;
  transition: .3s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast span { color: #f2a09a; }
.toast p { margin: 0; font-size: 11px; }
.empty-state { padding: 50px; text-align: center; color: var(--muted); }
.empty-state span { font-size: 35px; }
.empty-state h3 { margin: 10px 0 4px; color: var(--ink); }
.empty-state p { margin: 0; font-size: 11px; }
.hidden { display: none !important; }
.mobile-nav { display: none; }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 190px minmax(0, 1fr); }
  .sidebar { padding-inline: 16px; }
  .main-content { padding-inline: 30px; }
  .mood-orbit { margin-right: 0; transform: scale(.82); }
  .hero-card { padding: 38px; }
  .status-grid, .mood-dashboard { grid-template-columns: 1fr; }
  .memory-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 680px) {
  body { background: #fffaf7; }
  .app-shell { display: block; padding-bottom: 77px; }
  .sidebar { display: none; }
  .main-content { padding: 23px 16px 40px; }
  .topbar { margin-bottom: 24px; }
  .profile-copy, .icon-button { display: none; }
  .profile-button { padding: 2px; border: 0; background: none; }
  .hero-card { min-height: 330px; padding: 30px 25px; align-items: flex-start; }
  .hero-copy h2 { font-size: 31px; }
  .hero-copy p { max-width: 230px; line-height: 1.6; }
  .mood-orbit { position: absolute; right: -52px; bottom: -71px; transform: scale(.67); opacity: .75; }
  .status-grid { grid-template-columns: 1fr; margin-bottom: 35px; }
  .mini-calendar-card { display: none; }
  .section-heading { align-items: flex-start; gap: 16px; }
  .filter-pills { margin-top: 22px; white-space: nowrap; }
  .entry-card.with-photo { grid-template-columns: 1fr; }
  .entry-photo { grid-row: 1; height: 210px; min-height: 0; }
  .memory-stats { gap: 7px; }
  .memory-stats div { display: block; padding: 13px; text-align: center; }
  .memory-stats span, .memory-stats b, .memory-stats small { display: block; }
  .memory-stats span { font-size: 17px; }
  .memory-stats b { margin: 4px 0; font-size: 19px; }
  .memory-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .memory-item { min-height: 190px; }
  .vent-box { align-items: flex-start; flex-wrap: wrap; }
  .secondary-button { margin-left: 80px; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-heading { margin-top: 24px; }
  .us-hero { padding-top: 20px; }
  .big-avatar { width: 72px; height: 72px; }
  .heart-line { width: 65px; }
  .modal { padding: 23px 18px; border-radius: 24px; }
  .modal-backdrop { align-items: end; padding: 0; }
  .modal { width: 100%; max-height: 92vh; border-radius: 26px 26px 0 0; }
  .auth-card { padding: 30px 22px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .mobile-nav {
    position: fixed; z-index: 30;
    left: 0; right: 0; bottom: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    height: 70px;
    padding: 7px 10px max(7px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(255,253,250,.92);
    backdrop-filter: blur(18px);
  }
  .mobile-nav button {
    display: grid; place-items: center;
    border: 0; background: none;
    color: var(--muted);
  }
  .mobile-nav button.active { color: var(--rose-dark); }
  .mobile-nav button span { font-size: 19px; }
  .mobile-nav button small { margin-top: 3px; font-size: 8px; }
  .mobile-nav .mobile-create span {
    display: grid; place-items: center;
    width: 44px; height: 44px;
    margin-top: -27px;
    border: 5px solid #fffaf7;
    border-radius: 50%;
    color: #fff;
    background: var(--rose);
    box-sizing: content-box;
    box-shadow: 0 7px 18px rgba(198,84,82,.25);
    font-size: 25px;
  }
}
