:root {
  color-scheme: light;
  --bg: #f7f1ea;
  --bg-soft: #fffaf5;
  --panel: rgba(255, 252, 248, 0.86);
  --ink: #231f20;
  --muted: #746a63;
  --faint: #9d928a;
  --line: rgba(109, 87, 73, 0.16);
  --shadow: 0 28px 90px rgba(87, 61, 43, 0.13);
  --rose: #bd6f7d;
  --green: #688b71;
  --gold: #b5834c;
  --blue: #667f9a;
  --button-primary-bg: #332721;
  --button-primary-hover: #43342d;
  --button-primary-text: #fffaf5;
  --button-secondary-bg: rgba(255, 253, 249, 0.9);
  --button-secondary-border: rgba(92, 70, 56, 0.24);
  --button-secondary-text: #3a2e28;
  --button-subtle-bg: rgba(255, 248, 239, 0.78);
  --button-subtle-border: rgba(126, 93, 72, 0.18);
  --button-subtle-text: #66574e;
  --button-danger-bg: #fff7f5;
  --button-danger-border: rgba(159, 58, 56, 0.28);
  --button-danger-text: #8b2e2e;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 224, 205, 0.72), transparent 32%),
    radial-gradient(circle at 86% 12%, rgba(205, 223, 226, 0.58), transparent 30%),
    linear-gradient(145deg, #fffaf4 0%, #f1e7dd 46%, #ede4dc 100%);
  color: var(--ink);
  font-family: Inter, Arial, "Microsoft YaHei", sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(104, 80, 63, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(104, 80, 63, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent 82%);
}

a {
  color: inherit;
}

img {
  image-orientation: from-image;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px;
  padding: 16px clamp(16px, 4vw, 52px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 250, 245, 0.82);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(123, 82, 65, 0.24);
  border-radius: 14px;
  background: linear-gradient(145deg, #fff7ed, #ecd9ca);
  box-shadow: 0 12px 28px rgba(88, 56, 36, 0.12);
  color: #7e4f3f;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 15px;
  letter-spacing: 0.02em;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.nav a,
.button-link,
button,
.primary-action,
.secondary-action,
.subtle-action,
.danger-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--button-secondary-border);
  border-radius: 999px;
  padding: 9px 15px;
  appearance: none;
  font: inherit;
  font-size: 14px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.nav a,
.button-link,
button,
.secondary-action {
  background: var(--button-secondary-bg);
  color: var(--button-secondary-text);
}

.nav a:hover,
.button-link:hover,
button:hover,
.primary-action:hover,
.secondary-action:hover,
.subtle-action:hover,
.danger-action:hover {
  transform: translateY(-1px);
  border-color: rgba(126, 79, 63, 0.34);
  box-shadow: 0 12px 26px rgba(76, 49, 35, 0.08);
}

.button-link:focus-visible,
button:focus-visible,
.primary-action:focus-visible,
.secondary-action:focus-visible,
.subtle-action:focus-visible,
.danger-action:focus-visible {
  outline: 3px solid rgba(126, 79, 63, 0.22);
  outline-offset: 3px;
}

.primary-action {
  border-color: rgba(47, 38, 34, 0.36);
  background: var(--button-primary-bg);
  color: var(--button-primary-text);
  box-shadow: 0 16px 38px rgba(43, 31, 26, 0.18);
  font-weight: 800;
}

.primary-action:hover {
  background: var(--button-primary-hover);
  color: var(--button-primary-text);
}

.secondary-action,
.button-link {
  border-color: var(--button-secondary-border);
  background: var(--button-secondary-bg);
  color: var(--button-secondary-text);
}

.subtle-action {
  border-color: var(--button-subtle-border);
  background: var(--button-subtle-bg);
  color: var(--button-subtle-text);
}

.subtle-action:hover {
  background: rgba(255, 242, 229, 0.96);
  color: #4f433c;
}

.danger-action,
.button-link.danger-action,
button.danger-action {
  border-color: var(--button-danger-border);
  background: var(--button-danger-bg);
  color: var(--button-danger-text);
}

.danger-action:hover,
.button-link.danger-action:hover,
button.danger-action:hover {
  border-color: rgba(139, 46, 46, 0.46);
  background: #fff0ed;
  color: #732524;
}

.user-panel {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: max-content;
}

.user-panel form {
  margin: 0;
}

.user-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.54);
  color: var(--muted);
  padding: 9px 12px;
  font-size: 13px;
}

.page {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 64px;
}

.museum-hero {
  display: grid;
  min-height: 540px;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  align-items: center;
  gap: clamp(28px, 5vw, 68px);
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    linear-gradient(120deg, rgba(255, 253, 249, 0.94), rgba(255, 247, 237, 0.74)),
    radial-gradient(circle at 78% 22%, rgba(192, 132, 96, 0.18), transparent 34%);
  padding: clamp(30px, 6vw, 74px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-copy h1 {
  margin: 0;
  max-width: 620px;
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  font-size: clamp(44px, 8vw, 86px);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: 0;
}

.hero-lead {
  max-width: 560px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(18px, 2.2vw, 23px);
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.hero-memory-screen {
  position: relative;
  min-width: 0;
}

.memory-screen-frame,
.hero-memory-empty {
  position: relative;
  overflow: hidden;
  min-height: 390px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 28px;
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.75), transparent 30%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.6), rgba(244, 226, 210, 0.72)),
    linear-gradient(135deg, rgba(194, 139, 104, 0.18), rgba(115, 139, 134, 0.15));
  color: var(--ink);
  box-shadow: 0 20px 48px rgba(75, 51, 36, 0.14);
}

.memory-screen-frame {
  display: grid;
  height: clamp(340px, 41vw, 430px);
  place-items: center;
}

.memory-screen-slide {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: inherit;
  opacity: 0;
  pointer-events: none;
  text-decoration: none;
  transition: opacity 420ms ease;
}

.memory-screen-slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.memory-screen-bg {
  position: absolute;
  inset: -24px;
  width: calc(100% + 48px);
  height: calc(100% + 48px);
  filter: blur(14px);
  opacity: 0.32;
  object-fit: cover;
  transform: scale(1.08);
}

.memory-screen-photo {
  position: relative;
  z-index: 1;
  max-width: calc(100% - 46px);
  max-height: calc(100% - 72px);
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 22px;
  object-fit: contain;
  box-shadow: 0 18px 42px rgba(47, 34, 27, 0.2);
}

.memory-screen-caption {
  position: absolute;
  z-index: 2;
  right: 18px;
  bottom: 18px;
  left: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #fffaf5;
  pointer-events: none;
  text-shadow: 0 2px 16px rgba(36, 27, 22, 0.38);
}

.memory-screen-caption span,
.memory-screen-caption time {
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(43, 34, 30, 0.32);
  backdrop-filter: blur(6px);
  padding: 7px 10px;
  font-size: 12px;
}

.memory-screen-nav {
  position: absolute;
  z-index: 3;
  top: 50%;
  width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  border-color: rgba(255, 255, 255, 0.52);
  background: rgba(255, 250, 245, 0.72);
  color: #4b3a31;
  font-size: 28px;
  line-height: 1;
  transform: translateY(-50%);
}

.memory-screen-nav:hover {
  background: rgba(255, 250, 245, 0.92);
  transform: translateY(-50%);
}

.memory-screen-nav.prev {
  left: 16px;
}

.memory-screen-nav.next {
  right: 16px;
}

.memory-screen-dots {
  position: absolute;
  z-index: 3;
  right: 0;
  top: 16px;
  left: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  pointer-events: none;
}

.memory-screen-dots button {
  width: 9px;
  height: 9px;
  min-height: 9px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.58);
  padding: 0;
  pointer-events: auto;
}

.memory-screen-dots button.is-active {
  width: 22px;
  border-radius: 999px;
  background: #fffaf5;
}

.featured-memory-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-memory-media::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, rgba(38, 30, 27, 0.02), rgba(38, 30, 27, 0.54));
}

.hero-memory-empty {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 16px;
  min-height: 360px;
  padding: 32px;
  text-align: center;
}

.hero-memory-empty strong {
  display: block;
  max-width: 360px;
  color: #5c4b42;
  font-size: 24px;
  line-height: 1.35;
}

.memory-frame {
  position: relative;
  min-height: 390px;
}

.photo-stack,
.photo-card {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.66);
  box-shadow: 0 28px 58px rgba(75, 51, 36, 0.18);
}

.photo-stack {
  width: 62%;
  height: 64%;
  border-radius: 28px;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.16), transparent),
    linear-gradient(135deg, #d7b7a6, #987b72);
}

.photo-stack-one {
  top: 8%;
  left: 10%;
  transform: rotate(-8deg);
}

.photo-stack-two {
  right: 7%;
  bottom: 10%;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.2), transparent),
    linear-gradient(135deg, #b4c8be, #738b86);
  transform: rotate(7deg);
}

.photo-card {
  right: 15%;
  bottom: 18%;
  display: grid;
  width: 58%;
  min-width: 230px;
  min-height: 190px;
  align-content: end;
  border-radius: 24px;
  background:
    linear-gradient(180deg, transparent 0%, rgba(37, 30, 27, 0.78) 100%),
    linear-gradient(135deg, #f7d5c1, #a77262);
  color: #fff;
  padding: 22px;
}

.photo-card span,
.photo-card small {
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
}

.photo-card strong {
  margin: 8px 0;
  font-size: 28px;
  line-height: 1;
}

.intro-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 24px 0 46px;
}

.intro-strip div,
.visitor-note,
.coming-soon,
.error-panel,
.auth-card,
.album-callout,
.empty-state,
.form-shell {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: 0 18px 48px rgba(83, 58, 41, 0.08);
}

.intro-strip div {
  padding: 20px;
}

.intro-strip strong,
.intro-strip span {
  display: block;
}

.intro-strip strong {
  margin-bottom: 7px;
}

.intro-strip span,
.section-heading p,
.space-card p,
.visitor-note p,
.coming-soon p,
.error-panel p,
.empty-state p,
.form-shell p,
.album-callout p,
.upload-note span {
  color: var(--muted);
  line-height: 1.7;
}

.section-heading {
  max-width: 720px;
  margin: 0 0 22px;
}

.section-heading span {
  color: var(--faint);
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.section-heading h2,
.section-heading h1,
.visitor-note h2,
.coming-soon h2,
.empty-state h2,
.album-callout h2 {
  margin: 8px 0 10px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.12;
}

.section-heading p {
  margin: 0;
}

.space-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.space-card {
  position: relative;
  display: flex;
  min-height: 260px;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(255, 251, 247, 0.9);
  padding: 24px;
  text-decoration: none;
  box-shadow: 0 20px 58px rgba(79, 54, 38, 0.1);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.space-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 28px 76px rgba(79, 54, 38, 0.14);
}

.space-card::after {
  position: absolute;
  inset: auto -18% -26% 28%;
  height: 150px;
  border-radius: 999px;
  content: "";
  filter: blur(4px);
  opacity: 0.24;
}

.space-card.rose::after {
  background: var(--rose);
}

.space-card.green::after {
  background: var(--green);
}

.space-card.gold::after {
  background: var(--gold);
}

.space-card.blue::after {
  background: var(--blue);
}

.space-badge-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(126, 93, 72, 0.18);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 253, 248, 0.92), rgba(246, 232, 220, 0.62));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 14px 30px rgba(62, 42, 31, 0.09);
  color: #6a5144;
  font-size: 19px;
  font-weight: 900;
}

.space-card.rose .space-badge-mark {
  border-color: rgba(189, 111, 125, 0.22);
  background: linear-gradient(145deg, rgba(255, 250, 248, 0.96), rgba(249, 226, 231, 0.76));
  color: #9b5361;
}

.space-card.green .space-badge-mark {
  border-color: rgba(104, 139, 113, 0.24);
  background: linear-gradient(145deg, rgba(255, 253, 248, 0.96), rgba(225, 239, 226, 0.82));
  color: #4f7359;
}

.space-card.blue .space-badge-mark {
  border-color: rgba(102, 127, 154, 0.24);
  background: linear-gradient(145deg, rgba(255, 253, 248, 0.96), rgba(226, 237, 244, 0.82));
  color: #526c86;
}

.space-card h3 {
  margin: 0 0 12px;
  font-size: 26px;
}

.space-card p {
  margin: 0;
}

.space-card small {
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--muted);
  padding: 7px 10px;
}

.visitor-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-top: 26px;
  padding: 26px;
}

.visitor-note h2 {
  font-size: clamp(24px, 3vw, 34px);
}

.album-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 46px;
  padding: clamp(24px, 4vw, 34px);
}

.album-callout span {
  color: var(--faint);
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.featured-memory-section {
  margin: 0 0 46px;
}

.featured-memory-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.featured-memory-card {
  display: grid;
  min-height: 210px;
  align-content: space-between;
  gap: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 251, 247, 0.9);
  color: inherit;
  padding: 20px;
  text-decoration: none;
  box-shadow: 0 18px 48px rgba(83, 58, 41, 0.08);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.featured-memory-card.photo,
.featured-memory-card.album:has(.featured-memory-media) {
  padding: 0;
}

.featured-memory-media {
  position: relative;
  min-height: 190px;
  overflow: hidden;
}

.featured-memory-card.photo .featured-card-topline,
.featured-memory-card.photo h3,
.featured-memory-card.photo p,
.featured-memory-card.photo footer,
.featured-memory-card.album:has(.featured-memory-media) .featured-card-topline,
.featured-memory-card.album:has(.featured-memory-media) h3,
.featured-memory-card.album:has(.featured-memory-media) p,
.featured-memory-card.album:has(.featured-memory-media) footer {
  margin-inline: 18px;
}

.featured-memory-card.photo .featured-card-topline,
.featured-memory-card.album:has(.featured-memory-media) .featured-card-topline {
  margin-top: 16px;
}

.featured-memory-card.photo footer,
.featured-memory-card.album:has(.featured-memory-media) footer {
  margin-bottom: 18px;
}

.featured-memory-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 64px rgba(83, 58, 41, 0.12);
}

.featured-card-topline,
.featured-memory-card footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.featured-card-topline > span:not(.featured-badge),
.featured-memory-card footer {
  color: var(--muted);
  font-size: 0.78rem;
}

.featured-memory-card h3 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.24;
  overflow-wrap: anywhere;
}

.featured-memory-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.featured-empty {
  border: 1px dashed rgba(126, 93, 72, 0.22);
  border-radius: 20px;
  background: rgba(255, 253, 248, 0.58);
  color: var(--muted);
  padding: 22px;
}

.featured-empty p {
  margin: 0;
}

.space-content-row {
  margin-top: 34px;
}

.space-life-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px;
  margin-top: 36px;
}

.space-life-grid .space-content-row {
  margin-top: 0;
}

.space-life-grid .space-note-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact-heading {
  margin-bottom: 16px;
}

.space-note-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.space-note-card,
.space-anniversary-card {
  display: flex;
  min-height: 164px;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 14px 34px rgba(68, 48, 38, 0.08);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.space-note-card:hover,
.space-anniversary-card:hover {
  transform: translateY(-2px);
  border-color: rgba(126, 79, 63, 0.28);
  box-shadow: 0 20px 44px rgba(68, 48, 38, 0.12);
}

.space-note-card time,
.space-anniversary-card time {
  color: var(--faint);
  font-size: 12px;
}

.space-note-card h3,
.space-anniversary-card h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.space-note-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.space-note-card span,
.space-anniversary-card span {
  color: var(--rose);
  font-size: 13px;
  font-weight: 700;
}

.space-anniversary-card strong {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.space-anniversary-card.today strong {
  color: var(--rose);
}

.space-soft-empty {
  border: 1px dashed rgba(126, 79, 63, 0.22);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.45);
  color: var(--muted);
  padding: 18px;
  line-height: 1.7;
}

.album-callout h2,
.album-callout p {
  margin-left: 0;
}

.album-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.empty-state,
.form-shell {
  margin-top: 24px;
  padding: clamp(24px, 5vw, 44px);
}

.memory-form {
  display: grid;
  gap: 13px;
  max-width: 680px;
}

.memory-form label {
  color: var(--muted);
  font-size: 14px;
}

.memory-form input,
.memory-form textarea,
.memory-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  padding: 13px 14px;
  font: inherit;
}

.memory-form textarea {
  resize: vertical;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.detail-action-row,
.inline-action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.detail-action-row form,
.inline-action-row form {
  margin: 0;
}

.detail-action-row .primary-action,
.detail-action-row .button-link,
.detail-action-row button,
.detail-action-row .secondary-action,
.detail-action-row .subtle-action,
.detail-action-row .danger-action,
.inline-action-row .primary-action,
.inline-action-row .button-link,
.inline-action-row button,
.inline-action-row .secondary-action,
.inline-action-row .subtle-action,
.inline-action-row .danger-action {
  min-height: 40px;
  padding: 9px 15px;
  white-space: nowrap;
}

.memory-form button {
  border-color: rgba(47, 38, 34, 0.36);
  background: var(--button-primary-bg);
  color: var(--button-primary-text);
  font-weight: 800;
}

.featured-toggle {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid rgba(126, 93, 72, 0.14);
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.64);
  color: var(--ink);
  padding: 13px 14px;
}

.featured-toggle input[type="checkbox"] {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  padding: 0;
  margin-top: 2px;
  background: #fff;
  accent-color: #8d6757;
}

.featured-toggle span {
  display: grid;
  gap: 4px;
}

.featured-toggle strong {
  color: var(--ink);
  font-size: 0.92rem;
}

.featured-toggle small {
  color: var(--muted);
  line-height: 1.5;
}

.form-helper-list {
  display: grid;
  gap: 8px;
  margin: 0 0 4px;
}

.form-helper-list p {
  display: grid;
  gap: 3px;
  margin: 0;
  border: 1px solid rgba(126, 93, 72, 0.14);
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.58);
  padding: 10px 12px;
}

.form-helper-list strong {
  color: var(--ink);
  font-size: 0.92rem;
}

.form-helper-list span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.upload-note {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.58);
  padding: 14px 16px;
}

code {
  border: 1px solid rgba(111, 84, 66, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
  color: #6d5143;
  padding: 8px 11px;
}

.memory-space-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(320px, 1.08fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  overflow: hidden;
  min-height: 430px;
  margin: 8px 0 46px;
  border: 1px solid rgba(126, 93, 72, 0.14);
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(255, 253, 249, 0.94), rgba(247, 239, 230, 0.78));
  padding: clamp(28px, 6vw, 62px);
  box-shadow: 0 24px 70px rgba(83, 58, 41, 0.09);
}

.personal-memory-hero {
  background:
    linear-gradient(135deg, rgba(255, 253, 249, 0.95), rgba(240, 232, 222, 0.76)),
    radial-gradient(circle at 88% 14%, rgba(142, 119, 92, 0.13), transparent 30%);
}

.rose-memory-hero {
  background:
    linear-gradient(135deg, rgba(255, 252, 248, 0.96), rgba(255, 238, 237, 0.72)),
    radial-gradient(circle at 88% 10%, rgba(204, 123, 137, 0.16), transparent 32%);
}

.green-memory-hero {
  background:
    linear-gradient(135deg, rgba(252, 255, 249, 0.96), rgba(231, 242, 233, 0.76)),
    radial-gradient(circle at 86% 12%, rgba(95, 139, 111, 0.14), transparent 34%);
}

.memory-space-copy {
  position: relative;
  z-index: 2;
}

.memory-space-copy h1 {
  margin: 0 0 18px;
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  font-size: clamp(48px, 8vw, 88px);
  font-weight: 520;
  line-height: 0.98;
  letter-spacing: 0;
}

.memory-space-copy p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.85;
}

.memory-space-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.memory-collage {
  position: relative;
  min-height: 330px;
}

.memory-collage-photo,
.memory-collage-card,
.memory-collage-line,
.memory-collage-dot {
  position: absolute;
  display: grid;
  overflow: hidden;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.45);
  box-shadow: 0 22px 54px rgba(65, 44, 31, 0.14);
}

.memory-collage-photo,
.memory-collage-card {
  border-radius: 24px;
}

.memory-collage-photo img,
.memory-collage-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.memory-collage-photo.is-portrait,
.memory-collage-card.is-portrait {
  background:
    linear-gradient(145deg, rgba(255, 253, 249, 0.82), rgba(238, 228, 218, 0.66));
}

.memory-collage-photo.is-portrait img,
.memory-collage-card.is-portrait img {
  box-sizing: border-box;
  object-fit: contain;
  padding: 7px;
}

.memory-collage-card strong {
  color: rgba(72, 54, 45, 0.58);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 54px;
}

.memory-collage .photo-1 {
  top: 4%;
  left: 7%;
  width: 48%;
  height: 58%;
  transform: rotate(-4deg);
}

.memory-collage .photo-2 {
  right: 6%;
  top: 14%;
  width: 42%;
  height: 44%;
  transform: rotate(5deg);
}

.memory-collage .photo-3 {
  left: 22%;
  bottom: 2%;
  width: 36%;
  height: 36%;
  transform: rotate(3deg);
}

.memory-collage .photo-4 {
  right: 14%;
  bottom: 10%;
  width: 28%;
  height: 28%;
  transform: rotate(-6deg);
}

.memory-collage .photo-1.is-portrait {
  top: 0;
  left: 10%;
  width: 34%;
  height: 72%;
}

.memory-collage .photo-2.is-portrait {
  right: 10%;
  top: 8%;
  width: 31%;
  height: 62%;
}

.memory-collage .photo-3.is-portrait {
  left: 27%;
  bottom: 0;
  width: 28%;
  height: 50%;
}

.memory-collage .photo-4.is-portrait {
  right: 18%;
  bottom: 5%;
  width: 24%;
  height: 42%;
}

.memory-collage-line {
  left: 13%;
  width: 70%;
  height: 1px;
  border: 0;
  background: rgba(125, 95, 75, 0.26);
  box-shadow: none;
}

.memory-collage-line.line-one {
  top: 38%;
  transform: rotate(-7deg);
}

.memory-collage-line.line-two {
  top: 58%;
  transform: rotate(5deg);
}

.memory-collage-dot {
  right: 22%;
  top: 42%;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.58);
}

.rose-collage::before,
.rose-collage::after {
  position: absolute;
  z-index: 3;
  color: #b7797d;
  content: "♡";
  font-family: Georgia, "Times New Roman", serif;
  opacity: 0.7;
  animation: softFloat 4.5s ease-in-out infinite;
}

.rose-collage::before {
  right: 9%;
  top: 4%;
  font-size: 26px;
}

.rose-collage::after {
  left: 5%;
  bottom: 14%;
  font-size: 18px;
  animation-delay: 1.2s;
}

.green-collage .memory-collage-photo,
.green-collage .memory-collage-card {
  border-radius: 14px;
}

.green-collage::before {
  position: absolute;
  z-index: 3;
  right: 8%;
  bottom: 8%;
  width: 118px;
  height: 86px;
  border: 1px solid rgba(109, 135, 104, 0.24);
  border-radius: 10px;
  background:
    linear-gradient(rgba(109, 135, 104, 0.12) 1px, transparent 1px),
    rgba(255, 252, 226, 0.64);
  background-size: 100% 18px;
  content: "";
  transform: rotate(4deg);
}

.couple-pup-sticker {
  position: absolute;
  z-index: 4;
  width: 116px;
  height: auto;
  fill: rgba(255, 252, 248, 0.76);
  stroke: #5d4037;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3.5;
  filter: drop-shadow(0 14px 18px rgba(84, 51, 44, 0.14));
  animation: stickerWiggle 5.4s ease-in-out infinite;
}

.couple-pup-sticker path {
  vector-effect: non-scaling-stroke;
}

.couple-pup-sticker .fill-none,
.couple-pup-sticker path:not(:first-child) {
  fill: none;
}

.pup-one {
  right: 4%;
  bottom: 1%;
  transform: rotate(-6deg);
}

.pup-two {
  right: 22%;
  bottom: -1%;
  width: 104px;
  transform: rotate(7deg);
  animation-delay: 0.8s;
}

@keyframes softFloat {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-8px) rotate(5deg);
  }
}

@keyframes stickerWiggle {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rose-collage::before,
  .rose-collage::after,
  .couple-pup-sticker {
    animation: none;
  }
}

.space-overview-nav {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  margin: -22px 0 34px;
  padding: 4px 2px 12px;
  scrollbar-width: thin;
}

.space-overview-nav a {
  flex: 0 0 auto;
  border: 1px solid rgba(118, 91, 72, 0.16);
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.72);
  color: var(--muted);
  padding: 9px 14px;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(72, 52, 39, 0.06);
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.space-overview-nav a:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
}

.space-overview-flow {
  display: grid;
  gap: clamp(30px, 5vw, 52px);
  margin-bottom: 46px;
}

.space-feature-block,
.space-album-block {
  min-width: 0;
}

.space-feature-block {
  margin-bottom: 0;
}

.space-feature-block .featured-memory-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.space-album-block .gallery-album-grid,
.space-more-albums .gallery-album-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.space-album-block .gallery-album-card,
.space-album-block .gallery-album-card:nth-child(5n + 1),
.space-album-block .gallery-album-card:nth-child(5n + 4),
.space-more-albums .gallery-album-card,
.space-more-albums .gallery-album-card:nth-child(5n + 1),
.space-more-albums .gallery-album-card:nth-child(5n + 4) {
  display: flex;
  grid-column: auto;
  min-height: 100%;
  flex-direction: column;
}

.space-album-block .gallery-album-cover,
.space-more-albums .gallery-album-cover {
  min-height: 0;
  height: clamp(150px, 18vw, 210px);
}

.space-album-block .gallery-album-cover img,
.space-more-albums .gallery-album-cover img {
  min-height: 0;
  height: 100%;
}

.space-album-block .album-monogram,
.space-more-albums .album-monogram {
  font-size: clamp(44px, 7vw, 70px);
  opacity: 0.72;
}

.space-album-block .gallery-album-body,
.space-more-albums .gallery-album-body {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.space-more-albums {
  margin-top: 18px;
}

.space-more-albums summary {
  width: fit-content;
  cursor: pointer;
  border: 1px solid rgba(118, 91, 72, 0.18);
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.82);
  color: var(--muted);
  padding: 10px 15px;
  list-style: none;
  box-shadow: 0 10px 24px rgba(72, 52, 39, 0.06);
}

.space-more-albums summary::-webkit-details-marker {
  display: none;
}

.space-more-albums[open] summary {
  margin-bottom: 18px;
  color: var(--ink);
}

.space-label {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--muted);
  padding: 8px 12px;
  font-size: 13px;
}

.auth-card h1,
.error-panel h1 {
  margin: 18px 0 16px;
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  font-size: clamp(42px, 7vw, 76px);
  font-weight: 600;
  line-height: 1;
}

.space-current {
  margin-top: 26px;
}

.coming-soon,
.auth-card,
.error-panel {
  margin-top: 24px;
  padding: clamp(24px, 5vw, 44px);
}

.memory-error {
  position: relative;
  max-width: 760px;
  overflow: hidden;
  margin: 54px auto;
  padding: clamp(34px, 7vw, 70px);
  border-radius: 34px 34px 34px 10px;
  background:
    radial-gradient(circle at 88% 18%, rgba(189, 111, 125, 0.16), transparent 28%),
    linear-gradient(145deg, rgba(255, 253, 248, 0.97), rgba(244, 231, 220, 0.86));
  text-align: center;
}

.memory-error.missing {
  background:
    radial-gradient(circle at 88% 18%, rgba(102, 127, 154, 0.16), transparent 28%),
    linear-gradient(145deg, rgba(255, 253, 248, 0.97), rgba(227, 237, 243, 0.86));
}

.memory-error-mark {
  display: grid;
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  place-items: center;
  border: 1px solid rgba(126, 93, 72, 0.14);
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.72);
  color: #a76573;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
}

.memory-error.missing .memory-error-mark {
  color: #667f9a;
}

.memory-error .space-label {
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.memory-error h1 {
  margin: 18px auto 16px;
  max-width: 620px;
}

.memory-error > p:not(.space-label) {
  max-width: 560px;
  margin: 0 auto;
  font-size: 1rem;
}

.memory-error small {
  display: block;
  margin: 14px auto 26px;
  color: var(--faint);
  line-height: 1.7;
}

.memory-error .button-link {
  min-width: 140px;
}

.login-form {
  display: grid;
  gap: 12px;
  max-width: 420px;
}

.login-form label {
  color: var(--muted);
  font-size: 14px;
}

.login-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.78);
  padding: 13px 14px;
  font: inherit;
}

.login-form button {
  width: fit-content;
  border-color: rgba(44, 37, 34, 0.14);
  background: #2c2522;
  color: #fffaf5;
}

.flash-list {
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  padding: 10px 16px;
  color: var(--muted);
}

.flash-list p {
  margin: 6px 0;
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: 1fr;
  }

  .nav {
    justify-content: flex-start;
  }

  .user-panel {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .museum-hero,
  .memory-space-hero {
    grid-template-columns: 1fr;
  }

  .memory-frame,
  .hero-memory-screen,
  .memory-screen-frame,
  .memory-collage {
    min-height: 320px;
  }

  .space-grid,
  .featured-memory-grid,
  .space-note-grid,
  .space-life-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .space-feature-block .featured-memory-grid,
  .space-album-block .gallery-album-grid,
  .space-more-albums .gallery-album-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 640px) {
  .page {
    width: min(100% - 24px, 1120px);
    padding-top: 24px;
  }

  .site-header {
    gap: 12px;
    padding: 14px 12px;
  }

  .nav,
  .user-panel {
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar,
  .user-panel::-webkit-scrollbar,
  .album-filter-bar::-webkit-scrollbar,
  .space-overview-nav::-webkit-scrollbar {
    display: none;
  }

  .nav a,
  .user-panel > * {
    flex: 0 0 auto;
  }

  .user-badge {
    white-space: nowrap;
  }

  .nav a,
  .button-link,
  button,
  .primary-action,
  .secondary-action {
    width: auto;
    min-height: 36px;
    padding: 8px 12px;
    font-size: 13px;
  }

  .museum-hero,
  .memory-space-hero {
    min-height: auto;
    border-radius: 22px;
    padding: 24px;
  }

  .hero-copy h1 {
    font-size: clamp(38px, 13vw, 52px);
    line-height: 1.04;
    overflow-wrap: normal;
    word-break: keep-all;
  }

  .hero-lead {
    font-size: 16px;
  }

  .memory-frame,
  .hero-memory-screen,
  .memory-screen-frame,
  .memory-collage {
    min-height: 250px;
  }

  .memory-screen-frame {
    height: clamp(250px, 72vw, 320px);
    border-radius: 22px;
  }

  .memory-screen-photo {
    max-width: calc(100% - 30px);
    max-height: calc(100% - 62px);
    border-radius: 18px;
  }

  .memory-screen-caption {
    right: 12px;
    bottom: 12px;
    left: 12px;
  }

  .memory-screen-nav {
    width: 36px;
    height: 36px;
    min-height: 36px;
    font-size: 24px;
  }

  .memory-space-copy h1 {
    max-width: 100%;
    font-size: clamp(36px, 12vw, 50px);
    line-height: 1.08;
    overflow-wrap: normal;
    word-break: keep-all;
  }

  .photo-card {
    right: 8%;
    width: 72%;
    min-width: 0;
  }

  .space-grid,
  .featured-memory-grid,
  .space-note-grid,
  .space-life-grid,
  .space-life-grid .space-note-grid,
  .space-feature-block .featured-memory-grid,
  .space-album-block .gallery-album-grid,
  .space-more-albums .gallery-album-grid {
    grid-template-columns: 1fr;
  }

  .space-overview-nav {
    margin: -10px 0 24px;
    padding-bottom: 10px;
  }

  .memory-collage .photo-1,
  .memory-collage .photo-2,
  .memory-collage .photo-3,
  .memory-collage .photo-4 {
    width: 58%;
    height: 48%;
  }

  .memory-collage .photo-1.is-portrait,
  .memory-collage .photo-2.is-portrait,
  .memory-collage .photo-3.is-portrait,
  .memory-collage .photo-4.is-portrait {
    width: 42%;
    height: 68%;
  }

  .memory-collage .photo-2 {
    right: 2%;
  }

  .memory-collage .photo-2.is-portrait {
    right: 6%;
  }

  .memory-collage .photo-3,
  .memory-collage .photo-4 {
    bottom: 0;
  }

  .memory-collage .photo-3.is-portrait,
  .memory-collage .photo-4.is-portrait {
    bottom: 2%;
    height: 54%;
  }

  .couple-pup-sticker {
    width: 78px;
    opacity: 0.72;
  }

  .pup-two {
    right: 28%;
    width: 70px;
  }

  .album-callout {
    align-items: flex-start;
    flex-direction: column;
  }

  .album-actions {
    justify-content: flex-start;
  }

  .space-card {
    min-height: 210px;
  }

  .visitor-note {
    align-items: flex-start;
    flex-direction: column;
  }

}

/* V1 gallery exhibition */
.gallery-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  margin: 16px 0 34px;
  padding: 8px 2px 28px;
  border-bottom: 1px solid var(--line);
}

.gallery-heading h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  font-size: clamp(46px, 7vw, 76px);
  font-weight: 500;
  line-height: 1;
}

.gallery-heading p {
  max-width: 620px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.gallery-album-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 26px;
}

.gallery-album-card {
  grid-column: span 4;
  overflow: hidden;
  border: 1px solid rgba(99, 78, 65, 0.14);
  border-radius: 10px;
  background: rgba(255, 253, 250, 0.94);
  text-decoration: none;
  box-shadow: 0 16px 42px rgba(61, 45, 36, 0.08);
  transition: transform 180ms ease, box-shadow 180ms ease;
  content-visibility: auto;
  contain-intrinsic-size: 360px;
}

.gallery-album-card:nth-child(5n + 1),
.gallery-album-card:nth-child(5n + 4) {
  grid-column: span 6;
}

.gallery-album-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 56px rgba(61, 45, 36, 0.12);
}

.gallery-album-cover {
  position: relative;
  display: grid;
  min-height: 270px;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.14), transparent),
    linear-gradient(135deg, #cbb9ab, #7f7167);
}

.gallery-album-card.couple .gallery-album-cover {
  background: linear-gradient(135deg, #eac8cf, #a85f70);
}

.gallery-album-card.dorm .gallery-album-cover {
  background: linear-gradient(135deg, #c7d9cc, #668a72);
}

.gallery-album-card.selected .gallery-album-cover {
  background: linear-gradient(135deg, #ebd3ad, #a77a45);
}

.gallery-album-card.public .gallery-album-cover {
  background: linear-gradient(135deg, #cbd7e0, #627d99);
}

.gallery-album-cover img {
  width: 100%;
  height: 100%;
  min-height: 270px;
  object-fit: cover;
  transition: transform 220ms ease;
}

.gallery-album-card:hover .gallery-album-cover img {
  transform: scale(1.015);
}

.album-monogram {
  color: rgba(255, 255, 255, 0.82);
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  font-size: 92px;
  line-height: 1;
}

.visibility-badge,
.photo-count,
.featured-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 999px;
  background: rgba(32, 28, 27, 0.58);
  color: #fff;
  padding: 7px 11px;
  font-size: 12px;
  line-height: 1;
  backdrop-filter: blur(12px);
}

.featured-badge {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(190, 126, 67, 0.82);
  color: #fffaf5;
}

.card-muted,
.card-meta {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.65;
}

.soft-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid rgba(126, 93, 72, 0.16);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.72);
  color: var(--muted);
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 800;
}

.visibility-badge.couple {
  background: rgba(139, 62, 82, 0.76);
}

.visibility-badge.dorm {
  background: rgba(55, 105, 71, 0.78);
}

.visibility-badge.selected {
  background: rgba(142, 100, 42, 0.8);
}

.visibility-badge.public {
  background: rgba(61, 88, 115, 0.78);
}

.visibility-badge.private {
  background: rgba(50, 45, 43, 0.8);
}

.gallery-album-cover > .visibility-badge {
  position: absolute;
  top: 16px;
  left: 16px;
}

.gallery-album-cover > .featured-badge {
  position: absolute;
  top: 16px;
  right: 16px;
}

.photo-count {
  position: absolute;
  right: 16px;
  bottom: 16px;
}

.gallery-album-body {
  padding: 24px 24px 22px;
}

.gallery-album-body h2 {
  margin: 0 0 10px;
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  font-size: 28px;
  font-weight: 500;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.gallery-album-body p {
  min-height: 54px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.gallery-album-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 13px;
}

.gallery-empty {
  display: grid;
  justify-items: center;
  min-height: 260px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 253, 250, 0.7);
  padding: 34px 24px;
  text-align: center;
  box-shadow: 0 16px 44px rgba(71, 50, 38, 0.06);
}

.empty-frame {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  margin-bottom: 18px;
  border: 1px solid rgba(104, 81, 66, 0.2);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(255, 253, 248, 0.96), rgba(242, 226, 214, 0.72));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 12px 28px rgba(116, 94, 79, 0.07);
}

.empty-frame span {
  width: 42%;
  height: 42%;
  border-radius: 50%;
  background: linear-gradient(145deg, #f0ded1, #bfcfca);
}

.gallery-empty h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 800;
}

.gallery-empty p {
  max-width: 560px;
  margin: 14px 0 24px;
  color: var(--muted);
  line-height: 1.8;
}

.exhibition-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 30px;
  margin: 10px 0 36px;
  padding: 4px 2px 34px;
  border-bottom: 1px solid var(--line);
}

.back-link {
  display: inline-flex;
  align-items: center;
  grid-column: 1 / -1;
  width: fit-content;
  color: #6c5a4f;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.back-link:hover {
  color: #392d27;
}

.exhibition-title h1 {
  margin: 20px 0 14px;
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  font-size: clamp(48px, 8vw, 88px);
  font-weight: 500;
  line-height: 0.98;
  overflow-wrap: anywhere;
}

.exhibition-title > p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.exhibition-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 22px;
  color: var(--faint);
  font-size: 13px;
}

.exhibition-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-self: end;
  justify-content: flex-end;
}

.exhibition-actions form {
  margin: 0;
}

.album-download-menu {
  position: relative;
}

.album-download-menu summary {
  list-style: none;
}

.album-download-menu summary::-webkit-details-marker {
  display: none;
}

.album-download-panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  min-width: 190px;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 249, 0.98);
  box-shadow: 0 18px 46px rgba(54, 38, 30, 0.16);
}

.album-download-panel a,
.album-download-panel button {
  justify-content: flex-start;
  width: 100%;
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  padding: 8px 10px;
  text-align: left;
}

.album-download-panel small {
  color: var(--faint);
  font-size: 12px;
  line-height: 1.5;
  padding: 0 10px 4px;
}

.album-list-heading {
  align-items: center;
  margin-bottom: 20px;
}

.album-filter-bar {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  margin: 0 0 26px;
  padding: 4px 2px 12px;
  scrollbar-width: thin;
}

.album-filter-bar a {
  flex: 0 0 auto;
  border: 1px solid rgba(118, 91, 72, 0.16);
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.72);
  color: var(--muted);
  padding: 9px 14px;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(72, 52, 39, 0.06);
}

.album-filter-bar a.active,
.album-filter-bar a:hover {
  background: rgba(74, 55, 43, 0.92);
  color: #fffaf5;
}

.album-list-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.album-list-grid .gallery-album-card,
.album-list-grid .gallery-album-card:nth-child(5n + 1),
.album-list-grid .gallery-album-card:nth-child(5n + 4) {
  display: flex;
  grid-column: auto;
  min-width: 0;
  flex-direction: column;
  border-radius: 12px;
}

.album-list-grid .gallery-album-cover {
  min-height: 0;
  height: clamp(170px, 21vw, 230px);
  background:
    linear-gradient(135deg, rgba(255, 253, 249, 0.82), rgba(235, 224, 214, 0.72));
}

.album-list-grid .gallery-album-cover img {
  min-height: 0;
  height: 100%;
}

.album-list-grid .album-monogram {
  color: rgba(97, 73, 56, 0.34);
  font-size: clamp(42px, 7vw, 72px);
}

.album-card-tags,
.album-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.album-card-tags span,
.album-detail-tags span {
  border: 1px solid rgba(118, 91, 72, 0.16);
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.78);
  color: var(--muted);
  padding: 6px 10px;
  font-size: 12px;
}

.album-list-grid .gallery-album-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 20px;
}

.album-list-grid .gallery-album-body h2 {
  font-size: 24px;
}

.album-list-grid .gallery-album-body p {
  min-height: 0;
}

.album-list-grid .gallery-album-meta {
  margin-top: auto;
}

.memory-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 30px 0 4px;
}

.memory-pagination a,
.memory-pagination span {
  border: 1px solid rgba(118, 91, 72, 0.16);
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.74);
  color: var(--muted);
  padding: 9px 14px;
  text-decoration: none;
}

.memory-pagination span {
  opacity: 0.48;
}

.memory-pagination small {
  color: var(--faint);
}

.album-action-row {
  align-items: center;
}

.album-action-row .primary-action,
.album-action-row .button-link,
.album-action-row button {
  min-height: 40px;
  border-radius: 999px;
  padding: 9px 14px;
}

.album-action-row .danger-action {
  border-color: var(--button-danger-border);
  color: var(--button-danger-text);
}

.album-action-row .danger-action:hover {
  background: #fff0ed;
}

.album-photo-wall {
  display: block;
  column-count: 4;
  column-width: 260px;
  column-gap: 18px;
}

.album-photo-wall .selectable-photo-card {
  display: block;
  position: relative;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  min-width: 0;
  min-height: 0;
  margin: 0 0 18px;
  overflow: hidden;
  border-radius: 14px;
  background: rgba(255, 253, 249, 0.74);
  box-shadow: 0 10px 24px rgba(58, 43, 35, 0.09);
}

.album-photo-wall .selectable-photo-card .exhibition-photo {
  display: block;
  min-height: 0;
  width: 100%;
  height: auto;
  max-height: 620px;
  overflow: hidden;
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(255, 253, 249, 0.92), rgba(232, 224, 216, 0.72));
}

.album-photo-wall .selectable-photo-card .exhibition-photo img {
  display: block;
  width: 100%;
  min-height: 0;
  height: auto;
  aspect-ratio: auto;
  object-fit: initial;
  padding: 0;
}

.album-photo-wall .exhibition-photo::after {
  inset: auto 0 0;
  height: 36%;
}

.album-photo-wall .photo-caption {
  right: 14px;
  bottom: 13px;
  left: 14px;
}

.album-photo-wall .photo-caption span {
  color: rgba(255, 255, 255, 0.82);
}

.exhibition-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
}

.exhibition-photo {
  position: relative;
  grid-column: span 4;
  min-height: 320px;
  overflow: hidden;
  border-radius: 9px;
  background: #ded6cf;
  box-shadow: 0 14px 38px rgba(58, 43, 35, 0.1);
  text-decoration: none;
}

.exhibition-photo.wide {
  grid-column: span 8;
}

.selectable-photo-card {
  position: relative;
  grid-column: span 4;
  min-height: 320px;
}

.selectable-photo-card.wide {
  grid-column: span 8;
}

.selectable-photo-card .exhibition-photo {
  display: block;
  width: 100%;
  height: 100%;
}

.photo-select-control {
  position: absolute;
  z-index: 5;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.9);
  color: var(--ink);
  padding: 7px 10px;
  font-size: 12px;
  box-shadow: 0 8px 24px rgba(37, 28, 24, 0.16);
}

.album-cover-current,
.album-cover-form {
  position: absolute;
  z-index: 5;
  left: 14px;
  top: 14px;
}

.album-cover-current,
.album-cover-form button {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 999px;
  background: rgba(42, 35, 31, 0.58);
  color: #fffaf5;
  padding: 7px 10px;
  font-size: 12px;
  line-height: 1;
  box-shadow: 0 8px 24px rgba(37, 28, 24, 0.16);
  backdrop-filter: blur(12px);
}

.album-cover-form {
  margin: 0;
}

.album-cover-form button {
  cursor: pointer;
}

.album-cover-form button {
  border-color: rgba(255, 255, 255, 0.72);
  background: rgba(42, 35, 31, 0.62);
  color: #fffaf5;
  font-weight: 800;
}

.album-cover-form button:hover {
  background: rgba(42, 35, 31, 0.78);
}

.photo-select-control input {
  width: 14px;
  height: 14px;
  margin: 0;
}

.exhibition-photo img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 320px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 280ms ease;
}

.exhibition-photo.wide img {
  aspect-ratio: 16 / 9;
}

.exhibition-photo:hover img {
  transform: scale(1.025);
}

.exhibition-photo::after {
  position: absolute;
  inset: 44% 0 0;
  content: "";
  background: linear-gradient(to bottom, transparent, rgba(25, 21, 20, 0.72));
  pointer-events: none;
}

.exhibition-photo > .visibility-badge {
  position: absolute;
  z-index: 2;
  top: 14px;
  left: 14px;
}

.photo-caption {
  position: absolute;
  z-index: 2;
  right: 18px;
  bottom: 17px;
  left: 18px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  color: #fff;
}

.photo-caption strong {
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  font-size: 22px;
  font-weight: 500;
  min-width: 0;
  overflow-wrap: anywhere;
}

.photo-caption span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.album-empty {
  margin-top: 12px;
}

body.modal-open {
  overflow: hidden;
}

.related-diaries {
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.related-diaries-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.related-diaries h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  font-size: 30px;
  font-weight: 500;
}

.related-diary-list {
  display: grid;
  gap: 12px;
}

.related-diary-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
}

.related-diary-card time,
.diary-modal-card time {
  color: var(--faint);
  font-size: 12px;
}

.related-diary-card h3 {
  margin: 5px 0 0;
  font-size: 18px;
}

.related-diary-card p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.diary-modal[hidden] {
  display: none;
}

.diary-modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
}

.diary-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(36, 27, 22, 0.42);
}

.diary-modal-card {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: min(78vh, 720px);
  overflow: auto;
  border-radius: 10px;
  background: #fffdf9;
  padding: 28px;
  box-shadow: 0 30px 90px rgba(36, 27, 22, 0.28);
}

.diary-modal-card h3 {
  margin: 8px 38px 14px 0;
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  font-size: 30px;
  font-weight: 500;
}

.diary-modal-tags {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
}

.diary-modal-content {
  color: var(--ink);
  line-height: 1.9;
  white-space: pre-wrap;
}

.diary-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34px;
  min-height: 34px;
  border-radius: 50%;
  padding: 0;
}

.immersive-photo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 0;
  min-height: calc(100vh - 180px);
  overflow: hidden;
  border: 1px solid rgba(68, 54, 48, 0.2);
  border-radius: 12px;
  background: #171717;
  box-shadow: 0 32px 90px rgba(28, 22, 20, 0.24);
}

.museum-stage {
  display: grid;
  min-width: 0;
  grid-template-rows: auto 1fr;
  background:
    radial-gradient(circle at center, #34302e 0%, #1b1918 54%, #111 100%);
}

.stage-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
}

.stage-toolbar a {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
}

.museum-stage > img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 78vh;
  object-fit: contain;
  padding: clamp(18px, 4vw, 48px);
}

.museum-caption {
  border: 0;
  border-radius: 0;
  background: #fffdf9;
  padding: clamp(28px, 4vw, 46px);
  box-shadow: none;
}

.museum-caption h1 {
  margin: 22px 0 16px;
  font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
  font-size: clamp(38px, 5vw, 58px);
  font-weight: 500;
  line-height: 1.02;
  overflow-wrap: anywhere;
}

.museum-caption > p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.85;
}

.caption-divider {
  width: 54px;
  height: 1px;
  margin: 28px 0;
  background: rgba(70, 56, 48, 0.35);
}

.museum-caption dl {
  display: grid;
  gap: 13px;
  margin: 0 0 30px;
}

.museum-caption dl div {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.museum-caption dt {
  color: var(--faint);
  font-size: 13px;
}

.museum-caption dd {
  margin: 0;
  color: var(--ink);
  min-width: 0;
  overflow-wrap: anywhere;
}

.caption-action {
  width: 100%;
}

.museum-caption form {
  margin: 0 0 10px;
}

.museum-caption .danger-action {
  width: 100%;
}

@media (max-width: 980px) {
  .gallery-album-card,
  .gallery-album-card:nth-child(5n + 1),
  .gallery-album-card:nth-child(5n + 4) {
    grid-column: span 6;
  }

  .exhibition-photo,
  .exhibition-photo.wide,
  .selectable-photo-card,
  .selectable-photo-card.wide {
    grid-column: span 6;
  }

  .immersive-photo {
    grid-template-columns: 1fr;
  }

  .museum-stage > img {
    max-height: 68vh;
  }
}

@media (max-width: 640px) {
  .detail-action-row,
  .inline-action-row {
    align-items: stretch;
    flex-direction: column;
  }

  .detail-action-row .primary-action,
  .detail-action-row .button-link,
  .detail-action-row button,
  .detail-action-row form,
  .detail-action-row .album-download-menu,
  .detail-action-row .album-download-menu summary,
  .inline-action-row .primary-action,
  .inline-action-row .button-link,
  .inline-action-row button,
  .inline-action-row form {
    width: 100%;
  }

  .gallery-heading,
  .exhibition-header {
    align-items: flex-start;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .gallery-heading {
    display: flex;
  }

  .gallery-heading .primary-action,
  .exhibition-actions .primary-action {
    width: 100%;
  }

  .gallery-album-grid,
  .exhibition-grid {
    grid-template-columns: 1fr;
  }

  .gallery-album-card,
  .gallery-album-card:nth-child(5n + 1),
  .gallery-album-card:nth-child(5n + 4),
  .exhibition-photo,
  .exhibition-photo.wide,
  .selectable-photo-card,
  .selectable-photo-card.wide {
    grid-column: 1;
  }

  .gallery-album-cover,
  .gallery-album-cover img {
    min-height: 230px;
  }

  .exhibition-photo,
  .exhibition-photo img,
  .exhibition-photo.wide img {
    min-height: 260px;
    aspect-ratio: 4 / 3;
  }

  .photo-caption {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .album-download-menu,
  .album-download-menu summary {
    width: 100%;
  }

  .album-download-panel {
    right: auto;
    left: 0;
    width: min(100%, 260px);
  }

  .related-diary-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .diary-modal {
    padding: 14px;
  }

  .diary-modal-card {
    max-height: 84vh;
    padding: 24px;
  }

  .immersive-photo {
    min-height: 0;
  }

  .museum-stage > img {
    min-height: 300px;
    max-height: 58vh;
    padding: 12px;
  }

  .museum-caption dl div {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }

  .memory-screen-slide,
  .memory-screen-photo,
  .memory-screen-bg,
  .gallery-album-card,
  .gallery-album-cover img,
  .featured-memory-card,
  .space-entry-card,
  .space-note-card,
  .exhibition-photo img,
  .couple-pup-sticker {
    animation: none !important;
    transition: none;
  }

  .gallery-album-card:hover,
  .featured-memory-card:hover,
  .space-note-card:hover,
  .exhibition-photo:hover img {
    transform: none;
  }
}

@media (max-width: 980px) {
  .album-list-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .album-photo-wall {
    column-count: 3;
    column-width: 220px;
    column-gap: 16px;
  }

  .album-list-grid .gallery-album-card,
  .album-list-grid .gallery-album-card:nth-child(5n + 1),
  .album-list-grid .gallery-album-card:nth-child(5n + 4),
  .album-photo-wall .selectable-photo-card {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  .album-list-grid {
    grid-template-columns: 1fr;
  }

  .album-photo-wall {
    column-count: 2;
    column-width: 150px;
    column-gap: 12px;
  }

  .album-filter-bar {
    margin-bottom: 20px;
  }

  .album-list-grid .gallery-album-cover,
  .album-list-grid .gallery-album-cover img {
    min-height: 0;
    height: 210px;
  }

  .album-photo-wall .selectable-photo-card .exhibition-photo,
  .album-photo-wall .selectable-photo-card .exhibition-photo img {
    min-height: 0;
  }

  .album-photo-wall .selectable-photo-card {
    margin-bottom: 12px;
    border-radius: 12px;
  }

  .album-photo-wall .selectable-photo-card .exhibition-photo {
    height: auto;
    max-height: 520px;
    border-radius: 12px;
  }

  .album-photo-wall .photo-select-control {
    top: 10px;
    right: 10px;
  }

  .album-photo-wall .album-cover-current,
  .album-photo-wall .album-cover-form {
    top: 10px;
    left: 10px;
  }

  .album-action-row {
    justify-content: flex-start;
  }

  .album-action-row .primary-action,
  .album-action-row .button-link,
  .album-action-row button,
  .album-download-menu,
  .album-download-menu summary {
    width: auto;
  }
}

@media (max-width: 420px) {
  .album-photo-wall {
    column-count: 1;
  }
}

/* V1 diary / memory notes */
.diary-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin: 34px 0 38px;
}

.diary-heading > div > span {
  color: var(--rose);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.diary-heading h1 {
  margin: 8px 0 10px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.5rem, 5vw, 4.8rem);
  font-weight: 500;
  letter-spacing: -0.045em;
}

.diary-heading p {
  max-width: 650px;
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.diary-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 24px;
}

.diary-card {
  position: relative;
  grid-column: span 4;
  min-height: 330px;
  overflow: hidden;
  border: 1px solid rgba(87, 69, 55, 0.12);
  border-radius: 28px 28px 28px 8px;
  background: rgba(255, 253, 248, 0.9);
  box-shadow: 0 18px 45px rgba(77, 57, 43, 0.08);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.diary-card:nth-child(5n + 1),
.diary-card:nth-child(5n + 4) {
  grid-column: span 6;
}

.diary-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: #9f715c;
  content: "";
}

.diary-card.couple::before {
  background: #c97882;
}

.diary-card.dorm::before {
  background: #6f967c;
}

.diary-card.selected::before {
  background: #b68b3c;
}

.diary-card.public::before {
  background: #6b8ca4;
}

.diary-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 24px 55px rgba(77, 57, 43, 0.13);
}

.diary-card > a {
  display: flex;
  min-height: 330px;
  flex-direction: column;
  padding: 30px 30px 26px 34px;
  color: inherit;
  text-decoration: none;
}

.diary-card-topline,
.diary-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.diary-card-topline time,
.diary-card-meta {
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.diary-card h2 {
  margin: 28px 0 10px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.55rem, 3vw, 2.25rem);
  font-weight: 500;
  line-height: 1.24;
}

.diary-mood {
  margin: 0 0 14px;
  color: var(--rose);
  font-size: 0.86rem;
}

.diary-excerpt {
  display: -webkit-box;
  margin: 0 0 24px;
  overflow: hidden;
  color: #65584f;
  line-height: 1.85;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.diary-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.diary-tags span {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(126, 93, 72, 0.08);
  color: #725d50;
  font-size: 0.76rem;
}

.diary-card .diary-tags {
  margin-bottom: 24px;
}

.diary-card-meta {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(87, 69, 55, 0.1);
}

.diary-empty {
  margin-top: 30px;
}

.empty-note {
  display: grid;
  width: 92px;
  height: 70px;
  place-items: center;
  border: 1px solid rgba(87, 69, 55, 0.14);
  border-radius: 18px;
  background: rgba(255, 253, 247, 0.78);
  box-shadow: 0 12px 28px rgba(126, 93, 72, 0.07);
  color: #a08372;
  font-weight: 800;
}

.diary-form-shell {
  max-width: 980px;
}

.diary-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 22px;
}

.diary-form > div:not(.form-actions) {
  display: grid;
  align-content: start;
  gap: 8px;
}

.diary-form .form-field-wide {
  grid-column: 1 / -1;
}

.field-help {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
}

.diary-reading {
  max-width: 1120px;
  margin: 36px auto;
  overflow: hidden;
  border: 1px solid rgba(87, 69, 55, 0.12);
  border-radius: 36px 36px 36px 10px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 0 28px 70px rgba(77, 57, 43, 0.1);
}

.diary-reading-header {
  position: relative;
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 24px 40px;
  padding: 38px 60px 44px;
  border-bottom: 1px solid rgba(87, 69, 55, 0.1);
  background: linear-gradient(135deg, rgba(151, 116, 91, 0.09), transparent 60%);
}

.diary-reading.couple .diary-reading-header {
  background: linear-gradient(135deg, rgba(202, 120, 130, 0.13), transparent 60%);
}

.diary-reading.dorm .diary-reading-header {
  background: linear-gradient(135deg, rgba(111, 150, 124, 0.14), transparent 60%);
}

.diary-reading.selected .diary-reading-header {
  background: linear-gradient(135deg, rgba(182, 139, 60, 0.14), transparent 60%);
}

.diary-reading.public .diary-reading-header {
  background: linear-gradient(135deg, rgba(107, 140, 164, 0.14), transparent 60%);
}

.diary-reading-header .back-link {
  grid-column: 1 / -1;
}

.diary-reading-date {
  display: flex;
  align-self: start;
  flex-direction: column;
  padding: 18px 12px;
  border-right: 1px solid rgba(87, 69, 55, 0.16);
  color: var(--rose);
}

.diary-reading-date span {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.5rem;
}

.diary-reading-date strong {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
}

.diary-reading-header h1 {
  max-width: 780px;
  margin: 18px 0 12px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.3rem, 5vw, 4.6rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.diary-byline {
  margin: 0;
  color: var(--muted);
}

.diary-reading-body {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 48px;
  padding: 56px 60px 68px;
}

.diary-margin-note {
  display: grid;
  align-content: start;
  gap: 24px;
}

.diary-margin-note div {
  display: grid;
  gap: 6px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(87, 69, 55, 0.1);
}

.diary-margin-note span {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.diary-margin-note strong,
.diary-margin-note a {
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.5;
}

.diary-prose {
  min-width: 0;
  color: #4d443e;
  font-family: Georgia, "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(1.04rem, 1.8vw, 1.18rem);
  line-height: 2.05;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.diary-reading-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 60px;
  border-top: 1px solid rgba(87, 69, 55, 0.1);
  background: rgba(126, 93, 72, 0.035);
}

.diary-reading-footer form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.diary-reading-footer small {
  color: var(--muted);
  text-align: right;
}

@media (max-width: 980px) {
  .diary-card,
  .diary-card:nth-child(5n + 1),
  .diary-card:nth-child(5n + 4) {
    grid-column: span 6;
  }
}

@media (max-width: 640px) {
  .diary-heading {
    align-items: stretch;
    flex-direction: column;
    margin-top: 20px;
  }

  .diary-heading .primary-action {
    width: 100%;
  }

  .diary-grid {
    grid-template-columns: 1fr;
  }

  .diary-card,
  .diary-card:nth-child(5n + 1),
  .diary-card:nth-child(5n + 4) {
    grid-column: 1;
  }

  .diary-card > a {
    padding: 24px 22px 22px 27px;
  }

  .diary-form {
    grid-template-columns: 1fr;
  }

  .diary-form .form-field-wide {
    grid-column: 1;
  }

  .diary-reading {
    margin: 18px auto;
    border-radius: 24px 24px 24px 8px;
  }

  .diary-reading-header {
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 26px 22px 32px;
  }

  .diary-reading-date {
    width: fit-content;
    padding: 0 18px 0 0;
  }

  .diary-reading-body {
    grid-template-columns: 1fr;
    gap: 34px;
    padding: 36px 22px 44px;
  }

  .diary-margin-note {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .diary-reading-footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 24px 22px;
  }

  .diary-reading-footer small {
    text-align: left;
  }
}

/* V1 memoir timeline */
.timeline-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
  margin: 42px 0 28px;
  padding: 42px 48px;
  border: 1px solid rgba(87, 69, 55, 0.11);
  border-radius: 34px 34px 34px 10px;
  background:
    linear-gradient(115deg, rgba(255, 253, 248, 0.96), rgba(245, 231, 218, 0.84)),
    radial-gradient(circle at 82% 18%, rgba(189, 111, 125, 0.18), transparent 28%);
  box-shadow: 0 24px 64px rgba(77, 57, 43, 0.09);
}

.timeline-hero h1 {
  margin: 0 0 16px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: clamp(3rem, 7vw, 6rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 1;
}

.timeline-hero p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.9;
}

.timeline-seal {
  position: relative;
  display: grid;
  width: 140px;
  height: 140px;
  flex: 0 0 auto;
  place-content: center;
  transform: rotate(3deg);
  border: 1px solid rgba(126, 93, 72, 0.24);
  border-radius: 50%;
  color: #7d6251;
  text-align: center;
}

.timeline-seal::before {
  position: absolute;
  width: 118px;
  height: 118px;
  border: 1px dashed rgba(126, 93, 72, 0.25);
  border-radius: 50%;
  content: "";
}

.timeline-seal span,
.timeline-seal small {
  position: relative;
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.timeline-seal strong {
  position: relative;
  margin: 3px 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  font-weight: 500;
}

.timeline-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 52px;
  padding: 8px;
  border: 1px solid rgba(87, 69, 55, 0.1);
  border-radius: 999px;
  background: rgba(255, 252, 248, 0.72);
  width: fit-content;
  max-width: 100%;
}

.timeline-filters a {
  padding: 10px 17px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.timeline-filters a:hover {
  transform: translateY(-1px);
  color: var(--ink);
}

.timeline-filters a.active {
  background: #765a49;
  color: #fffaf5;
  box-shadow: 0 8px 20px rgba(85, 59, 43, 0.16);
}

.memoir-timeline {
  position: relative;
  max-width: 1160px;
  margin: 0 auto;
}

.memoir-timeline::before {
  position: absolute;
  top: 44px;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: linear-gradient(to bottom, rgba(126, 93, 72, 0.3), rgba(126, 93, 72, 0.04));
  content: "";
}

.timeline-month {
  position: relative;
  margin-bottom: 76px;
}

.timeline-month-heading {
  position: relative;
  z-index: 2;
  width: fit-content;
  margin: 0 auto 38px;
  padding: 13px 24px 14px;
  border: 1px solid rgba(87, 69, 55, 0.12);
  border-radius: 4px;
  background: #fffaf4;
  box-shadow: 6px 7px 0 rgba(126, 93, 72, 0.07);
  text-align: center;
}

.timeline-month-heading span {
  display: block;
  margin-bottom: 3px;
  color: var(--faint);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
}

.timeline-month-heading h2 {
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 1.25rem;
  font-weight: 500;
}

.timeline-month-items {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px 78px;
}

.timeline-entry {
  position: relative;
  min-width: 0;
}

.timeline-entry:nth-child(even) {
  margin-top: 92px;
}

.timeline-dot {
  position: absolute;
  z-index: 3;
  top: 42px;
  right: -46px;
  width: 13px;
  height: 13px;
  border: 3px solid #fffaf4;
  border-radius: 50%;
  background: #95715d;
  box-shadow: 0 0 0 1px rgba(126, 93, 72, 0.28);
}

.timeline-entry:nth-child(even) .timeline-dot {
  right: auto;
  left: -45px;
}

.timeline-entry.couple .timeline-dot {
  background: var(--rose);
}

.timeline-entry.dorm .timeline-dot {
  background: var(--green);
}

.timeline-entry.selected .timeline-dot {
  background: var(--gold);
}

.timeline-entry.public .timeline-dot {
  background: var(--blue);
}

.timeline-card {
  display: block;
  overflow: hidden;
  border: 1px solid rgba(87, 69, 55, 0.12);
  border-radius: 26px 26px 26px 7px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 0 18px 48px rgba(77, 57, 43, 0.09);
  color: inherit;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.timeline-entry:nth-child(even) .timeline-card {
  border-radius: 26px 26px 7px 26px;
}

.timeline-card:hover {
  transform: translateY(-5px) rotate(-0.25deg);
  box-shadow: 0 26px 58px rgba(77, 57, 43, 0.14);
}

.timeline-entry:nth-child(even) .timeline-card:hover {
  transform: translateY(-5px) rotate(0.25deg);
}

.timeline-photo-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: #ded3c9;
}

.timeline-photo-frame::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to top, rgba(42, 31, 25, 0.13), transparent 45%);
  content: "";
}

.timeline-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 300ms ease;
}

.timeline-album-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: rgba(88, 66, 51, 0.42);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 10vw, 5.8rem);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0)),
    #e9ded4;
}

.timeline-card:hover .timeline-photo-frame img {
  transform: scale(1.035);
}

.timeline-card-body {
  padding: 26px 28px 28px;
}

.timeline-card-topline,
.timeline-entry-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.timeline-type {
  color: #836754;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.timeline-card-body > time {
  display: block;
  margin: 20px 0 7px;
  color: var(--faint);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
}

.timeline-card h3 {
  margin: 0 0 14px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: clamp(1.55rem, 2.8vw, 2.25rem);
  font-weight: 500;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.timeline-card-body > p {
  margin: 0 0 18px;
  color: #65584f;
  line-height: 1.85;
}

.timeline-entry-meta {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(87, 69, 55, 0.09);
  color: var(--muted);
  font-size: 0.78rem;
}

.timeline-mood {
  color: var(--rose) !important;
  font-size: 0.84rem;
}

.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.timeline-tags span {
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(126, 93, 72, 0.08);
  color: #725d50;
  font-size: 0.72rem;
}

.timeline-empty {
  display: grid;
  max-width: 760px;
  margin: 44px auto;
  place-items: center;
  padding: 36px 30px;
  border: 1px solid rgba(87, 69, 55, 0.11);
  border-radius: 24px;
  background: rgba(255, 253, 248, 0.82);
  text-align: center;
}

.timeline-empty-mark {
  position: relative;
  width: 82px;
  height: 58px;
  margin-bottom: 18px;
}

.timeline-empty-mark span {
  position: absolute;
  width: 46px;
  height: 54px;
  border: 1px solid rgba(126, 93, 72, 0.2);
  border-radius: 12px;
  background: #fffaf4;
}

.timeline-empty-mark span:nth-child(1) {
  left: 0;
  transform: rotate(-9deg);
}

.timeline-empty-mark span:nth-child(2) {
  left: 23px;
  z-index: 2;
}

.timeline-empty-mark span:nth-child(3) {
  right: 0;
  transform: rotate(9deg);
}

.timeline-empty h2 {
  margin: 0 0 12px;
  font-size: 1.55rem;
  font-weight: 800;
}

.timeline-empty p {
  max-width: 540px;
  margin: 0 0 26px;
  color: var(--muted);
  line-height: 1.8;
}

.timeline-empty > div:last-child {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

@media (max-width: 760px) {
  .timeline-hero {
    align-items: flex-start;
    padding: 32px 26px;
  }

  .timeline-seal {
    width: 96px;
    height: 96px;
  }

  .timeline-seal::before {
    width: 78px;
    height: 78px;
  }

  .timeline-seal strong {
    font-size: 1.45rem;
  }

  .timeline-filters {
    width: 100%;
    border-radius: 22px;
  }

  .timeline-filters a {
    flex: 1 1 calc(33.333% - 10px);
    text-align: center;
  }

  .memoir-timeline::before {
    left: 15px;
  }

  .timeline-month-heading {
    margin-left: 0;
  }

  .timeline-month-items {
    grid-template-columns: 1fr;
    gap: 26px;
    padding-left: 42px;
  }

  .timeline-entry:nth-child(even) {
    margin-top: 0;
  }

  .timeline-dot,
  .timeline-entry:nth-child(even) .timeline-dot {
    top: 36px;
    right: auto;
    left: -33px;
  }

  .timeline-entry:nth-child(even) .timeline-card {
    border-radius: 26px 26px 26px 7px;
  }
}

@media (max-width: 520px) {
  .timeline-hero {
    flex-direction: column;
    margin-top: 20px;
  }

  .timeline-seal {
    align-self: flex-end;
    margin-top: -12px;
  }

  .timeline-filters a {
    flex-basis: calc(50% - 10px);
  }

  .timeline-card-body {
    padding: 22px 20px 24px;
  }

  .timeline-card-topline,
  .timeline-entry-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
  }

  .timeline-empty {
    margin: 44px auto;
    padding: 42px 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .timeline-card,
  .timeline-photo-frame img,
  .timeline-filters a {
    transition: none;
  }
}

/* V1 message board */
.message-board-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
  margin: 42px 0 24px;
  padding: 40px 46px;
  border: 1px solid rgba(87, 69, 55, 0.11);
  border-radius: 34px 34px 34px 10px;
  background:
    radial-gradient(circle at 88% 18%, rgba(189, 111, 125, 0.15), transparent 30%),
    linear-gradient(120deg, rgba(255, 253, 248, 0.96), rgba(244, 232, 218, 0.82));
  box-shadow: 0 24px 64px rgba(77, 57, 43, 0.09);
}

.message-board-heading h1 {
  margin: 0 0 14px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: clamp(3rem, 7vw, 5.8rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 1;
}

.message-board-heading p {
  max-width: 690px;
  margin: 0;
  color: var(--muted);
  line-height: 1.9;
}

.message-board-stamp {
  display: grid;
  width: 128px;
  height: 128px;
  flex: 0 0 auto;
  place-content: center;
  transform: rotate(4deg);
  border: 1px dashed rgba(126, 93, 72, 0.3);
  border-radius: 50%;
  color: #866856;
  text-align: center;
}

.message-board-stamp span {
  font-size: 0.66rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.message-board-stamp strong {
  margin-top: 4px;
  color: var(--rose);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  font-weight: 500;
}

.message-board-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  margin-bottom: 32px;
  padding: 8px;
  border: 1px solid rgba(87, 69, 55, 0.1);
  border-radius: 999px;
  background: rgba(255, 252, 248, 0.76);
}

.message-board-filters a {
  padding: 10px 17px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 160ms ease, color 160ms ease, background 160ms ease;
}

.message-board-filters a:hover {
  transform: translateY(-1px);
  color: var(--ink);
}

.message-board-filters a.active {
  background: #765a49;
  color: #fffaf5;
  box-shadow: 0 8px 20px rgba(85, 59, 43, 0.15);
}

.message-board-filters a.active.couple {
  background: var(--rose);
}

.message-board-filters a.active.dorm {
  background: var(--green);
}

.message-board-filters a.active.public {
  background: var(--blue);
}

.message-compose {
  display: grid;
  grid-template-columns: minmax(220px, 0.55fr) minmax(0, 1.45fr);
  gap: 34px;
  margin-bottom: 44px;
  padding: 32px 36px;
  border: 1px solid rgba(87, 69, 55, 0.11);
  border-radius: 28px 28px 28px 8px;
  background: rgba(255, 253, 248, 0.9);
  box-shadow: 0 18px 48px rgba(77, 57, 43, 0.07);
}

.message-compose-copy h2 {
  margin: 2px 0 10px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 1.65rem;
  font-weight: 500;
}

.message-compose-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.75;
}

.message-form {
  display: grid;
  gap: 10px;
}

.message-form label {
  color: #55483f;
  font-size: 0.82rem;
  font-weight: 800;
}

.message-form textarea,
.message-form select {
  width: 100%;
  border: 1px solid rgba(87, 69, 55, 0.16);
  border-radius: 16px;
  outline: none;
  background: #fffdf8;
  color: var(--ink);
  font: inherit;
}

.message-form textarea {
  min-height: 130px;
  resize: vertical;
  padding: 16px 18px;
  line-height: 1.75;
}

.message-form select {
  min-width: 190px;
  padding: 11px 38px 11px 13px;
}

.message-form textarea:focus,
.message-form select:focus {
  border-color: rgba(189, 111, 125, 0.55);
  box-shadow: 0 0 0 3px rgba(189, 111, 125, 0.08);
}

.message-form-footer {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.message-form-footer > div {
  display: grid;
  gap: 7px;
}

.message-form-footer button {
  padding: 12px 21px;
  border: 1px solid rgba(47, 38, 34, 0.36);
  border-radius: 999px;
  background: var(--button-primary-bg);
  color: var(--button-primary-text);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
}

.message-visitor-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 42px;
  padding: 28px 34px;
  border: 1px solid rgba(102, 127, 154, 0.15);
  border-radius: 24px;
  background: rgba(238, 245, 247, 0.7);
}

.message-visitor-note h2 {
  margin: 0 0 7px;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 1.35rem;
  font-weight: 500;
}

.message-visitor-note p {
  margin: 0;
  color: var(--muted);
}

.message-wall {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 22px;
}

.message-card {
  position: relative;
  grid-column: span 4;
  min-height: 250px;
  display: flex;
  flex-direction: column;
  padding: 25px 25px 21px;
  overflow: hidden;
  border: 1px solid rgba(87, 69, 55, 0.12);
  border-radius: 24px 24px 24px 7px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 0 16px 40px rgba(77, 57, 43, 0.08);
}

.message-card:nth-child(6n + 1),
.message-card:nth-child(6n + 5) {
  grid-column: span 6;
}

.message-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: #9c7d69;
  content: "";
}

.message-card.couple::before {
  background: var(--rose);
}

.message-card.dorm::before {
  background: var(--green);
}

.message-card.public::before {
  background: var(--blue);
}

.message-card.selected::before {
  background: var(--gold);
}

.message-card header,
.message-card footer,
.message-author {
  display: flex;
  align-items: center;
}

.message-card header,
.message-card footer {
  justify-content: space-between;
  gap: 14px;
}

.message-author {
  gap: 10px;
}

.message-author > span {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: rgba(126, 93, 72, 0.1);
  color: #715747;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
}

.message-author div {
  display: grid;
  gap: 2px;
}

.message-author strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.message-author small {
  color: var(--faint);
  font-size: 0.69rem;
}

.message-space-label {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(126, 93, 72, 0.08);
  color: #765e4f;
  font-size: 0.72rem;
  white-space: nowrap;
}

.message-space-label.couple {
  background: rgba(189, 111, 125, 0.11);
  color: #9b5361;
}

.message-space-label.dorm {
  background: rgba(104, 139, 113, 0.12);
  color: #4f7359;
}

.message-space-label.public {
  background: rgba(102, 127, 154, 0.12);
  color: #526c86;
}

.message-card > p {
  margin: 28px 2px 30px;
  color: #4f453f;
  font-family: Georgia, "Noto Serif SC", "Songti SC", serif;
  font-size: 1.02rem;
  line-height: 1.9;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message-card footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(87, 69, 55, 0.09);
}

.message-card time {
  color: var(--faint);
  font-size: 0.74rem;
}

.message-card footer form {
  margin: 0;
}

.message-card footer button {
  padding: 5px 9px;
  min-height: 30px;
  border: 1px solid rgba(126, 93, 72, 0.14);
  border-radius: 999px;
  background: rgba(255, 248, 239, 0.72);
  color: #9b7065;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 800;
  cursor: pointer;
}

.message-card footer .danger-action {
  border-color: var(--button-danger-border);
  background: var(--button-danger-bg);
  color: var(--button-danger-text);
}

.message-empty {
  display: grid;
  max-width: 720px;
  margin: 44px auto;
  place-items: center;
  padding: 34px 28px;
  border: 1px solid rgba(87, 69, 55, 0.11);
  border-radius: 24px;
  background: rgba(255, 253, 248, 0.82);
  text-align: center;
}

.message-empty > div {
  color: rgba(126, 93, 72, 0.28);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.6rem;
  line-height: 0.8;
}

.message-empty h2 {
  margin: 14px 0 10px;
  font-size: 1.55rem;
  font-weight: 800;
}

.message-empty p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

@media (max-width: 980px) {
  .message-card,
  .message-card:nth-child(6n + 1),
  .message-card:nth-child(6n + 5) {
    grid-column: span 6;
  }
}

@media (max-width: 700px) {
  .message-board-heading {
    align-items: flex-start;
    padding: 32px 25px;
  }

  .message-board-stamp {
    width: 92px;
    height: 92px;
  }

  .message-board-filters {
    width: 100%;
    border-radius: 22px;
  }

  .message-board-filters a {
    flex: 1 1 calc(33.333% - 10px);
    text-align: center;
  }

  .message-compose {
    grid-template-columns: 1fr;
    padding: 27px 24px;
  }

  .message-wall {
    grid-template-columns: 1fr;
  }

  .message-card,
  .message-card:nth-child(6n + 1),
  .message-card:nth-child(6n + 5) {
    grid-column: 1;
  }
}

@media (max-width: 520px) {
  .message-board-heading {
    flex-direction: column;
    margin-top: 20px;
  }

  .message-board-stamp {
    align-self: flex-end;
    margin-top: -12px;
  }

  .message-board-filters a {
    flex-basis: calc(50% - 10px);
  }

  .message-form-footer,
  .message-visitor-note,
  .message-card header {
    align-items: stretch;
    flex-direction: column;
  }

  .message-form select,
  .message-form-footer button,
  .message-visitor-note .button-link {
    width: 100%;
  }

  .message-card {
    padding: 22px 20px 19px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .message-board-filters a {
    transition: none;
  }
}

/* V1 shared todo lists */
.todo-gallery-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  margin: 42px 0 38px;
}

.todo-gallery-heading h1 {
  margin: 0 0 13px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: clamp(3rem, 7vw, 5.8rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 1;
}

.todo-gallery-heading p {
  max-width: 700px;
  margin: 0;
  color: var(--muted);
  line-height: 1.9;
}

.todo-card-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 24px;
}

.todo-list-card {
  position: relative;
  grid-column: span 4;
  min-height: 390px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 28px 28px 24px;
  border: 1px solid rgba(87, 69, 55, 0.12);
  border-radius: 28px 28px 28px 8px;
  background:
    linear-gradient(145deg, rgba(255, 253, 248, 0.97), rgba(249, 242, 234, 0.91));
  box-shadow: 0 18px 48px rgba(77, 57, 43, 0.09);
  color: inherit;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.todo-list-card:nth-child(5n + 1),
.todo-list-card:nth-child(5n + 4) {
  grid-column: span 6;
}

.todo-list-card::after {
  position: absolute;
  right: -58px;
  bottom: -58px;
  width: 150px;
  height: 150px;
  border: 1px solid rgba(126, 93, 72, 0.08);
  border-radius: 50%;
  content: "";
}

.todo-list-card.couple {
  background: linear-gradient(145deg, rgba(255, 251, 248, 0.98), rgba(249, 230, 232, 0.82));
}

.todo-list-card.dorm {
  background: linear-gradient(145deg, rgba(255, 253, 248, 0.98), rgba(226, 238, 227, 0.8));
}

.todo-list-card.selected {
  background: linear-gradient(145deg, rgba(255, 253, 248, 0.98), rgba(244, 234, 208, 0.82));
}

.todo-list-card.public {
  background: linear-gradient(145deg, rgba(255, 253, 248, 0.98), rgba(227, 237, 243, 0.82));
}

.todo-list-card:hover {
  transform: translateY(-6px) rotate(-0.2deg);
  box-shadow: 0 28px 62px rgba(77, 57, 43, 0.14);
}

.todo-card-topline,
.todo-progress > div:first-child,
.todo-list-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.todo-type-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(126, 93, 72, 0.13);
  border-radius: 16px 16px 16px 5px;
  background: rgba(255, 253, 248, 0.7);
  color: #765a49;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
}

.todo-space-badge {
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(126, 93, 72, 0.09);
  color: #71594a;
  font-size: 0.72rem;
  white-space: nowrap;
}

.todo-space-badge.couple {
  background: rgba(189, 111, 125, 0.12);
  color: #9a5260;
}

.todo-space-badge.dorm {
  background: rgba(104, 139, 113, 0.13);
  color: #4f7359;
}

.todo-space-badge.selected {
  background: rgba(181, 131, 76, 0.13);
  color: #8d673b;
}

.todo-space-badge.public {
  background: rgba(102, 127, 154, 0.13);
  color: #526c86;
}

.todo-card-copy {
  margin: 34px 0 28px;
}

.todo-card-copy > span {
  color: #876b59;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.todo-card-copy h2 {
  margin: 9px 0 13px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  font-weight: 500;
  line-height: 1.23;
}

.todo-card-copy p {
  margin: 0;
  color: #665950;
  line-height: 1.75;
}

.todo-progress {
  margin-top: auto;
}

.todo-progress > div:first-child {
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 0.78rem;
}

.todo-progress strong {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.95rem;
}

.todo-progress-track,
.todo-detail-progress-track {
  overflow: hidden;
  height: 7px;
  border-radius: 999px;
  background: rgba(126, 93, 72, 0.1);
}

.todo-progress-track span,
.todo-detail-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #96725e, #bd8b74);
}

.todo-list-card.couple .todo-progress-track span,
.todo-detail-hero.couple .todo-detail-progress-track span {
  background: linear-gradient(90deg, #bd6f7d, #d7959f);
}

.todo-list-card.dorm .todo-progress-track span,
.todo-detail-hero.dorm .todo-detail-progress-track span {
  background: linear-gradient(90deg, #688b71, #91ad96);
}

.todo-list-card.public .todo-progress-track span,
.todo-detail-hero.public .todo-detail-progress-track span {
  background: linear-gradient(90deg, #667f9a, #91a6ba);
}

.todo-list-card footer {
  margin-top: 20px;
  padding-top: 17px;
  border-top: 1px solid rgba(87, 69, 55, 0.09);
  color: var(--faint);
  font-size: 0.75rem;
}

.todo-empty,
.todo-detail-empty {
  display: grid;
  max-width: 760px;
  margin: 44px auto;
  place-items: center;
  padding: 34px 28px;
  border: 1px solid rgba(87, 69, 55, 0.11);
  border-radius: 24px;
  background: rgba(255, 253, 248, 0.84);
  text-align: center;
}

.todo-empty > div {
  position: relative;
  width: 82px;
  height: 62px;
}

.todo-empty > div span:not(:first-child) {
  position: absolute;
  left: 24px;
  width: 48px;
  height: 24px;
  border-bottom: 1px solid rgba(126, 93, 72, 0.19);
}

.todo-empty > div span:nth-child(2) {
  top: 12px;
}

.todo-empty > div span:nth-child(3) {
  top: 34px;
}

.todo-empty > div span:first-child {
  position: absolute;
  top: 15px;
  left: 0;
  color: rgba(104, 139, 113, 0.5);
  font-size: 1.5rem;
}

.todo-empty h2,
.todo-detail-empty h2 {
  margin: 14px 0 10px;
  font-size: 1.55rem;
  font-weight: 800;
}

.todo-empty p,
.todo-detail-empty p {
  max-width: 520px;
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.8;
}

.todo-create-shell {
  max-width: 940px;
}

.todo-create-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 22px;
}

.todo-create-form > div:not(.form-actions) {
  display: grid;
  align-content: start;
  gap: 8px;
}

.todo-create-form .form-field-wide {
  grid-column: 1 / -1;
}

.todo-detail-hero {
  margin: 38px 0 30px;
  padding: 34px 42px 38px;
  border: 1px solid rgba(87, 69, 55, 0.11);
  border-radius: 34px 34px 34px 9px;
  background: linear-gradient(130deg, rgba(255, 253, 248, 0.96), rgba(244, 232, 218, 0.8));
  box-shadow: 0 22px 58px rgba(77, 57, 43, 0.09);
}

.todo-detail-hero.couple {
  background: linear-gradient(130deg, rgba(255, 253, 248, 0.97), rgba(249, 226, 230, 0.82));
}

.todo-detail-hero.dorm {
  background: linear-gradient(130deg, rgba(255, 253, 248, 0.97), rgba(223, 237, 225, 0.82));
}

.todo-detail-hero.public {
  background: linear-gradient(130deg, rgba(255, 253, 248, 0.97), rgba(225, 236, 243, 0.82));
}

.todo-detail-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 26px;
  margin-top: 32px;
}

.todo-detail-icon {
  display: grid;
  width: 78px;
  height: 78px;
  place-items: center;
  border: 1px solid rgba(126, 93, 72, 0.14);
  border-radius: 24px 24px 24px 7px;
  background: rgba(255, 253, 248, 0.72);
  color: #765a49;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
}

.todo-detail-labels {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  color: #816654;
  font-size: 0.78rem;
  font-weight: 800;
}

.todo-detail-main h1 {
  margin: 13px 0 12px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.todo-detail-main p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  line-height: 1.85;
}

.todo-detail-progress {
  display: grid;
  grid-template-columns: auto auto minmax(180px, 1fr);
  align-items: end;
  gap: 26px;
  margin-top: 34px;
  padding-top: 26px;
  border-top: 1px solid rgba(87, 69, 55, 0.1);
}

.todo-detail-progress > div:not(.todo-detail-progress-track) {
  display: grid;
  gap: 2px;
}

.todo-detail-progress strong {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  font-weight: 500;
}

.todo-detail-progress span {
  color: var(--muted);
  font-size: 0.74rem;
}

.todo-detail-progress-track {
  margin-bottom: 5px;
}

.todo-item-compose {
  display: grid;
  grid-template-columns: minmax(210px, 0.55fr) minmax(0, 1.45fr);
  gap: 32px;
  margin-bottom: 30px;
  padding: 28px 32px;
  border: 1px solid rgba(87, 69, 55, 0.11);
  border-radius: 25px 25px 25px 7px;
  background: rgba(255, 253, 248, 0.9);
}

.todo-item-compose h2 {
  margin: 0 0 8px;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 1.45rem;
  font-weight: 500;
}

.todo-item-compose p {
  margin: 0;
  color: var(--muted);
  font-size: 0.87rem;
  line-height: 1.7;
}

.todo-item-compose form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px auto;
  align-items: end;
  gap: 13px;
}

.todo-item-compose form > div {
  display: grid;
  gap: 7px;
}

.todo-item-compose label {
  color: #55483f;
  font-size: 0.78rem;
  font-weight: 800;
}

.todo-item-compose input {
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid rgba(87, 69, 55, 0.16);
  border-radius: 13px;
  outline: none;
  background: #fffdf8;
  color: var(--ink);
  font: inherit;
}

.todo-item-compose button {
  min-height: 44px;
  padding: 10px 17px;
  border: 1px solid rgba(47, 38, 34, 0.36);
  border-radius: 999px;
  background: var(--button-primary-bg);
  color: var(--button-primary-text);
  font: inherit;
  font-size: 0.83rem;
  font-weight: 800;
  cursor: pointer;
}

.todo-item-list {
  display: grid;
  gap: 13px;
}

.todo-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 17px;
  padding: 19px 22px;
  border: 1px solid rgba(87, 69, 55, 0.11);
  border-radius: 18px 18px 18px 6px;
  background: rgba(255, 253, 248, 0.91);
  box-shadow: 0 10px 28px rgba(77, 57, 43, 0.055);
}

.todo-item.done {
  background: rgba(239, 242, 234, 0.72);
  opacity: 0.82;
}

.todo-item-state form,
.todo-item-delete {
  margin: 0;
}

.todo-item-state button,
.todo-item-state > span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(104, 139, 113, 0.42);
  border-radius: 10px;
  background: #fffdf8;
  color: var(--green);
  font: inherit;
  font-weight: 900;
}

.todo-item-state button {
  cursor: pointer;
}

.todo-item.done .todo-item-state button,
.todo-item.done .todo-item-state > span {
  background: rgba(104, 139, 113, 0.14);
}

.todo-item-copy p {
  margin: 0 0 7px;
  color: var(--ink);
  line-height: 1.6;
}

.todo-item.done .todo-item-copy p {
  color: var(--muted);
  text-decoration: line-through;
}

.todo-item-copy > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--faint);
  font-size: 0.72rem;
}

.todo-item-delete button,
.todo-detail-footer button {
  min-height: 32px;
  border: 1px solid rgba(126, 93, 72, 0.14);
  border-radius: 999px;
  background: rgba(255, 248, 239, 0.72);
  color: #755f54;
  padding: 6px 10px;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
}

.todo-item-delete button,
.todo-detail-footer .danger-action {
  border-color: var(--button-danger-border);
  background: var(--button-danger-bg);
  color: var(--button-danger-text);
}

.todo-detail-empty {
  margin: 44px auto;
}

.todo-detail-empty > div {
  color: rgba(104, 139, 113, 0.45);
  font-size: 2.5rem;
}

.todo-detail-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 38px;
  padding: 22px 4px;
  border-top: 1px solid rgba(87, 69, 55, 0.1);
  color: var(--faint);
  font-size: 0.76rem;
}

.todo-detail-footer form {
  margin: 0;
}

.todo-detail-footer .button-link,
.todo-detail-footer button {
  min-height: 36px;
}

.todo-detail-footer form {
  margin: 0;
}

@media (max-width: 980px) {
  .todo-list-card,
  .todo-list-card:nth-child(5n + 1),
  .todo-list-card:nth-child(5n + 4) {
    grid-column: span 6;
  }

  .todo-item-compose {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .todo-gallery-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .todo-gallery-heading .primary-action {
    width: 100%;
  }

  .todo-card-grid {
    grid-template-columns: 1fr;
  }

  .todo-list-card,
  .todo-list-card:nth-child(5n + 1),
  .todo-list-card:nth-child(5n + 4) {
    grid-column: 1;
  }

  .todo-create-form {
    grid-template-columns: 1fr;
  }

  .todo-create-form .form-field-wide {
    grid-column: 1;
  }

  .todo-detail-hero {
    padding: 28px 24px 31px;
  }

  .todo-detail-main {
    grid-template-columns: 1fr;
  }

  .todo-detail-progress {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .todo-detail-progress-track {
    grid-column: 1 / -1;
  }

  .todo-item-compose {
    padding: 25px 22px;
  }

  .todo-item-compose form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .todo-gallery-heading {
    margin-top: 24px;
  }

  .todo-list-card {
    min-height: 360px;
    padding: 24px 21px 21px;
  }

  .todo-card-topline {
    align-items: flex-start;
  }

  .todo-item {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    padding: 17px 16px;
  }

  .todo-item-delete {
    grid-column: 2;
    justify-self: end;
  }

  .todo-detail-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .todo-list-card {
    transition: none;
  }
}

/* V1 anniversaries */
.anniversary-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin: 44px 0 32px;
}

.anniversary-heading > div > span,
.anniversary-detail-story > span {
  color: #a16872;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.anniversary-heading h1 {
  margin: 8px 0 10px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: clamp(2.6rem, 6vw, 5.4rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.anniversary-heading p {
  max-width: 650px;
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.anniversary-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 22px;
}

.anniversary-card {
  position: relative;
  display: flex;
  grid-column: span 4;
  min-height: 440px;
  overflow: hidden;
  flex-direction: column;
  padding: 26px;
  border: 1px solid rgba(87, 69, 55, 0.11);
  border-radius: 30px 30px 30px 8px;
  background:
    radial-gradient(circle at 86% 12%, rgba(184, 119, 132, 0.15), transparent 28%),
    linear-gradient(145deg, rgba(255, 253, 248, 0.98), rgba(246, 232, 220, 0.84));
  box-shadow: 0 18px 46px rgba(77, 57, 43, 0.075);
  color: inherit;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.anniversary-card:nth-child(6n + 1),
.anniversary-card:nth-child(6n + 5) {
  grid-column: span 6;
}

.anniversary-card.couple {
  background:
    radial-gradient(circle at 86% 12%, rgba(203, 113, 132, 0.22), transparent 30%),
    linear-gradient(145deg, rgba(255, 253, 248, 0.98), rgba(249, 226, 231, 0.9));
}

.anniversary-card.dorm {
  background:
    radial-gradient(circle at 86% 12%, rgba(100, 148, 111, 0.18), transparent 30%),
    linear-gradient(145deg, rgba(255, 253, 248, 0.98), rgba(225, 239, 226, 0.9));
}

.anniversary-card.selected {
  background:
    radial-gradient(circle at 86% 12%, rgba(190, 151, 71, 0.2), transparent 30%),
    linear-gradient(145deg, rgba(255, 253, 248, 0.98), rgba(246, 237, 206, 0.88));
}

.anniversary-card.public {
  background:
    radial-gradient(circle at 86% 12%, rgba(98, 132, 163, 0.18), transparent 30%),
    linear-gradient(145deg, rgba(255, 253, 248, 0.98), rgba(226, 237, 244, 0.9));
}

.anniversary-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 25px 58px rgba(77, 57, 43, 0.12);
}

.anniversary-card::after {
  position: absolute;
  right: -36px;
  bottom: -56px;
  width: 150px;
  height: 150px;
  border: 1px solid rgba(133, 88, 78, 0.11);
  border-radius: 50%;
  content: "";
}

.anniversary-card-topline,
.anniversary-detail-labels,
.anniversary-detail-footer,
.anniversary-detail-actions {
  display: flex;
  align-items: center;
}

.anniversary-card-topline {
  justify-content: space-between;
  gap: 14px;
}

.anniversary-type-mark {
  color: #a16872;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.7rem;
}

.anniversary-space-badge {
  padding: 7px 11px;
  border: 1px solid rgba(126, 93, 72, 0.13);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.68);
  color: #765f51;
  font-size: 0.7rem;
  font-weight: 800;
}

.anniversary-date-block {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 40px 0 32px;
}

.anniversary-date-block time {
  display: grid;
  color: #6e5144;
}

.anniversary-date-block time strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 4.6rem;
  font-weight: 500;
  letter-spacing: -0.07em;
  line-height: 0.78;
}

.anniversary-date-block time span {
  margin-top: 13px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
}

.anniversary-countdown {
  padding: 9px 13px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
}

.anniversary-countdown.upcoming {
  background: rgba(177, 105, 119, 0.12);
  color: #985a68;
}

.anniversary-countdown.today {
  background: #a76573;
  color: #fffaf6;
}

.anniversary-countdown.past {
  background: rgba(105, 88, 75, 0.09);
  color: #76675d;
}

.anniversary-card-copy {
  position: relative;
  z-index: 1;
  margin-top: auto;
}

.anniversary-card-copy > span {
  color: #9a6b66;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.anniversary-card-copy h2 {
  margin: 9px 0 12px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 1.8rem;
  font-weight: 500;
  line-height: 1.25;
}

.anniversary-card-copy p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 0.87rem;
  line-height: 1.75;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.anniversary-card footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(87, 69, 55, 0.09);
  color: var(--faint);
  font-size: 0.7rem;
}

.anniversary-empty {
  display: grid;
  max-width: 760px;
  margin: 44px auto;
  place-items: center;
  padding: 36px 30px;
  border: 1px solid rgba(87, 69, 55, 0.11);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(255, 253, 248, 0.95), rgba(249, 230, 232, 0.72));
  text-align: center;
}

.anniversary-empty > div {
  position: relative;
  width: 78px;
  height: 58px;
}

.anniversary-empty > div span:first-child {
  position: absolute;
  top: 10px;
  left: 27px;
  z-index: 1;
  color: rgba(177, 105, 119, 0.64);
  font-size: 1.8rem;
}

.anniversary-empty > div span:not(:first-child) {
  position: absolute;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(177, 105, 119, 0.2);
  border-radius: 50%;
}

.anniversary-empty > div span:nth-child(2) {
  top: 2px;
  left: 10px;
}

.anniversary-empty > div span:nth-child(3) {
  top: 20px;
  right: 4px;
}

.anniversary-empty h2 {
  margin: 12px 0 10px;
  font-size: 1.55rem;
  font-weight: 800;
}

.anniversary-empty p {
  max-width: 520px;
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.8;
}

.anniversary-form-shell {
  max-width: 940px;
}

.anniversary-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 22px;
}

.anniversary-form > div:not(.form-actions) {
  display: grid;
  align-content: start;
  gap: 8px;
}

.anniversary-form .form-field-wide {
  grid-column: 1 / -1;
}

.anniversary-form-note {
  padding: 15px 17px;
  border: 1px solid rgba(167, 101, 115, 0.14);
  border-radius: 15px;
  background: rgba(249, 230, 232, 0.38);
}

.anniversary-form-note strong {
  color: #72534f;
  font-size: 0.78rem;
}

.anniversary-form-note p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.6;
}

.anniversary-detail {
  margin: 40px 0;
}

.anniversary-detail-header {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 30px;
  overflow: hidden;
  margin-top: 26px;
  padding: 48px;
  border: 1px solid rgba(87, 69, 55, 0.11);
  border-radius: 38px 38px 38px 10px;
  background: linear-gradient(135deg, rgba(255, 253, 248, 0.98), rgba(245, 229, 216, 0.88));
  box-shadow: 0 24px 64px rgba(77, 57, 43, 0.1);
}

.anniversary-detail.couple .anniversary-detail-header {
  background: linear-gradient(135deg, rgba(255, 253, 248, 0.98), rgba(249, 224, 230, 0.92));
}

.anniversary-detail.dorm .anniversary-detail-header {
  background: linear-gradient(135deg, rgba(255, 253, 248, 0.98), rgba(222, 238, 224, 0.92));
}

.anniversary-detail.selected .anniversary-detail-header {
  background: linear-gradient(135deg, rgba(255, 253, 248, 0.98), rgba(246, 236, 203, 0.92));
}

.anniversary-detail.public .anniversary-detail-header {
  background: linear-gradient(135deg, rgba(255, 253, 248, 0.98), rgba(224, 237, 245, 0.92));
}

.anniversary-detail-symbol {
  display: grid;
  width: 92px;
  height: 92px;
  place-items: center;
  border: 1px solid rgba(145, 89, 101, 0.17);
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.68);
  color: #a76573;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.5rem;
}

.anniversary-detail-labels {
  flex-wrap: wrap;
  gap: 10px;
  color: #90635e;
  font-size: 0.76rem;
  font-weight: 800;
}

.anniversary-detail-intro h1 {
  margin: 12px 0 11px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: clamp(2.5rem, 6vw, 5.3rem);
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 1.02;
}

.anniversary-detail-intro time {
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  letter-spacing: 0.08em;
}

.anniversary-detail-countdown {
  display: grid;
  min-width: 150px;
  place-items: center;
  padding: 24px 20px;
  border: 1px solid rgba(126, 93, 72, 0.12);
  border-radius: 26px 26px 26px 7px;
  background: rgba(255, 253, 248, 0.72);
  text-align: center;
}

.anniversary-detail-countdown strong {
  color: #9f6170;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 3.2rem;
  font-weight: 500;
  line-height: 1;
}

.anniversary-detail-countdown span {
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.74rem;
}

.anniversary-detail-countdown.past strong {
  color: #796b61;
}

.anniversary-detail-countdown.today {
  background: #a76573;
}

.anniversary-detail-countdown.today strong,
.anniversary-detail-countdown.today span {
  color: #fffaf6;
}

.anniversary-detail-story {
  max-width: 850px;
  margin: 50px auto;
  padding: 0 28px;
}

.anniversary-detail-story p {
  margin: 18px 0 0;
  color: #51443c;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: clamp(1.18rem, 2.2vw, 1.55rem);
  line-height: 2;
  white-space: pre-wrap;
}

.anniversary-detail-story .anniversary-detail-placeholder {
  color: var(--muted);
  font-style: italic;
}

.anniversary-detail-footer {
  justify-content: space-between;
  gap: 24px;
  padding: 24px 4px;
  border-top: 1px solid rgba(87, 69, 55, 0.1);
}

.anniversary-detail-footer > div:first-child {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  color: var(--faint);
  font-size: 0.75rem;
}

.anniversary-detail-actions {
  gap: 11px;
}

.anniversary-detail-actions form {
  margin: 0;
}

.anniversary-detail-actions button {
  padding: 10px 16px;
  border: 1px solid var(--button-subtle-border);
  border-radius: 999px;
  background: var(--button-subtle-bg);
  color: var(--button-subtle-text);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.anniversary-detail-actions .danger-action {
  border-color: var(--button-danger-border);
  background: var(--button-danger-bg);
  color: var(--button-danger-text);
}

@media (max-width: 980px) {
  .anniversary-card,
  .anniversary-card:nth-child(6n + 1),
  .anniversary-card:nth-child(6n + 5) {
    grid-column: span 6;
  }

  .anniversary-detail-header {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .anniversary-detail-countdown {
    grid-column: 1 / -1;
    grid-template-columns: auto auto;
    justify-content: center;
    gap: 10px;
  }

  .anniversary-detail-countdown span {
    margin-top: 0;
  }
}

@media (max-width: 700px) {
  .anniversary-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .anniversary-heading .primary-action {
    width: 100%;
  }

  .anniversary-grid {
    grid-template-columns: 1fr;
  }

  .anniversary-card,
  .anniversary-card:nth-child(6n + 1),
  .anniversary-card:nth-child(6n + 5) {
    grid-column: 1;
  }

  .anniversary-form {
    grid-template-columns: 1fr;
  }

  .anniversary-form .form-field-wide {
    grid-column: 1;
  }

  .anniversary-detail-header {
    grid-template-columns: 1fr;
    padding: 34px 26px;
  }

  .anniversary-detail-symbol {
    width: 72px;
    height: 72px;
  }

  .anniversary-detail-countdown {
    grid-column: 1;
  }

  .anniversary-detail-story {
    padding: 0 8px;
  }

  .anniversary-detail-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .anniversary-heading {
    margin-top: 24px;
  }

  .anniversary-card {
    min-height: 400px;
    padding: 23px 20px;
  }

  .anniversary-date-block time strong {
    font-size: 4rem;
  }

  .anniversary-detail-actions {
    align-items: stretch;
    width: 100%;
    flex-direction: column;
  }

  .anniversary-detail-actions .button-link,
  .anniversary-detail-actions button {
    width: 100%;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .anniversary-card {
    transition: none;
  }
}

/* V1 owner user management */
.admin-users-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin: 42px 0 30px;
}

.admin-users-heading > div > span {
  color: #9b6c57;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.admin-users-heading h1 {
  margin: 8px 0 10px;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: clamp(2.6rem, 6vw, 5.1rem);
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 1;
}

.admin-users-heading p {
  max-width: 650px;
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.admin-user-list {
  display: grid;
  gap: 16px;
}

.admin-user-card {
  display: grid;
  grid-template-columns: minmax(210px, 0.8fr) minmax(360px, 1.4fr) auto;
  align-items: center;
  gap: 28px;
  padding: 24px 26px;
  border: 1px solid rgba(87, 69, 55, 0.11);
  border-radius: 25px 25px 25px 7px;
  background: rgba(255, 253, 248, 0.9);
  box-shadow: 0 12px 34px rgba(77, 57, 43, 0.06);
}

.admin-user-card.disabled {
  background: rgba(239, 235, 230, 0.78);
  opacity: 0.8;
}

.admin-user-identity {
  display: flex;
  align-items: center;
  gap: 15px;
  min-width: 0;
}

.admin-user-avatar {
  display: grid;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(126, 93, 72, 0.15);
  border-radius: 17px 17px 17px 5px;
  background: linear-gradient(145deg, #fff9f2, #ecdccf);
  font-size: 1.35rem;
}

.admin-user-identity h2 {
  overflow: hidden;
  margin: 0 0 5px;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 1.3rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-identity p {
  overflow: hidden;
  margin: 0;
  color: var(--faint);
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
}

.admin-user-meta > div {
  min-width: 0;
}

.admin-user-meta dt {
  margin-bottom: 7px;
  color: var(--faint);
  font-size: 0.68rem;
}

.admin-user-meta dd {
  margin: 0;
  color: #564941;
  font-size: 0.8rem;
}

.admin-role-badge,
.admin-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
}

.admin-role-badge.owner,
.admin-role-badge.co_owner {
  background: rgba(189, 111, 125, 0.12);
  color: #985c68;
}

.admin-role-badge.roommate {
  background: rgba(104, 139, 113, 0.13);
  color: #587661;
}

.admin-role-badge.friend {
  background: rgba(181, 131, 76, 0.14);
  color: #916a3e;
}

.admin-role-badge.visitor {
  background: rgba(102, 127, 154, 0.13);
  color: #58718b;
}

.admin-status-badge.active {
  background: rgba(104, 139, 113, 0.13);
  color: #587661;
}

.admin-status-badge.disabled {
  background: rgba(155, 112, 101, 0.13);
  color: #91665c;
}

.admin-user-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-user-actions form {
  margin: 0;
}

.admin-user-actions .button-link,
.admin-user-actions button {
  min-height: 34px;
  padding: 8px 12px;
  font-size: 0.75rem;
}

.admin-user-actions .danger-action {
  border-color: rgba(155, 90, 77, 0.22);
  color: #9b5f55;
}

.admin-user-owner-note {
  display: grid;
  justify-items: end;
  gap: 5px;
  color: var(--faint);
  font-size: 0.7rem;
  text-align: right;
}

.admin-user-owner-note strong {
  color: #8b5e51;
  font-size: 0.76rem;
}

.admin-form-shell {
  max-width: 900px;
}

.admin-user-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 22px;
}

.admin-user-form > div:not(.form-actions),
.admin-compact-form > div:not(.form-actions) {
  display: grid;
  align-content: start;
  gap: 8px;
}

.admin-user-form .form-field-wide {
  grid-column: 1 / -1;
}

.admin-compact-form {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 18px;
}

@media (max-width: 980px) {
  .admin-user-card {
    grid-template-columns: minmax(210px, 0.8fr) minmax(0, 1.2fr);
  }

  .admin-user-actions,
  .admin-user-owner-note {
    grid-column: 1 / -1;
    justify-content: flex-start;
    justify-items: start;
    text-align: left;
  }
}

@media (max-width: 700px) {
  .admin-users-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-users-heading .primary-action {
    width: 100%;
  }

  .admin-user-card {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 22px 20px;
  }

  .admin-user-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-user-actions,
  .admin-user-owner-note {
    grid-column: 1;
  }

  .admin-user-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-user-actions .button-link,
  .admin-user-actions button,
  .admin-user-actions form {
    width: 100%;
  }

  .admin-user-form,
  .admin-compact-form {
    grid-template-columns: 1fr;
  }

  .admin-user-form .form-field-wide {
    grid-column: 1;
  }
}

@media (max-width: 480px) {
  .admin-user-meta {
    grid-template-columns: 1fr;
  }
}

/* V1 AI assistant */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.ai-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin: 28px 0 26px;
}

.ai-heading > div > span {
  color: #9b6c57;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.ai-heading h1 {
  margin: 8px 0 10px;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: clamp(2.8rem, 7vw, 5.4rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.96;
}

.ai-heading p {
  max-width: 650px;
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.ai-workspace {
  display: grid;
  min-height: 680px;
  grid-template-columns: minmax(220px, 0.28fr) minmax(0, 0.72fr);
  overflow: hidden;
  border: 1px solid rgba(101, 78, 63, 0.14);
  border-radius: 30px 30px 30px 8px;
  background: rgba(255, 252, 248, 0.86);
  box-shadow: 0 30px 85px rgba(77, 54, 40, 0.12);
}

.ai-history {
  min-width: 0;
  border-right: 1px solid rgba(101, 78, 63, 0.12);
  background:
    radial-gradient(circle at 20% 8%, rgba(213, 178, 154, 0.22), transparent 30%),
    rgba(246, 238, 230, 0.72);
  padding: 26px 18px;
}

.ai-history-heading {
  padding: 0 8px 18px;
}

.ai-history-heading span {
  color: #a1705d;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.ai-history-heading h2 {
  margin: 7px 0 0;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 1.45rem;
  font-weight: 500;
}

.ai-conversation-list {
  display: grid;
  gap: 8px;
  max-height: 570px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.ai-conversation-list a {
  display: grid;
  min-width: 0;
  gap: 5px;
  border: 1px solid transparent;
  border-radius: 17px 17px 17px 5px;
  padding: 13px 14px;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease;
}

.ai-conversation-list a:hover,
.ai-conversation-list a.active {
  border-color: rgba(157, 104, 83, 0.16);
  background: rgba(255, 253, 250, 0.82);
}

.ai-conversation-list a > span {
  color: #a06a58;
  font-size: 0.65rem;
  font-weight: 800;
}

.ai-conversation-list strong {
  overflow: hidden;
  font-size: 0.82rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-conversation-list small {
  color: var(--faint);
  font-size: 0.65rem;
}

.ai-history-empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 48px 14px;
  color: var(--faint);
  text-align: center;
}

.ai-history-empty > span {
  font-size: 1.6rem;
}

.ai-history-empty p {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.7;
}

.ai-chat-panel {
  display: grid;
  min-width: 0;
  grid-template-rows: auto auto minmax(380px, 1fr) auto auto;
  background:
    radial-gradient(circle at 92% 0%, rgba(203, 221, 218, 0.28), transparent 28%),
    rgba(255, 253, 250, 0.72);
}

.ai-chat-header {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid rgba(101, 78, 63, 0.1);
  padding: 19px 24px;
}

.ai-chat-header > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.ai-chat-header strong,
.ai-chat-header small {
  display: block;
}

.ai-chat-header strong {
  margin-bottom: 3px;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 1.1rem;
  font-weight: 600;
}

.ai-chat-header small {
  color: var(--faint);
  font-size: 0.7rem;
}

.ai-status-dot {
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
  border: 3px solid rgba(104, 139, 113, 0.18);
  border-radius: 50%;
  background: #76927c;
  box-shadow: 0 0 0 4px rgba(104, 139, 113, 0.08);
}

.ai-clear-button {
  min-height: 32px;
  padding: 7px 11px;
  color: #956258;
  font-size: 0.7rem;
}

.ai-attachment-panel {
  min-width: 0;
  border-bottom: 1px solid rgba(101, 78, 63, 0.1);
  padding: 18px 24px;
}

.ai-attachment-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.56fr);
  gap: 14px;
  align-items: start;
}

.ai-attachment-intro strong {
  display: block;
  margin-bottom: 4px;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 1rem;
}

.ai-attachment-intro p,
.ai-attachment-intro small,
.ai-attachment-empty {
  margin: 0;
  color: var(--faint);
  font-size: 0.72rem;
  line-height: 1.7;
}

.ai-attachment-upload {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.ai-attachment-upload label {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.ai-attachment-upload input[type="file"] {
  width: 100%;
  min-width: 0;
  border: 1px dashed rgba(104, 78, 63, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.62);
  padding: 9px;
  color: var(--muted);
  font-size: 0.74rem;
}

.ai-attachment-upload button,
.ai-attachment-actions button {
  min-height: 34px;
  padding: 8px 12px;
  font-size: 0.72rem;
}

.ai-attachment-list {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.ai-attachment-item {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(105, 79, 63, 0.11);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.68);
  padding: 10px 12px;
}

.ai-attachment-item > div:first-child {
  min-width: 0;
}

.ai-attachment-item strong,
.ai-attachment-item small {
  display: block;
}

.ai-attachment-item strong {
  margin: 4px 0 2px;
  overflow-wrap: anywhere;
  font-size: 0.82rem;
}

.ai-attachment-item small {
  color: var(--faint);
  font-size: 0.68rem;
}

.ai-file-chip {
  display: inline-flex;
  border-radius: 999px;
  background: rgba(123, 148, 132, 0.12);
  padding: 4px 8px;
  color: #637d6d;
  font-size: 0.64rem;
  font-weight: 800;
}

.ai-attachment-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.ai-attachment-actions form {
  margin: 0;
}

.ai-attachment-actions button {
  color: #956258;
}

.ai-attachment-empty {
  margin-top: 12px;
}

.ai-messages {
  min-width: 0;
  max-height: 520px;
  overflow-y: auto;
  padding: 30px clamp(20px, 4vw, 46px);
  scrollbar-width: thin;
}

.ai-message {
  display: flex;
  max-width: 82%;
  align-items: flex-start;
  gap: 11px;
  margin-bottom: 22px;
}

.ai-message.user {
  flex-direction: row-reverse;
  margin-left: auto;
}

.ai-message-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(112, 82, 65, 0.13);
  border-radius: 12px 12px 12px 4px;
  background: linear-gradient(145deg, #fff8ef, #e9d6c7);
  color: #7e5546;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.78rem;
  font-weight: 800;
}

.ai-message.user .ai-message-avatar {
  border-radius: 12px 12px 4px 12px;
  background: linear-gradient(145deg, #e5efeb, #c7d8d0);
  color: #567264;
}

.ai-message > div {
  min-width: 0;
}

.ai-message > div > small {
  display: block;
  margin: 0 4px 6px;
  color: var(--faint);
  font-size: 0.66rem;
}

.ai-message.user > div > small,
.ai-message.user time {
  text-align: right;
}

.ai-message p {
  margin: 0;
  border: 1px solid rgba(106, 81, 65, 0.1);
  border-radius: 6px 18px 18px 18px;
  background: rgba(255, 255, 255, 0.88);
  padding: 13px 16px;
  color: #4c423d;
  font-size: 0.9rem;
  line-height: 1.75;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.ai-message.user p {
  border-radius: 18px 6px 18px 18px;
  background: rgba(224, 235, 229, 0.78);
}

.ai-message time {
  display: block;
  margin: 6px 4px 0;
  color: var(--faint);
  font-size: 0.62rem;
}

.ai-empty-state {
  display: grid;
  min-height: 350px;
  align-content: center;
  justify-items: center;
  padding: 32px 20px;
  text-align: center;
}

.ai-empty-state > div:first-child {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 1px solid rgba(171, 115, 87, 0.17);
  border-radius: 20px 20px 20px 6px;
  background: linear-gradient(145deg, #fffaf3, #ead9cd);
  color: #9a6856;
  font-size: 1.5rem;
  box-shadow: 0 18px 40px rgba(88, 56, 40, 0.09);
}

.ai-empty-state h2 {
  margin: 18px 0 9px;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 500;
}

.ai-empty-state > p {
  max-width: 470px;
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.ai-prompt-ideas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

.ai-prompt-ideas span {
  border: 1px solid rgba(108, 82, 67, 0.11);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.56);
  padding: 8px 11px;
  color: var(--faint);
  font-size: 0.68rem;
}

.ai-composer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin: 0 24px 22px;
  border: 1px solid rgba(105, 79, 63, 0.14);
  border-radius: 22px 22px 22px 7px;
  background: rgba(255, 255, 255, 0.86);
  padding: 13px;
  box-shadow: 0 14px 34px rgba(72, 52, 40, 0.07);
}

.ai-provider-field,
.ai-input-field {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.ai-provider-field label {
  color: var(--faint);
  font-size: 0.64rem;
  font-weight: 750;
}

.ai-provider-field select {
  min-width: 112px;
  border: 0;
  border-radius: 12px;
  outline: 0;
  background: #f4ece5;
  padding: 10px;
  color: #67564c;
  font: inherit;
  font-size: 0.76rem;
}

.ai-input-field textarea {
  width: 100%;
  min-height: 48px;
  max-height: 160px;
  resize: vertical;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
  line-height: 1.55;
}

.ai-input-field textarea::placeholder {
  color: #aaa09a;
}

.ai-input-field > small {
  color: var(--faint);
  font-size: 0.6rem;
  text-align: right;
}

.ai-send-button {
  min-width: 82px;
  border-color: #302723;
  background: #302723;
  color: #fffaf5;
}

.ai-send-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.ai-send-button span:last-child {
  margin-left: 6px;
}

.ai-loading {
  margin: -10px 28px 18px;
  color: var(--faint);
  font-size: 0.68rem;
  text-align: right;
}

@media (max-width: 820px) {
  .ai-workspace {
    grid-template-columns: 1fr;
  }

  .ai-history {
    border-right: 0;
    border-bottom: 1px solid rgba(101, 78, 63, 0.12);
    padding: 18px;
  }

  .ai-history-heading {
    padding-bottom: 10px;
  }

  .ai-conversation-list {
    display: flex;
    max-height: none;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .ai-conversation-list a {
    width: 190px;
    flex: 0 0 auto;
  }

  .ai-history-empty {
    padding: 18px 12px;
  }
}

@media (max-width: 620px) {
  .ai-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .ai-new-conversation {
    width: 100%;
  }

  .ai-workspace {
    min-height: 0;
    border-radius: 24px 24px 24px 7px;
  }

  .ai-chat-header {
    align-items: flex-start;
    padding: 16px;
  }

  .ai-attachment-panel {
    padding: 16px;
  }

  .ai-attachment-intro,
  .ai-attachment-upload {
    grid-template-columns: 1fr;
  }

  .ai-attachment-item {
    align-items: stretch;
    flex-direction: column;
  }

  .ai-attachment-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .ai-messages {
    max-height: 460px;
    padding: 24px 16px;
  }

  .ai-message {
    max-width: 94%;
  }

  .ai-composer {
    grid-template-columns: 1fr auto;
    margin: 0 12px 14px;
  }

  .ai-provider-field {
    grid-column: 1 / -1;
  }

  .ai-provider-field select {
    width: 100%;
  }

  .ai-loading {
    margin-right: 16px;
  }
}

@media (max-width: 390px) {
  .ai-chat-header {
    flex-direction: column;
  }

  .ai-clear-button {
    width: 100%;
  }

  .ai-chat-header form {
    width: 100%;
  }

  .ai-attachment-actions,
  .ai-attachment-actions .button-link,
  .ai-attachment-actions form,
  .ai-attachment-actions button,
  .ai-attachment-upload button {
    width: 100%;
  }

  .ai-composer {
    grid-template-columns: 1fr;
  }

  .ai-send-button {
    width: 100%;
  }
}

/* V1 one-to-one chat */
.chat-heading,
.chat-detail-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin: 28px 0 26px;
}

.chat-heading > div > span,
.chat-detail-heading > div > span,
.chat-start-panel > div > span,
.chat-section-title > span {
  color: #9b6c57;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.chat-heading h1,
.chat-detail-heading h1 {
  margin: 8px 0 10px;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: clamp(2.7rem, 7vw, 5.2rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.chat-heading p,
.chat-detail-heading p,
.chat-start-panel p,
.chat-empty p,
.chat-room-empty p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.chat-heading form {
  flex: 0 0 auto;
  margin: 0;
}

.chat-start-panel {
  display: grid;
  grid-template-columns: minmax(240px, 0.34fr) minmax(0, 0.66fr);
  gap: 22px;
  margin-bottom: 34px;
  border: 1px solid rgba(101, 78, 63, 0.13);
  border-radius: 28px 28px 28px 8px;
  background:
    radial-gradient(circle at 12% 10%, rgba(213, 178, 154, 0.22), transparent 35%),
    rgba(255, 252, 248, 0.86);
  padding: 24px;
  box-shadow: 0 24px 64px rgba(77, 54, 40, 0.09);
}

.chat-start-panel h2,
.chat-section-title h2,
.chat-empty h2,
.chat-room-empty h2 {
  margin: 8px 0 10px;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  font-weight: 500;
  letter-spacing: -0.035em;
}

.chat-participant-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.chat-participant-card,
.chat-conversation-card {
  border: 1px solid rgba(101, 78, 63, 0.12);
  background: rgba(255, 253, 249, 0.9);
  box-shadow: 0 14px 38px rgba(77, 54, 40, 0.07);
}

.chat-participant-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 20px 20px 20px 6px;
  padding: 14px;
}

.chat-participant-card > div,
.chat-conversation-card header,
.chat-room-header > div,
.chat-bubble {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.chat-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(112, 82, 65, 0.13);
  border-radius: 15px 15px 15px 5px;
  background: linear-gradient(145deg, #fff8ef, #e9d6c7);
  color: #7e5546;
  font-size: 1rem;
  font-weight: 800;
}

.chat-participant-card strong,
.chat-conversation-card strong {
  display: block;
  overflow: hidden;
  color: #3c312d;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-participant-card small,
.chat-conversation-card small {
  display: block;
  margin-top: 4px;
  color: var(--faint);
  font-size: 0.68rem;
}

.chat-participant-card form {
  flex: 0 0 auto;
  margin: 0;
}

.chat-participant-card button {
  min-height: 34px;
  padding: 8px 12px;
  font-size: 0.72rem;
}

.chat-muted {
  align-self: center;
}

.chat-section-title {
  margin: 10px 0 16px;
}

.chat-conversation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.chat-conversation-shell {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.chat-conversation-card {
  position: relative;
  display: grid;
  min-height: 220px;
  align-content: space-between;
  overflow: hidden;
  border-radius: 26px 26px 26px 8px;
  padding: 20px;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.chat-conversation-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 68px rgba(77, 54, 40, 0.12);
}

.chat-conversation-card::after {
  position: absolute;
  inset: auto -22% -32% 22%;
  height: 140px;
  border-radius: 999px;
  content: "";
  opacity: 0.18;
}

.chat-conversation-card.couple::after {
  background: var(--rose);
}

.chat-conversation-card.roommate::after {
  background: var(--green);
}

.chat-conversation-card.friend::after {
  background: var(--gold);
}

.chat-conversation-card p {
  display: -webkit-box;
  overflow: hidden;
  margin: 22px 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.75;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow-wrap: anywhere;
}

.chat-conversation-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--faint);
  font-size: 0.7rem;
}

.chat-empty,
.chat-room-empty {
  display: grid;
  justify-items: center;
  border: 1px solid rgba(101, 78, 63, 0.12);
  border-radius: 28px 28px 28px 8px;
  background: rgba(255, 252, 248, 0.86);
  padding: clamp(34px, 8vw, 72px);
  text-align: center;
  box-shadow: 0 22px 58px rgba(77, 54, 40, 0.08);
}

.chat-empty > div,
.chat-room-empty > div:first-child {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 1px solid rgba(171, 115, 87, 0.17);
  border-radius: 20px 20px 20px 6px;
  background: linear-gradient(145deg, #fffaf3, #ead9cd);
  color: #9a6856;
  font-size: 1.5rem;
}

.chat-detail-heading {
  align-items: flex-start;
  justify-content: space-between;
}

.chat-detail-heading .button-link {
  flex: 0 0 auto;
  margin-top: 12px;
}

.chat-delete-link {
  justify-self: end;
  color: #9a6b62;
  font-size: 0.72rem;
  font-weight: 750;
  text-decoration: none;
}

.chat-delete-link:hover {
  color: #6f3933;
  text-decoration: underline;
}

.chat-delete-link.detail {
  flex: 0 0 auto;
  margin-top: 14px;
}

.chat-room {
  overflow: hidden;
  border: 1px solid rgba(101, 78, 63, 0.14);
  border-radius: 30px 30px 30px 8px;
  background:
    radial-gradient(circle at 92% 0%, rgba(203, 221, 218, 0.22), transparent 28%),
    rgba(255, 253, 250, 0.9);
  box-shadow: 0 30px 85px rgba(77, 54, 40, 0.12);
}

.chat-room-header {
  border-bottom: 1px solid rgba(101, 78, 63, 0.1);
  padding: 20px 24px;
}

.chat-room-header strong,
.chat-room-header small {
  display: block;
}

.chat-room-header strong {
  margin-bottom: 3px;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 1.12rem;
  font-weight: 600;
}

.chat-room-header small {
  color: var(--faint);
  font-size: 0.72rem;
}

.chat-status-dot {
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
  border: 3px solid rgba(104, 139, 113, 0.18);
  border-radius: 50%;
  background: #76927c;
  box-shadow: 0 0 0 4px rgba(104, 139, 113, 0.08);
}

.chat-message-list {
  max-height: 560px;
  overflow-y: auto;
  padding: 30px clamp(18px, 4vw, 46px);
  scrollbar-width: thin;
}

.chat-bubble {
  max-width: 78%;
  align-items: flex-start;
  margin-bottom: 20px;
}

.chat-bubble.mine {
  flex-direction: row-reverse;
  margin-left: auto;
}

.chat-bubble.mine .chat-avatar {
  border-radius: 15px 15px 5px 15px;
  background: linear-gradient(145deg, #e5efeb, #c7d8d0);
  color: #567264;
}

.chat-bubble > div {
  min-width: 0;
}

.chat-bubble small {
  display: block;
  margin: 0 4px 6px;
  color: var(--faint);
  font-size: 0.66rem;
}

.chat-bubble.mine small {
  text-align: right;
}

.chat-bubble p {
  margin: 0;
  border: 1px solid rgba(106, 81, 65, 0.1);
  border-radius: 6px 18px 18px 18px;
  background: rgba(255, 255, 255, 0.88);
  padding: 13px 16px;
  color: #4c423d;
  font-size: 0.9rem;
  line-height: 1.75;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.chat-bubble.mine p {
  border-radius: 18px 6px 18px 18px;
  background: rgba(224, 235, 229, 0.78);
}

.chat-attachment-list {
  display: grid;
  gap: 9px;
  margin-top: 9px;
}

.chat-attachment-item {
  display: grid;
  min-width: 0;
  gap: 8px;
  border: 1px solid rgba(106, 81, 65, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
  padding: 10px;
}

.chat-bubble.mine .chat-attachment-item {
  background: rgba(224, 235, 229, 0.64);
}

.chat-attachment-item img,
.chat-attachment-item video {
  display: block;
  width: 100%;
  max-height: 260px;
  border-radius: 10px;
  object-fit: cover;
  background: rgba(70, 58, 50, 0.08);
}

.chat-attachment-info {
  min-width: 0;
}

.chat-attachment-info strong,
.chat-attachment-info small {
  display: block;
}

.chat-attachment-info strong {
  margin: 5px 0 2px;
  overflow-wrap: anywhere;
  color: #4c423d;
  font-size: 0.82rem;
}

.chat-attachment-info small {
  color: var(--faint);
  font-size: 0.66rem;
}

.chat-file-chip {
  display: inline-flex;
  border-radius: 999px;
  background: rgba(123, 148, 132, 0.12);
  padding: 4px 8px;
  color: #637d6d;
  font-size: 0.64rem;
  font-weight: 800;
}

.chat-attachment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.chat-attachment-actions form {
  margin: 0;
}

.chat-attachment-actions button {
  min-height: 32px;
  padding: 7px 11px;
  color: #956258;
  font-size: 0.7rem;
}

.chat-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.46fr) auto;
  align-items: end;
  gap: 12px;
  margin: 0 24px 22px;
  border: 1px solid rgba(105, 79, 63, 0.14);
  border-radius: 22px 22px 22px 7px;
  background: rgba(255, 255, 255, 0.86);
  padding: 13px;
  box-shadow: 0 14px 34px rgba(72, 52, 40, 0.07);
}

.chat-input-field,
.chat-attachment-field {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.chat-attachment-field label {
  color: var(--faint);
  font-size: 0.64rem;
  font-weight: 750;
}

.chat-attachment-field input[type="file"] {
  width: 100%;
  min-width: 0;
  border: 1px dashed rgba(104, 78, 63, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.62);
  padding: 9px;
  color: var(--muted);
  font-size: 0.72rem;
}

.chat-input-field textarea {
  width: 100%;
  min-height: 50px;
  max-height: 170px;
  resize: vertical;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.55;
}

.chat-input-field textarea::placeholder {
  color: #aaa09a;
}

.chat-input-field > small,
.chat-attachment-field > small {
  color: var(--faint);
  font-size: 0.6rem;
}

.chat-input-field > small {
  text-align: right;
}

.chat-send-button {
  min-width: 82px;
  border-color: #302723;
  background: #302723;
  color: #fffaf5;
}

.chat-delete-confirm {
  display: grid;
  min-height: 58vh;
  place-items: center;
  padding: 38px 0;
}

.chat-delete-card {
  width: min(620px, 100%);
  border: 1px solid rgba(111, 57, 51, 0.14);
  border-radius: 28px 28px 28px 8px;
  background:
    radial-gradient(circle at 90% 8%, rgba(181, 112, 96, 0.14), transparent 32%),
    rgba(255, 252, 248, 0.92);
  padding: clamp(24px, 5vw, 42px);
  box-shadow: 0 28px 78px rgba(77, 54, 40, 0.12);
}

.chat-delete-card > span {
  color: #9b6c57;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.chat-delete-card h1 {
  margin: 10px 0 12px;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: clamp(2.2rem, 7vw, 4rem);
  font-weight: 500;
  letter-spacing: -0.045em;
}

.chat-delete-card p {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.8;
}

.chat-delete-card dl {
  display: grid;
  gap: 10px;
  margin: 0 0 24px;
}

.chat-delete-card dl > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid rgba(101, 78, 63, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.68);
  padding: 12px 14px;
}

.chat-delete-card dt,
.chat-delete-card dd {
  margin: 0;
}

.chat-delete-card dt {
  color: var(--faint);
  font-size: 0.74rem;
}

.chat-delete-card dd {
  color: #3c312d;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.chat-delete-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.chat-delete-actions form {
  margin: 0;
}

.chat-delete-actions button {
  border-color: var(--button-danger-border);
  background: var(--button-danger-bg);
  color: var(--button-danger-text);
  font-weight: 800;
}

.chat-delete-actions button:hover {
  border-color: rgba(139, 46, 46, 0.46);
  background: #fff0ed;
  color: #732524;
}

@media (max-width: 980px) {
  .chat-start-panel,
  .chat-conversation-grid {
    grid-template-columns: 1fr;
  }

  .chat-participant-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .chat-heading,
  .chat-detail-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .chat-heading .primary-action,
  .chat-heading form,
  .chat-detail-heading .button-link,
  .chat-delete-link.detail {
    width: 100%;
  }

  .chat-start-panel {
    padding: 20px;
  }

  .chat-participant-grid {
    grid-template-columns: 1fr;
  }

  .chat-participant-card {
    align-items: stretch;
    flex-direction: column;
  }

  .chat-participant-card form,
  .chat-participant-card button {
    width: 100%;
  }

  .chat-room-header {
    padding: 16px;
  }

  .chat-message-list {
    max-height: 520px;
    padding: 24px 16px;
  }

  .chat-bubble {
    max-width: 94%;
  }

  .chat-composer {
    grid-template-columns: 1fr;
    margin: 0 12px 14px;
  }

  .chat-attachment-actions,
  .chat-attachment-actions .button-link,
  .chat-attachment-actions form,
  .chat-attachment-actions button {
    width: 100%;
  }

  .chat-send-button {
    width: 100%;
  }

  .chat-delete-actions,
  .chat-delete-actions .button-link,
  .chat-delete-actions form,
  .chat-delete-actions button {
    width: 100%;
  }
}
