/* Page Timeline, Year Picker Wheel & Month Grid */
#panel-timeline .month-stage {
  min-height: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}

#panel-timeline .month-shell {
  padding: 10px 0 0;
}

#panel-timeline .month-progress {
  position: relative;
  min-height: 16px;
  justify-content: center;
  margin: 3px 2px 10px;
  display: flex;
  align-items: center;
}

#panel-timeline .month-progress .dots {
  margin-inline: auto;
  display: flex;
  gap: 3px;
}

.dot {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: rgba(159, 112, 132, 0.3);
}

.dot.active {
  width: 15px;
  background: var(--pink);
}

#panel-timeline .month-progress #monthPosition {
  position: absolute;
  right: 2px;
  font-size: 9px;
  font-weight: 800;
  color: var(--muted);
}

.timeline-card {
  padding: 11px;
  border-radius: 27px;
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
}

.timeline-toolbar {
  margin-bottom: 8px;
  padding: 3px 2px 8px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.timeline-info b {
  display: block;
  font-size: 13px;
}

.timeline-info small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.year-display {
  min-width: 70px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(255, 95, 158, 0.28);
  border-radius: 12px;
  background: var(--solid);
  color: var(--text);
  font-weight: 950;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.month-arrow {
  width: 34px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: var(--solid);
  font-size: 18px;
  font-weight: 900;
}

.month-tabs {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 8px 10px 14px;
  margin-bottom: -6px;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  cursor: grab;
}

.month-tabs::-webkit-scrollbar {
  display: none;
}

.month-tab {
  position: relative;
  min-width: 69px;
  height: 41px;
  padding: 0 9px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--muted);
  background: var(--solid);
  font-size: 10px;
  font-weight: 850;
  scroll-snap-align: center;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.month-tab.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--pink), var(--pink2));
  box-shadow: 0 3px 10px rgba(255, 61, 137, 0.22), 0 0 6px rgba(255, 95, 158, 0.14);
  transform: translateY(-2px);
}

.month-tab.has:after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--pink);
}

.month-tab.active.has:after {
  background: #fff;
}

.month-head {
  margin-bottom: 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.month-head small {
  display: block;
  color: var(--pink);
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

.month-head h3 {
  margin: 3px 0 0;
  font-size: 18px;
  font-weight: 850;
}

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

.memory {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
}

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

.memory-num {
  position: absolute;
  top: 6px;
  left: 6px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  font-size: 8px;
  font-weight: 900;
  display: grid;
  place-items: center;
  pointer-events: auto;
  cursor: default;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.memory-caption {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  padding: 6px 8px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.58);
  color: #fff;
  font-size: 10px;
  line-height: 1.3;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.add-memory {
  min-height: 120px;
  aspect-ratio: 1 / 1;
  border: 1.5px dashed var(--line);
  border-radius: 18px;
  background: rgba(255, 95, 158, 0.04);
  color: var(--pink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.add-memory span {
  font-size: 24px;
}

.add-memory b {
  font-size: 12px;
}

.add-memory small {
  font-size: 8px;
  color: var(--muted);
}

/* Year Picker Wheel */
.year-wheel {
  height: 180px;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  text-align: center;
}

.year-option {
  height: 44px;
  line-height: 44px;
  font-size: 16px;
  font-weight: 800;
  color: var(--muted);
  scroll-snap-align: center;
  transition: 0.18s ease;
}

.year-option.selected {
  font-size: 22px;
  font-weight: 950;
  color: var(--pink);
}

@media (min-width: 900px) {
  #panel-timeline .month-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
