﻿
/* =========================================================
   v0.2 — moments, anniversaries & photo journaling
   ========================================================= */

/* --- navigation density for six sections --- */
.side-nav {
  gap: 4px;
}

.nav-link {
  min-height: 46px;
}

.sidebar-kicker {
  margin-top: 27px;
}

.mobile-nav a {
  gap: 3px;
  font-size: 7.5px;
  letter-spacing: 0.01em;
}

.mobile-nav a svg {
  width: 17px;
  height: 17px;
}

/* --- clickable home anniversary card --- */
a.anniversary-card {
  display: block;
  color: inherit;
  cursor: pointer;
  transition: transform 250ms var(--ease-spring), box-shadow 250ms ease, border-color 200ms ease;
}

a.anniversary-card:hover {
  border-color: rgba(174, 127, 93, 0.35);
  box-shadow: 0 22px 38px -31px rgba(72, 43, 35, 0.46);
  transform: translateY(-3px);
}

a.anniversary-card:focus-visible {
  outline-offset: 4px;
}

/* --- shared small ui --- */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.modal--wide {
  width: min(690px, 100%);
}

.image-frame {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(110deg, rgba(234, 219, 205, 0.4), rgba(250, 243, 235, 0.7) 45%, rgba(234, 219, 205, 0.4)),
    #f2e7dc;
}

.image-frame::after {
  content: "照片加载中…";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(110, 85, 75, 0.52);
  font-size: 9px;
  letter-spacing: 0.08em;
  pointer-events: none;
}

.image-frame.is-loaded::after {
  display: none;
}

.image-frame.is-missing::after {
  content: "照片暂时找不到";
  color: rgba(135, 83, 75, 0.72);
}

.image-frame img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 300ms ease;
}

.image-frame.is-loaded img {
  opacity: 1;
}

/* =========================================================
   Moments / 点滴日常
   ========================================================= */

.moment-daybar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 145px;
  padding: 26px 30px;
  overflow: hidden;
  border: 1px solid rgba(134, 90, 72, 0.15);
  border-radius: 25px;
  background:
    radial-gradient(circle at 91% 8%, rgba(255, 250, 241, 0.48), transparent 31%),
    linear-gradient(133deg, #f1dfd0, #ecd3c4);
}

.moment-daybar::before {
  content: "";
  position: absolute;
  top: -72px;
  right: 11%;
  width: 190px;
  height: 190px;
  border: 1px solid rgba(153, 103, 79, 0.14);
  border-radius: 50%;
}

.moment-daybar::after {
  content: "“";
  position: absolute;
  right: 34%;
  bottom: -42px;
  color: rgba(255, 249, 240, 0.26);
  font-family: var(--font-display);
  font-size: 150px;
  line-height: 1;
  pointer-events: none;
}

.moment-day-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.moment-day-copy .eyebrow {
  color: rgba(115, 77, 61, 0.66);
  font-size: 7.5px;
  letter-spacing: 0.17em;
}

.moment-day-copy h2 {
  margin: 9px 0 0;
  color: #593d36;
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.04em;
}

.moment-day-copy > p:last-child {
  margin: 5px 0 0;
  color: rgba(105, 72, 59, 0.63);
  font-size: 9.5px;
  line-height: 1.8;
}

.moment-date-controls {
  position: relative;
  z-index: 2;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}

.day-arrow {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  padding: 0;
  border: 1px solid rgba(123, 82, 65, 0.15);
  border-radius: 50%;
  color: rgba(116, 77, 60, 0.75);
  background: rgba(255, 250, 243, 0.52);
  transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.day-arrow:hover:not(:disabled) {
  color: var(--rose-deep);
  border-color: rgba(141, 74, 81, 0.25);
  background: rgba(255, 251, 246, 0.9);
  transform: translateY(-1px);
}

.day-arrow:disabled {
  opacity: 0.32;
}

.day-arrow svg {
  width: 13px;
  height: 13px;
}

.date-picker {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 35px;
  padding: 0 11px;
  border: 1px solid rgba(123, 82, 65, 0.15);
  border-radius: 999px;
  color: rgba(116, 77, 60, 0.7);
  background: rgba(255, 250, 243, 0.56);
  transition: background-color 180ms ease, border-color 180ms ease;
}

.date-picker:focus-within {
  border-color: rgba(141, 74, 81, 0.3);
  background: #fffbf6;
}

.date-picker > svg {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
}

.date-picker input {
  width: 112px;
  padding: 0;
  border: 0;
  outline: 0;
  color: rgb(99, 68, 55);
  font-family: var(--font-display);
  font-size: 9.5px;
  letter-spacing: 0.02em;
  background: transparent;
}

.today-button {
  min-height: 35px;
  padding: 7px 11px;
  border: 1px solid rgba(141, 74, 81, 0.2);
  border-radius: 999px;
  color: var(--rose-deep);
  font-size: 9px;
  letter-spacing: 0.03em;
  background: rgba(255, 249, 241, 0.35);
  transition: background-color 180ms ease, border-color 180ms ease, opacity 180ms ease;
}

.today-button:hover:not(:disabled) {
  border-color: rgba(141, 74, 81, 0.32);
  background: rgba(255, 251, 246, 0.74);
}

.today-button:disabled {
  opacity: 0.36;
}

.quick-moment {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 16px;
  padding: 16px 19px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: rgba(255, 251, 246, 0.64);
  box-shadow: 0 14px 35px -38px rgba(80, 47, 38, 0.46);
}

.quick-moment-avatar {
  width: 40px;
  height: 40px;
  margin: 0;
  border: 1px solid rgba(91, 58, 51, 0.08);
  font-size: 12px;
  background: #e4e8dc;
  color: #5d6956;
}

.quick-moment-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  line-height: 1.5;
}

.quick-moment-copy strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.quick-moment-copy span {
  overflow: hidden;
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 8.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-moment .button {
  flex: 0 0 auto;
  min-height: 37px;
  padding: 8px 14px;
  font-size: 10px;
}

.moment-feed-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 880px;
  margin: 24px auto 12px;
  padding: 0 3px;
}

.moment-feed-heading p {
  margin: 0;
  color: var(--ink-faint);
  font-family: var(--font-display);
  font-size: 9.5px;
  letter-spacing: 0.04em;
}

.moment-feed-heading strong {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 500;
}

.moment-feed-date {
  font-family: var(--font-display);
  letter-spacing: 0.1em !important;
}

.moment-feed {
  display: flex;
  flex-direction: column;
  gap: 17px;
  max-width: 880px;
  margin: 0 auto;
}

.moment-card {
  position: relative;
  padding: 23px 26px 19px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 251, 246, 0.79);
  box-shadow: 0 20px 48px -43px rgba(80, 47, 38, 0.5);
  animation: card-in 500ms var(--ease-spring) both;
}

.moment-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.moment-avatar {
  width: 35px;
  height: 35px;
  margin: 0;
  border: 1px solid rgba(91, 58, 51, 0.08);
  font-size: 11px;
}

.moment-author {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.4;
}

.moment-author strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.moment-author small {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 8px;
  letter-spacing: 0.03em;
}

.moment-card-actions {
  display: flex;
  margin-left: auto;
  opacity: 0.76;
  transition: opacity 180ms ease;
}

.moment-card:hover .moment-card-actions,
.moment-card:focus-within .moment-card-actions {
  opacity: 1;
}

.moment-text {
  margin: 15px 0 0;
  overflow-wrap: anywhere;
  color: #5d4842;
  font-family: var(--font-display);
  font-size: 14.5px;
  line-height: 1.85;
  letter-spacing: 0.016em;
  white-space: pre-line;
}

.moment-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin-top: 15px;
  overflow: hidden;
  border-radius: 15px;
}

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

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

.moment-photo {
  position: relative;
  display: block;
  width: 100%;
  min-height: 132px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 10px;
  background: #eee3d9;
  cursor: zoom-in;
}

.moment-photo-grid[data-photo-count="1"] .moment-photo {
  aspect-ratio: 16 / 9;
  max-height: 390px;
}

.moment-photo-grid[data-photo-count="2"] .moment-photo,
.moment-photo-grid[data-photo-count="3"] .moment-photo {
  aspect-ratio: 1 / 1;
}

.moment-photo img {
  transition: transform 450ms var(--ease-spring), opacity 300ms ease;
}

.moment-photo:hover img {
  transform: scale(1.025);
}

.moment-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 13px;
}

.moment-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid rgba(91, 58, 51, 0.07);
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 8px;
  letter-spacing: 0.015em;
  background: rgba(247, 237, 226, 0.65);
}

.moment-meta-chip svg {
  width: 10px;
  height: 10px;
  color: var(--rose);
}

.moment-meta-chip .weather-emoji {
  font-size: 11px;
  line-height: 1;
}

.moment-weather-custom {
  color: var(--ink-soft);
}

.moment-comments {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.moment-comments-head {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-faint);
  font-size: 8.5px;
  letter-spacing: 0.05em;
}

.moment-comments-head svg {
  width: 12px;
  height: 12px;
  color: rgba(141, 74, 81, 0.6);
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 9px;
}

.comment-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(248, 238, 227, 0.58);
}

.comment-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(91, 58, 51, 0.06);
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 7.5px;
}

.comment-avatar--her {
  color: #84434a;
  background: #efd0cb;
}

.comment-avatar--me {
  color: #56614f;
  background: #dde2d4;
}

.comment-content {
  min-width: 0;
  flex: 1;
  font-size: 10px;
  line-height: 1.7;
}

.comment-content strong {
  margin-right: 6px;
  color: var(--ink);
  font-size: 9.5px;
  font-weight: 600;
}

.comment-content p {
  display: inline;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink-soft);
}

.comment-time {
  margin-left: 6px;
  color: var(--ink-faint);
  font-size: 7px;
  white-space: nowrap;
}

.comment-delete {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--ink-faint);
  background: transparent;
  opacity: 0;
  transition: opacity 160ms ease, color 160ms ease, background-color 160ms ease;
}

.comment-row:hover .comment-delete,
.comment-delete:focus-visible {
  opacity: 0.85;
}

.comment-delete:hover {
  color: #94554f;
  background: rgba(255, 251, 246, 0.75);
}

@media (hover: none) {
  .comment-delete {
    opacity: 0.6;
  }
}

.comment-delete svg {
  width: 9px;
  height: 9px;
}

.comment-form {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}

.comment-identity {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  height: 31px;
  padding: 0 6px 0 8px;
  border: 1px solid rgba(91, 58, 51, 0.1);
  border-radius: 9px;
  color: var(--ink-soft);
  background: rgba(255, 252, 247, 0.78);
}

.comment-identity > span {
  color: var(--ink-faint);
  font-size: 7px;
  white-space: nowrap;
}

.comment-identity select {
  max-width: 65px;
  padding: 0 1px;
  border: 0;
  outline: 0;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 8.5px;
  background: transparent;
  cursor: pointer;
}

.comment-input {
  flex: 1;
  min-width: 0;
  height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(91, 58, 51, 0.1);
  border-radius: 999px;
  outline: 0;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 9.5px;
  background: rgba(255, 252, 247, 0.8);
  transition: border-color 180ms ease, background-color 180ms ease;
}

.comment-input:focus {
  border-color: rgba(184, 95, 101, 0.3);
  background: #fffdfa;
}

.comment-send {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 31px;
  height: 31px;
  padding: 0;
  border: 1px solid rgba(141, 74, 81, 0.14);
  border-radius: 50%;
  color: var(--rose-deep);
  background: var(--rose-wash);
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.comment-send:hover {
  color: #fff9f1;
  background: var(--rose-deep);
  transform: translateY(-1px);
}

.comment-send svg {
  width: 12px;
  height: 12px;
}

.comment-empty {
  margin: 9px 0 0;
  color: var(--ink-faint);
  font-size: 8.5px;
}

.empty-state--moment {
  max-width: 880px;
  margin: 0 auto;
}

/* =========================================================
   Anniversaries / 纪念日
   ========================================================= */

.anniv-spotlight {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 206px;
  padding: 30px 38px;
  overflow: hidden;
  border-radius: 27px;
  color: #fcece0;
  background:
    radial-gradient(circle at 94% 16%, rgba(255, 235, 216, 0.12), transparent 30%),
    linear-gradient(135deg, #8a4b51, #6b3c43);
  box-shadow: 0 26px 55px -38px rgba(77, 40, 38, 0.75);
}

.anniv-spotlight::before {
  content: "";
  position: absolute;
  top: -78px;
  left: 36%;
  width: 235px;
  height: 235px;
  border: 1px solid rgba(255, 240, 223, 0.13);
  border-radius: 50%;
}

.anniv-spotlight::after {
  content: "“";
  position: absolute;
  right: 23%;
  bottom: -62px;
  color: rgba(255, 240, 225, 0.07);
  font-family: var(--font-display);
  font-size: 210px;
  line-height: 1;
  pointer-events: none;
}

.anniv-spotlight-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.anniv-spotlight-copy .eyebrow {
  color: rgba(252, 236, 224, 0.57);
  font-size: 7.5px;
  letter-spacing: 0.2em;
}

.anniv-spotlight-copy h2 {
  margin: 12px 0 0;
  color: #fff7ed;
  font-family: var(--font-display);
  font-size: clamp(29px, 3.4vw, 42px);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.045em;
}

.anniv-spotlight-copy > p {
  margin: 5px 0 0;
  color: rgba(252, 236, 224, 0.65);
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.05em;
}

.anniv-spotlight-note {
  display: block;
  max-width: 400px;
  margin-top: 18px;
  color: rgba(252, 236, 224, 0.44);
  font-size: 8.5px;
  letter-spacing: 0.025em;
}

.anniv-spotlight-count {
  position: relative;
  z-index: 2;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 160px;
  min-height: 146px;
  padding: 19px 24px;
  border: 1px solid rgba(255, 241, 226, 0.16);
  border-radius: 50%;
  text-align: center;
  background: rgba(255, 249, 241, 0.055);
}

.anniv-spotlight-count > span {
  max-width: 120px;
  color: rgba(252, 236, 224, 0.57);
  font-size: 8px;
  line-height: 1.6;
  letter-spacing: 0.04em;
}

.anniv-spotlight-count div {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
  margin-top: 2px;
}

.anniv-spotlight-count strong {
  color: #fff7eb;
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.06em;
}

.anniv-spotlight-count em {
  color: rgba(252, 236, 224, 0.62);
  font-size: 10px;
  font-style: normal;
}

.anniv-spotlight-count.is-today strong {
  font-size: 32px;
  letter-spacing: -0.02em;
}

.anniv-spotlight-flower {
  position: absolute;
  right: 22px;
  bottom: -30px;
  width: 159px;
  height: 159px;
  color: rgba(255, 238, 220, 0.15);
  pointer-events: none;
}

.anniv-list-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 25px 3px 13px;
}

.anniv-list-heading p {
  margin: 0;
  color: var(--ink-faint);
  font-size: 9.5px;
  line-height: 1.8;
  letter-spacing: 0.025em;
}

.anniv-list-heading p:last-child {
  max-width: 460px;
  text-align: right;
  font-size: 8px;
}

.anniv-list-heading strong {
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
}

.anniversary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding-bottom: 14px;
}

.anniv-card {
  --anniv-accent: var(--rose);
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 205px;
  padding: 20px 21px 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 251, 246, 0.78);
  box-shadow: 0 15px 40px -41px rgba(80, 47, 38, 0.5);
  animation: card-in 500ms var(--ease-spring) both;
  transition: transform 250ms var(--ease-spring), border-color 200ms ease, box-shadow 250ms ease;
}

.anniv-card:nth-child(3n + 2) {
  --anniv-accent: var(--gold);
}

.anniv-card:nth-child(3n + 3) {
  --anniv-accent: var(--sage);
}

.anniv-card:hover {
  border-color: rgba(125, 78, 66, 0.2);
  box-shadow: 0 22px 45px -35px rgba(80, 47, 38, 0.37);
  transform: translateY(-3px);
}

.anniv-card.is-builtin {
  border-color: rgba(184, 95, 101, 0.2);
  background:
    radial-gradient(circle at 100% 0%, rgba(247, 226, 217, 0.7), transparent 37%),
    rgba(255, 251, 246, 0.86);
}

.anniv-card.is-today {
  border-color: rgba(184, 95, 101, 0.35);
  box-shadow: 0 18px 45px -36px rgba(141, 74, 81, 0.5);
}

.anniv-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.anniv-emoji {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border: 1px solid rgba(91, 58, 51, 0.06);
  border-radius: 50%;
  font-size: 16px;
  background: var(--rose-wash);
}

.anniv-badge {
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--ink-faint);
  font-size: 7px;
  letter-spacing: 0.05em;
  background: rgba(244, 235, 225, 0.75);
}

.anniv-badge--builtin {
  color: var(--rose-deep);
  background: var(--rose-wash);
}

.anniv-card-actions {
  display: flex;
  margin-left: auto;
  opacity: 0.64;
  transition: opacity 180ms ease;
}

.anniv-card:hover .anniv-card-actions,
.anniv-card:focus-within .anniv-card-actions {
  opacity: 1;
}

.anniv-card h3 {
  margin: 13px 0 0;
  overflow: hidden;
  color: var(--ink-deep);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.anniv-card-date {
  margin: 4px 0 0;
  color: var(--ink-faint);
  font-family: var(--font-display);
  font-size: 8.5px;
  letter-spacing: 0.06em;
}

.anniv-card-count {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-top: auto;
  padding-top: 16px;
  color: var(--ink-soft);
}

.anniv-card-count strong {
  color: var(--anniv-accent);
  font-family: var(--font-display);
  font-size: 37px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.06em;
}

.anniv-card-count span {
  color: var(--ink-faint);
  font-size: 8px;
  letter-spacing: 0.04em;
}

.anniv-card-count.is-today strong {
  font-size: 24px;
  letter-spacing: -0.035em;
}

.anniv-card.is-past {
  background: rgba(250, 246, 239, 0.65);
}

.anniv-card.is-past .anniv-card-count strong,
.anniv-card-past strong {
  color: var(--ink-faint);
  font-size: 24px;
  letter-spacing: -0.03em;
}

.anniv-card-note {
  display: -webkit-box;
  margin: 7px 0 0;
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 8.5px;
  line-height: 1.7;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.anniv-add-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 205px;
  padding: 24px;
  border: 1px dashed rgba(91, 58, 51, 0.18);
  border-radius: 22px;
  color: var(--ink-faint);
  text-align: center;
  background: rgba(255, 252, 247, 0.28);
  transition: border-color 200ms ease, background-color 200ms ease, color 200ms ease;
}

.anniv-add-card:hover {
  color: var(--rose-deep);
  border-color: rgba(184, 95, 101, 0.28);
  background: rgba(255, 251, 246, 0.6);
}

.anniv-add-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 10px;
  border: 1px solid rgba(141, 74, 81, 0.18);
  border-radius: 50%;
  background: var(--rose-wash);
}

.anniv-add-icon svg {
  width: 17px;
  height: 17px;
}

.anniv-add-card strong {
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
}

.anniv-add-card span {
  margin-top: 4px;
  font-size: 8px;
}

/* =========================================================
   Memory additions / photos, weather & moods
   ========================================================= */

.memory-day-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}

.memory-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border: 1px solid rgba(91, 58, 51, 0.07);
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 8px;
  line-height: 1.4;
  background: rgba(247, 237, 226, 0.6);
}

.memory-meta-chip .meta-emoji {
  font-size: 10px;
  line-height: 1;
}

.memory-photo {
  position: relative;
  display: block;
  width: 100%;
  max-height: 310px;
  margin-top: 15px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(91, 58, 51, 0.07);
  border-radius: 13px;
  background: #eee3d9;
  aspect-ratio: 16 / 9;
  cursor: zoom-in;
}

.memory-photo img {
  transition: opacity 300ms ease, transform 450ms var(--ease-spring);
}

.memory-photo:hover img {
  transform: scale(1.02);
}

/* photo picker */
.photo-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: stretch;
}

.photo-thumb {
  position: relative;
  flex: 0 0 100px;
  width: 100px;
  height: 100px;
  overflow: hidden;
  border: 1px solid rgba(91, 58, 51, 0.1);
  border-radius: 12px;
  background: #f2e7dc;
}

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

.photo-thumb-remove {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  color: #fff8f0;
  background: rgba(57, 39, 35, 0.58);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.photo-thumb-remove:hover {
  background: rgba(141, 74, 81, 0.86);
}

.photo-thumb-remove svg {
  width: 9px;
  height: 9px;
}

.photo-add {
  display: flex;
  flex: 0 0 100px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 100px;
  padding: 8px;
  border: 1px dashed rgba(91, 58, 51, 0.19);
  border-radius: 12px;
  color: var(--ink-faint);
  text-align: center;
  background: rgba(255, 252, 247, 0.45);
  transition: border-color 180ms ease, color 180ms ease, background-color 180ms ease;
}

.photo-add:hover {
  color: var(--rose-deep);
  border-color: rgba(184, 95, 101, 0.3);
  background: var(--rose-wash);
}

.photo-add:disabled {
  opacity: 0.48;
}

.photo-add svg {
  width: 17px;
  height: 17px;
  margin-bottom: 5px;
}

.photo-add span {
  font-size: 8px;
  line-height: 1.5;
}

.photo-add small {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 7px;
}

.photo-hint {
  width: 100%;
  margin: 1px 0 0;
  color: var(--ink-faint);
  font-size: 8px;
  line-height: 1.7;
}

.photo-status {
  width: 100%;
  color: var(--ink-faint);
  font-size: 8.5px;
}

.photo-status.is-error {
  color: #96534e;
}

/* quick choices in memory modal */
.quick-field {
  gap: 8px;
}

.quick-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.quick-field-head .field-label {
  color: var(--ink-soft);
}

.quick-field-head .field-hint {
  white-space: nowrap;
}

.quick-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.quick-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid rgba(91, 58, 51, 0.1);
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 8.5px;
  line-height: 1;
  background: rgba(255, 252, 247, 0.58);
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.quick-chip:hover {
  color: var(--ink);
  border-color: rgba(184, 95, 101, 0.2);
  background: var(--rose-wash);
}

.quick-chip.is-active {
  color: var(--rose-deep);
  border-color: rgba(184, 95, 101, 0.25);
  background: var(--rose-wash);
}

.quick-chip .quick-emoji {
  font-size: 11px;
  line-height: 1;
}

.quick-field input {
  min-height: 38px;
}

/* lightbox */
.modal--lightbox {
  width: min(880px, calc(100vw - 40px));
  padding: 14px;
  background: #f9f2e9;
}

.lightbox-image {
  display: block;
  width: 100%;
  max-height: 76vh;
  object-fit: contain;
  border-radius: 16px;
  background: #eee2d7;
}

.lightbox-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 6px 3px;
  color: var(--ink-faint);
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.lightbox-close {
  position: fixed;
  top: 23px;
  right: 25px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  padding: 0;
  border: 1px solid rgba(255, 244, 232, 0.2);
  border-radius: 50%;
  color: #fff7ed;
  background: rgba(54, 37, 32, 0.44);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

/* empty add tile for anniversaries */
.anniv-empty-note {
  grid-column: 1 / -1;
  margin-top: 1px;
  color: var(--ink-faint);
  font-size: 8px;
  text-align: center;
}

/* =========================================================
   v0.4 — nine-photo grids, drag & drop, clearer anniversary actions
   ========================================================= */

.photo-picker {
  position: relative;
  min-height: 100px;
  border-radius: 14px;
  transition: background-color 180ms ease, outline-color 180ms ease;
}

.photo-picker.is-dragover {
  outline: 2px dashed var(--rose);
  outline-offset: 5px;
  background: var(--rose-wash);
}

.photo-picker.is-dragover::after {
  content: "松开鼠标，把照片放进来";
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--rose-deep);
  font-size: 11px;
  letter-spacing: 0.03em;
  background: rgba(255, 250, 244, 0.88);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  pointer-events: none;
}

.photo-add small {
  font-size: 6.5px;
  letter-spacing: -0.01em;
}

/* moment grid */
.moment-photo-grid[data-photo-count="4"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.moment-photo-grid[data-photo-count="3"] .moment-photo,
.moment-photo-grid[data-photo-count="4"] .moment-photo,
.moment-photo-grid[data-photo-count="5"] .moment-photo,
.moment-photo-grid[data-photo-count="6"] .moment-photo,
.moment-photo-grid[data-photo-count="7"] .moment-photo,
.moment-photo-grid[data-photo-count="8"] .moment-photo,
.moment-photo-grid[data-photo-count="9"] .moment-photo {
  aspect-ratio: 1 / 1;
  min-height: 0;
}

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

/* memory grid */
.memory-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin-top: 15px;
  overflow: hidden;
  border-radius: 13px;
}

.memory-photo-grid .memory-photo {
  width: 100%;
  min-height: 0;
  max-height: none;
  margin-top: 0;
  border: 0;
  border-radius: 0;
  aspect-ratio: 1 / 1;
}

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

.memory-photo-grid[data-photo-count="1"] .memory-photo {
  aspect-ratio: 16 / 9;
  max-height: 310px;
}

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

.memory-photo-grid[data-photo-count="2"] .memory-photo,
.memory-photo-grid[data-photo-count="4"] .memory-photo {
  aspect-ratio: 1 / 1;
}

/* anniversary actions always visible */
.anniv-card-actions {
  gap: 4px;
  opacity: 1;
}

.anniv-action {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid rgba(91, 58, 51, 0.12);
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 8.5px;
  line-height: 1;
  background: rgba(255, 252, 247, 0.82);
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.anniv-action svg {
  width: 10px;
  height: 10px;
}

.anniv-action:hover {
  color: var(--rose-deep);
  border-color: rgba(184, 95, 101, 0.2);
  background: var(--rose-wash);
}

.anniv-action--danger:hover {
  color: #93544f;
  background: #f1e1d9;
}

.anniv-action--settings {
  color: var(--rose-deep);
}

/* one-off past count needs the quieter treatment on all widths */
.anniv-card-count.anniv-card-past strong,
.anniv-card.is-past .anniv-card-count strong {
  color: var(--ink-faint);
  font-size: 24px;
  letter-spacing: -0.03em;
}

@media (max-width: 760px) {
  .anniv-card-top {
    flex-wrap: wrap;
  }

  .anniv-card-actions {
    gap: 3px;
  }

  .anniv-action {
    min-height: 24px;
    padding: 3px 7px;
    font-size: 8px;
  }

  .moment-photo-grid[data-photo-count="5"] .moment-photo,
  .moment-photo-grid[data-photo-count="6"] .moment-photo,
  .moment-photo-grid[data-photo-count="7"] .moment-photo,
  .moment-photo-grid[data-photo-count="8"] .moment-photo,
  .moment-photo-grid[data-photo-count="9"] .moment-photo {
    min-height: 0;
  }
}

@media (max-width: 480px) {
  .anniversary-grid {
    grid-template-columns: 1fr;
  }

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

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

  .moment-photo-grid[data-photo-count="3"] .moment-photo:first-child {
    grid-column: 1 / -1;
    aspect-ratio: 16 / 9;
  }

  .memory-photo-grid {
    gap: 4px;
  }

  .anniv-action {
    font-size: 7.5px;
  }
}


@media (max-width: 1240px) {
  .anniversary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .anniv-spotlight {
    padding-right: 30px;
    padding-left: 30px;
  }

  .anniv-spotlight-count {
    min-width: 145px;
    min-height: 136px;
  }

  .anniv-spotlight-count strong {
    font-size: 49px;
  }
}

@media (max-width: 1080px) {
  .moment-daybar {
    align-items: flex-start;
    flex-direction: column;
    gap: 17px;
    padding: 23px 24px;
  }

  .moment-daybar::after {
    right: 25%;
  }

  .moment-date-controls {
    width: 100%;
  }

  .date-picker {
    flex: 1;
    max-width: 220px;
  }

  .date-picker input {
    width: 100%;
  }

  .today-button {
    margin-left: auto;
  }

  .anniv-spotlight {
    min-height: 190px;
  }

  .anniv-spotlight-note {
    margin-top: 13px;
  }
}

@media (max-width: 960px) {
  .mobile-nav {
    padding-right: 5px;
    padding-left: 5px;
  }

  .mobile-nav a {
    min-width: 0;
    font-size: 7px;
  }

  .mobile-nav a svg {
    width: 16px;
    height: 16px;
  }

  .anniv-spotlight {
    padding: 27px 28px;
  }

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

@media (max-width: 760px) {
  .nav-link {
    min-height: 46px;
  }

  .moment-daybar {
    border-radius: 22px;
    padding: 21px;
  }

  .moment-day-copy h2 {
    font-size: 29px;
  }

  .moment-day-copy > p:last-child {
    font-size: 9px;
  }

  .moment-date-controls {
    gap: 5px;
  }

  .day-arrow {
    width: 33px;
    height: 33px;
  }

  .date-picker {
    min-width: 0;
    height: 33px;
    padding: 0 9px;
  }

  .date-picker input {
    font-size: 9px;
  }

  .today-button {
    min-height: 33px;
    padding: 6px 9px;
    font-size: 8.5px;
  }

  .quick-moment {
    gap: 10px;
    padding: 13px 14px;
  }

  .quick-moment-copy span {
    display: none;
  }

  .quick-moment-copy strong {
    font-size: 12.5px;
  }

  .quick-moment .button {
    min-height: 34px;
    padding: 7px 11px;
    font-size: 9px;
  }

  .quick-moment .button svg {
    display: none;
  }

  .moment-feed-heading {
    margin-top: 20px;
  }

  .moment-card {
    padding: 19px 18px 16px;
    border-radius: 20px;
  }

  .moment-text {
    margin-top: 12px;
    font-size: 13.5px;
    line-height: 1.85;
  }

  .moment-photo-grid {
    margin-top: 12px;
  }

  .moment-photo {
    min-height: 108px;
  }

  .moment-comments {
    margin-top: 13px;
    padding-top: 12px;
  }

  .comment-form {
    flex-wrap: wrap;
  }

  .comment-identity {
    height: 30px;
  }

  .comment-input {
    height: 31px;
    flex-basis: calc(100% - 93px);
  }

  .comment-send {
    width: 31px;
    height: 31px;
  }

  .anniv-spotlight {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
    min-height: 0;
    padding: 24px;
  }

  .anniv-spotlight-copy h2 {
    font-size: 30px;
  }

  .anniv-spotlight-note {
    max-width: 330px;
  }

  .anniv-spotlight-count {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    min-width: 0;
    min-height: 0;
    width: 100%;
    padding: 11px 15px;
    border-radius: 13px;
    text-align: left;
  }

  .anniv-spotlight-count > span {
    max-width: 160px;
  }

  .anniv-spotlight-count div {
    margin-top: 0;
    margin-left: auto;
  }

  .anniv-spotlight-count strong {
    font-size: 36px;
  }

  .anniv-spotlight-count.is-today strong {
    font-size: 23px;
  }

  .anniv-spotlight-flower {
    width: 115px;
    height: 115px;
    right: -20px;
    bottom: -35px;
  }

  .anniv-list-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
    padding-top: 21px;
  }

  .anniv-list-heading p:last-child {
    text-align: left;
  }

  .anniversary-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .anniv-card {
    min-height: 177px;
  }

  .anniv-add-card {
    min-height: 145px;
  }

  .anniv-card-count {
    padding-top: 12px;
  }

  .modal--wide {
    width: 100%;
  }

  .photo-thumb,
  .photo-add {
    flex-basis: 86px;
    width: 86px;
    height: 86px;
  }

  .photo-thumb-remove {
    width: 19px;
    height: 19px;
  }

  .memory-photo {
    max-height: 260px;
  }

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

  .modal--lightbox {
    width: 100%;
    padding: 10px;
    border-radius: 21px 21px 0 0;
  }

  .lightbox-image {
    max-height: 71vh;
  }
}

@media (max-width: 480px) {
  .moment-day-copy h2 {
    font-size: 26px;
  }

  .moment-daybar {
    padding: 18px;
    border-radius: 20px;
  }

  .moment-date-controls {
    display: grid;
    grid-template-columns: 33px minmax(0, 1fr) 33px;
    width: 100%;
  }

  .date-picker {
    width: 100%;
    max-width: none;
    grid-column: 1 / -1;
    grid-row: 1;
    justify-content: center;
    order: -1;
    margin-bottom: 2px;
  }

  .day-arrow {
    grid-row: 2;
  }

  .day-arrow:first-of-type {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
  }

  #moments-next {
    grid-column: 3;
    grid-row: 2;
    justify-self: end;
    margin-left: 0;
  }

  .today-button {
    grid-column: 2;
    grid-row: 2;
    justify-self: center;
    margin-left: 0;
  }

  .quick-moment {
    border-radius: 17px;
  }

  .quick-moment-avatar {
    width: 35px;
    height: 35px;
  }

  .quick-moment-copy strong {
    font-size: 11.5px;
  }

  .quick-moment .button {
    padding-right: 9px;
    padding-left: 9px;
    font-size: 8.5px;
  }

  .moment-card {
    padding: 16px 14px 14px;
    border-radius: 18px;
  }

  .moment-avatar {
    width: 32px;
    height: 32px;
    font-size: 10px;
  }

  .moment-author strong {
    font-size: 12px;
  }

  .moment-text {
    font-size: 13px;
  }

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

  .moment-photo-grid[data-photo-count="3"] .moment-photo:first-child {
    grid-column: 1 / -1;
    aspect-ratio: 16 / 9;
  }

  .moment-photo-grid[data-photo-count="2"] .moment-photo,
  .moment-photo-grid[data-photo-count="3"] .moment-photo {
    min-height: 100px;
  }

  .comment-row {
    padding: 7px 8px;
  }

  .comment-content {
    font-size: 9.5px;
  }

  .comment-identity {
    padding-left: 6px;
  }

  .comment-identity > span {
    display: none;
  }

  .comment-identity select {
    max-width: 58px;
    font-size: 8px;
  }

  .comment-input {
    flex-basis: calc(100% - 92px);
    font-size: 9px;
  }

  .anniv-spotlight {
    border-radius: 22px;
    padding: 20px;
  }

  .anniv-spotlight-copy h2 {
    font-size: 27px;
  }

  .anniv-spotlight-note {
    font-size: 8px;
    line-height: 1.8;
  }

  .anniv-spotlight-count {
    flex-wrap: wrap;
    gap: 4px 10px;
  }

  .anniv-spotlight-count strong {
    font-size: 31px;
  }

  .anniv-card {
    padding: 17px;
    min-height: 169px;
    border-radius: 19px;
  }

  .anniv-card h3 {
    font-size: 17px;
  }

  .anniv-card-count strong {
    font-size: 33px;
  }

  .anniv-card.is-past .anniv-card-count strong,
  .anniv-card-count.anniv-card-past strong {
    font-size: 22px;
  }

  .anniv-add-card {
    min-height: 130px;
    border-radius: 19px;
  }

  .quick-field-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .quick-field-head .field-hint {
    white-space: normal;
  }

  .quick-chip {
    min-height: 27px;
    padding: 4px 8px;
    font-size: 8px;
  }
}

@media (max-width: 380px) {
  .mobile-nav a {
    font-size: 6.5px;
  }

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

  .quick-moment-copy strong {
    font-size: 10.5px;
  }

  .quick-moment .button {
    padding-right: 8px;
    padding-left: 8px;
  }

  .moment-date-controls {
    grid-template-columns: 31px minmax(0, 1fr) 31px;
  }

  .day-arrow {
    width: 31px;
    height: 31px;
  }

  .date-picker {
    height: 31px;
  }

  .today-button {
    min-height: 31px;
    font-size: 8px;
  }

  .photo-thumb,
  .photo-add {
    flex-basis: 79px;
    width: 79px;
    height: 79px;
  }
}

/* =========================================================
   v0.5 — account-aware identity, avatars, shared preference
   ========================================================= */

.avatar,
.filter-avatar,
.comment-avatar,
.owner-mini {
  overflow: hidden;
}

.avatar img,
.filter-avatar img,
.comment-avatar img,
.owner-mini img,
.avatar-setting-preview img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.quick-moment-avatar.avatar--her {
  color: #84434a;
  background: #efd0cb;
}

.quick-moment-avatar.avatar--me {
  color: #56614f;
  background: #dde2d4;
}

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

.avatar-setting {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(248, 238, 226, 0.5);
}

.avatar-setting-preview {
  width: 46px;
  height: 46px;
  margin: 0;
  border: 2px solid #fbf4ed;
  font-size: 16px;
}

.avatar-setting-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.avatar-setting-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar-setting-copy small {
  color: var(--ink-faint);
  font-size: 8.5px;
  line-height: 1.5;
}

.avatar-setting-copy small.is-error {
  color: #985b52;
}

.avatar-setting-button {
  flex: none;
  padding: 5px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 9px;
  line-height: 1.2;
  background: var(--card);
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.avatar-setting-button:hover {
  color: var(--rose-deep);
  border-color: rgba(184, 95, 101, 0.24);
  background: var(--rose-wash);
}

.shared-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(248, 238, 226, 0.48);
  cursor: pointer;
}

.shared-toggle input {
  width: 15px;
  height: 15px;
  margin: 2px 0 0;
  accent-color: var(--rose);
  flex: none;
}

.shared-toggle-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.shared-toggle-copy strong {
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
}

.shared-toggle-copy small {
  color: var(--ink-faint);
  font-size: 8.5px;
  line-height: 1.55;
}

@media (max-width: 640px) {
  .avatar-settings {
    grid-template-columns: 1fr;
  }
}

.choice-symbol {
  overflow: hidden;
}

.choice-symbol img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

/* account-aware home motto and personal settings */
.hero-motto {
  display: flex;
  align-items: baseline;
  gap: 9px;
  max-width: 520px;
  margin: 16px 0 0;
  color: var(--rose-deep);
  font-family: var(--font-display);
  font-size: 14px;
  line-height: 1.75;
  letter-spacing: 0.015em;
}

.hero-motto-label {
  flex: none;
  color: var(--ink-faint);
  font-family: var(--font-body);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-motto #home-motto {
  min-width: 0;
}

@media (max-width: 640px) {
  .hero-motto {
    font-size: 12.5px;
  }

  .hero-motto-label {
    font-size: 7px;
  }
}

.avatar-setting-preview {
  width: 80px;
  height: 80px;
  padding: 0;
  cursor: zoom-in;
}

.avatar-zoom {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 252, 246, 0.72);
}

.avatar-zoom[hidden] {
  display: none;
}

.avatar-zoom-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.avatar-zoom-head strong {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 500;
}

.avatar-zoom-close {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-faint);
  font-family: var(--font-body);
  font-size: 8.5px;
  background: transparent;
  cursor: pointer;
}

.avatar-zoom img {
  display: block;
  width: min(320px, 100%);
  height: auto;
  margin: 0 auto;
  border-radius: 18px;
  object-fit: contain;
}

/* =========================================================
   v0.7 — weekly timetable
   ========================================================= */

.timetable-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.timetable-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 22px 0 13px;
}

.segmented--timetable {
  flex-wrap: wrap;
}

.timetable-summary {
  margin: 0;
  color: var(--ink-faint);
  font-size: 10px;
  letter-spacing: 0.02em;
}

.schedule-weekbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 12px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 252, 246, 0.62);
}

.schedule-week-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.schedule-week-picker {
  min-width: 132px;
}

.schedule-week-range {
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.timetable-shell {
  overflow-x: auto;
  overflow-y: visible;
  max-height: none;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 252, 246, 0.64);
  box-shadow: var(--shadow-soft);
  scrollbar-width: thin;
}

.timetable-grid {
  display: grid;
  grid-template-columns: 94px repeat(7, minmax(118px, 1fr));
  min-width: 940px;
  grid-auto-rows: minmax(104px, auto);
}

.timetable-corner,
.timetable-day {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  min-height: 55px;
  padding: 8px 6px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line-strong);
  background: rgba(248, 238, 226, 0.96);
  color: var(--ink-soft);
  font-size: 10px;
  backdrop-filter: blur(8px);
}

.timetable-corner {
  left: 0;
  z-index: 6;
  align-items: flex-start;
  padding-left: 15px;
}

.timetable-corner span {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 13px;
}

.timetable-corner small,
.timetable-day small {
  color: var(--ink-faint);
  font-size: 7px;
  letter-spacing: 0.05em;
}

.timetable-day.is-today {
  color: var(--rose-deep);
  background: #f7e8e4;
}

.timetable-day.is-today small {
  color: var(--rose);
}

.timetable-time {
  position: sticky;
  left: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  padding: 9px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(252, 247, 239, 0.98);
}

.timetable-time strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
}

.timetable-time span,
.timetable-time i {
  color: var(--ink-faint);
  font-size: 7.5px;
  font-style: normal;
  letter-spacing: 0.02em;
}

.timetable-time span {
  color: var(--ink-soft);
}

.timetable-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  padding: 6px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transition: background-color 160ms ease;
}

.timetable-cell.is-today {
  background: rgba(247, 232, 228, 0.34);
}

.timetable-cell:hover {
  background: rgba(255, 253, 249, 0.86);
}

.timetable-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-height: 88px;
  padding: 6px;
  border: 1px dashed rgba(184, 95, 101, 0.2);
  border-radius: 9px;
  color: var(--ink-faint);
  font-family: var(--font-body);
  font-size: 8px;
  background: transparent;
  cursor: pointer;
  opacity: 0.48;
  transition: opacity 160ms ease, border-color 160ms ease, color 160ms ease;
}

.timetable-add svg {
  width: 11px;
  height: 11px;
}

.timetable-add:hover {
  opacity: 1;
  border-color: var(--rose);
  color: var(--rose-deep);
}

.timetable-add--mini {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 20px;
  min-height: 20px;
  height: 20px;
  padding: 0;
  border-style: solid;
  border-radius: 50%;
  background: rgba(255, 252, 246, 0.94);
  opacity: 0;
}

.timetable-cell:hover .timetable-add--mini,
.timetable-cell:focus-within .timetable-add--mini {
  opacity: 1;
}

.course-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  min-width: 0;
  padding: 7px 7px 6px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, filter 160ms ease;
}

.course-chip:hover {
  filter: brightness(0.97);
  transform: translateY(-1px);
}

.course-chip--me {
  border-left-color: #8b9b75;
  color: #4e5b46;
  background: #eef1e7;
}

.course-chip--her {
  border-left-color: #c48285;
  color: #7c484b;
  background: #f7e7e4;
}

.course-chip-title {
  display: -webkit-box;
  overflow: hidden;
  width: 100%;
  font-family: var(--font-display);
  font-size: 9.5px;
  font-weight: 500;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.course-chip-meta {
  overflow: hidden;
  width: 100%;
  color: currentColor;
  font-size: 7px;
  line-height: 1.35;
  opacity: 0.72;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.course-chip-owner {
  color: currentColor;
  font-size: 6.5px;
  letter-spacing: 0.03em;
  opacity: 0.62;
}

.timetable-note {
  margin: 10px 2px 0;
  color: var(--ink-faint);
  font-size: 8.5px;
  line-height: 1.7;
}

.unscheduled-panel {
  margin-top: 24px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 252, 246, 0.6);
}

.unscheduled-heading .eyebrow {
  margin-bottom: 5px;
}

.unscheduled-heading h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
}

.unscheduled-heading p {
  margin: 5px 0 13px;
  color: var(--ink-faint);
  font-size: 9px;
}

.unscheduled-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.unscheduled-chip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 180px;
  padding: 9px 11px;
  border-left: 3px solid transparent;
  border-radius: 10px;
}

.unscheduled-chip--me {
  border-left-color: #8b9b75;
  background: #eef1e7;
  color: #4e5b46;
}

.unscheduled-chip--her {
  border-left-color: #c48285;
  background: #f7e7e4;
  color: #7c484b;
}

.unscheduled-chip strong {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
}

.unscheduled-chip span {
  font-size: 8px;
  opacity: 0.7;
}

.course-detail-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0 2px;
}

.course-detail-list p {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.course-detail-list span {
  flex: 0 0 54px;
  color: var(--ink-faint);
  font-size: 8px;
}

.course-detail-list strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
}

.course-delete-button {
  color: #995c54;
}

@media (max-width: 760px) {
  .timetable-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .timetable-shell {
    max-height: none;
    border-radius: 16px;
  }

  .timetable-grid {
    grid-template-columns: 78px repeat(7, minmax(104px, 1fr));
    min-width: 810px;
  }

  .timetable-header-actions .button {
    padding-right: 11px;
    padding-left: 11px;
    font-size: 8.5px;
  }

  .timetable-summary {
    font-size: 9px;
  }

  .unscheduled-panel {
    padding: 15px;
    border-radius: 15px;
  }
}

/* v0.7.1 — compact personal-settings header */
.modal-header--compact {
  justify-content: flex-end;
  min-height: 32px;
  margin-bottom: 8px;
}

.modal-header--compact .modal-close {
  margin-top: -3px;
}

/* v0.7.1 — larger overlapping avatars in the personal-settings summary */
.settings-summary .avatar-stack .avatar {
  width: 42px;
  height: 42px;
  font-size: 13px;
}

/* v0.7.1 — make the date line under each weekday readable */
.timetable-day small {
  font-size: 8.5px;
  letter-spacing: 0.02em;
}

/* ---------------------------------------------------------
   v0.8 课表按周显示：周次选择器 + 学期设置
   --------------------------------------------------------- */
.week-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.week-picker select {
  flex: 1 1 92px;
  width: auto;
  min-width: 92px;
  min-height: 40px;
  padding: 8px 10px;
}

.week-picker-sep {
  color: var(--ink-faint);
  font-size: 9px;
}

.week-picker-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip-button {
  padding: 6px 12px;
  border: 1px solid rgba(91, 58, 51, 0.16);
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.9);
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 10px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: border-color 180ms ease, color 180ms ease, background-color 180ms ease;
}

.chip-button:hover {
  border-color: rgba(184, 95, 101, 0.4);
  color: var(--ink);
  background: #fffdfa;
}

.term-skip-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid rgba(91, 58, 51, 0.1);
  border-radius: 11px;
  background: rgba(255, 253, 249, 0.7);
}

.term-skip-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 7px;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 10px;
  cursor: pointer;
}

.term-skip-item:hover {
  background: rgba(184, 95, 101, 0.07);
}

.term-skip-item input {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  min-height: 0;
  padding: 0;
  accent-color: var(--rose);
}

/* =========================================================
   v0.9 — blind boxes
   ========================================================= */

.blindbox-viewbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 22px 0 16px;
}

.segmented--blindbox button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.segmented--blindbox b {
  display: grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  color: var(--rose-deep);
  font-size: 8px;
  font-weight: 500;
  background: rgba(255, 250, 243, 0.85);
}

.blindbox-tip {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  color: var(--ink-faint);
  font-size: 9px;
}

.blindbox-tip svg {
  width: 12px;
  height: 12px;
  color: var(--gold);
}

.blindbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 12px;
}

.blindbox-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 252, 246, 0.72);
  box-shadow: var(--shadow-soft);
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.blindbox-card:hover {
  transform: translateY(-2px);
  border-color: rgba(184, 95, 101, 0.24);
}

.blindbox-card.is-active {
  border-color: rgba(184, 95, 101, 0.42);
  background: rgba(251, 242, 234, 0.84);
}

.blindbox-card-main {
  display: flex;
  flex: 1;
  align-items: flex-start;
  gap: 11px;
  width: 100%;
  min-height: 112px;
  padding: 15px 15px 10px;
  border: 0;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.blindbox-card-emoji {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(184, 95, 101, 0.13);
  border-radius: 13px;
  font-size: 22px;
  background: rgba(248, 232, 221, 0.62);
}

.blindbox-card-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.blindbox-card-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.blindbox-card-copy > span {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.blindbox-card-copy small {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 8px;
}

.blindbox-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 12px 11px;
}

.blindbox-card-draw {
  margin-right: auto;
  padding: 5px 10px;
  border: 1px solid rgba(141, 74, 81, 0.18);
  border-radius: 999px;
  color: var(--rose-deep);
  font-family: var(--font-body);
  font-size: 8px;
  background: rgba(255, 249, 241, 0.8);
  cursor: pointer;
}

.blindbox-card-draw:hover {
  border-color: rgba(141, 74, 81, 0.35);
  background: #fffaf3;
}

.empty-state--blindbox {
  min-height: 280px;
  border: 1px dashed rgba(184, 95, 101, 0.22);
  border-radius: 20px;
  background: rgba(255, 252, 246, 0.52);
}

.blindbox-empty-icon {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  margin: 0 auto 14px;
  border-radius: 50%;
  color: var(--rose-deep);
  background: rgba(248, 232, 221, 0.7);
}

.blindbox-empty-icon svg {
  width: 25px;
  height: 25px;
}

.blindbox-detail {
  margin-top: 20px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 252, 246, 0.6);
  box-shadow: var(--shadow-soft);
}

.blindbox-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.blindbox-detail-head .eyebrow {
  margin-bottom: 5px;
}

.blindbox-detail-head h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
}

.blindbox-detail-head p:not(.eyebrow) {
  margin: 5px 0 0;
  color: var(--ink-faint);
  font-size: 9px;
}

.blindbox-detail-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.blindbox-detail-actions .button {
  padding: 8px 11px;
  font-size: 8px;
}

.blindbox-element-list {
  display: flex;
  flex-direction: column;
  margin-top: 4px;
}

.blindbox-element-row {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 58px;
  padding: 9px 4px;
  border-bottom: 1px solid var(--line);
}

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

.blindbox-element-index {
  flex: 0 0 25px;
  color: var(--ink-faint);
  font-family: var(--font-display);
  font-size: 10px;
}

.blindbox-element-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 2px;
}

.blindbox-element-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.blindbox-element-copy small {
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.blindbox-element-weight {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 8px;
  background: rgba(244, 233, 220, 0.7);
}

.blindbox-element-prob {
  flex: 0 0 48px;
  color: var(--rose-deep);
  font-family: var(--font-display);
  font-size: 12px;
  text-align: right;
}

.blindbox-element-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 1px;
}

.blindbox-element-empty {
  padding: 23px 0 5px;
  color: var(--ink-faint);
  font-size: 9px;
  text-align: center;
}

.blindbox-draw-grid {
  display: grid;
  grid-template-columns: minmax(210px, 260px) minmax(0, 1fr);
  align-items: center;
  gap: 36px;
  padding: 22px 0 8px;
}

.blindbox-draw-panel .eyebrow {
  margin-bottom: 5px;
}

.blindbox-draw-panel h2 {
  margin: 0 0 18px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 500;
  line-height: 1.35;
}

.blindbox-select-label {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 8px;
  letter-spacing: 0.04em;
}

.blindbox-select {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 10px;
  background: rgba(255, 252, 246, 0.9);
}

.blindbox-select:focus {
  border-color: var(--rose);
  outline: 0;
}

.blindbox-select:disabled {
  opacity: 0.6;
}

.blindbox-draw-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 12px 0 16px;
  padding: 10px 11px;
  border-radius: 11px;
  background: rgba(248, 238, 226, 0.52);
}

.blindbox-draw-meta strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
}

.blindbox-draw-meta span {
  color: var(--ink-soft);
  font-size: 8px;
}

.blindbox-draw-meta small {
  color: var(--ink-faint);
  font-size: 8px;
  line-height: 1.5;
}

.blindbox-spin {
  width: 100%;
  min-height: 43px;
}

.blindbox-spin:disabled {
  cursor: default;
  opacity: 0.66;
}

.blindbox-draw-note {
  margin: 11px 0 0;
  color: var(--ink-faint);
  font-size: 8px;
  line-height: 1.7;
}

.blindbox-wheel-column {
  min-width: 0;
}

.blindbox-wheel-stage {
  position: relative;
  display: flex;
  justify-content: center;
  width: 100%;
  padding-top: 10px;
}

.blindbox-wheel-wrap {
  width: min(100%, 450px);
  aspect-ratio: 1;
  filter: drop-shadow(0 15px 24px rgba(91, 58, 51, 0.12));
}

.blindbox-wheel {
  width: 100%;
  height: 100%;
  transform-origin: 50% 50%;
  will-change: transform;
}

.blindbox-wheel svg {
  display: block;
  width: 100%;
  height: 100%;
}

.blindbox-pointer {
  position: absolute;
  top: -7px;
  left: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(141, 74, 81, 0.28);
  border-radius: 50%;
  color: var(--rose-deep);
  background: #fffaf3;
  box-shadow: 0 4px 10px rgba(91, 58, 51, 0.15);
  transform: translateX(-50%);
}

.blindbox-pointer::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  width: 8px;
  height: 8px;
  border-right: 1px solid rgba(141, 74, 81, 0.28);
  border-bottom: 1px solid rgba(141, 74, 81, 0.28);
  background: #fffaf3;
  transform: translateX(-50%) rotate(45deg);
}

.blindbox-pointer svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.blindbox-wheel-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 7px;
  width: 100%;
  height: 100%;
  border: 1px dashed rgba(184, 95, 101, 0.24);
  border-radius: 50%;
  color: var(--ink-faint);
  background: rgba(255, 252, 246, 0.55);
}

.blindbox-wheel-empty span {
  font-size: 35px;
  opacity: 0.72;
}

.blindbox-wheel-empty small {
  font-size: 9px;
}

.blindbox-wheel-caption {
  margin: 8px 0 11px;
  color: var(--ink-faint);
  font-size: 8px;
  text-align: center;
}

.blindbox-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  justify-content: center;
}

.blindbox-legend-row {
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: 200px;
  min-width: 0;
  padding: 3px 0;
}

.blindbox-legend-dot {
  flex: 0 0 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.blindbox-legend-title {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.blindbox-legend-weight {
  color: var(--ink-faint);
  font-size: 7.5px;
}

.blindbox-legend-prob {
  color: var(--rose-deep);
  font-size: 7.5px;
}

.blindbox-result {
  margin: 25px auto 0;
  max-width: 620px;
}

.blindbox-result-inner {
  position: relative;
  overflow: hidden;
  padding: 26px 25px 24px;
  border: 1px solid rgba(184, 95, 101, 0.22);
  border-radius: 22px;
  text-align: center;
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 247, 235, 0.95), transparent 42%),
    linear-gradient(135deg, rgba(249, 233, 224, 0.9), rgba(239, 235, 219, 0.82));
  box-shadow: 0 18px 35px rgba(91, 58, 51, 0.1);
  animation: blindboxResultIn 480ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.blindbox-result-inner::after {
  content: "♡";
  position: absolute;
  right: 26px;
  bottom: 15px;
  color: rgba(141, 74, 81, 0.18);
  font-family: var(--font-display);
  font-size: 40px;
}

.blindbox-result-emoji {
  display: block;
  margin: 8px 0 2px;
  font-size: 34px;
}

.blindbox-result-inner h2 {
  margin: 4px 0 7px;
  color: var(--ink-deep);
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
}

.blindbox-result-inner > p:not(.blindbox-result-meta) {
  max-width: 430px;
  margin: 0 auto 12px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.7;
}

.blindbox-result-meta {
  margin: 0 0 16px;
  color: var(--ink-faint);
  font-size: 8px;
  letter-spacing: 0.03em;
}

.blindbox-result-inner .button {
  position: relative;
  z-index: 1;
}

.blindbox-draw-empty {
  min-height: 320px;
  padding: 35px 20px;
  border: 1px dashed rgba(184, 95, 101, 0.22);
  border-radius: 20px;
  background: rgba(255, 252, 246, 0.52);
}

.blindbox-draw-empty > h3,
.blindbox-draw-empty > p {
  margin-right: auto;
  margin-left: auto;
}

@keyframes blindboxResultIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 900px) {
  .blindbox-draw-grid {
    grid-template-columns: 1fr;
    gap: 18px;
    padding-top: 10px;
  }

  .blindbox-draw-panel {
    order: 2;
  }

  .blindbox-wheel-column {
    order: 1;
  }

  .blindbox-draw-panel h2 {
    margin-bottom: 13px;
  }
}

@media (max-width: 640px) {
  .blindbox-viewbar {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .blindbox-detail {
    padding: 15px;
    border-radius: 16px;
  }

  .blindbox-detail-head h2 {
    font-size: 21px;
  }

  .blindbox-detail-actions {
    width: 100%;
  }

  .blindbox-detail-actions .button {
    flex: 1;
  }

  .blindbox-element-row {
    flex-wrap: wrap;
    gap: 5px 8px;
  }

  .blindbox-element-copy {
    flex-basis: calc(100% - 80px);
  }

  .blindbox-element-index {
    flex-basis: 22px;
  }

  .blindbox-element-prob {
    margin-left: auto;
  }

  .blindbox-element-actions {
    margin-left: auto;
  }

  .blindbox-wheel-wrap {
    width: min(100%, 360px);
  }

  .blindbox-result-inner {
    padding: 22px 18px 20px;
  }

  .blindbox-result-inner h2 {
    font-size: 24px;
  }
}

.blindbox-draw-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  text-align: center;
}

.blindbox-draw-empty h3 {
  margin: 3px 0 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
}

.blindbox-draw-empty p {
  max-width: 300px;
  margin: 0 0 6px;
  color: var(--ink-faint);
  font-size: 9px;
  line-height: 1.7;
}

.blindbox-card-draw:disabled {
  cursor: default;
  opacity: 0.42;
}

/* v0.9.1 — reliable emoji picker for blind-box covers */
.blindbox-emoji-picker {
  display: flex;
  align-items: center;
  gap: 10px;
}

.blindbox-emoji-preview {
  display: grid;
  flex: 0 0 48px;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(184, 95, 101, 0.16);
  border-radius: 13px;
  font-size: 24px;
  background: rgba(248, 232, 221, 0.62);
}

.blindbox-emoji-picker input {
  flex: 1;
  min-width: 0;
}

.blindbox-emoji-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.blindbox-emoji-choice {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  padding: 0;
  border: 1px solid rgba(123, 82, 65, 0.12);
  border-radius: 9px;
  font-size: 16px;
  line-height: 1;
  background: rgba(255, 252, 246, 0.72);
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.blindbox-emoji-choice:hover {
  border-color: rgba(141, 74, 81, 0.28);
  background: #fffaf3;
  transform: translateY(-1px);
}

.blindbox-emoji-choice:focus-visible {
  outline: 2px solid rgba(141, 74, 81, 0.32);
  outline-offset: 1px;
}

/* v0.10 — avatar crop editor */
.avatar-crop-overlay {
  position: fixed;
  inset: 0;
  z-index: 800;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(55, 35, 30, 0.46);
  backdrop-filter: blur(8px);
}

.avatar-crop-card {
  width: min(420px, 100%);
  max-height: 92vh;
  overflow: auto;
  padding: 20px;
  border: 1px solid rgba(255, 250, 243, 0.7);
  border-radius: 23px;
  background: #fdf8f1;
  box-shadow: 0 28px 70px rgba(45, 30, 28, 0.32);
  animation: avatarCropIn 220ms ease both;
}

@keyframes avatarCropIn {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.avatar-crop-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.avatar-crop-head .eyebrow {
  margin-bottom: 6px;
}

.avatar-crop-head h2 {
  margin: 0;
  color: var(--ink-deep);
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 500;
}

.avatar-crop-head p:not(.eyebrow) {
  margin: 7px 0 0;
  color: var(--ink-faint);
  font-size: 9px;
  line-height: 1.65;
}

.avatar-crop-stage-wrap {
  display: grid;
  place-items: center;
  padding: 15px 0 13px;
}

.avatar-crop-stage {
  position: relative;
  width: min(260px, 64vw);
  aspect-ratio: 1;
  overflow: hidden;
  border: 3px solid #fffaf3;
  border-radius: 50%;
  background: #e9d8c7;
  box-shadow: 0 12px 30px rgba(70, 43, 35, 0.17);
  cursor: grab;
  touch-action: none;
}

.avatar-crop-stage.is-dragging {
  cursor: grabbing;
}

.avatar-crop-stage img {
  position: absolute;
  max-width: none;
  user-select: none;
  pointer-events: none;
  -webkit-user-drag: none;
}

.avatar-crop-controls {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 252, 246, 0.64);
}

.avatar-crop-control {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 8.5px;
}

.avatar-crop-control > span {
  flex: 0 0 78px;
}

.avatar-crop-control b {
  color: var(--rose-deep);
  font-weight: 500;
}

.avatar-crop-control input[type="range"] {
  flex: 1;
  min-width: 0;
  accent-color: var(--rose);
}

.avatar-crop-hint {
  margin: 10px 1px 14px;
  color: var(--ink-faint);
  font-size: 8px;
  line-height: 1.7;
}

.avatar-crop-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 480px) {
  .avatar-crop-overlay {
    padding: 12px;
  }

  .avatar-crop-card {
    padding: 16px;
    border-radius: 19px;
  }

  .avatar-crop-head h2 {
    font-size: 22px;
  }

  .avatar-crop-stage {
    width: min(230px, 68vw);
  }

  .avatar-crop-footer .button {
    flex: 1;
  }
}

/* v0.10 — multi-select memory moods */
.mood-custom-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
}

.mood-custom-row input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 10px;
  background: rgba(255, 252, 246, 0.9);
}

.mood-custom-row input:focus {
  border-color: var(--rose);
  outline: 0;
}

.mood-add-button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 7px 11px;
  font-size: 8px;
}

.mood-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.mood-selected:empty {
  display: none;
}

.mood-selected-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 4px 8px;
  border: 1px solid rgba(184, 95, 101, 0.16);
  border-radius: 999px;
  color: var(--rose-deep);
  font-family: var(--font-body);
  font-size: 8px;
  background: rgba(248, 232, 221, 0.58);
  cursor: pointer;
}

.mood-selected-tag:hover {
  border-color: rgba(141, 74, 81, 0.32);
  background: #f8e8e1;
}

.mood-count {
  color: var(--ink-faint);
  font-size: 8px;
}

/* v0.10 — compact mobile preference cards */
@media (max-width: 900px) {
  .pref-grid {
    align-items: start;
  }

  .pref-card {
    min-height: 0;
  }

  .pref-card-text p {
    min-height: 0;
  }
}

@media (max-width: 640px) {
  .pref-grid {
    gap: 10px;
  }

  .pref-card {
    min-height: 0;
    padding: 14px 15px 12px;
    border-radius: 17px;
  }

  .pref-card-body {
    margin-top: 11px;
    gap: 9px;
  }

  .pref-symbol {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .pref-card-text h3 {
    font-size: 16px;
  }

  .pref-card-text p {
    min-height: 0;
    margin-top: 4px;
    font-size: 10.5px;
    line-height: 1.65;
    -webkit-line-clamp: 2;
  }

  .pref-card-footer {
    padding-top: 9px;
  }
}

/* v0.10 — current-user avatar in the top bar + slightly larger avatars */
.topbar-avatar {
  width: 38px;
  height: 38px;
  margin: 0;
  padding: 0;
  border: 2px solid #fbf4ed;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(91, 58, 51, 0.12);
  transition: transform 160ms ease, border-color 160ms ease;
}

.topbar-avatar:hover {
  border-color: rgba(184, 95, 101, 0.35);
  transform: translateY(-1px);
}

.topbar-actions {
  gap: 10px;
}

.avatar {
  width: 32px;
  height: 32px;
  font-size: 11px;
}

.avatar-setting-preview {
  width: 92px;
  height: 92px;
}

@media (max-width: 640px) {
  .topbar-avatar {
    width: 34px;
    height: 34px;
  }

  .topbar-actions {
    gap: 8px;
  }
}

.topbar-avatar.avatar {
  width: 38px;
  height: 38px;
  font-size: 11px;
}

@media (max-width: 640px) {
  .topbar-avatar.avatar {
    width: 34px;
    height: 34px;
  }
}

/* v0.10 — custom moment date picker with highlighted days */
.moment-date-controls {
  position: relative;
}

.moment-date-picker {
  gap: 7px;
  border: 1px solid rgba(123, 82, 65, 0.15);
  border-radius: 10px;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 9.5px;
  background: rgba(255, 252, 246, 0.65);
  cursor: pointer;
}

.moment-date-picker:hover {
  border-color: rgba(141, 74, 81, 0.28);
  background: #fffbf6;
}

.moment-calendar {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  width: 300px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: #fffaf3;
  box-shadow: 0 20px 45px rgba(70, 43, 35, 0.18);
}

.moment-calendar[hidden] {
  display: none;
}

.moment-calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}

.moment-calendar-head .day-arrow {
  width: 28px;
  height: 28px;
}

.moment-calendar-head strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
}

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

.moment-calendar-weekdays {
  margin-bottom: 3px;
}

.moment-calendar-weekdays span {
  color: var(--ink-faint);
  font-size: 7px;
  text-align: center;
}

.moment-calendar-blank {
  display: block;
  min-height: 30px;
}

.moment-calendar-day {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 30px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 9px;
  background: transparent;
  cursor: pointer;
}

.moment-calendar-day:hover:not(:disabled) {
  border-color: rgba(184, 95, 101, 0.2);
  background: rgba(248, 232, 221, 0.6);
}

.moment-calendar-day.is-today {
  border-color: rgba(184, 95, 101, 0.32);
  color: var(--rose-deep);
}

.moment-calendar-day.has-moment {
  color: var(--rose-deep);
  font-weight: 600;
  background: rgba(248, 232, 221, 0.42);
}

.moment-calendar-day.has-moment::after {
  content: "";
  position: absolute;
  bottom: 3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--rose);
}

.moment-calendar-day.is-selected {
  border-color: var(--rose-deep);
  color: #fffaf3;
  background: var(--rose-deep);
  font-weight: 500;
}

.moment-calendar-day.is-selected::after {
  background: #fffaf3;
}

.moment-calendar-day:disabled {
  color: var(--ink-faint);
  opacity: 0.34;
  cursor: default;
}

.moment-calendar-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.moment-calendar-foot span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-faint);
  font-size: 7.5px;
}

.moment-calendar-dot {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--rose);
}

.moment-calendar-foot button {
  padding: 3px 7px;
  border: 0;
  color: var(--rose-deep);
  font-family: var(--font-body);
  font-size: 8px;
  background: transparent;
  cursor: pointer;
}

@media (max-width: 640px) {
  .moment-calendar {
    right: -1px;
    width: min(300px, calc(100vw - 30px));
  }

  .moment-date-picker {
    font-size: 9px;
  }
}

/* v0.10.1 — bigger crop canvas */
.avatar-crop-stage {
  width: min(300px, 70vw);
}

@media (max-width: 480px) {
  .avatar-crop-stage {
    width: min(250px, 72vw);
  }
}

/* v0.10.1 — let the date popover escape the daybar clipping */
.moment-calendar {
  position: fixed;
  top: auto;
  right: auto;
  z-index: 60;
}

/* v0.10.2 — make the current avatar and settings preview clearly larger */
.topbar-avatar.avatar {
  width: 50px;
  height: 50px;
  font-size: 14px;
}

.settings-summary .avatar-stack .avatar {
  width: 48px;
  height: 48px;
  font-size: 14px;
}

.avatar-setting-preview {
  width: 120px;
  height: 120px;
}

.couple-chip .avatar {
  width: 40px;
  height: 40px;
  font-size: 12px;
}

.avatar-crop-stage {
  width: min(320px, 72vw);
}

@media (max-width: 640px) {
  .topbar-avatar.avatar {
    width: 40px;
    height: 40px;
  }

  .settings-summary .avatar-stack .avatar {
    width: 44px;
    height: 44px;
  }

  .avatar-setting-preview {
    width: 104px;
    height: 104px;
  }

  .couple-chip .avatar {
    width: 36px;
    height: 36px;
  }

  .avatar-crop-stage {
    width: min(270px, 74vw);
  }
}

/* final size pass: make the top-bar identity clearly visible */
.topbar-avatar.avatar {
  width: 56px;
  height: 56px;
  font-size: 15px;
}

.couple-chip .avatar {
  width: 44px;
  height: 44px;
}

@media (max-width: 640px) {
  .topbar-avatar.avatar {
    width: 44px;
    height: 44px;
  }

  .couple-chip .avatar {
    width: 40px;
    height: 40px;
  }
}

/* Avoid showing a guessed identity before the cloud role is known. */
.is-role-pending {
  visibility: hidden;
}

/* v0.11 — likes + full moment photos */
.moment-social-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(145, 104, 84, 0.12);
}

.moment-like-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border: 1px solid rgba(184, 95, 101, 0.18);
  border-radius: 999px;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 8.5px;
  background: rgba(255, 251, 246, 0.7);
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.moment-like-button svg {
  width: 13px;
  height: 13px;
}

.moment-like-button:hover {
  border-color: rgba(184, 95, 101, 0.38);
  color: var(--rose-deep);
}

.moment-like-button.is-liked {
  border-color: rgba(184, 95, 101, 0.35);
  color: var(--rose-deep);
  background: rgba(248, 225, 218, 0.7);
}

.moment-like-names {
  color: var(--ink-faint);
  font-family: var(--font-body);
  font-size: 8px;
}

/* Single photos keep their real aspect ratio; multi-photo thumbnails are
   contained instead of cropped, so the feed never hides part of a photo. */
.moment-photo-grid[data-photo-count="1"] .moment-photo {
  aspect-ratio: auto;
  min-height: 160px;
  max-height: 640px;
}

.moment-photo-grid[data-photo-count="1"] .moment-photo img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 640px;
  margin: 0 auto;
  object-fit: contain;
}

.moment-photo-grid:not([data-photo-count="1"]) .moment-photo img {
  object-fit: contain;
}

/* Cloud boot screen: avoid painting stale cached data before the role/state
   has been confirmed by Supabase. */
.cloud-boot-screen {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 250, 241, 0.95), transparent 38%),
    #f6ece2;
  color: var(--ink-soft);
}

.cloud-boot-screen[hidden] {
  display: none;
}

.cloud-boot-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(142, 91, 71, 0.24);
  border-radius: 50%;
  color: var(--rose-deep);
  font-family: var(--font-display);
  font-size: 23px;
  background: rgba(255, 250, 243, 0.8);
  animation: cloud-boot-pulse 1.6s ease-in-out infinite;
}

.cloud-boot-screen p {
  margin: 0;
  font-family: var(--font-body);
  font-size: 10px;
  letter-spacing: 0.12em;
}

@keyframes cloud-boot-pulse {
  0%, 100% { transform: scale(1); opacity: 0.75; }
  50% { transform: scale(1.05); opacity: 1; }
}
