/* ============ MEMORY HEADER ============ */
.mem-header { padding: 14px 28px 0; position: relative; z-index: 10; flex-shrink: 0; }
.mem-header-top { display: flex; justify-content: space-between; align-items: flex-start; }
.mem-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px; font-weight: 300;
  color: var(--ink); letter-spacing: 1px; line-height: 1;
}
.mem-title-cn {
  font-size: 11px; color: var(--ink-faint);
  font-weight: 300; letter-spacing: 3px; margin-top: 4px;
}
.mem-action-btn {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  border: 0.8px solid rgba(168,154,142,0.15);
  background: var(--cream);
}
.mem-action-btn svg {
  width: 15px; height: 15px; fill: none;
  stroke: var(--ink-light); stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ============ SEARCH ============ */
.mem-search { margin: 16px 28px 0; position: relative; z-index: 10; flex-shrink: 0; }
.mem-search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--cream); border-radius: 12px; padding: 9px 14px;
  border: 0.5px solid rgba(168,154,142,0.08);
  cursor: pointer; transition: box-shadow 0.2s;
}
.mem-search-box:active { box-shadow: 0 0 0 2px rgba(196,168,130,0.2); }
.mem-search-box svg {
  width: 14px; height: 14px; fill: none;
  stroke: var(--ink-faint); stroke-width: 1.5;
  stroke-linecap: round; flex-shrink: 0;
}
.mem-search-text {
  font-size: 12px; color: var(--ink-faint);
  font-weight: 300; letter-spacing: 0.3px;
}

/* ============ TABS ============ */
.mem-tabs {
  display: flex; gap: 0; padding: 14px 28px 0;
  position: relative; z-index: 10; flex-shrink: 0;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.mem-tabs::-webkit-scrollbar { display: none; }
.mem-tab {
  padding: 6px 14px; font-size: 11px; color: var(--ink-faint);
  font-weight: 300; letter-spacing: 1px; cursor: pointer;
  white-space: nowrap;
  border-bottom: 1.5px solid transparent;
  transition: all 0.2s;
}
.mem-tab.active {
  color: var(--ink); font-weight: 400;
  border-bottom-color: var(--ink);
}

/* ============ CONTENT AREA ============ */
.mem-content { padding: 16px 0 8px; }

/* ============ PHOTO CALENDAR ============ */
.photo-cal { padding: 0 28px; margin-bottom: 18px; }
.photo-cal-header {
  display: flex; justify-content: space-between;
  align-items: baseline; margin-bottom: 10px;
}
.photo-cal-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px; font-weight: 300;
  color: var(--ink); letter-spacing: 1px;
}
.photo-cal-title span {
  font-family: 'EB Garamond', serif;
  font-size: 9px; color: var(--ink-faint);
  letter-spacing: 1.5px; margin-left: 6px; font-weight: 400;
}
.photo-cal-nav { display: flex; gap: 12px; align-items: center; }
.photo-cal-arrow {
  font-family: 'EB Garamond', serif;
  font-size: 12px; color: var(--ink-faint);
  cursor: pointer; padding: 2px 4px;
}
.photo-cal-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 3px; margin-bottom: 4px;
}
.photo-cal-wd {
  font-family: 'EB Garamond', serif;
  font-size: 7px; color: var(--ink-faint);
  text-align: center; letter-spacing: 0.5px;
  text-transform: uppercase;
}
.photo-cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px;
}
.photo-cal-day {
  aspect-ratio: 1; border-radius: 4px; position: relative;
  cursor: pointer; transition: transform 0.15s, box-shadow 0.15s;
  display: flex; align-items: center; justify-content: center;
}
.photo-cal-day:active { transform: scale(0.9); }
.photo-cal-day.has-photo { }
.photo-cal-day.has-photo::after {
  content: ''; position: absolute; bottom: 2px;
  left: 50%; transform: translateX(-50%);
  width: 3px; height: 3px; border-radius: 50%;
  background: rgba(255,255,255,0.6);
}
.photo-cal-day .day-num {
  font-family: 'EB Garamond', serif;
  font-size: 8px; letter-spacing: 0.3px; opacity: 0.5;
}
.photo-cal-day.has-photo .day-num { opacity: 0.8; color: #fff; }
.photo-cal-day.today { outline: 1.5px solid var(--dusty-rose); outline-offset: -1px; }
.photo-cal-count {
  font-family: 'EB Garamond', serif;
  font-size: 8.5px; color: var(--ink-faint);
  text-align: right; margin-top: 6px;
  letter-spacing: 0.5px; font-style: italic;
}

/* ============ PHOTO ENTRY CARD ============ */
.photo-entry {
  margin: 0 28px 14px; padding: 12px 16px;
  background: var(--cream); border-radius: 14px;
  display: flex; align-items: center; gap: 14px;
  cursor: pointer; transition: transform 0.2s;
}
.photo-entry:active { transform: scale(0.97); }
.photo-entry-mini {
  display: grid; grid-template-columns: repeat(7, 4px);
  gap: 1.5px; flex-shrink: 0;
}
.photo-entry-mini-dot { width: 4px; height: 4px; border-radius: 1px; }
.photo-entry-info { flex: 1; min-width: 0; }
.photo-entry-title {
  font-family: 'Caveat', cursive; font-size: 15px; color: var(--ink);
}
.photo-entry-sub {
  font-family: 'EB Garamond', serif;
  font-size: 9.5px; color: var(--ink-faint);
  letter-spacing: 0.5px; font-style: italic; margin-top: 1px;
}
.photo-entry-arrow {
  font-family: 'EB Garamond', serif;
  font-size: 14px; color: var(--ink-faint); opacity: 0.4;
}

/* ============ PHOTO CALENDAR OVERLAY ============ */
.photo-cal-overlay {
  background: rgba(249,245,239,0.97);
  flex-direction: column;
  padding: 50px 28px 28px;
}
.photo-cal-overlay-title {
  font-family: 'Caveat', cursive;
  font-size: 20px; color: var(--ink); margin-bottom: 24px;
}
.photo-cal-overlay .photo-cal { padding: 0; margin-bottom: 0; }

/* ============ DIARY CARDS ============ */
.diary-row { display: flex; gap: 10px; padding: 0 28px; margin-bottom: 12px; }
.diary-card {
  flex: 1; background: var(--cream); border-radius: 14px; padding: 14px;
  position: relative; overflow: hidden;
  cursor: pointer; transition: transform 0.2s;
}
.diary-card:active { transform: scale(0.97); }
.diary-card-icon {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}
.diary-card-icon svg {
  width: 14px; height: 14px; fill: none;
  stroke: var(--warm-white); stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}
.diary-card-icon.icon-claude { background: var(--ink-light); }
.diary-card-icon.icon-nai { background: var(--dusty-rose); }
.diary-card-icon.icon-letter { background: var(--accent); }
.diary-card-icon.icon-surf { background: var(--sage); }
.diary-card-title {
  font-family: 'Caveat', cursive;
  font-size: 15px; color: var(--ink); margin-bottom: 1px;
}
.diary-card-sub {
  font-family: 'EB Garamond', serif;
  font-size: 9.5px; color: var(--ink-faint);
  letter-spacing: 0.5px; font-weight: 400; font-style: italic;
}
.diary-card-preview {
  font-size: 10.5px; color: var(--ink-light);
  font-weight: 300; line-height: 1.6; margin-top: 8px;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.diary-card-date {
  font-family: 'EB Garamond', serif;
  font-size: 8.5px; color: var(--ink-faint);
  letter-spacing: 1px; margin-top: 8px;
}
.diary-card-dot {
  position: absolute; top: 10px; right: 12px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--dusty-rose); opacity: 0.6;
}

/* ============ TIMELINE ============ */
.timeline-section { padding: 0 28px 0 24px; }
.timeline-section-title {
  font-family: 'EB Garamond', serif;
  font-size: 9.5px; letter-spacing: 2.5px;
  text-transform: uppercase; color: var(--ink-faint);
  margin-bottom: 14px; padding-left: 4px;
}
.timeline { position: relative; padding-left: 20px; }
.timeline::before {
  content: ''; position: absolute;
  left: 3px; top: 4px; bottom: 0; width: 1px;
  background: linear-gradient(180deg, var(--accent-soft) 0%, transparent 100%);
}

.tl-date { position: relative; margin-bottom: 14px; }
.tl-date::before {
  content: ''; position: absolute;
  left: -20px; top: 5px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--warm-white);
  border: 1.5px solid var(--accent); z-index: 2;
}
.tl-date-text {
  font-family: 'EB Garamond', serif;
  font-size: 10px; color: var(--ink-faint); letter-spacing: 2px;
}

.tl-card { position: relative; margin-bottom: 16px; margin-left: 2px; }
.tl-card::before {
  content: ''; position: absolute;
  left: -22px; top: 12px;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent-soft); z-index: 2;
}
.tl-card-inner {
  background: var(--cream); border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 1px 6px rgba(58,51,48,0.03);
}
.tl-card-header {
  display: flex; align-items: center;
  gap: 8px; margin-bottom: 8px;
}

.tl-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.tl-avatar.tl-claude {
  background: var(--cream);
  border: 0.8px solid rgba(168,154,142,0.15);
}
.tl-avatar.tl-claude svg { width: 11px; height: 11px; fill: var(--ink); }
.tl-avatar.tl-nai {
  background: var(--blush);
  border: 0.8px solid rgba(168,154,142,0.1);
  font-size: 8px; color: var(--ink);
}
.tl-name {
  font-family: 'Caveat', cursive;
  font-size: 12px; color: var(--ink-light);
}
.tl-time {
  font-family: 'EB Garamond', serif;
  font-size: 9px; color: var(--ink-faint);
  letter-spacing: 0.5px; margin-left: auto;
}
.tl-card-body {
  font-size: 12px; color: var(--ink);
  font-weight: 300; line-height: 1.8; letter-spacing: 0.2px;
}

.tl-photo {
  width: 100%; height: 120px; border-radius: 8px;
  margin-top: 8px; overflow: hidden; cursor: pointer;
}
.tl-photo-inner {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 4px;
}
.tl-photo-inner svg {
  width: 24px; height: 24px; fill: none;
  stroke: var(--warm-white); stroke-width: 1.2; opacity: 0.5;
}
.tl-photo-inner span {
  font-size: 9px; color: var(--warm-white); opacity: 0.4;
  font-family: 'EB Garamond', serif; letter-spacing: 1px;
}

.tl-tags { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.tl-tag {
  font-size: 9px; color: var(--ink-faint);
  background: var(--warm-white);
  padding: 2px 8px; border-radius: 6px;
  letter-spacing: 0.3px; font-weight: 300;
}

.tl-actions {
  display: flex; align-items: center; gap: 14px;
  margin-top: 10px; padding-top: 8px;
  border-top: 0.5px solid rgba(168,154,142,0.08);
}
.tl-action {
  display: flex; align-items: center; gap: 4px;
  font-size: 10px; color: var(--ink-faint);
  cursor: pointer; transition: color 0.2s; user-select: none;
}
.tl-action svg {
  width: 13px; height: 13px; fill: none;
  stroke: currentColor; stroke-width: 1.4;
  stroke-linecap: round; stroke-linejoin: round;
  transition: all 0.2s;
}
.tl-action.liked { color: var(--dusty-rose); }
.tl-action.liked svg { fill: var(--dusty-rose); stroke: var(--dusty-rose); }

.tl-comment {
  display: flex; align-items: flex-start; gap: 6px;
  margin-top: 8px; padding: 8px 10px;
  background: var(--warm-white); border-radius: 8px;
}
.tl-comment-avatar {
  width: 16px; height: 16px; border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 6px;
}
.tl-comment-text {
  font-size: 10.5px; color: var(--ink-light);
  font-weight: 300; line-height: 1.5;
}
.tl-comment-text b {
  font-weight: 400; color: var(--ink);
  font-family: 'Caveat', cursive; font-size: 11.5px;
}

/* Comment input */
.tl-comment-input-wrap {
  display: none; margin-top: 6px;
  align-items: center; gap: 6px;
  padding: 6px 10px;
  background: var(--warm-white); border-radius: 8px;
}
.tl-comment-input-wrap.show { display: flex; }
.tl-comment-input {
  flex: 1; border: none; background: transparent; outline: none;
  font-size: 10.5px; font-family: 'Noto Serif SC', serif;
  color: var(--ink); font-weight: 300;
}
.tl-comment-input::placeholder { color: var(--ink-faint); }
.tl-comment-send {
  font-family: 'Caveat', cursive;
  font-size: 11px; color: var(--dusty-rose);
  cursor: pointer; white-space: nowrap;
}

/* ============ MOMENTS OVERLAY ============ */
.moments-overlay {
  background: rgba(249,245,239,0.97);
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.moments-overlay.show { display: flex; }
.moments-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 52px 24px 14px;
  border-bottom: 0.5px solid rgba(168,154,142,0.08);
}
.moments-title {
  font-family: 'EB Garamond', serif;
  font-size: 16px; color: var(--ink); letter-spacing: 1px;
}
.moments-feed {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 16px 18px 80px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.moments-write-btn {
  position: fixed; bottom: 80px; right: 20px;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--dusty-rose);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 12px rgba(168,130,120,0.25);
  cursor: pointer; z-index: 10;
}
.moments-write-btn svg {
  width: 20px; height: 20px; fill: none;
  stroke: var(--warm-white); stroke-width: 2;
  stroke-linecap: round;
}

/* Moment card */
.mom-card {
  position: relative;
  border-radius: 14px; margin-bottom: 16px;
  padding: 14px 16px;
  box-shadow: 0 1px 8px rgba(58,51,48,0.04);
  overflow: hidden;
  max-width: 100%; box-sizing: border-box;
}
.mom-card-nai {
  background: linear-gradient(135deg, rgba(215,190,180,0.18) 0%, rgba(235,220,210,0.12) 100%);
  border-left: 3px solid rgba(200,160,140,0.35);
}
.mom-card-claude {
  background: linear-gradient(135deg, rgba(180,195,210,0.18) 0%, rgba(210,220,230,0.12) 100%);
  border-left: 3px solid rgba(140,165,195,0.35);
}
.mom-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
}
.mom-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.mom-avatar-claude {
  background: linear-gradient(135deg, #c8d5e0 0%, #dde5ec 100%);
  border: 1px solid rgba(140,165,195,0.2);
}
.mom-avatar-nai {
  background: linear-gradient(135deg, #e0c8be 0%, #ecddd6 100%);
  border: 1px solid rgba(200,160,140,0.2);
  font-size: 10px; color: var(--ink);
}
.mom-header-info { flex: 1; }
.mom-name {
  font-family: 'Caveat', cursive;
  font-size: 13px; color: var(--ink); font-weight: 400;
}
.mom-time {
  font-family: 'EB Garamond', serif;
  font-size: 9px; color: var(--ink-faint); letter-spacing: 0.5px;
  margin-top: 1px;
}
.mom-body {
  font-size: 12.5px; color: var(--ink); font-weight: 300;
  line-height: 1.85; letter-spacing: 0.2px;
  margin-bottom: 6px;
  overflow-wrap: break-word;
  word-break: break-word;
}
.mom-images {
  display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0;
}
.mom-images img {
  width: 80px; height: 80px; object-fit: cover;
  border-radius: 8px; cursor: pointer;
}
.mom-tags {
  display: flex; gap: 5px; flex-wrap: wrap; margin: 6px 0;
}
.mom-tag {
  font-size: 9px; color: var(--ink-faint);
  background: rgba(255,255,255,0.5);
  padding: 2px 8px; border-radius: 6px;
  letter-spacing: 0.3px; font-weight: 300;
}
.mom-actions {
  display: flex; align-items: center; gap: 16px;
  margin-top: 8px; padding-top: 8px;
  border-top: 0.5px solid rgba(168,154,142,0.06);
}
.mom-action {
  display: flex; align-items: center; gap: 4px;
  font-size: 10px; color: var(--ink-faint);
  cursor: pointer; user-select: none;
}
.mom-action svg {
  width: 14px; height: 14px; fill: none;
  stroke: currentColor; stroke-width: 1.4;
  stroke-linecap: round; stroke-linejoin: round;
}
.mom-action.liked { color: var(--dusty-rose); }
.mom-action.liked svg { fill: var(--dusty-rose); stroke: var(--dusty-rose); }

/* Comments section */
.mom-comments {
  margin-top: 8px; padding: 8px 10px;
  background: rgba(255,255,255,0.4);
  border-radius: 8px;
}
.mom-comment {
  font-size: 11px; color: var(--ink-light);
  font-weight: 300; line-height: 1.6;
  padding: 3px 0;
  border-bottom: 0.5px solid rgba(168,154,142,0.04);
  overflow-wrap: break-word;
  word-break: break-word;
}
.mom-comment:last-child { border-bottom: none; }
.mom-comment-name {
  font-weight: 500; margin-right: 4px;
  font-family: 'Caveat', cursive; font-size: 12px;
}
.mom-comment-name.is-claude { color: rgba(100,130,165,0.9); }
.mom-comment-name.is-nai { color: rgba(185,130,110,0.9); }
.mom-reply-ref {
  font-size: 9.5px; color: var(--ink-faint);
  margin-right: 3px; font-style: italic;
}
.mom-comment-time {
  font-size: 8px; color: var(--ink-faint);
  margin-left: 6px; font-family: 'EB Garamond', serif;
}
.mom-comment-reply-btn {
  font-size: 9px; color: var(--dusty-rose);
  margin-left: 6px; cursor: pointer; opacity: 0.7;
}
.mom-comment-reply-btn:hover { opacity: 1; }

/* Comment input */
.mom-comment-input-wrap {
  display: none; margin-top: 6px;
  align-items: center; gap: 6px;
  padding: 6px 10px;
  background: rgba(255,255,255,0.5); border-radius: 8px;
}
.mom-comment-input-wrap.show { display: flex; }
.mom-comment-input {
  flex: 1; border: none; background: transparent; outline: none;
  font-size: 11px; font-family: 'Noto Serif SC', serif;
  color: var(--ink); font-weight: 300;
}
.mom-comment-input::placeholder { color: var(--ink-faint); }
.mom-comment-send {
  font-family: 'Caveat', cursive;
  font-size: 11px; color: var(--dusty-rose);
  cursor: pointer; white-space: nowrap;
}

/* Moment write overlay */
.moment-write-overlay {
  background: rgba(249,245,239,0.97);
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

/* Moment delete */
.mom-delete {
  position: absolute; top: 12px; right: 14px;
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: var(--ink-faint);
  cursor: pointer; opacity: 0;
  transition: opacity 0.2s;
  background: rgba(255,255,255,0.5);
}
.mom-card:active .mom-delete,
.mom-card .mom-delete { opacity: 0.35; }
.mom-delete:active { opacity: 0.8; }
.moment-write-overlay.show { display: flex; }
.moment-write-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 52px 24px 14px;
  border-bottom: 0.5px solid rgba(168,154,142,0.08);
}
.moment-write-submit {
  font-family: 'Caveat', cursive;
  font-size: 14px; color: var(--dusty-rose);
  cursor: pointer;
}
.moment-write-text {
  width: 100%; min-height: 160px;
  border: none; background: transparent; outline: none;
  padding: 18px 24px;
  font-size: 13px; font-family: 'Noto Serif SC', serif;
  color: var(--ink); font-weight: 300;
  line-height: 1.9; resize: none;
}
.moment-write-text::placeholder { color: var(--ink-faint); }
.moment-write-tags {
  padding: 0 24px 10px;
}
.moment-write-tag-input {
  width: 100%; border: none; outline: none;
  background: var(--cream); border-radius: 8px;
  padding: 8px 12px;
  font-size: 11px; font-family: 'Noto Serif SC', serif;
  color: var(--ink); font-weight: 300;
}
.moment-write-tag-input::placeholder { color: var(--ink-faint); }
.moment-write-imgs {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 0 24px 10px;
}
.moment-img-preview {
  position: relative; width: 70px; height: 70px;
  border-radius: 8px; overflow: hidden;
}
.moment-img-preview img {
  width: 100%; height: 100%; object-fit: cover;
}
.moment-img-remove {
  position: absolute; top: 2px; right: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: rgba(0,0,0,0.4); color: #fff;
  font-size: 10px; display: flex; align-items: center;
  justify-content: center; cursor: pointer;
}
.moment-write-photo-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 0 24px;
  font-size: 11px; color: var(--ink-faint);
  cursor: pointer; font-weight: 300;
}
.moment-write-photo-btn svg {
  width: 18px; height: 18px; fill: none;
  stroke: var(--ink-faint); stroke-width: 1.2;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ============ SEARCH OVERLAY ============ */
.search-overlay {
  background: rgba(249,245,239,0.97);
  flex-direction: column;
  padding: 50px 28px 28px;
}
.search-input-real {
  width: 100%; border: none;
  border-bottom: 1px solid var(--accent-soft);
  background: transparent;
  font-family: 'Noto Serif SC', serif;
  font-size: 16px; color: var(--ink);
  padding: 10px 0; outline: none; font-weight: 300;
}
.search-input-real::placeholder { color: var(--ink-faint); font-weight: 300; }
.search-hints { margin-top: 20px; }
.search-hint-title {
  font-family: 'EB Garamond', serif;
  font-size: 9.5px; letter-spacing: 2px;
  text-transform: uppercase; color: var(--ink-faint);
  margin-bottom: 10px;
}
.search-hint-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.search-hint-tag {
  font-size: 11px; color: var(--ink-light);
  background: var(--cream);
  padding: 5px 12px; border-radius: 8px;
  cursor: pointer; font-weight: 300;
  transition: background 0.2s;
}
.search-hint-tag:active { background: var(--blush); }
.search-results { margin-top: 20px; flex: 1; overflow-y: auto; }
.search-result-item {
  padding: 12px 0;
  border-bottom: 0.5px solid rgba(168,154,142,0.08);
  cursor: pointer;
}
.search-result-type {
  font-family: 'EB Garamond', serif;
  font-size: 8.5px; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--dusty-rose);
  margin-bottom: 3px;
}
.search-result-text {
  font-size: 12px; color: var(--ink);
  font-weight: 300; line-height: 1.6;
}
.search-result-text mark {
  background: rgba(196,168,130,0.2);
  color: var(--ink); border-radius: 2px; padding: 0 2px;
}
.search-result-date {
  font-family: 'EB Garamond', serif;
  font-size: 9px; color: var(--ink-faint);
  margin-top: 4px; letter-spacing: 1px;
}

/* ============ DIARY DETAIL OVERLAY ============ */
.diary-overlay {
  background: rgba(249,245,239,0.97);
  flex-direction: column;
}
.diary-overlay-header {
  padding: 50px 28px 16px;
  display: flex; justify-content: space-between;
  align-items: center; flex-shrink: 0;
}
.diary-overlay-title {
  font-family: 'Caveat', cursive;
  font-size: 22px; color: var(--ink);
}
.diary-overlay-content {
  flex: 1; overflow-y: auto; padding: 0 28px 28px;
}
.diary-entry { margin-bottom: 24px; }
.diary-entry-date {
  font-family: 'EB Garamond', serif;
  font-size: 10px; letter-spacing: 2px;
  color: var(--ink-faint); margin-bottom: 8px;
}
.diary-entry-text {
  font-size: 13px; color: var(--ink);
  font-weight: 300; line-height: 2; letter-spacing: 0.3px;
}
.diary-entry-divider {
  width: 30px; height: 0.5px;
  background: var(--accent-soft); margin: 0 auto;
}
.diary-entry-mood {
  display: inline-block; font-size: 9px; color: var(--ink-faint);
  background: var(--cream); padding: 2px 8px; border-radius: 6px;
  margin-top: 8px; font-weight: 300;
}

/* ============ PHOTO LIGHTBOX ============ */
.photo-lightbox {
  background: rgba(30,26,24,0.92);
  flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px 16px;
}
.photo-lightbox.show { display: flex; }
img.photo-lightbox-img {
  max-width: 92vw; max-height: 70vh;
  border-radius: 8px; object-fit: contain;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}
.photo-lightbox-caption {
  color: var(--warm-white); font-size: 12px;
  font-weight: 300; margin-top: 16px; opacity: 0.7;
}
.photo-lightbox-date {
  font-family: 'EB Garamond', serif;
  color: var(--warm-white); font-size: 10px;
  margin-top: 6px; opacity: 0.4; letter-spacing: 1.5px;
}

/* ============ LETTER OVERLAY ============ */
.letter-overlay {
  background: rgba(249,245,239,0.97);
  flex-direction: column;
}
.letter-overlay-header {
  padding: 50px 28px 16px;
  display: flex; justify-content: space-between;
  align-items: center; flex-shrink: 0;
}
.letter-overlay-title {
  font-family: 'Caveat', cursive;
  font-size: 22px; color: var(--ink);
}
.letter-overlay-content {
  flex: 1; overflow-y: auto; padding: 0 28px 28px;
}
.letter-item {
  background: var(--cream); border-radius: 14px;
  padding: 20px; margin-bottom: 16px;
  position: relative; cursor: pointer;
  transition: transform 0.2s;
}
.letter-item:active { transform: scale(0.98); }
.letter-item-from {
  font-family: 'Caveat', cursive;
  font-size: 14px; color: var(--ink); margin-bottom: 4px;
}
.letter-item-date {
  font-family: 'EB Garamond', serif;
  font-size: 9px; color: var(--ink-faint);
  letter-spacing: 1.5px; margin-bottom: 10px;
}
.letter-item-preview {
  font-size: 12px; color: var(--ink-light);
  font-weight: 300; line-height: 1.8; font-style: italic;
}
.letter-item-unread {
  position: absolute; top: 10px; right: 54px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--dusty-rose); z-index: 3;
}
.letter-item-seal {
  position: absolute; top: 8px; right: 20px;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--dusty-rose);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(201,169,160,0.25);
}
.letter-item-seal svg {
  width: 12px; height: 12px; fill: none;
  stroke: var(--warm-white); stroke-width: 1.8;
}

/* ============ LETTER WRITE / DETAIL ============ */
.letter-write-overlay, .letter-detail-overlay {
  background: rgba(249,245,239,0.97);
  flex-direction: column;
}
.letter-write-header, .letter-detail-header {
  padding: 50px 28px 12px;
  display: flex; justify-content: space-between;
  align-items: center; flex-shrink: 0;
}
.letter-write-title {
  font-family: 'Caveat', cursive;
  font-size: 22px; color: var(--ink);
}
.letter-write-body {
  flex: 1; overflow-y: auto; padding: 0 28px 20px;
  display: flex; flex-direction: column; gap: 12px;
}
.letter-write-to {
  display: flex; align-items: center; gap: 8px;
  padding-bottom: 8px;
  border-bottom: 0.5px solid rgba(168,154,142,0.1);
}
.letter-write-label {
  font-family: 'EB Garamond', serif;
  font-size: 13px; color: var(--ink-faint); font-style: italic;
}
.letter-write-recipient {
  font-family: 'Caveat', cursive;
  font-size: 16px; color: var(--ink);
}
.letter-write-textarea {
  flex: 1; min-height: 200px; padding: 0;
  border: none; background: transparent;
  font-size: 14px; color: var(--ink);
  font-family: 'Noto Serif SC', serif; font-weight: 300;
  line-height: 2.2; letter-spacing: 0.3px;
  outline: none; resize: none;
  background-image: repeating-linear-gradient(
    transparent, transparent 33px,
    rgba(168,154,142,0.08) 33px, rgba(168,154,142,0.08) 33.5px
  );
  background-size: 100% 33.5px;
  background-position-y: 32px;
}
.letter-write-textarea::placeholder { color: var(--ink-faint); font-weight: 300; }
.letter-write-footer { padding: 16px 28px; flex-shrink: 0; }
.letter-write-submit {
  width: 100%; padding: 12px;
  border: none; border-radius: 20px;
  background: var(--accent); color: var(--warm-white);
  font-family: 'Caveat', cursive; font-size: 16px;
  cursor: pointer; transition: opacity 0.2s;
  letter-spacing: 0.5px;
}
.letter-write-submit:active { opacity: 0.7; }
.letter-write-submit:disabled { opacity: 0.4; cursor: default; }

.letter-write-btn {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; padding: 10px 0; margin-bottom: 16px;
  background: var(--cream); border-radius: 12px;
  cursor: pointer; transition: background 0.2s;
  border: 0.8px dashed rgba(168,154,142,0.2);
}
.letter-write-btn:active { background: var(--blush); }
.letter-write-btn svg {
  width: 14px; height: 14px; fill: none;
  stroke: var(--accent); stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
}
.letter-write-btn span {
  font-size: 12px; color: var(--accent);
  font-family: 'Caveat', cursive; letter-spacing: 0.5px;
}

.letter-detail-body { flex: 1; overflow-y: auto; padding: 0 28px 28px; }
.letter-detail-from {
  font-family: 'Caveat', cursive;
  font-size: 13px; color: var(--ink-faint);
  margin-bottom: 4px;
}
.letter-detail-date {
  font-family: 'EB Garamond', serif;
  font-size: 10px; color: var(--ink-faint);
  letter-spacing: 1.5px; margin-bottom: 20px;
}
.letter-detail-text {
  font-size: 14px; color: var(--ink);
  font-weight: 300; line-height: 2.2; letter-spacing: 0.3px;
}
.letter-detail-sign {
  margin-top: 32px; text-align: right;
  font-family: 'Caveat', cursive;
  font-size: 14px; color: var(--ink-light);
}

/* envelope card */
.envelope {
  position: relative; margin-bottom: 16px;
  border-radius: 12px; cursor: pointer;
  transition: transform 0.2s;
  overflow: hidden;
}
.envelope:active { transform: scale(0.97); }

/* sealed (unread) */
.envelope.sealed {
  padding: 0; min-height: 100px;
}
.envelope-body {
  position: relative; padding: 20px 22px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 100px;
}
.envelope-flap {
  position: absolute; top: 0; left: 0; right: 0;
  height: 48px; clip-path: polygon(0 0, 50% 100%, 100% 0);
  opacity: 0.25;
}
.envelope-seal {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 8px; z-index: 2;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.envelope-seal svg {
  width: 14px; height: 14px; fill: none;
  stroke: var(--warm-white); stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}
.envelope-label {
  font-family: 'Caveat', cursive;
  font-size: 14px; z-index: 2; text-align: center;
  line-height: 1.5;
}
.envelope-date {
  font-family: 'EB Garamond', serif;
  font-size: 9px; letter-spacing: 1.5px;
  margin-top: 4px; z-index: 2; opacity: 0.6;
}

/* opened (read) — shows content preview */
.envelope.opened { padding: 16px 20px; }
.envelope.opened .envelope-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
}
.envelope.opened .envelope-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 8px;
}
.envelope.opened .envelope-meta { flex: 1; }
.envelope.opened .envelope-from-name {
  font-family: 'Caveat', cursive;
  font-size: 13px;
}
.envelope.opened .envelope-from-date {
  font-family: 'EB Garamond', serif;
  font-size: 9px; letter-spacing: 1px; opacity: 0.5;
}
.envelope.opened .envelope-preview {
  font-size: 12px; font-weight: 300; line-height: 1.8;
  font-style: italic; opacity: 0.7;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}

/* Claude style — blue-gray */
.envelope.from-claude { background: rgba(180,190,205,0.18); border: 0.8px solid rgba(150,165,185,0.15); }
.envelope.from-claude .envelope-flap { background: rgba(150,165,185,0.4); }
.envelope.from-claude .envelope-seal { background: rgb(140,155,175); }
.envelope.from-claude .envelope-label { color: rgb(100,115,135); }
.envelope.from-claude .envelope-date { color: rgb(120,135,155); }
.envelope.from-claude.opened .envelope-avatar { background: rgba(150,165,185,0.2); color: rgb(100,115,135); }
.envelope.from-claude.opened .envelope-from-name { color: rgb(100,115,135); }
.envelope.from-claude.opened .envelope-preview { color: rgb(80,95,115); }

/* Nai style — warm rose */
.envelope.from-nai { background: rgba(210,170,165,0.15); border: 0.8px solid rgba(200,160,155,0.12); }
.envelope.from-nai .envelope-flap { background: rgba(200,160,155,0.4); }
.envelope.from-nai .envelope-seal { background: var(--dusty-rose); }
.envelope.from-nai .envelope-label { color: rgb(170,120,115); }
.envelope.from-nai .envelope-date { color: rgb(180,140,135); }
.envelope.from-nai.opened .envelope-avatar { background: rgba(200,160,155,0.2); color: rgb(170,120,115); }
.envelope.from-nai.opened .envelope-from-name { color: rgb(170,120,115); }
.envelope.from-nai.opened .envelope-preview { color: rgb(140,100,95); }

/* ============ WRITE POST OVERLAY ============ */
.write-overlay {
  background: rgba(249,245,239,0.97);
  flex-direction: column;
}
.write-overlay-header {
  padding: 50px 28px 16px;
  display: flex; justify-content: space-between;
  align-items: center; flex-shrink: 0;
}
.write-overlay-title {
  font-family: 'Caveat', cursive;
  font-size: 22px; color: var(--ink);
}
.write-overlay-content {
  flex: 1; padding: 0 28px;
  display: flex; flex-direction: column; gap: 16px;
}
.write-type-row { display: flex; gap: 8px; }
.write-type-btn {
  font-size: 10px; padding: 5px 12px; border-radius: 8px;
  background: var(--cream); color: var(--ink-faint);
  cursor: pointer; font-weight: 300;
  letter-spacing: 0.5px; transition: all 0.2s;
}
.write-type-btn.active { background: var(--ink); color: var(--warm-white); }
.write-textarea {
  flex: 1; border: none; background: transparent;
  resize: none; outline: none;
  font-family: 'Noto Serif SC', serif;
  font-size: 14px; color: var(--ink);
  font-weight: 300; line-height: 2; letter-spacing: 0.3px;
}
.write-textarea::placeholder { color: var(--ink-faint); }
.write-bottom {
  padding: 16px 28px;
  display: flex; justify-content: space-between;
  align-items: center; flex-shrink: 0;
}
.write-attach { display: flex; gap: 12px; }
.write-attach-btn { cursor: pointer; }
.write-attach-btn svg {
  width: 18px; height: 18px; fill: none;
  stroke: var(--ink-faint); stroke-width: 1.4;
  stroke-linecap: round; stroke-linejoin: round;
}
.write-submit {
  font-family: 'Caveat', cursive;
  font-size: 14px; color: var(--warm-white);
  background: var(--ink);
  padding: 6px 20px; border-radius: 20px;
  cursor: pointer; transition: opacity 0.2s;
}
.write-submit:active { opacity: 0.7; }

/* ============ CALENDAR EVENTS ============ */
.cal-event-badge {
  position: absolute; top: 1px; right: 1px;
  font-size: 8px; line-height: 1; pointer-events: none;
}
.cal-event-badge.anni { color: #d48a9a; }
.cal-event-badge.reminder { color: #9a9abf; }
.photo-cal-day { position: relative; }
.photo-cal-day.has-event { }

.cal-event-list {
  margin-top: 16px; padding: 0 4px;
}
.cal-event-empty {
  text-align: center; padding: 12px 0;
  color: var(--ink-faint); font-size: 11px;
  font-family: 'Caveat', cursive; letter-spacing: 0.5px;
}
.cal-event-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 6px; border-bottom: 0.5px solid rgba(168,154,142,0.1);
}
.cal-event-icon { font-size: 14px; flex-shrink: 0; width: 20px; text-align: center; }
.cal-event-info { flex: 1; min-width: 0; }
.cal-event-title {
  font-size: 12px; color: var(--ink); font-weight: 400;
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-event-range {
  font-size: 10px; color: var(--ink-faint); font-weight: 300;
  font-family: 'Caveat', cursive;
}
.cal-event-del {
  font-size: 16px; color: var(--ink-faint); cursor: pointer;
  width: 24px; text-align: center; opacity: 0.4;
  transition: opacity 0.2s;
}
.cal-event-del:active { opacity: 1; }

/* ============ DAY DETAIL OVERLAY ============ */
.day-detail-overlay {
  background: rgba(249,245,239,0.97);
  flex-direction: column;
  padding: 50px 28px 28px;
}
.day-detail-content {
  flex: 1; overflow-y: auto;
}
.day-detail-header {
  margin-bottom: 24px;
}
.day-detail-date {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px; font-weight: 300; color: var(--ink);
  letter-spacing: 1px; line-height: 1;
}
.day-detail-weekday {
  font-size: 11px; color: var(--ink-faint);
  font-weight: 300; margin-top: 4px; letter-spacing: 2px;
}
.day-detail-section-title {
  font-family: 'EB Garamond', serif;
  font-size: 10px; letter-spacing: 2px;
  text-transform: uppercase; color: var(--ink-faint);
  margin: 20px 0 10px; padding-bottom: 6px;
  border-bottom: 0.5px solid rgba(168,154,142,0.1);
}
.day-detail-event {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0;
  border-bottom: 0.5px solid rgba(168,154,142,0.06);
}
.day-detail-event-icon { font-size: 16px; flex-shrink: 0; width: 24px; text-align: center; }
.day-detail-event-title {
  font-size: 13px; color: var(--ink); font-weight: 300;
  line-height: 1.5;
}
.day-detail-photos {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-top: 4px;
}
.day-photo-item {
  position: relative; border-radius: 8px; overflow: hidden;
  aspect-ratio: 1; cursor: pointer;
  background: var(--cream);
}
.day-photo-item img {
  width: 100%; height: 100%; object-fit: cover;
  display: block;
}
.day-photo-time {
  position: absolute; bottom: 4px; right: 6px;
  font-family: 'EB Garamond', serif;
  font-size: 9px; color: #fff; letter-spacing: 0.5px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.day-detail-add-btn {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; padding: 12px 0; margin-top: 24px;
  background: var(--cream); border-radius: 12px;
  cursor: pointer; transition: background 0.2s;
  border: 0.8px dashed rgba(168,154,142,0.2);
}
.day-detail-add-btn:active { background: var(--blush); }
.day-detail-add-btn svg {
  width: 14px; height: 14px; fill: none;
  stroke: var(--ink-faint); stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
}
.day-detail-add-btn span {
  font-size: 12px; color: var(--ink-faint);
  font-family: 'Caveat', cursive; letter-spacing: 0.5px;
}

/* ============ ADD EVENT OVERLAY ============ */
.add-event-overlay.show {
  background: rgba(249,245,239,0.97);
  flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px 32px;
}
.add-event-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px; font-weight: 300; color: var(--ink);
  margin-bottom: 24px; letter-spacing: 1px;
}
.add-event-form {
  width: 100%; max-width: 300px;
  display: flex; flex-direction: column; gap: 14px;
}
.event-input {
  width: 100%; padding: 10px 12px;
  border: 0.8px solid rgba(168,154,142,0.2);
  border-radius: 8px; background: var(--cream);
  font-size: 13px; color: var(--ink);
  font-family: 'Noto Serif SC', serif;
  outline: none; box-sizing: border-box;
}
.event-input:focus { border-color: rgba(168,154,142,0.5); }
.event-row {
  display: flex; align-items: center; gap: 10px;
}
.event-row label {
  font-size: 12px; color: var(--ink-faint); font-weight: 300;
  width: 36px; flex-shrink: 0;
}
.event-select, .event-input-date {
  flex: 1; padding: 8px 10px;
  border: 0.8px solid rgba(168,154,142,0.2);
  border-radius: 8px; background: var(--cream);
  font-size: 12px; color: var(--ink);
  font-family: 'Noto Serif SC', serif;
  outline: none; -webkit-appearance: none;
}
.event-select:focus, .event-input-date:focus { border-color: rgba(168,154,142,0.5); }
.event-submit {
  margin-top: 4px; padding: 10px;
  border: none; border-radius: 20px;
  background: var(--ink); color: var(--warm-white);
  font-family: 'Caveat', cursive; font-size: 15px;
  cursor: pointer; transition: opacity 0.2s;
  letter-spacing: 0.5px;
}
.event-submit:active { opacity: 0.7; }

/* ============ DIARY DETAIL ============ */
.diary-entry-clickable { cursor: pointer; transition: background 0.2s; padding: 12px; border-radius: 10px; margin: -12px; margin-bottom: 0; }
.diary-entry-clickable:active { background: rgba(196,168,130,0.08); }
.diary-entry-title-text {
  font-size: 13.5px; color: var(--ink); font-weight: 400;
  line-height: 1.6; margin-top: 4px;
}
.diary-entry-tags { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.diary-detail-back {
  font-family: 'Caveat', cursive;
  font-size: 13px; color: var(--dusty-rose);
  cursor: pointer; margin-bottom: 16px; padding: 4px 0;
}
.diary-detail-back:active { opacity: 0.6; }

/* ============ SECRET ALBUM ============ */
.album-entry { margin: 0 28px 14px; }
.album-entry-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(168,154,142,0.1);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.album-entry-icon svg {
  width: 18px; height: 18px; fill: none;
  stroke: var(--ink-light); stroke-width: 1.4;
  stroke-linecap: round; stroke-linejoin: round;
}
.album-overlay {
  background: rgba(249,245,239,0.97);
  flex-direction: column;
}
.album-header {
  padding: 50px 28px 12px;
  display: flex; justify-content: space-between;
  align-items: center; flex-shrink: 0;
}
.album-title {
  font-family: 'Caveat', cursive;
  font-size: 22px; color: var(--ink);
}
.album-content {
  flex: 1; overflow-y: auto; padding: 0 28px 80px;
}
.album-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
}
.album-item {
  position: relative; border-radius: 8px; overflow: hidden;
  aspect-ratio: 1; cursor: pointer; background: var(--cream);
}
.album-item img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.album-item-cat {
  position: absolute; bottom: 4px; left: 6px;
  font-size: 8px; color: #fff; letter-spacing: 0.5px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  font-family: 'EB Garamond', serif;
}
.album-upload-btn {
  position: fixed; bottom: 90px; right: 28px;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--ink); color: var(--warm-white);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 4px 12px rgba(58,51,48,0.15);
  z-index: 100; transition: transform 0.2s;
}
.album-upload-btn:active { transform: scale(0.9); }
.album-upload-btn svg {
  width: 20px; height: 20px; fill: none;
  stroke: var(--warm-white); stroke-width: 2;
  stroke-linecap: round;
}
.album-empty {
  text-align: center; padding: 60px 0;
  color: var(--ink-faint); font-size: 12px;
  font-weight: 300; line-height: 1.8;
}

/* ============ SURF LOG OVERLAY ============ */
.surf-overlay {
  background: rgba(249,245,239,0.97);
  flex-direction: column;
}
.surf-header {
  padding: 50px 28px 12px;
  display: flex; justify-content: space-between;
  align-items: center; flex-shrink: 0;
}
.surf-title {
  font-family: 'Caveat', cursive;
  font-size: 22px; color: var(--ink);
}
.surf-cats {
  padding: 0 28px 10px;
  display: flex; gap: 8px; flex-wrap: nowrap;
  overflow-x: auto; flex-shrink: 0;
  -webkit-overflow-scrolling: touch;
}
.surf-cats::-webkit-scrollbar { display: none; }
.surf-cat-chip {
  font-size: 10px; color: var(--ink-faint);
  background: var(--cream); padding: 5px 12px;
  border-radius: 12px; cursor: pointer;
  font-weight: 300; letter-spacing: 0.3px;
  white-space: nowrap; flex-shrink: 0;
  border: 0.8px solid rgba(168,154,142,0.08);
  transition: all 0.2s; user-select: none;
}
.surf-cat-chip.active {
  background: var(--sage); color: var(--warm-white);
  border-color: var(--sage);
}
.surf-content {
  flex: 1; overflow-y: auto; padding: 0 28px 28px;
}
.surf-card {
  background: var(--cream); border-radius: 12px;
  padding: 14px 16px; margin-bottom: 12px;
  cursor: pointer; transition: transform 0.2s;
}
.surf-card:active { transform: scale(0.98); }
.surf-card-cat {
  font-family: 'EB Garamond', serif;
  font-size: 9px; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--sage);
  margin-bottom: 4px;
}
.surf-card-title {
  font-size: 13px; color: var(--ink); font-weight: 400;
  line-height: 1.5; margin-bottom: 4px;
}
.surf-card-preview {
  font-size: 11px; color: var(--ink-light);
  font-weight: 300; line-height: 1.7;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.surf-card-date {
  font-family: 'EB Garamond', serif;
  font-size: 9px; color: var(--ink-faint);
  letter-spacing: 1px; margin-top: 6px;
}

.surf-detail-overlay {
  background: rgba(249,245,239,0.97);
  flex-direction: column;
}
.surf-detail-header {
  padding: 50px 28px 12px;
  flex-shrink: 0;
}
.surf-detail-body {
  flex: 1; overflow-y: auto; padding: 0 28px 28px;
}
.surf-detail-cat {
  font-family: 'EB Garamond', serif;
  font-size: 10px; letter-spacing: 2px;
  text-transform: uppercase; color: var(--sage);
  margin-bottom: 6px;
}
.surf-detail-title {
  font-size: 17px; color: var(--ink); font-weight: 400;
  line-height: 1.4; margin-bottom: 8px;
}
.surf-detail-date {
  font-family: 'EB Garamond', serif;
  font-size: 10px; color: var(--ink-faint);
  letter-spacing: 1.5px; margin-bottom: 16px;
}
.surf-detail-text {
  font-size: 13px; color: var(--ink);
  font-weight: 300; line-height: 2; letter-spacing: 0.3px;
}
.surf-detail-link {
  display: inline-block; margin-top: 16px;
  font-family: 'EB Garamond', serif;
  font-size: 11px; color: var(--sage);
  text-decoration: underline; letter-spacing: 0.5px;
}
.surf-empty {
  text-align: center; padding: 40px 0;
  color: var(--ink-faint); font-size: 12px;
  font-weight: 300; line-height: 1.8;
}

/* ============ NAI DIARY WRITE OVERLAY ============ */
.nai-diary-write-overlay {
  background: rgba(249,245,239,0.97);
  flex-direction: column;
}
.nai-dw-header {
  padding: 50px 28px 12px;
  display: flex; justify-content: space-between;
  align-items: center; flex-shrink: 0;
}
.nai-dw-title {
  font-family: 'Caveat', cursive;
  font-size: 22px; color: var(--ink);
}
.nai-dw-body {
  flex: 1; overflow-y: auto; padding: 0 28px 20px;
  display: flex; flex-direction: column; gap: 10px;
}
.nai-dw-input {
  width: 100%; padding: 10px 12px;
  border: 0.8px solid rgba(168,154,142,0.15);
  border-radius: 10px; background: var(--cream);
  font-size: 13px; color: var(--ink);
  font-family: 'Noto Serif SC', serif; font-weight: 300;
  outline: none; box-sizing: border-box;
}
.nai-dw-input:focus { border-color: rgba(168,154,142,0.4); }
.nai-dw-textarea {
  width: 100%; min-height: 140px; padding: 12px;
  border: 0.8px solid rgba(168,154,142,0.15);
  border-radius: 10px; background: var(--cream);
  font-size: 13px; color: var(--ink);
  font-family: 'Noto Serif SC', serif; font-weight: 300;
  line-height: 2; letter-spacing: 0.3px;
  outline: none; resize: none; box-sizing: border-box;
}
.nai-dw-textarea:focus { border-color: rgba(168,154,142,0.4); }
.nai-dw-section-label {
  font-family: 'EB Garamond', serif;
  font-size: 10px; letter-spacing: 2px; color: var(--ink-faint);
  text-transform: uppercase; margin-top: 4px;
}
.nai-dw-options {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.nai-dw-chip {
  font-size: 11px; color: var(--ink-faint);
  background: var(--cream); padding: 5px 12px;
  border-radius: 14px; cursor: pointer;
  font-weight: 300; letter-spacing: 0.3px;
  border: 0.8px solid rgba(168,154,142,0.1);
  transition: all 0.2s; user-select: none;
}
.nai-dw-chip.selected {
  background: var(--dusty-rose); color: var(--warm-white);
  border-color: var(--dusty-rose);
}
.nai-dw-custom-tag-row {
  display: flex; gap: 8px; align-items: center;
}
.nai-dw-tag-input { flex: 1; }
.nai-dw-add-tag {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--cream); color: var(--ink-faint);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; cursor: pointer; flex-shrink: 0;
  border: 0.8px solid rgba(168,154,142,0.1);
  transition: background 0.2s;
}
.nai-dw-add-tag:active { background: var(--blush); }
.nai-dw-footer {
  padding: 16px 28px; flex-shrink: 0;
}
.nai-dw-submit {
  width: 100%; padding: 12px;
  border: none; border-radius: 20px;
  background: var(--dusty-rose); color: var(--warm-white);
  font-family: 'Caveat', cursive; font-size: 16px;
  cursor: pointer; transition: opacity 0.2s;
  letter-spacing: 0.5px;
}
.nai-dw-submit:active { opacity: 0.7; }
.nai-dw-submit:disabled { opacity: 0.4; cursor: default; }

/* Nai diary entry actions in overlay */
.nai-diary-write-btn {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; padding: 10px 0; margin-bottom: 16px;
  background: var(--cream); border-radius: 12px;
  cursor: pointer; transition: background 0.2s;
  border: 0.8px dashed rgba(168,154,142,0.2);
}
.nai-diary-write-btn:active { background: var(--blush); }
.nai-diary-write-btn svg {
  width: 14px; height: 14px; fill: none;
  stroke: var(--dusty-rose); stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
}
.nai-diary-write-btn span {
  font-size: 12px; color: var(--dusty-rose);
  font-family: 'Caveat', cursive; letter-spacing: 0.5px;
}

/* dark mode */
html.dark-mode .event-input,
html.dark-mode .event-select,
html.dark-mode .event-input-date {
  background: var(--cream); border-color: rgba(168,154,142,0.15);
  color: var(--ink);
}
html.dark-mode .cal-event-badge.anni { color: #e0a0b0; }
html.dark-mode .cal-event-badge.reminder { color: #b0b0d8; }
