/* ========================================
   RESET & VARIABLES
   ======================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --cream: #faf5ee;
  --cream-dark: #f3ead8;
  --peach: #f4c2a1;
  --peach-light: #fbe0cf;
  --peach-lighter: #fef0e6;
  --coral: #e8957a;
  --coral-soft: #f0a890;
  --brown-dark: #5c3d2e;
  --brown-medium: #7a5c4f;
  --brown-light: #a08272;
  --brown-muted: #bfa393;
  --white: #fffdf9;
  --danger: #c65d5d;
  --shadow-soft: 0 2px 12px rgba(92,61,46,.08);
  --shadow-card: 0 3px 16px rgba(92,61,46,.10), 0 1px 4px rgba(92,61,46,.06);
  --shadow-elevated: 0 8px 32px rgba(92,61,46,.15), 0 2px 8px rgba(92,61,46,.08);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --font-head: 'Quicksand', sans-serif;
  --font-body: 'Nunito', sans-serif;
  --font-script: 'Caveat', cursive;
}

html { font-size: 18px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--brown-dark);
  line-height: 1.6;
  min-height: 100dvh;
  overflow-x: hidden;
}

h1, h2, h3 { font-family: var(--font-head); font-weight: 700; line-height: 1.2; }
button { font-family: var(--font-body); cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: var(--font-body); }

.hidden { display: none !important; }

/* ========================================
   SCREENS
   ======================================== */
.screen { display: none; min-height: 100dvh; }
.screen.active { display: block; }
.screen.passcode-screen.active { display: flex; }

/* ========================================
   PASSCODE SCREEN
   ======================================== */
.passcode-screen {
  flex-direction: column; align-items: center; justify-content: center;
  min-height: 100dvh; padding: 2rem; text-align: center;
  background: linear-gradient(160deg, var(--cream) 0%, var(--peach-lighter) 50%, var(--cream-dark) 100%);
}

.passcode-logo {
  width: 120px; height: 120px; border-radius: 50%;
  background: linear-gradient(135deg, var(--peach), var(--coral-soft));
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.5rem; box-shadow: var(--shadow-card);
}

.passcode-title {
  font-family: var(--font-script); font-size: 2.8rem; font-weight: 700;
  color: var(--brown-dark); margin-bottom: .25rem; line-height: 1.2;
}

.passcode-subtitle {
  font-family: var(--font-head); font-size: 1.1rem; color: var(--brown-light);
  margin-bottom: 2.5rem; font-weight: 500;
}

.passcode-box {
  background: var(--white); border-radius: var(--radius-lg); padding: 2rem;
  box-shadow: var(--shadow-elevated); width: 100%; max-width: 360px;
}

.passcode-label {
  font-family: var(--font-head); font-size: 1rem; font-weight: 600;
  color: var(--brown-medium); margin-bottom: .75rem; display: block; text-align: left;
}

.passcode-input {
  width: 100%; padding: 1rem 1.25rem; font-size: 1.2rem;
  border: 2px solid var(--cream-dark); border-radius: var(--radius-md);
  background: var(--cream); color: var(--brown-dark);
  text-align: center; letter-spacing: .3em; outline: none;
  transition: border-color .2s;
}
.passcode-input:focus { border-color: var(--peach); }
.passcode-input::placeholder { letter-spacing: .15em; color: var(--brown-muted); }

.passcode-btn {
  width: 100%; margin-top: 1.25rem; padding: 1rem;
  background: linear-gradient(135deg, var(--peach), var(--coral-soft));
  border: none; border-radius: var(--radius-md);
  font-family: var(--font-head); font-size: 1.1rem; font-weight: 700; color: var(--white);
  cursor: pointer; transition: transform .15s, box-shadow .15s; box-shadow: var(--shadow-soft);
}
.passcode-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-card); }
.passcode-btn:active { transform: translateY(0); }
.passcode-btn:disabled { opacity: .5; cursor: default; }

.passcode-error {
  color: var(--danger); font-size: .9rem; font-weight: 600; margin-top: .75rem;
}

.passcode-footer { margin-top: 2rem; font-size: .85rem; color: var(--brown-muted); }

.passcode-admin-link {
  margin-top: 1rem; font-size: .85rem; color: var(--brown-muted);
  cursor: pointer; text-decoration: underline;
  transition: color .2s;
}
.passcode-admin-link:hover { color: var(--brown-medium); }

/* ========================================
   ALBUM SCREEN
   ======================================== */
.album-screen { background: var(--cream); padding-bottom: 5rem; }

.album-header {
  background: linear-gradient(160deg, var(--peach-lighter), var(--cream));
  padding: 2rem 1.5rem 1.5rem; text-align: center;
  border-bottom: 1px solid var(--cream-dark);
}

.album-avatar {
  width: 100px; height: 100px; border-radius: 50%;
  background: linear-gradient(135deg, var(--peach), var(--coral-soft));
  margin: 0 auto 1rem; box-shadow: var(--shadow-card); border: 4px solid var(--white);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-script); font-size: 2.8rem; color: var(--white);
}

.album-baby-name {
  font-family: var(--font-script); font-size: 2.6rem; font-weight: 700;
  color: var(--brown-dark); line-height: 1.1;
}

.album-baby-age {
  font-family: var(--font-head); font-size: 1.15rem; font-weight: 600;
  color: var(--coral); margin-top: .25rem;
}

.album-photo-count {
  font-size: .95rem; color: var(--brown-light); margin-top: .5rem;
}

/* Toolbar */
.album-toolbar {
  display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem;
  padding: .75rem 1rem; background: var(--white);
  border-bottom: 1px solid var(--cream-dark);
  position: sticky; top: 0; z-index: 10;
}

.toolbar-btn {
  display: flex; align-items: center; gap: .35rem;
  padding: .5rem .85rem; border: 2px solid var(--cream-dark); border-radius: 50px;
  background: var(--white); font-family: var(--font-head);
  font-size: .8rem; font-weight: 600; color: var(--brown-medium);
  transition: all .15s; white-space: nowrap;
}
.toolbar-btn:hover { border-color: var(--peach); color: var(--brown-dark); }
.toolbar-btn svg { width: 18px; height: 18px; }

.toolbar-btn.primary-btn {
  background: linear-gradient(135deg, var(--peach), var(--coral-soft));
  border-color: transparent; color: var(--white);
}

/* New photos banner */
.new-photos-banner {
  margin: 1.25rem 1.5rem 0; padding: 1rem 1.25rem;
  background: linear-gradient(135deg, var(--peach-lighter), #fff5ef);
  border: 2px solid var(--peach); border-radius: var(--radius-md);
  display: flex; align-items: center; gap: .75rem;
  cursor: pointer; transition: transform .15s;
}
.new-photos-banner:hover { transform: translateY(-1px); }

.new-photos-dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--coral);
  flex-shrink: 0; animation: pulse-dot 2s ease-in-out infinite;
}

.new-photos-text { font-weight: 600; color: var(--brown-dark); font-size: 1rem; }
.new-photos-text span { color: var(--coral); font-weight: 700; }
.new-photos-arrow { margin-left: auto; color: var(--coral); font-size: 1.2rem; }

/* Timeline */
.timeline { padding: 1.5rem; max-width: 1000px; margin: 0 auto; }

.milestone-section { margin-bottom: 2.5rem; animation: fadeUp .4s ease-out backwards; }

.milestone-header {
  display: flex; align-items: center; gap: .75rem;
  margin-bottom: 1.25rem; padding-bottom: .75rem;
  border-bottom: 2px dashed var(--cream-dark);
}

.milestone-icon {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--peach), var(--coral-soft));
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 1.3rem;
}

.milestone-title {
  font-family: var(--font-head); font-size: 1.3rem; font-weight: 700;
  color: var(--brown-dark);
}

.milestone-date { font-size: .9rem; color: var(--brown-light); font-weight: 500; }

/* Journal entries */
.journal-entry {
  background: var(--white); border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem; margin-bottom: 1.25rem;
  box-shadow: var(--shadow-soft); border-left: 4px solid var(--peach);
  position: relative;
}
.journal-entry::before {
  content: '\201C'; font-family: var(--font-script); font-size: 3rem;
  color: var(--peach); position: absolute; top: -.1rem; left: .75rem; line-height: 1;
}

.journal-text {
  font-family: var(--font-script); font-size: 1.35rem; color: var(--brown-medium);
  line-height: 1.5; padding-left: 1.25rem;
}

.journal-author {
  font-family: var(--font-body); font-size: .85rem; color: var(--brown-muted);
  margin-top: .5rem; text-align: right;
}

.journal-actions {
  display: flex; gap: .5rem; justify-content: flex-end; margin-top: .5rem;
}

.journal-action-btn {
  font-size: .8rem; color: var(--brown-muted); padding: .25rem .5rem;
  border-radius: 6px; transition: all .15s;
}
.journal-action-btn:hover { background: var(--peach-lighter); color: var(--coral); }

.add-journal-btn {
  display: flex; align-items: center; gap: .5rem;
  padding: .75rem 1rem; margin-bottom: 1.25rem;
  border: 2px dashed var(--cream-dark); border-radius: var(--radius-md);
  color: var(--brown-muted); font-size: .9rem; width: 100%;
  transition: all .15s;
}
.add-journal-btn:hover { border-color: var(--peach); color: var(--coral); }

/* Polaroid grid */
.polaroid-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1.25rem;
}

.polaroid {
  background: var(--white); border-radius: var(--radius-sm);
  padding: .6rem .6rem 0; box-shadow: var(--shadow-card);
  cursor: pointer; transition: transform .2s, box-shadow .2s;
  transform: rotate(var(--tilt, 0deg));
}
.polaroid:hover { transform: rotate(0deg) translateY(-4px); box-shadow: var(--shadow-elevated); }

.polaroid-photo {
  width: 100%; aspect-ratio: 1; border-radius: 4px;
  overflow: hidden; position: relative; background: var(--cream-dark);
}
.polaroid-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.age-badge {
  position: absolute; bottom: 8px; left: 8px;
  background: rgba(92,61,46,.82); backdrop-filter: blur(6px);
  color: #fff; font-family: var(--font-head); font-weight: 700;
  font-size: .8rem; padding: .3rem .65rem; border-radius: 50px; line-height: 1.2;
}

.polaroid-caption { padding: .65rem .25rem .75rem; text-align: center; }
.polaroid-caption .caption-text {
  font-family: var(--font-script); font-size: 1.1rem; color: var(--brown-medium); line-height: 1.3;
}
.polaroid-caption .caption-date {
  font-family: var(--font-body); font-size: .7rem; color: var(--brown-muted); margin-top: .15rem;
}

/* Empty state */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  padding: 3rem 1.5rem; text-align: center;
}
.empty-state svg { margin-bottom: 1.5rem; }
.empty-state h2 { font-size: 1.5rem; margin-bottom: .5rem; }
.empty-state p { color: var(--brown-light); max-width: 360px; margin-bottom: 1rem; }

/* ========================================
   VERTICAL TIMELINE VIEW ("photos on a string")
   ======================================== */
.vtimeline { padding: 1.5rem 1rem 1.5rem 0; max-width: 700px; margin: 0 auto; }

.vt-item {
  display: flex; gap: 0; min-height: 80px;
  animation: fadeUp .4s ease-out backwards;
}

.vt-rail {
  display: flex; flex-direction: column; align-items: center;
  width: 60px; flex-shrink: 0; position: relative;
}

.vt-dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--coral); border: 3px solid var(--peach-light);
  flex-shrink: 0; z-index: 1; margin-top: 8px;
}

.vt-line {
  width: 2px; flex: 1; background: linear-gradient(to bottom, var(--peach), var(--cream-dark));
  min-height: 20px;
}
.vt-item:last-child .vt-line { display: none; }

.vt-date {
  position: absolute; top: 4px; right: calc(50% + 14px);
  font-family: var(--font-head); font-size: .7rem; font-weight: 700;
  color: var(--brown-muted); white-space: nowrap; text-align: right;
}

.vt-content {
  flex: 1; min-width: 0; padding: 0 0 1.5rem .5rem;
}

.vt-age-label {
  font-family: var(--font-head); font-size: .75rem; font-weight: 700;
  color: var(--coral); margin-bottom: .35rem;
}

.vt-photo {
  width: 100%; max-width: 360px;
  background: var(--white); border-radius: var(--radius-sm);
  padding: .5rem .5rem 0; box-shadow: var(--shadow-card);
  cursor: pointer; transition: transform .2s, box-shadow .2s;
}
.vt-photo:hover { transform: translateY(-2px); box-shadow: var(--shadow-elevated); }

.vt-photo-img {
  width: 100%; border-radius: 4px; overflow: hidden;
}
.vt-photo-img img {
  width: 100%; display: block; border-radius: 4px;
}

.vt-photo-caption {
  padding: .5rem .25rem .6rem; text-align: center;
}
.vt-photo-caption .caption-text {
  font-family: var(--font-script); font-size: 1.05rem; color: var(--brown-medium); line-height: 1.3;
}

/* Date group header in vertical timeline */
.vt-date-group {
  display: flex; gap: 0; align-items: center; margin-bottom: .25rem;
}

.vt-date-group .vt-rail { width: 60px; }

.vt-group-dot {
  width: 20px; height: 20px; border-radius: 50%;
  background: linear-gradient(135deg, var(--peach), var(--coral-soft));
  display: flex; align-items: center; justify-content: center;
  font-size: .6rem; z-index: 1; box-shadow: var(--shadow-soft);
}

.vt-group-label {
  font-family: var(--font-head); font-size: .85rem; font-weight: 700;
  color: var(--brown-dark); padding: .4rem 0 .4rem .5rem;
}

/* View toggle tab in toolbar */
.view-toggle {
  display: flex; background: var(--cream-dark); border-radius: 50px;
  padding: 2px; gap: 2px;
}
.view-toggle-btn {
  padding: .4rem .7rem; border-radius: 50px;
  font-family: var(--font-head); font-size: .75rem; font-weight: 600;
  color: var(--brown-muted); transition: all .15s; display: flex;
  align-items: center; gap: .3rem;
}
.view-toggle-btn.active {
  background: var(--white); color: var(--brown-dark); box-shadow: var(--shadow-soft);
}
.view-toggle-btn svg { width: 14px; height: 14px; }

@media (max-width: 480px) {
  .vt-rail { width: 45px; }
  .vt-date { font-size: .6rem; right: calc(50% + 12px); }
  .vt-photo { max-width: 100%; }
  .view-toggle-btn span { display: none; }
}

/* ========================================
   LIGHTBOX
   ======================================== */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(40,25,18,.92); backdrop-filter: blur(8px);
  display: none; flex-direction: column; align-items: center; justify-content: center;
  padding: 1rem;
}
.lightbox.active { display: flex; }

.lightbox-close {
  position: absolute; top: 1rem; right: 1rem;
  background: rgba(255,255,255,.15); border-radius: 50%;
  width: 52px; height: 52px; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.5rem; transition: background .15s; z-index: 2;
}
.lightbox-close:hover { background: rgba(255,255,255,.25); }

.lightbox-content { max-width: 700px; width: 100%; }

.lightbox-img {
  width: 100%; max-height: 70vh; object-fit: contain;
  border-radius: var(--radius-md); box-shadow: 0 8px 40px rgba(0,0,0,.3);
}

.lightbox-info { margin-top: 1.25rem; text-align: center; color: #fff; }

.lightbox-age-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--peach), var(--coral-soft));
  font-family: var(--font-head); font-weight: 700; font-size: 1rem;
  padding: .4rem 1rem; border-radius: 50px; color: var(--white); margin-bottom: .75rem;
}

.lightbox-caption {
  font-family: var(--font-script); font-size: 1.6rem;
  color: rgba(255,255,255,.95); line-height: 1.4; margin-bottom: .3rem;
}

.lightbox-date {
  font-family: var(--font-body); font-size: .9rem; color: rgba(255,255,255,.55);
}

.lightbox-nav {
  position: fixed; top: 50%; display: flex; z-index: 2;
}

.lightbox-arrow {
  position: fixed; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.12); border-radius: 50%;
  width: 52px; height: 52px; display: flex; align-items: center; justify-content: center;
  color: #fff; transition: background .15s;
}
.lightbox-arrow:hover { background: rgba(255,255,255,.22); }
.lightbox-arrow.prev { left: 1rem; }
.lightbox-arrow.next { right: 1rem; }

.lightbox-counter {
  font-family: var(--font-head); font-weight: 600; font-size: .9rem;
  color: rgba(255,255,255,.4); margin-top: .75rem;
}

/* Admin controls in lightbox */
.lightbox-admin-controls {
  display: flex; justify-content: center; gap: 1rem; margin-top: 1rem;
}

.lightbox-admin-btn {
  padding: .4rem 1rem; border-radius: 8px; font-size: .85rem;
  font-weight: 600; color: rgba(255,255,255,.7); transition: all .15s;
}
.lightbox-admin-btn:hover { color: #fff; background: rgba(255,255,255,.12); }
.lightbox-admin-btn.delete-btn:hover { color: var(--danger); }

/* ========================================
   SLIDESHOW
   ======================================== */
.slideshow {
  position: fixed; inset: 0; z-index: 110;
  background: #0d0a08; display: none;
}
.slideshow.active { display: block; }

.ss-slide {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 1.2s ease; overflow: hidden;
}
.ss-slide.ss-active { opacity: 1; }
.ss-slide img {
  width: 100%; height: 100%; object-fit: contain;
}
.ss-slide.ss-active img { animation: slowZoom 7s ease-in-out forwards; }
.ss-slide:nth-child(even).ss-active img { animation: slowZoomAlt 7s ease-in-out forwards; }

.ss-progress {
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: rgba(255,255,255,.1); z-index: 3;
}
.ss-bar {
  height: 100%; background: var(--coral); transition: width .4s ease; border-radius: 0 2px 2px 0;
}

.ss-info {
  position: absolute; bottom: 88px; left: 0; right: 0; z-index: 3;
  text-align: center; color: rgba(255,255,255,.9);
  text-shadow: 0 2px 12px rgba(0,0,0,.5);
}
.ss-caption { font-family: var(--font-script); font-size: 1.6rem; }
.ss-date { font-size: .85rem; opacity: .6; margin-top: .25rem; }
.ss-age { font-size: .9rem; opacity: .5; font-family: var(--font-head); font-weight: 600; margin-top: .1rem; }

.ss-controls {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 1rem; z-index: 3;
}

.ss-btn {
  width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; color: rgba(255,255,255,.8);
  background: rgba(255,255,255,.08); transition: background .2s;
}
.ss-btn:hover { background: rgba(255,255,255,.18); }
.ss-btn.ss-play { width: 56px; height: 56px; }

.ss-counter {
  position: absolute; bottom: 36px; right: 24px;
  color: rgba(255,255,255,.35); font-size: .85rem;
  font-family: var(--font-head); font-weight: 600; z-index: 3;
}

.ss-close {
  position: absolute; top: 1rem; right: 1rem; z-index: 3;
  width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; color: rgba(255,255,255,.7);
  background: rgba(255,255,255,.08); transition: background .2s;
}
.ss-close:hover { background: rgba(255,255,255,.18); }

/* ========================================
   MODALS
   ======================================== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 120;
  display: none; place-items: center; padding: 1.5rem;
  background: rgba(30,24,20,.4); backdrop-filter: blur(4px);
}
.modal-overlay.active { display: grid; }

.modal-card {
  background: var(--white); border-radius: 22px;
  padding: 2rem; width: 100%; max-width: 440px;
  box-shadow: var(--shadow-elevated); animation: fadeUp .3s ease-out;
  max-height: 90vh; overflow-y: auto;
}

.modal-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem;
}
.modal-header h2 { font-size: 1.2rem; }

.modal-close {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; color: var(--brown-muted); border-radius: 50%; transition: background .2s;
}
.modal-close:hover { background: var(--peach-lighter); }

.form-group { margin-bottom: 1rem; }
.form-label {
  display: block; font-size: .85rem; font-weight: 600;
  color: var(--brown-light); margin-bottom: .4rem; letter-spacing: .02em;
}

.form-input {
  width: 100%; padding: .85rem 1rem; font-size: 1rem; color: var(--brown-dark);
  background: var(--cream); border: 2px solid var(--cream-dark); border-radius: var(--radius-md);
  outline: none; transition: border-color .2s;
}
.form-input:focus { border-color: var(--peach); }

.form-textarea {
  width: 100%; padding: .85rem 1rem; font-size: 1rem; color: var(--brown-dark);
  background: var(--cream); border: 2px solid var(--cream-dark); border-radius: var(--radius-md);
  outline: none; resize: vertical; min-height: 80px;
  font-family: var(--font-script); font-size: 1.2rem;
  transition: border-color .2s;
}
.form-textarea:focus { border-color: var(--peach); }

.form-btn {
  width: 100%; padding: .85rem; margin-top: .5rem;
  background: linear-gradient(135deg, var(--peach), var(--coral-soft));
  border: none; border-radius: var(--radius-md);
  font-family: var(--font-head); font-size: 1rem; font-weight: 700; color: var(--white);
  cursor: pointer; transition: transform .15s; box-shadow: var(--shadow-soft);
}
.form-btn:hover { transform: translateY(-1px); }
.form-btn:disabled { opacity: .5; cursor: default; transform: none; }

.form-btn.secondary {
  background: var(--cream); color: var(--brown-medium);
  box-shadow: none; border: 2px solid var(--cream-dark);
}
.form-btn.secondary:hover { border-color: var(--peach); }

.form-btn.danger { background: var(--danger); }

.upload-previews {
  display: flex; gap: .5rem; overflow-x: auto; padding: .5rem 0; margin-bottom: .5rem;
}
.upload-preview-img {
  width: 70px; height: 70px; object-fit: cover; border-radius: var(--radius-sm); flex-shrink: 0;
}

/* Settings sections */
.settings-section {
  margin-bottom: 1.5rem; padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--cream-dark);
}
.settings-section:last-child { border-bottom: none; margin-bottom: 0; }
.settings-section h3 {
  font-size: 1rem; color: var(--brown-light); margin-bottom: 1rem;
  text-transform: uppercase; letter-spacing: .04em; font-size: .8rem;
}

/* ========================================
   MILESTONE PINNED PHOTOS
   ======================================== */
.polaroid.pinned {
  position: relative;
  box-shadow: 0 0 0 3px var(--coral), var(--shadow-card);
}
.polaroid.pinned:hover {
  box-shadow: 0 0 0 3px var(--coral), var(--shadow-elevated);
}

.pin-badge {
  position: absolute; top: -6px; right: -6px; z-index: 2;
  background: var(--coral); color: #fff;
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; box-shadow: var(--shadow-soft);
}

.milestone-label-tag {
  display: inline-block; margin-top: .25rem;
  background: linear-gradient(135deg, var(--peach), var(--coral-soft));
  color: var(--white); font-family: var(--font-head); font-weight: 700;
  font-size: .7rem; padding: .2rem .55rem; border-radius: 50px;
  letter-spacing: .01em;
}

/* Lightbox milestone controls */
.milestone-toggle {
  display: flex; align-items: center; gap: .5rem; justify-content: center;
  margin-top: .75rem;
}

.milestone-pin-btn {
  display: flex; align-items: center; gap: .35rem;
  padding: .4rem .85rem; border-radius: 50px; font-size: .8rem; font-weight: 600;
  color: rgba(255,255,255,.7); transition: all .15s;
  border: 1.5px solid rgba(255,255,255,.2);
}
.milestone-pin-btn:hover { color: #fff; border-color: rgba(255,255,255,.4); }
.milestone-pin-btn.is-pinned {
  background: var(--coral); border-color: var(--coral); color: #fff;
}

.milestone-label-input {
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
  color: #fff; padding: .4rem .75rem; border-radius: 10px; font-size: .85rem;
  outline: none; font-family: var(--font-body); width: 200px; text-align: center;
}
.milestone-label-input:focus { border-color: var(--coral); }
.milestone-label-input::placeholder { color: rgba(255,255,255,.4); }

.milestone-colors {
  display: flex; gap: .35rem; justify-content: center; margin-top: .25rem;
}
.ms-color-btn {
  width: 30px; height: 30px; border-radius: 50%; font-size: .85rem;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid rgba(255,255,255,.2); transition: all .15s;
  background: none; cursor: pointer;
}
.ms-color-btn:hover { border-color: rgba(255,255,255,.5); transform: scale(1.15); }
.ms-color-btn.active { border-color: var(--coral); box-shadow: 0 0 0 2px var(--coral); }

/* ========================================
   EMOJI PICKER
   ======================================== */
.emoji-picker {
  position: absolute; z-index: 130;
  background: var(--white); border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevated); padding: .6rem;
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px;
  max-width: 300px; animation: fadeUp .15s ease-out;
}

.emoji-opt {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; border-radius: 8px; transition: background .1s;
  cursor: pointer; border: none; background: none;
}
.emoji-opt:hover { background: var(--peach-lighter); }

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .6; transform: scale(.8); }
}
@keyframes slowZoom {
  from { transform: scale(1) translate(0,0); }
  to { transform: scale(1.1) translate(1.5%,1%); }
}
@keyframes slowZoomAlt {
  from { transform: scale(1.08) translate(1%,1%); }
  to { transform: scale(1) translate(-1%,-.5%); }
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%,60% { transform: translateX(-8px); }
  40%,80% { transform: translateX(8px); }
}
.shake { animation: shake .4s ease-in-out; }

/* ========================================
   RESPONSIVE
   ======================================== */
@media (min-width: 600px) {
  .polaroid-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.5rem; }
}

@media (max-width: 480px) {
  .toolbar-btn span { display: none; }
  .toolbar-btn { padding: .55rem .7rem; }
  .toolbar-btn svg { width: 20px; height: 20px; }
}

@media (max-width: 420px) {
  html { font-size: 16px; }
  .passcode-title { font-size: 2.2rem; }
  .album-baby-name { font-size: 2.2rem; }
  .polaroid-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .milestone-title { font-size: 1.15rem; }
  .lightbox-arrow { width: 44px; height: 44px; }
  .lightbox-arrow.prev { left: .5rem; }
  .lightbox-arrow.next { right: .5rem; }
  .ss-caption { font-size: 1.3rem; }
  .ss-btn { width: 44px; height: 44px; }
  .ss-btn.ss-play { width: 50px; height: 50px; }
}
