:root {
  --bg-color: #fdfcf8;
  --panel-color: #fffefc;
  --accent-moss: #8b9d83;
  --accent-sage: #b4c9b4;
  --ink-color: #4a4442;
  --muted-ink: #7a726f;
  --border-soft: rgba(74, 68, 66, 0.08);
  --font-serif: 'Libre Baskerville', serif;
  --font-sans: 'Quicksand', sans-serif;
  --shadow-soft: 0 12px 30px -10px rgba(74, 68, 66, 0.1);
  --shadow-lift: 0 20px 40px -15px rgba(74, 68, 66, 0.15);
  --transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--accent-moss) transparent;
}
*::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
*::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 10px;
}
*::-webkit-scrollbar-thumb {
  background: var(--accent-moss);
  border-radius: 10px;
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--accent-sage);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink-color);
  background: linear-gradient(135deg, #fefdf9 0%, #eddfc8 100%);
  line-height: 1.6;
  overflow-x: hidden;
  transition: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 40%, transparent 45%, rgba(74, 68, 66, 0.1) 100%);
  pointer-events: none;
  z-index: 9998;
}

.navbar, .panel, .memory-card, .btn, .input, .textarea, .modal-card, .person-chip, .quote-card {
  transition: box-shadow 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Ffilter id='n'%3E%3FfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3F/filter%3E%3Frect width='100%25' height='100%25' filter='url(%23n)'/%3E%3F/svg%3E");
  opacity: 0.035;
  pointer-events: none;
  z-index: 9999;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 40px;
  background-color: rgba(253, 252, 248, 0.85);
  background-image: radial-gradient(circle, rgba(139, 157, 131, 0.18) 1.5px, transparent 1.5px);
  background-size: 28px 28px;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand { display: flex; align-items: center; gap: 16px; }
.brand-logo {
  height: 48px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.08));
}
.brand-name {
  font-family: var(--font-serif);
  font-size: 28px;
  margin: 0;
  font-weight: 700;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}
.brand-main { color: var(--ink-color); }
.brand-dot { color: var(--accent-moss); font-weight: 900; }
.brand-ext {
  color: white;
  background: var(--accent-sage);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 15px;
  padding: 5px 13px;
  border-radius: 2px;
  position: relative;
  transform: rotate(-2deg);
  transform-origin: center top;
  box-shadow: 1px 1px 3px rgba(0,0,0,0.1);
  text-transform: lowercase;
  cursor: pointer;
}

.brand-ext:hover,
.brand-ext.wiggling {
  animation: noteWiggle 0.6s ease-in-out;
}

.brand-ext:hover {
  animation-iteration-count: infinite;
}

@keyframes noteWiggle {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(3deg); }
}

.brand-ext .pin {
  position: absolute;
  top: -6px;
  right: -5px;
  left: auto;
  transform: rotate(45deg);
  width: 13px;
  height: 13px;
  background: var(--accent-moss);
  border-radius: 50%;
  box-shadow: inset -1px -1px 2px rgba(0,0,0,0.3);
}
.brand-tagline {
  font-size: 11px;
  margin: 2px 0 0 0;
  color: var(--muted-ink);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
  opacity: 0.8;
}

.nav-links { display: flex; gap: 12px; align-items: center; }

.nav-search-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--paper-white);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  padding: 5px 12px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.nav-search-wrap:focus-within {
  border-color: var(--accent-moss);
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.1);
}
.nav-search-icon { font-size: 11px; opacity: 0.5; }
.nav-search-input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--ink-color);
  width: 150px;
  transition: width 0.2s ease;
}
.nav-search-input:focus { width: 200px; }
.nav-search-input::placeholder { color: var(--muted-ink); }
.nav-search-input::-webkit-search-cancel-button { cursor: pointer; opacity: 0.5; }
.nav-item {
  text-decoration: none;
  color: var(--ink-color);
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 99px;
  font-size: 14px;
  transition: var(--transition);
}
.nav-item:hover { background: var(--border-soft); }
.nav-item.active { background: var(--ink-color); color: white; }

.nav-actions { display: flex; gap: 12px; }

.btn {
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  font-family: var(--font-sans);
  transition: var(--transition);
}

.btn-primary {
  background: var(--accent-moss);
  color: #fff;
  box-shadow: 0 8px 16px rgba(139, 157, 131, 0.3);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 12px 24px rgba(139, 157, 131, 0.4); }

.btn-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
  vertical-align: middle;
}
@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

.btn-secondary {
  background: transparent;
  color: var(--muted-ink);
  border: 1.5px solid var(--border-soft);
}
.btn-secondary:hover { background: var(--border-soft); color: var(--ink-color); }

.btn-danger {
  background: #9b2020;
  color: #fff;
  box-shadow: 0 8px 16px rgba(155, 32, 32, 0.2);
}
.btn-danger:hover { transform: translateY(-3px); background: #b52626; box-shadow: 0 12px 24px rgba(155, 32, 32, 0.3); }

.btn-icon { background: none; border: none; font-size: 20px; cursor: pointer; padding: 8px; border-radius: 50%; transition: var(--transition); }
.btn-icon:hover { background: var(--border-soft); }

.btn-account {
  display: flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  padding: 5px 12px 5px 5px;
  border-radius: 99px;
  border: 1.5px solid var(--border-soft);
  transition: border-color 0.2s ease, background 0.2s ease;
  background: transparent;
}
.btn-account:hover {
  border-color: var(--accent-sage);
  background: rgba(180, 201, 180, 0.12);
}
.btn-account-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-moss);
  color: white;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.btn-account-label {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-ink);
}

.btn-admin {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fff;
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 10px;
  border: 1.5px solid #8b9d83;
  background: #8b9d83;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.btn-admin:hover {
  background: #7a8c73;
  border-color: #7a8c73;
}

.btn-logout {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-ink);
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--border-soft);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.btn-logout:hover {
  color: #9b2020;
  border-color: rgba(155, 32, 32, 0.3);
  background: rgba(155, 32, 32, 0.05);
}

.btn-ghost { background: transparent; border: 1px solid var(--border-soft); padding: 6px 16px; border-radius: 99px; font-size: 13px; font-weight: 600; color: var(--muted-ink); cursor: pointer; transition: var(--transition); }
.btn-ghost.active { background: var(--accent-sage); color: white; border-color: var(--accent-sage); }

.container {
  display: grid;
  grid-template-columns: 280px 1fr 280px;
  gap: 32px;
  padding: 40px;
  max-width: 1600px;
  margin: 0 auto;
  position: relative;
}

.container::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  background-image: repeating-linear-gradient(
    45deg,
    rgba(139, 157, 131, 0.07) 0px,
    rgba(139, 157, 131, 0.07) 1px,
    transparent 1px,
    transparent 18px
  );
  pointer-events: none;
  z-index: -1;
}

.keepsake-corner {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.jar-section {
  position: relative;
  background: linear-gradient(160deg, #fdfaf3 0%, #fffef0 60%, #faf6e8 100%);
  border: 1px solid rgba(196, 160, 112, 0.22);
  border-radius: 18px;
  padding: 24px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 -1px 0 rgba(196, 160, 112, 0.12) inset,
    0 6px 24px rgba(100, 75, 40, 0.07),
    0 2px 8px rgba(100, 75, 40, 0.04);
  transform: rotate(-0.6deg);
  overflow: hidden;
}
.jar-ambient-glow {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(240,171,252,0.22) 0%, rgba(249,168,212,0.08) 50%, transparent 72%);
  border-radius: 50%;
  pointer-events: none;
  animation: jarAmbient 5s ease-in-out infinite;
}
.jar-stage-0 .jar-ambient-glow { background: radial-gradient(circle, rgba(240,171,252,0.24) 0%, rgba(249,168,212,0.09) 50%, transparent 72%); }
.jar-stage-1 .jar-ambient-glow { background: radial-gradient(circle, rgba(251,191,36,0.26) 0%, rgba(251,146,60,0.1) 50%, transparent 72%); }
.jar-stage-2 .jar-ambient-glow { background: radial-gradient(circle, rgba(168,85,247,0.26) 0%, rgba(192,132,252,0.1) 50%, transparent 72%); }
.jar-stage-3 .jar-ambient-glow { background: radial-gradient(circle, rgba(45,212,191,0.26) 0%, rgba(99,246,228,0.1) 50%, transparent 72%); }
.jar-stage-4 .jar-ambient-glow { background: radial-gradient(circle, rgba(99,102,241,0.28) 0%, rgba(165,180,252,0.12) 50%, transparent 72%); }
@keyframes jarAmbient {
  0%, 100% { opacity: 0.7; transform: translateX(-50%) scale(1); }
  50%       { opacity: 1;   transform: translateX(-50%) scale(1.12); }
}
.jar-visual-wrap { position: relative; z-index: 1; }
.jar-svg-new {
  display: block;
  width: 136px;
  height: auto;
  margin: 0 auto;
  filter: drop-shadow(0 16px 28px rgba(100, 72, 38, 0.16)) drop-shadow(0 4px 10px rgba(100, 72, 38, 0.10));
}
.jar-info-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(196, 160, 112, 0.18);
  width: 100%;
  justify-content: center;
}
.jar-count-block { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.jar-num {
  font-family: var(--font-serif);
  font-size: 40px;
  font-weight: 700;
  color: var(--accent-moss);
  letter-spacing: -0.03em;
  line-height: 1;
}
.jar-noun {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted-ink);
  margin-top: 4px;
}
.jar-info-divider { width: 1px; height: 38px; background: rgba(196, 160, 112, 0.28); flex-shrink: 0; }

.jar-debug {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
  padding: 6px 10px;
  background: rgba(0,0,0,0.04);
  border: 1px dashed rgba(0,0,0,0.15);
  border-radius: 8px;
  width: 100%;
}
.jar-debug-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.18);
  background: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  font-family: var(--font-sans);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s ease;
}
.jar-debug-btn:hover { background: #f0f0f0; }
.jar-debug-val {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  min-width: 80px;
  text-align: center;
}
.jar-debug-stage {
  font-weight: 400;
  color: var(--muted-ink);
  font-size: 11px;
}
.jar-label-block { display: flex; flex-direction: column; gap: 3px; }
.jar-title-text { font-family: var(--font-serif); font-size: 15px; font-weight: 700; color: var(--ink); }
.jar-subtitle { font-family: var(--font-sans); font-size: 11px; color: var(--muted-ink); font-style: italic; }

.memory-jar-container {
  background: #fffef0;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
  transform: rotate(-1deg);
}

.jar-svg {
  display: block;
  width: 120px;
  height: 160px;
  margin: 0 auto 16px;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.05));
}

.jar-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  background: radial-gradient(circle, rgba(180, 201, 180, 0.4) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: pulseGlow 4s infinite ease-in-out;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.4; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.2); }
}

.rewind-card {
  background: #fffef0;
  padding: 18px 18px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  position: relative;
  transform: rotate(1deg);
  margin-top: 18px;
}

.rewind-card::before {
  content: "On This Day";
  position: absolute;
  top: -11px;
  left: 16px;
  background: var(--accent-moss);
  color: white;
  padding: 2px 10px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 4px;
  font-family: var(--font-sans);
}

.rewind-content h5 { font-family: var(--font-serif); margin: 12px 0 8px 0; font-size: 16px; }
.rewind-content p  { font-size: 13px; color: var(--muted-ink); margin: 0; line-height: 1.4; }

.otd-empty {
  font-size: 12px;
  color: var(--muted-ink);
  font-style: italic;
  margin: 8px 0 2px;
  line-height: 1.5;
}

.otd-track { position: relative; }

.otd-slide { display: none; cursor: pointer; }
.otd-slide.otd-active {
  display: block;
  animation: otdIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.otd-slide.otd-leaving {
  display: block;
  animation: otdOut 0.22s ease forwards;
  pointer-events: none;
}

@keyframes otdIn  { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes otdOut { from { opacity: 1; transform: translateX(0); }    to { opacity: 0; transform: translateX(-16px); } }

.otd-slide:hover .otd-title { color: var(--accent-moss); }

.otd-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.otd-year-badge {
  background: var(--accent-moss);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
}
.otd-type-icon {
  font-size: 11px;
  color: var(--muted-ink);
}
.otd-photo { margin: 0 0 10px; border-radius: 8px; overflow: hidden; }
.otd-photo img { width: 100%; max-height: 110px; object-fit: cover; display: block; }
.otd-title {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 5px;
  line-height: 1.3;
  color: var(--ink);
  transition: color 0.15s ease;
}
.otd-text {
  font-size: 12px;
  color: var(--muted-ink);
  margin: 0 0 8px;
  line-height: 1.6;
}
.otd-people { margin-bottom: 8px; }
.otd-date-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--accent-sage);
  text-transform: uppercase;
  display: block;
  margin-top: 4px;
}

.otd-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-soft);
}
.otd-counter {
  font-size: 11px;
  color: var(--muted-ink);
  font-family: var(--font-sans);
  flex: 1;
  font-weight: 600;
}
.otd-expand-btn {
  background: var(--paper-white);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
  color: var(--ink);
  letter-spacing: 0.03em;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.otd-expand-btn:hover { background: var(--accent-moss); border-color: var(--accent-moss); color: #fff; }
.otd-next-btn {
  background: var(--accent-moss);
  border: none;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  line-height: 1;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.otd-next-btn:hover { opacity: 0.85; transform: translateX(2px); }

.milestones-panel {
  background: #fffef0;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  position: relative;
  margin-top: 16px;
}

.milestones-label {
  position: absolute;
  top: -12px;
  left: 20px;
  background: var(--accent-moss);
  color: white;
  padding: 2px 10px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  border-radius: 4px;
  font-family: var(--font-sans);
  letter-spacing: 0.05em;
  z-index: 1;
}

.milestones-scroll {
  height: 400px;
  overflow-y: auto;
  padding: 28px 20px 20px 20px;
  position: relative;
}

.milestone {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 22px;
  position: relative;
}

.milestone:last-child {
  margin-bottom: 0;
}

.milestone:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 15px;
  top: 32px;
  height: calc(100% + 22px - 32px);
  width: 2px;
  background: linear-gradient(to bottom, var(--accent-sage), rgba(139, 157, 131, 0.25));
  border-radius: 1px;
}

.milestone-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fffef0;
  border: 2px solid var(--accent-sage);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  box-shadow: 0 2px 6px rgba(139, 157, 131, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.milestone:hover .milestone-dot {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(139, 157, 131, 0.35);
}

.milestone-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 4px;
}

.milestone-date {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-moss);
  font-family: var(--font-sans);
}

.milestone-title {
  font-size: 13px;
  font-family: var(--font-serif);
  color: var(--ink-color);
  line-height: 1.3;
}

.milestone-title-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.milestone-entry {
  cursor: pointer;
}

.milestone-entry:focus-visible {
  outline: 2px solid var(--accent-moss);
  outline-offset: 3px;
  border-radius: 6px;
}

.milestone-entry:active .milestone-dot {
  transform: scale(0.95);
}

.milestone-entry .milestone-title {
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 2px;
  transition: text-decoration-color 0.15s ease, color 0.15s ease;
}

.milestone-entry:hover .milestone-title {
  color: var(--accent-moss);
  text-decoration-color: var(--accent-moss);
}

.milestones-empty {
  font-size: 12px;
  color: var(--muted-ink);
  font-family: var(--font-sans);
  line-height: 1.5;
  padding: 8px 0;
}

.milestone-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.milestone-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-moss);
  cursor: pointer;
  flex-shrink: 0;
}

.milestone-checkbox-text {
  font-size: 13px;
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--ink-color);
}

.heartbeat-stats {
  background: #fffef0;
  padding: 20px;
  margin-top: 16px;
  margin-bottom: 24px;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  position: relative;
  transform: rotate(-0.5deg);
}

.heartbeat-stats::before {
  content: "Memory Pulse";
  position: absolute;
  top: -12px;
  left: 20px;
  background: var(--accent-moss);
  color: white;
  padding: 2px 10px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  border-radius: 4px;
}

.circle-panel {
  background: #fffef0;
  padding: 24px 20px 20px;
  margin-bottom: 24px;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  position: relative;
  transform: rotate(0.6deg);
}

.circle-panel::before {
  content: "In My Circle";
  position: absolute;
  top: -12px;
  left: 20px;
  background: var(--accent-moss);
  color: white;
  padding: 2px 10px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  border-radius: 4px;
  z-index: 1;
}

.people-grid-carousel {
  position: relative;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.person-slide {
  display: none;
  width: 100%;
  text-align: center;
}

.person-slide.active {
  display: block;
  animation: slideIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.person-slide.leaving {
  display: block;
  position: absolute;
  animation: slideOut 0.3s ease forwards;
  pointer-events: none;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(-30px); }
}

.person-chip-large {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px;
}

.avatar-large {
  font-size: 48px;
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

.name-large {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink-color);
}

.remove-person-btn {
  background: transparent;
  border: 1px solid var(--border-soft);
  color: #9b2020;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 4px;
  opacity: 0.6;
}

.remove-person-btn:hover {
  opacity: 1;
  background: rgba(155, 32, 32, 0.05);
  border-color: rgba(155, 32, 32, 0.2);
}

.circle-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
}

.circle-counter {
  font-size: 12px;
  color: var(--muted-ink);
  font-weight: 700;
  flex: 1;
  font-family: var(--font-sans);
}

.circle-next-btn {
  background: var(--accent-moss);
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  line-height: 1;
  transition: all 0.2s ease;
}

.circle-next-btn:hover {
  opacity: 0.9;
  transform: translateX(3px);
}

.circle-empty {
  font-size: 13px;
  color: var(--muted-ink);
  font-style: italic;
  text-align: center;
  padding: 20px 0;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.stat-item:last-child { margin-bottom: 0; }
.stat-icon { font-size: 20px; }
.stat-info { display: flex; flex-direction: column; }
.stat-value { font-weight: 800; font-size: 14px; }
.stat-label { font-size: 11px; color: var(--muted-ink); text-transform: uppercase; letter-spacing: 1px; }

.mobile-fab {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-moss);
  color: #fff;
  border: none;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(139, 157, 131, 0.5), 0 1px 4px rgba(0,0,0,0.12);
  z-index: 200;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.mobile-fab:hover  { transform: scale(1.08); box-shadow: 0 6px 24px rgba(139, 157, 131, 0.6); }
.mobile-fab:active { transform: scale(0.94); }

.sidebar-toggle-btn {
  display: none;
}

@media (max-width: 1200px) {
  .container {
    grid-template-columns: 250px 1fr;
  }
  .keepsake-corner {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 20px;
  }
  .keepsake-corner > * {
    flex: 1 1 260px;
    max-width: 420px;
  }
  .jar-section {
    transform: none;
  }
  .milestones-panel {
    transform: none;
  }
}

@media (max-width: 768px) {
  body {
    overflow-x: hidden;
  }

  .navbar {
    padding: 8px 12px;
    flex-wrap: wrap;
    gap: 6px;
    overflow: visible;
  }

  .brand {
    width: 100%;
    flex-shrink: 0;
  }

  .nav-links {
    flex: 1;
    flex-wrap: nowrap;
    gap: 4px;
    min-width: 0;
    justify-content: flex-start;
  }

  .nav-item {
    padding: 5px 10px;
    font-size: 12px;
  }

  .nav-search-wrap {
    flex-shrink: 0;
    width: auto;
  }

  .nav-search-input {
    width: 120px;
  }

  .nav-search-input:focus {
    width: 150px;
  }

  .nav-actions {
    width: 100%;
    gap: 6px;
    flex-wrap: nowrap;
  }

  .brand-tagline {
    display: none;
  }

  .brand-name {
    font-size: 17px;
    gap: 6px;
  }

  .brand-logo {
    height: 30px;
  }

  .brand-ext {
    font-size: 10px;
    padding: 3px 8px;
  }

  .btn-primary {
    flex: 1;
    justify-content: center;
    padding: 7px 10px;
    font-size: 12px;
    white-space: nowrap;
  }

  .btn-account {
    flex: 1;
    justify-content: center;
    padding: 6px 8px;
    gap: 4px;
  }

  .btn-account-label {
    font-size: 12px;
  }

  .btn-account-avatar {
    width: 22px;
    height: 22px;
    font-size: 10px;
  }

  .btn-logout {
    flex: 1;
    justify-content: center;
    font-size: 12px;
    padding: 6px 8px;
    white-space: nowrap;
    text-align: center;
  }

  .btn {
    padding: 7px 10px;
    font-size: 12px;
  }

  .btn-icon {
    font-size: 18px;
    padding: 6px;
  }

  .container {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 16px;
  }

  .sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
  }

  .sidebar .section {
    margin-bottom: 0;
    width: 100%;
  }

  .sidebar .section-title {
    font-size: 14px;
    margin-bottom: 10px;
  }

  .people-grid {
    flex-wrap: wrap;
  }

  .btn-add-family {
    display: inline-flex;
  }

  .quote-card {
    display: block;
  }

  .keepsake-corner {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 16px;
    width: 100%;
  }
  .keepsake-corner > * {
    flex: none;
    max-width: 100%;
    width: 100%;
  }

  .memory-jar-container {
    width: 100%;
  }

  .jar-svg {
    width: 80px;
    height: 106px;
  }

  .stream-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .album-stream-header {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
  }

  .album-stream-header .album-detail-heading {
    position: static;
    transform: none;
    align-items: center;
    text-align: center;
    width: 100%;
    order: 2;
    pointer-events: auto;
  }

  .album-stream-header .btn-back {
    order: 1;
  }

  .album-stream-header .btn-share-album {
    order: 3;
  }

  .stream-title {
    font-size: 22px;
  }

  .stream-controls {
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
  }

  .memory-card {
    transform: none !important;
  }

  .heartbeat-stats,
  .quote-card,
  .rewind-card,
  .jar-section,
  .memory-jar-container {
    transform: none;
  }

  .memory-stream   { order: 1; }
  .albums-view     { order: 2; }
  .sidebar         { order: 3; }
  .keepsake-corner { order: 4; }

  .sidebar-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: var(--panel-color);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 12px 16px;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 700;
    color: var(--ink-color);
    cursor: pointer;
    letter-spacing: 0.02em;
  }
  .sidebar-toggle-btn svg {
    width: 12px;
    height: 12px;
    transition: transform 0.25s ease;
    flex-shrink: 0;
  }
  .sidebar-toggle-btn.open svg {
    transform: rotate(180deg);
  }

  .sidebar-collapsible {
    display: none;
    flex-direction: column;
    gap: 16px;
  }
  .sidebar-collapsible.open {
    display: flex;
  }

  .mobile-fab {
    display: flex;
  }
}

.section { margin-bottom: 40px; }
.section-title { font-family: var(--font-serif); font-size: 18px; margin-bottom: 16px; border-bottom: 2px solid var(--accent-sage); display: inline-block; padding-bottom: 4px; }

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-title-row .section-title { margin-bottom: 0; }

.btn-add-family {
  margin-top: 12px;
  font-size: 13px;
  padding: 10px 16px;
}

.avatar-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.avatar-opt {
  background: var(--bg-color);
  border: 2px solid var(--border-soft);
  border-radius: 12px;
  width: 44px;
  height: 44px;
  font-size: 22px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: var(--transition);
}
.avatar-opt:hover { border-color: var(--accent-sage); transform: scale(1.1); }
.avatar-opt.active { border-color: var(--accent-moss); background: rgba(139, 157, 131, 0.12); }

.people-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.person-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: white;
  border: 1px solid var(--border-soft);
  border-radius: 99px;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-sans);
}
.person-chip:hover { border-color: var(--accent-moss); transform: translateY(-2px); }
.person-chip.active { background: var(--accent-moss); color: white; border-color: var(--accent-moss); }
.avatar { font-size: 18px; }
.name { font-weight: 700; font-size: 13px; }

.quote-card {
  padding: 20px;
  margin-top: 16px;
  background: #fffef0;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
  position: relative;
  font-style: italic;
  font-size: 14px;
  transform: rotate(0.8deg);
}

.quote-card::before {
  content: "Daily Wisdom";
  position: absolute;
  top: -12px;
  left: 20px;
  background: var(--accent-moss);
  color: white;
  padding: 2px 10px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  border-radius: 4px;
}

.quote-card span { display: block; margin-top: 12px; font-weight: 700; font-style: normal; color: var(--accent-sage); }

.stream-header { position: relative; display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; }
.stream-title { font-family: var(--font-serif); font-size: 32px; margin: 0; }
.stream-controls { display: flex; gap: 8px; }

.masonry-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  align-items: start;
}

@media (max-width: 600px) {
  .masonry-grid {
    grid-template-columns: 1fr;
  }
}

@keyframes cardEntrance {
  from {
    opacity: 0;
    transform: rotate(var(--rotation)) translateY(20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: rotate(var(--rotation)) translateY(0) scale(1);
  }
}

.memory-card {
  break-inside: avoid;
  background: white;
  padding: 16px;
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  transform: rotate(var(--rotation));
  transition: var(--transition);
  position: relative;
}

.memory-card.is-new {
  animation: cardEntrance 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.memory-card:hover {
  transform: rotate(0deg) translateY(-8px);
  box-shadow: var(--shadow-lift);
  z-index: 10;
}

.polaroid { padding: 16px 16px 40px 16px; border-radius: 2px; background: var(--polaroid-bg, #fffef8); }

.polaroid .card-content > .card-date {
  display: block;
  margin-bottom: 6px;
}
.card-photo { border: 1px solid rgba(0,0,0,0.05); overflow: hidden; margin-bottom: 16px; border-radius: 4px; }
.card-img { width: 100%; height: 240px; object-fit: contain; display: block; background: #1a1916; }
.photo-placeholder { height: 240px; display: grid; place-items: center; color: var(--muted-ink); }
.card-photo.small .photo-placeholder { height: 120px; }
.photo-placeholder .emoji { font-size: 48px; }
.photo-placeholder small { font-weight: 700; margin-top: 8px; }

.letter {
  background-color: var(--letter-bg, #fffef0);
  background-image: repeating-linear-gradient(
    transparent,
    transparent 27px,
    rgba(180, 201, 180, 0.35) 27px,
    rgba(180, 201, 180, 0.35) 28px
  );
  background-position: 0 36px;
  padding: 32px 32px 48px 32px;
  min-height: 180px;
  border-radius: 4px;
  border-left: 4px solid var(--accent-sage);
}

.paper-notebook {
  background-color: var(--letter-bg, #fffef8);
  background-image:
    repeating-linear-gradient(transparent, transparent 27px, rgba(139,157,131,0.3) 27px, rgba(139,157,131,0.3) 28px),
    linear-gradient(90deg, transparent 38px, rgba(200,120,120,0.18) 38px, rgba(200,120,120,0.18) 40px, transparent 40px);
  background-position: 0 36px, 0 0;
  border-left: 4px solid rgba(200,120,120,0.35);
}

.paper-linen {
  background-color: var(--letter-bg, #faf6ef);
  background-position: 0 0;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect width='4' height='4' fill='none'/%3E%3Cpath d='M0 0L4 4M4 0L0 4' stroke='rgba(180,160,120,0.12)' stroke-width='0.5'/%3E%3C/svg%3E"),
    linear-gradient(170deg, rgba(255,248,235,0.9) 0%, rgba(250,240,220,0.9) 100%);
  border-left: 4px solid rgba(180,150,100,0.35);
}

.paper-grid {
  background-color: var(--letter-bg, #f8fbff);
  background-position: 0 0;
  background-image:
    linear-gradient(rgba(100,140,200,0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(100,140,200,0.12) 1px, transparent 1px),
    linear-gradient(rgba(100,140,200,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(100,140,200,0.06) 1px, transparent 1px);
  background-size: 28px 28px, 28px 28px, 7px 7px, 7px 7px;
  border-left: 4px solid rgba(100,140,200,0.3);
}

.paper-ocean {
  background-color: var(--letter-bg, #f0f8ff);
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(100,180,220,0.2) 0%, transparent 70%),
    repeating-linear-gradient(170deg, transparent, transparent 18px, rgba(100,180,220,0.07) 18px, rgba(100,180,220,0.07) 19px),
    repeating-linear-gradient(190deg, transparent, transparent 22px, rgba(80,160,200,0.06) 22px, rgba(80,160,200,0.06) 23px);
  background-position: 0 0;
  border-left: 4px solid rgba(80,160,210,0.4);
}

.paper-texture {
  background-color: #c8b89a;
  background-image: url('assets/paper-texture.webp');
  background-size: 300px 300px;
  background-repeat: repeat;
  background-position: 0 0;
  border-left: 4px solid rgba(150,115,65,0.5);
}
@supports not (background-image: url('x.webp')) {
  .paper-texture {
    background-image: url('assets/paper-texture.jpg');
  }
}
@supports not (background-image: url('x.webp')) {
}

.paper-snowflakes {
  background-color: var(--letter-bg, #f0f6ff);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44'%3E%3Cg stroke='rgba(140,180,230,0.16)' stroke-width='1.2' stroke-linecap='round' fill='none' transform='translate(22,22)'%3E%3Cline x1='0' y1='-13' x2='0' y2='13'/%3E%3Cline x1='-13' y1='0' x2='13' y2='0'/%3E%3Cline x1='-9.2' y1='-9.2' x2='9.2' y2='9.2'/%3E%3Cline x1='9.2' y1='-9.2' x2='-9.2' y2='9.2'/%3E%3Cline x1='0' y1='-13' x2='-3' y2='-9'/%3E%3Cline x1='0' y1='-13' x2='3' y2='-9'/%3E%3Cline x1='0' y1='13' x2='-3' y2='9'/%3E%3Cline x1='0' y1='13' x2='3' y2='9'/%3E%3Cline x1='-13' y1='0' x2='-9' y2='-3'/%3E%3Cline x1='-13' y1='0' x2='-9' y2='3'/%3E%3Cline x1='13' y1='0' x2='9' y2='-3'/%3E%3Cline x1='13' y1='0' x2='9' y2='3'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 90px 80px;
  border-left: 4px solid rgba(140,180,230,0.35);
}

.paper-hearts {
  background-color: var(--letter-bg, #fff5f8);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28'%3E%3Cpath d='M14 22C14 22 3 15 3 9C3 5.7 5.7 3 9 3C11.1 3 12.9 4.2 14 6C15.1 4.2 16.9 3 19 3C22.3 3 25 5.7 25 9C25 15 14 22 14 22Z' fill='rgba(225,100,130,0.13)'/%3E%3C/svg%3E");
  background-size: 70px 60px;
  border-left: 4px solid rgba(225,100,130,0.3);
}

.paper-eggs {
  background-color: var(--letter-bg, #f8fff8);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='90'%3E%3Cg transform='translate(22,26)'%3E%3Cpath d='M0,-12 C7,-12 9,-2 9,4 C9,10 -9,10 -9,4 C-9,-2 -7,-12 0,-12Z' fill='none' stroke='rgba(160,120,210,0.2)' stroke-width='1'/%3E%3Cpath d='M-9,4 Q-4,1 0,4 Q4,7 9,4' fill='none' stroke='rgba(60,190,160,0.2)' stroke-width='0.8'/%3E%3Cpath d='M-7,-3 Q-3.5,-6 0,-3 Q3.5,0 7,-3' fill='none' stroke='rgba(240,160,60,0.18)' stroke-width='0.8'/%3E%3C/g%3E%3Cg transform='translate(72,60) rotate(15)'%3E%3Cpath d='M0,-9 C5,-9 7,-2 7,2 C7,7 -7,7 -7,2 C-7,-2 -5,-9 0,-9Z' fill='none' stroke='rgba(160,120,210,0.14)' stroke-width='0.9'/%3E%3Cpath d='M-7,2 Q-3,0 0,2 Q3,4 7,2' fill='none' stroke='rgba(60,190,160,0.14)' stroke-width='0.7'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 100px 90px;
  border-left: 4px solid rgba(160,120,210,0.3);
}

.paper-spring {
  background-color: var(--letter-bg, #f6fff4);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cg transform='translate(20,20)'%3E%3Cellipse cx='0' cy='-7' rx='3' ry='5' fill='rgba(255,155,185,0.28)'/%3E%3Cellipse cx='0' cy='-7' rx='3' ry='5' fill='rgba(255,185,145,0.28)' transform='rotate(72)'/%3E%3Cellipse cx='0' cy='-7' rx='3' ry='5' fill='rgba(255,155,185,0.28)' transform='rotate(144)'/%3E%3Cellipse cx='0' cy='-7' rx='3' ry='5' fill='rgba(255,185,145,0.28)' transform='rotate(216)'/%3E%3Cellipse cx='0' cy='-7' rx='3' ry='5' fill='rgba(255,155,185,0.28)' transform='rotate(288)'/%3E%3Ccircle cx='0' cy='0' r='3' fill='rgba(255,210,50,0.22)'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 90px 90px;
  border-left: 4px solid rgba(180,220,150,0.4);
}

.paper-autumn {
  background-color: var(--letter-bg, #fffbf4);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='36'%3E%3Cpath d='M16 3C22 7 27 14 25 21C23 27 16 32 16 32C16 32 9 27 7 21C5 14 10 7 16 3Z' fill='rgba(200,95,40,0.16)'/%3E%3Cline x1='16' y1='3' x2='16' y2='32' stroke='rgba(160,75,30,0.12)' stroke-width='0.8'/%3E%3Cline x1='16' y1='11' x2='10' y2='17' stroke='rgba(160,75,30,0.1)' stroke-width='0.6'/%3E%3Cline x1='16' y1='11' x2='22' y2='17' stroke='rgba(160,75,30,0.1)' stroke-width='0.6'/%3E%3Cline x1='16' y1='19' x2='10' y2='25' stroke='rgba(160,75,30,0.1)' stroke-width='0.6'/%3E%3Cline x1='16' y1='19' x2='22' y2='25' stroke='rgba(160,75,30,0.1)' stroke-width='0.6'/%3E%3C/svg%3E");
  background-size: 90px 80px;
  border-left: 4px solid rgba(200,95,40,0.3);
}

.wax-seal {
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 40px;
  background: #4a5d4e;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  font-size: 18px;
}

.letter .card-content > .card-date {
  display: block;
  margin-bottom: 6px;
}

.mini-moment { padding: 12px; border-radius: 24px; }
.pin {
  position: absolute;
  top: -13px;
  left: 50%;
  width: 18px;
  height: 18px;
  background: radial-gradient(circle at 35% 35%, var(--pin-color-light, #e8453c), var(--pin-color-dark, #9b1c18));
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow:
    inset -2px -2px 4px rgba(0,0,0,0.35),
    inset 2px 2px 3px rgba(255,255,255,0.25),
    0 4px 8px rgba(0,0,0,0.25),
    0 1px 2px rgba(0,0,0,0.4);
  z-index: 2;
}
.pin::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  width: 3px;
  height: 8px;
  background: linear-gradient(to bottom, #bbb, #888);
  border-radius: 0 0 2px 2px;
  transform: translateX(-50%);
  box-shadow: 0 2px 3px rgba(0,0,0,0.3);
}

.pin-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pin-btn:hover {
  transform: translateX(-50%) scale(1.25);
}

.pin-btn--active {
  background: radial-gradient(circle at 35% 35%, #ffd700, #e6a800) !important;
  box-shadow:
    inset -2px -2px 4px rgba(0,0,0,0.2),
    inset 2px 2px 3px rgba(255,255,255,0.4),
    0 4px 12px rgba(230,168,0,0.55),
    0 1px 2px rgba(0,0,0,0.3) !important;
}

.memory-card--pinned {
  outline: 2px solid rgba(230, 168, 0, 0.5);
  outline-offset: 2px;
}

.card-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.card-date { font-size: 11px; font-weight: 800; text-transform: uppercase; color: var(--muted-ink); letter-spacing: 0.5px; }
.card-tags { font-size: 11px; color: var(--accent-sage); font-weight: 700; }
.card-title { font-family: var(--font-serif); font-size: 18px; margin: 0 0 8px 0; line-height: 1.2; }
.card-body { font-size: 14px; margin: 0 0 16px 0; color: #555; font-weight: 500; }
.card-people { display: flex; gap: 4px; }
.mini-avatar { width: 24px; height: 24px; background: white; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--border-soft); cursor: help; font-size: 14px; }

.tape-top {
  position: absolute;
  top: -15px;
  left: 50%;
  width: 80px;
  height: 30px;
  background: rgba(255, 235, 150, 0.5);
  backdrop-filter: blur(2px);
  transform: translateX(-50%) rotate(2deg);
  border: 1px solid rgba(0,0,0,0.05);
  clip-path: polygon(5% 0%, 95% 2%, 100% 50%, 95% 98%, 5% 100%, 0% 50%);
}

.audio {
  padding: 0;
  border-radius: 16px;
  overflow: visible;
  background: var(--audio-bg, #f0f5ff);
}

.audio .audio-player {
  border-radius: 16px 16px 0 0;
}

.audio .card-content {
  border-radius: 0 0 16px 16px;
}

.audio-player {
  background: var(--audio-bg, #f0f5ff);
  padding: 20px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.audio-play-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-moss);
  border: none;
  color: white;
  font-size: 13px;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  padding: 0;
  transition: transform 0.2s ease, background 0.2s ease;
}

.audio-play-btn:hover { transform: scale(1.1); background: var(--accent-sage); }
.audio-play-btn:active { transform: scale(0.95); }

.audio-waveform {
  flex: 1;
  height: 32px;
}

.audio-waveform rect {
  fill: rgba(80, 110, 80, 0.3);
  transition: fill 0.3s ease;
}

.audio.playing .audio-waveform rect {
  fill: var(--accent-sage);
  animation: waveBar 0.5s ease-in-out infinite alternate;
}

.audio.playing .audio-waveform rect:nth-child(2n) { animation-delay: 0.1s; }
.audio.playing .audio-waveform rect:nth-child(3n) { animation-delay: 0.2s; }
.audio.playing .audio-waveform rect:nth-child(4n) { animation-delay: 0.15s; }

@keyframes waveBar {
  from { opacity: 0.3; }
  to { opacity: 1; }
}

.audio-duration {
  font-size: 10px;
  color: var(--muted-ink);
  font-weight: 800;
  font-family: var(--font-sans);
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.audio .card-content {
  background: var(--audio-bg, #f0f5ff);
  padding: 14px 16px 20px;
}

.audio .card-date {
  display: block;
  margin-bottom: 4px;
}

.audio .card-title { margin-bottom: 0; }

.site-footer {
  text-align: center;
  padding: 48px 40px 40px;
  border-top: 1px solid var(--border-soft);
  color: var(--muted-ink);
  font-size: 13px;
  font-weight: 600;
  background-image: radial-gradient(circle, rgba(139, 157, 131, 0.18) 1.5px, transparent 1.5px);
  background-size: 28px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 0;
}

.footer-link {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted-ink);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 99px;
  transition: background 0.2s ease, color 0.2s ease;
  letter-spacing: 0.02em;
}

.footer-link:hover {
  background: var(--border-soft);
  color: var(--ink-color);
}

.footer-dot {
  color: var(--border-soft);
  font-size: 16px;
  line-height: 1;
  user-select: none;
}

.footer-copy {
  margin: 0;
  font-size: 11px;
  opacity: 0.6;
}

.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 28px;
  z-index: 300;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-moss);
  color: white;
  border: none;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(139, 157, 131, 0.45), 0 2px 6px rgba(0,0,0,0.15);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.85);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.back-to-top:hover {
  background: var(--accent-sage);
  box-shadow: 0 10px 28px rgba(139, 157, 131, 0.55), 0 3px 8px rgba(0,0,0,0.15);
  transform: translateY(-3px) scale(1.05);
}

.back-to-top:active {
  transform: translateY(0) scale(0.95);
}

.memory-card {
  cursor: pointer;
}

.card-modal-inner {
  width: min(520px, 90vw);
  position: relative;
  padding-top: 24px;
  margin: auto;
  transform: translateY(30px) scale(0.95);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .card-modal-inner {
  transform: translateY(0) scale(1);
}

.card-modal-inner .memory-card {
  transform: none !important;
  margin: 0;
  cursor: default;
  break-inside: unset;
  font-size: 1.1em;
}

.card-modal-inner:has(.polaroid) {
  width: min(720px, 92vw);
}

.card-modal-inner .card-img {
  height: auto;
  max-height: 65vh;
  object-fit: contain;
  background: #000;
}

.card-photo.img-loading {
  position: relative;
  min-height: 180px;
  background: linear-gradient(90deg, #f0ede8 25%, #e8e4de 50%, #f0ede8 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
  border-radius: 4px;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.card-modal-inner .memory-card:hover {
  transform: none !important;
  box-shadow: var(--shadow-soft);
}

.card-modal-close {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--panel-color);
  border: 1px solid var(--border-soft);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  color: var(--muted-ink);
  display: grid;
  place-items: center;
  z-index: 10;
  line-height: 1;
}

.member-strip-viewport {
  overflow: hidden;
  width: 100%;
  padding: 16px 4px 4px;
  position: relative;
  mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
}
.member-strip-track {
  display: flex;
  gap: 8px;
  width: max-content;
}
.member-strip-track.centered {
  width: 100%;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.member-strip-track.scrolling {
  animation: memberScroll linear infinite;
  animation-duration: var(--scroll-duration, 10s);
}
@keyframes memberScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(calc(-1 * var(--scroll-width))); }
}
.member-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(139, 157, 131, 0.18);
  border: 1px solid rgba(139, 157, 131, 0.45);
  border-radius: 20px;
  padding: 5px 12px 5px 8px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.2s ease;
}
.member-pill:hover { background: rgba(139, 157, 131, 0.28); }
.member-pill-emoji { font-size: 15px; line-height: 1; }
.member-pill-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-color);
  font-family: var(--font-sans);
  letter-spacing: 0.01em;
}

@media (max-width: 768px) {
  #cardModal {
    align-items: flex-end;
    padding: 0;
  }

  #cardModal .card-modal-inner {
    width: 100%;
    border-radius: 24px 24px 0 0;
    background: var(--bg-color);
    padding: 32px 20px 32px;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 -8px 40px rgba(0,0,0,0.15);
  }

  #cardModal.active .card-modal-inner {
    transform: translateY(0);
  }

  #cardModal .card-modal-close {
    top: 12px;
    right: 16px;
  }

  #cardModal .memory-card {
    box-shadow: none;
    border: 1px solid var(--border-soft);
  }

  .card-delete-btn {
    width: 32px;
    height: 32px;
    font-size: 15px;
  }

}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(74, 68, 66, 0.4);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-color);
  width: min(500px, 100%);
  border-radius: 24px;
  padding: 32px;
  position: relative;
  box-shadow: 0 40px 80px -20px rgba(0,0,0,0.25);
  transform: translateY(20px) scale(0.95);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid white;
}

.modal-overlay.active .modal-card {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--muted-ink);
}

.modal-header { margin-bottom: 24px; }
.modal-title { font-family: var(--font-serif); font-size: 24px; margin: 0; }
.modal-subtitle { font-size: 14px; color: var(--muted-ink); margin-top: 4px; }

.form-group { margin-bottom: 20px; }
.label { display: block; font-weight: 700; font-size: 13px; margin-bottom: 8px; color: var(--ink-color); }

.input, .textarea, .select-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: white;
  font-family: var(--font-sans);
  font-size: 14px;
  transition: var(--transition);
  appearance: none;
}

.select-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%237a726f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  cursor: pointer;
}

.input:focus, .textarea:focus, .select-input:focus {
  outline: none;
  border-color: var(--accent-moss);
  box-shadow: 0 0 0 4px rgba(139, 157, 131, 0.15);
}

.textarea { min-height: 100px; resize: none; }

.tag-input {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  background: white;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
}
.tag-chip {
  background: var(--accent-sage);
  color: white;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.remove-tag {
  background: none;
  border: none;
  color: white;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}
.remove-tag:hover { opacity: 1; }

.input-inline {
  border: none;
  outline: none;
  font-family: var(--font-sans);
  font-size: 13px;
  flex: 1;
  min-width: 100px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 32px;
}

.color-swatch-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.color-swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1), border-color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 1px 4px rgba(74,68,66,0.15);
}

.color-swatch:hover {
  transform: scale(1.2);
}

.color-swatch.active {
  border-color: var(--accent-moss);
  box-shadow: 0 0 0 3px rgba(139,157,131,0.3);
  transform: scale(1.15);
}

.label-hint {
  font-weight: 500;
  font-size: 10px;
  opacity: 0.7;
  margin-left: 4px;
}

.input-file {
  padding: 8px 12px;
  cursor: pointer;
}

.label-char-counter {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 400;
  color: var(--muted-ink);
  margin-left: 4px;
  transition: color 0.15s ease;
}
.rich-editor-counter--over .label-char-counter {
  color: #c0392b;
  font-weight: 700;
}

.mem-form-error {
  padding: 10px 14px;
  background: #fff0f0;
  color: #9b2020;
  border: 1px solid rgba(155, 32, 32, 0.15);
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  margin-top: 12px;
}

.memories-empty {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  padding: 40px 20px 60px;
}

.empty-state-card {
  background: var(--card-bg);
  border: 1.5px dashed var(--border);
  border-radius: 20px;
  padding: 48px 40px 40px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

.empty-state-icon {
  font-size: 52px;
  line-height: 1;
  margin-bottom: 4px;
}

.empty-state-heading {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.empty-state-body {
  font-family: var(--font-sans);
  font-size: 0.92rem;
  color: var(--muted-ink);
  line-height: 1.6;
  margin: 0 0 4px;
}

.empty-state-btn {
  margin-top: 4px;
  padding: 10px 28px;
  font-size: 0.92rem;
}

.empty-state-hints {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  width: 100%;
  max-width: 240px;
}

.empty-state-hints li {
  font-family: var(--font-sans);
  font-size: 0.83rem;
  color: var(--muted-ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

.hint-icon {
  font-size: 1rem;
  width: 20px;
  flex-shrink: 0;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  background: var(--paper-white);
  color: var(--ink-color);
  font-size: 13px;
  font-family: var(--font-sans);
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.page-btn:hover {
  background: var(--accent-sage);
  border-color: var(--accent-sage);
  color: #fff;
  transform: translateY(-1px);
}

.page-btn:active {
  transform: translateY(0);
}

.page-btn-active {
  background: var(--accent-moss);
  border-color: var(--accent-moss);
  color: #fff;
  pointer-events: none;
}

.page-btn-disabled {
  opacity: 0.3;
  pointer-events: none;
  cursor: default;
}

.page-ellipsis {
  font-size: 13px;
  color: var(--muted-ink);
  padding: 0 4px;
  font-family: var(--font-sans);
}

.mini-avatar--initial {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-sage);
  color: white;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.person-chip {
  position: relative;
}
.remove-person {
  display: none;
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: #e55;
  color: white;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 1;
}
.person-chip:hover .remove-person { display: flex; }
.circle-empty {
  font-size: 12px;
  color: var(--muted-ink);
  font-style: italic;
  margin: 0;
}

.member-dropdown {
  position: relative;
  user-select: none;
}
.member-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px 9px 11px;
  background: var(--card-bg, #fdf8f0);
  border: 1.5px solid var(--border-color, #e0d8cc);
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-color);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.member-dropdown.open .member-dropdown-trigger {
  border-color: var(--accent-sage);
  box-shadow: 0 0 0 3px rgba(180,201,180,0.22);
  outline: none;
}
.member-dropdown-icon { font-size: 1rem; line-height: 1; flex-shrink: 0; }
.member-dropdown-label { flex: 1; letter-spacing: 0.01em; }
.member-dropdown-chevron {
  width: 10px;
  height: 6px;
  color: var(--muted-ink);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.member-dropdown.open .member-dropdown-chevron { transform: rotate(180deg); }
.member-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  background: var(--card-bg, #fdf8f0);
  border: 1.5px solid var(--border-color, #e0d8cc);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.11), 0 2px 6px rgba(0,0,0,0.06);
  z-index: 300;
  overflow: hidden;
  padding: 4px;
}
.member-dropdown.open .member-dropdown-menu {
  display: block;
  animation: memberMenuIn 0.18s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes memberMenuIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.member-dropdown-option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--ink-color);
  transition: background 0.12s ease;
}
.member-dropdown-option:hover { background: var(--hover-bg, rgba(180,201,180,0.15)); }
.member-dropdown-option.selected { background: var(--hover-bg, rgba(180,201,180,0.18)); font-weight: 700; }
.member-opt-emoji { font-size: 1.1rem; line-height: 1; flex-shrink: 0; width: 22px; text-align: center; }
.member-opt-name { flex: 1; }
.member-opt-check {
  width: 12px;
  height: 10px;
  color: var(--accent-sage);
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.member-dropdown-option.selected .member-opt-check { opacity: 1; }
.member-selector-empty {
  font-size: 12px;
  color: var(--muted-ink);
  font-style: italic;
  margin: 4px 10px;
}

.card-delete-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(155,32,32,0.2);
  color: #9b2020;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.5;
  transition: opacity 0.15s ease, background 0.15s ease, transform 0.15s ease;
  z-index: 3;
  padding: 0;
}
.memory-card:hover .card-delete-btn {
  opacity: 1;
}
.card-delete-btn:hover {
  background: rgba(155,32,32,0.12);
  transform: scale(1.1);
}

#cardModalContent .card-delete-btn {
  display: none;
}

.card-share-btn {
  position: absolute;
  bottom: 8px;
  right: 80px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(42,110,80,0.2);
  color: #2a6e50;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.5;
  transition: opacity 0.15s ease, background 0.15s ease, transform 0.15s ease;
  z-index: 3;
  padding: 0;
}
.memory-card:hover .card-share-btn {
  opacity: 1;
}
.card-share-btn--active {
  opacity: 1;
  background: rgba(42,110,80,0.15);
  border-color: rgba(42,110,80,0.5);
  color: #1e7a4a;
}
.card-share-btn:hover {
  background: rgba(42,110,80,0.1);
  transform: scale(1.1);
}
#cardModalContent .card-share-btn {
  display: none;
}
@media (max-width: 768px) {
  .card-share-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
}

.btn-share-album {
  margin-left: auto;
  background: none;
  border: 1px solid var(--border-soft);
  border-radius: 99px;
  padding: 6px 14px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-moss);
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-share-album:hover {
  background: rgba(139,157,131,0.12);
}

.share-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.share-modal-overlay.active {
  display: flex;
}
.share-modal-card {
  background: var(--panel-color);
  border-radius: 16px;
  padding: 28px 24px 24px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lift);
  position: relative;
}
.share-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 22px;
  color: var(--muted-ink);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}
.share-modal-icon {
  font-size: 32px;
  margin-bottom: 8px;
}
.share-modal-title {
  font-family: var(--font-serif);
  font-size: 19px;
  color: var(--ink-color);
  margin: 0 0 4px;
}
.share-modal-subtitle {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--muted-ink);
  margin: 0 0 20px;
}
.share-url-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.share-url-input {
  flex: 1;
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 9px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--bg-color);
  color: var(--ink-color);
  outline: none;
}
.share-copy-btn {
  background: var(--accent-moss);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}
.share-copy-btn:hover {
  opacity: 0.85;
}
.share-fb-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  background: #1877f2;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 14px;
  cursor: pointer;
  margin-bottom: 10px;
  transition: opacity 0.15s ease;
}
.share-fb-btn:hover {
  opacity: 0.88;
}
.share-revoke-btn {
  background: none;
  border: none;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--muted-ink);
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}
.share-revoke-btn:hover {
  color: #9b2020;
}
.share-modal-loading {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--muted-ink);
  text-align: center;
  padding: 12px 0;
}
.share-hint {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--muted-ink);
  margin: 10px 0 12px;
  line-height: 1.5;
}
.share-expiry-label {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--muted-ink);
  margin: 0 0 12px;
}
.share-duration-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.share-duration-label {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--muted-ink);
  white-space: nowrap;
}
.share-duration-select {
  flex: 1;
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 7px 10px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--bg-color);
  color: var(--ink-color);
  outline: none;
  cursor: pointer;
}
.share-update-btn {
  background: var(--accent-moss);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}
.share-update-btn:hover {
  opacity: 0.85;
}

.card-edit-btn {
  position: absolute;
  bottom: 8px;
  right: 44px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(42,90,120,0.2);
  color: #2a5a78;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.5;
  transition: opacity 0.15s ease, background 0.15s ease, transform 0.15s ease;
  z-index: 3;
  padding: 0;
}
.memory-card:hover .card-edit-btn {
  opacity: 1;
}
.card-edit-btn:hover {
  background: rgba(42,90,120,0.1);
  transform: scale(1.1);
}
#cardModalContent .card-edit-btn {
  display: none;
}
@media (max-width: 768px) {
  .card-edit-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
}

.albums-view { width: 100%; }

.btn-back {
  background: none;
  border: 1px solid var(--border-soft);
  border-radius: 99px;
  padding: 6px 14px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  color: var(--muted-ink);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}
.btn-back:hover {
  color: var(--ink-color);
  border-color: var(--accent-moss);
  background: rgba(139,157,131,0.08);
}

.albums-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 16px;
}

.albums-loading {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--muted-ink);
  padding: 24px 0;
}

.albums-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 24px;
  font-family: var(--font-sans);
  color: var(--muted-ink);
  font-size: 14px;
  line-height: 1.7;
}

.album-card {
  background: var(--paper-white);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06), 0 0 0 0 rgba(45,106,79,0);
  transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.22s ease;
  position: relative;
}
.album-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.10), 0 0 0 2px var(--accent-sage);
}

.album-cover {
  width: 100%;
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, var(--accent-sage) 0%, var(--accent-moss) 100%);
  position: relative;
  overflow: hidden;
}
.album-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.album-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  opacity: 0.6;
}
.album-cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.45) 0%, transparent 60%);
}

.album-info {
  padding: 12px 14px 14px;
}
.album-title {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-color);
  margin: 0 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.album-desc {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--muted-ink);
  margin: 2px 0 4px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.4;
}
.album-meta {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--muted-ink);
  font-weight: 600;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.album-shared-badge {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-moss);
  border: 1px solid var(--accent-moss);
  border-radius: 99px;
  padding: 1px 7px;
}
.album-detail-heading {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
  pointer-events: none;
}
.album-detail-desc {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--muted-ink);
  margin: 0;
}

.album-delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0,0,0,0.35);
  border: none;
  color: white;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease;
}
.album-card:hover .album-delete-btn { opacity: 1; }
.album-delete-btn:hover { background: rgba(155,32,32,0.8); }

.modal-card--album { max-width: 460px; }

.nav-item {
  background: none;
  border: none;
  cursor: pointer;
}

