@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Oleo+Script:wght@400;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --sidebar-bg:      #1a2b1a;
  --sidebar-hover:   #243424;
  --sidebar-active:  #2e4a2e;
  --sidebar-text:    #b8ccb0;
  --sidebar-muted:   #6a8264;
  --sidebar-accent:  #8fbf7a;
  --chat-bg:         #ffffff;
  --bubble-bg:       #FEDFE4;
  --bubble-border:   #F9D2DE;
  --bubble-text:     #2a1f22;
  --trans-text:      #9a6878;
  --date-text:       #c4a0a8;
  --header-bg:       #ffffff;
  --accent-rose:     #e87b9a;
  --accent-gold:     #a88c50;
  --online-dot:      #ff7eb3;
}

html { height: 100%; overflow: hidden; background: #000000; }
body { height: 100%; overflow: hidden; touch-action: manipulation; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
  background: #ffffff;
  color: var(--bubble-text);
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

/* ── Layout ── */
.app { display: flex; height: 100vh; height: 100dvh; }

/* ── Left Panel (calendar overlay) ── */
.side-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.3);
  z-index: 200; opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
.side-overlay.open { opacity: 1; pointer-events: all; }

.left-panel {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 268px;
  background: #ffffff;
  z-index: 300;
  display: flex; flex-direction: column;
  transform: translateX(-100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
  border-right: none;
  box-shadow: none;
}
.left-panel.open {
  transform: translateX(0);
  box-shadow: 2px 0 6px rgba(0,0,0,.048);
}

.lp-header {
  padding: 24px 20px 16px; flex-shrink: 0;
  border-bottom: none;
  position: relative;
}
.lp-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 15px;
  right: 15px;
  height: 1px;
  background: #f0dde4;
}
.lp-profile-row { display: flex; align-items: center; gap: 12px; }
.lp-avatar-wrap { width: 44px; height: 44px; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: #f5c0d6; display: flex; align-items: center; justify-content: center; }
.lp-avatar-img { width: 44px; height: 44px; object-fit: cover; border-radius: 50%; }
.lp-avatar-fallback { font-size: 18px; font-weight: 600; color: #fff; }
.lp-profile-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.lp-artist-name { font-size: 15px; font-weight: 600; color: var(--bubble-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-last-online { font-size: 11px; color: var(--date-text); }
.lpo-label { color: var(--date-text); }
.lpo-time { color: #c0c0c0; }

/* ── Right Panel (menu overlay) ── */
.right-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 280px;
  background: #ffffff;
  z-index: 300;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  overflow-y: auto;
  border-left: none;
  box-shadow: none;
}
.right-panel.open {
  transform: translateX(0);
  box-shadow: -2px 0 6px rgba(0,0,0,.048);
}
.right-panel::-webkit-scrollbar { width: 6px; }
.right-panel::-webkit-scrollbar-thumb { background: #d0d0d0; border-radius: 3px; }

.rp-top { padding: 14px 16px 0; flex-shrink: 0; }
.rp-back {
  background: none; border: none; cursor: pointer;
  color: var(--accent-rose); padding: 4px;
  display: flex; align-items: center;
  transition: opacity .15s;
}
.rp-back:hover { opacity: .7; }

.rp-artist { display: flex; flex-direction: column; align-items: center; padding: 16px 20px 20px; }
.rp-avatar-wrap { position: relative; width: 72px; height: 72px; margin-bottom: 10px; }
.rp-avatar-img {
  width: 72px; height: 72px; border-radius: 50%; object-fit: cover;
  border: 2px solid #f5c0d6;
}
.rp-avatar-fallback {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, #ffd6e7, #ffb3d1);
  color: var(--accent-rose); font-size: 28px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.rp-artist-badge {
  position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%);
  background: var(--accent-rose); color: #fff; font-size: 9px; font-weight: 600;
  letter-spacing: .08em; padding: 2px 7px; border-radius: 20px; white-space: nowrap;
}
.rp-artist-name { font-size: 15px; font-weight: 600; color: var(--bubble-text); flex: 1; text-align: center; }

.rp-artist-name-row { display: flex; align-items: center; width: 100%; }
.rp-name-spacer { width: 26px; flex-shrink: 0; }
.rp-pencil-btn {
  background: none; border: none; cursor: pointer; padding: 3px;
  opacity: 0.45; transition: opacity .15s; flex-shrink: 0;
  display: flex; align-items: center; position: relative; top: 2px;
}
.rp-pencil-btn:hover { opacity: 0.85; }

.rp-section { padding: 16px 20px; border-top: none; position: relative; }
.rp-section::before {
  content: ''; position: absolute; top: 0; left: 20px; right: 20px;
  height: 1px; background: #f0dde4;
}
.rp-alias-section { padding: 12px 20px; border-top: 1px solid #f0dde4; }
.rp-alias-btns { display: flex; gap: 6px; margin-top: 6px; }
.rp-alias-cancel {
  flex: 1; background: none; border: none; color: var(--date-text);
  border-radius: 20px; padding: 8px 16px; font-size: 13px; font-weight: 500;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif; cursor: pointer;
}
.rp-alias-cancel:hover { color: var(--accent-rose); }
.rp-alias-btns .rp-action-btn { flex: 1; display: block; width: auto; border: none; }
.rp-alias-btns .rp-action-btn:disabled {
  opacity: 0.35; cursor: default; pointer-events: none;
}
.rp-section-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: .1em;
  color: var(--accent-rose); font-weight: 600; margin-bottom: 10px;
}
.rp-hint { font-size: 12px; color: var(--date-text); margin-bottom: 10px; }

.rp-fandate-display { display: flex; flex-direction: column; gap: 5px; margin-bottom: 8px; }
.fandate-days-row { display: flex; align-items: baseline; gap: 6px; flex-wrap: nowrap; }
.fandate-days-row .rp-pencil-btn { align-self: center; margin-left: auto; }
.fandate-days { font-size: 36px; font-weight: 600; color: var(--accent-rose); line-height: 1; }
.fandate-label { font-size: 13px; color: var(--date-text); line-height: 1; }
.fandate-with-sub { font-size: 11px; color: var(--date-text); opacity: .75; flex: 1; }
.fandate-lock { font-size: 12px; opacity: .55; line-height: 1; align-self: center; }
.fandate-no-date { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.fandate-set-text { font-size: 13px; color: var(--date-text); }

.rp-action-btn {
  display: block; width: 100%;
  background: #ffd6e7; border: 1px solid #f5c0d6; color: var(--accent-rose);
  border-radius: 20px; padding: 8px 16px; font-size: 13px; font-weight: 500;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif; cursor: pointer;
  transition: background .15s; text-align: center;
}
.rp-action-btn:hover { background: #ffcadf; }
.rp-action-btn:disabled { opacity: .55; cursor: default; }

.rp-comments-status {
  font-size: 12px; color: var(--date-text);
  margin-top: 8px; line-height: 1.5;
}

#fandate-input {
  display: block; width: 100%; margin-top: 8px;
  border: none; border-bottom: 1px solid #f5c0d6; border-radius: 0;
  padding: 7px 0; font-size: 13px;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
  background: transparent; color: var(--bubble-text); outline: none;
}
#fandate-input:focus { border-bottom-color: var(--accent-rose); }

#fandate-save-btn { margin-top: 8px; border: none; }

/* MY FAVORITES card */
.fav-card {
  display: flex; align-items: center; gap: 12px;
  background: #fffbfd; border-radius: 10px; padding: 12px 14px;
  cursor: pointer; transition: background .15s;
}
.fav-card:active { background: #ffd6e7; }
.fav-card-icon { opacity: .75; flex-shrink: 0; }
.fav-card-info { display: flex; flex-direction: column; gap: 3px; }
.fav-card-title { font-size: 12px; font-weight: 600; color: var(--accent-rose); letter-spacing: .07em; }
.fav-card-hint { font-size: 11px; color: var(--date-text); }

/* ── Calendar ── */
.cal-wrap {
  display: flex; flex-direction: column; padding: 14px 12px 12px;
  flex-shrink: 0; margin: 0 15px;
}

.cal-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.cal-arrow {
  background: none; border: none; color: var(--date-text);
  font-size: 22px; cursor: pointer; padding: 0 6px; line-height: 1;
  transition: color .15s;
}
.cal-arrow:hover { color: var(--accent-rose); }
.cal-title {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
  font-size: 14px; color: var(--bubble-text); font-weight: 600;
}

.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 2px; user-select: none;
}
.cal-dow {
  text-align: center; font-size: 9px; text-transform: uppercase;
  color: var(--date-text); padding: 3px 0 5px; letter-spacing: .06em;
}
.cal-day {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; border-radius: 6px; cursor: pointer;
  color: var(--bubble-text); transition: background .12s, color .12s;
  position: relative;
}
.cal-day:hover:not(.empty) { background: #fff0f5; }
.cal-day.empty { cursor: default; color: transparent; }
.cal-day.future { opacity: 0.25; cursor: default; pointer-events: none; }
.cal-day.has-posts::after {
  content: ''; position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--accent-rose);
}
.cal-day.selected { background: #ffd6e7; color: var(--accent-rose); font-weight: 600; }
.cal-day.in-range { background: rgba(255,214,231,.5); color: var(--bubble-text); }
.cal-day.range-start, .cal-day.range-end { background: var(--accent-rose); color: #fff; font-weight: 600; }
.cal-day.today { color: var(--accent-rose); font-weight: 600; }

.cal-legend { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.cal-clear {
  font-size: 11px; color: var(--accent-rose); background: none; border: none;
  cursor: pointer; font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif; padding: 2px 4px;
  border-radius: 4px; transition: background .15s;
}
.cal-clear:hover { background: rgba(232,123,154,.12); }
.cal-range-btn {
  font-size: 11px; color: var(--accent-gold); background: none; border: none;
  cursor: pointer; padding: 2px 6px; border-radius: 4px;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
  transition: background .15s, color .15s;
}
.cal-range-btn:hover { background: #fff0f5; }
.cal-range-btn.active { background: var(--accent-rose); color: #fff; }

/* Month list */
.month-list-wrap {
  display: flex; flex-direction: column;
  flex: 1;
  min-height: 0;
  margin: 0 15px;
  border-bottom: none;
  position: relative;
}
.month-list-wrap::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: #f0dde4;
}
.month-list-label {
  font-size: 11px; letter-spacing: .03em;
  color: #c0c0c0; padding: 10px 20px 6px; flex-shrink: 0;
}
.month-list {
  overflow-y: auto; padding: 0 12px 8px; flex: 1;
  mask-image: linear-gradient(to bottom, black calc(100% - 15px), transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black calc(100% - 15px), transparent 100%);
}
.month-list.faded-top {
  mask-image: linear-gradient(to bottom, transparent 0%, black 15px, black calc(100% - 15px), transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 15px, black calc(100% - 15px), transparent 100%);
}
.month-list::-webkit-scrollbar { width: 3px; }
.month-list::-webkit-scrollbar-thumb { background: #f5c0d6; border-radius: 2px; }

.month-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 8px; border-radius: 8px; cursor: pointer;
  color: var(--bubble-text); font-size: 12.5px;
  transition: background .12s, color .12s; margin-bottom: 1px;
}
.month-item:hover { background: #fff0f5; }
.month-item.active { background: #ffe9f1; color: var(--accent-rose); }
.month-item .mi-count {
  font-size: 11px; color: var(--date-text);
  background: rgba(0,0,0,.05); padding: 1px 7px; border-radius: 20px;
  flex-shrink: 0;
}
.month-item.active .mi-count { color: var(--accent-rose); background: rgba(232,123,154,.12); }

.sidebar-footer { padding: 10px 20px; border-top: 1px solid #f0dde4; flex-shrink: 0; }
.post-count-label { font-size: 12px; color: var(--date-text); }

/* ── Chat Main ── */
.chat-main {
  flex: 1; display: flex; flex-direction: column;
  background: var(--chat-bg); overflow: hidden;
  position: relative;
}

.pull-older-hint {
  position: absolute; top: 70px; left: 0; right: 0; z-index: 20;
  text-align: center; font-size: 12px; color: var(--date-text);
  pointer-events: none; opacity: 0;
  transition: opacity .25s;
  letter-spacing: .04em;
}

.pull-next-indicator {
  position: absolute; bottom: 78px; left: 0; right: 0; z-index: 20;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  pointer-events: none; opacity: 0;
}
#pull-next-progress { transition: stroke-dashoffset .08s linear; }
.pull-next-label {
  font-size: 11px; color: var(--accent-rose);
  letter-spacing: .05em; font-weight: 500;
}

/* ── Chat Header (iOS-style) ── */
.chat-header {
  background: var(--header-bg);
  border-bottom: none;
  padding: 10px 14px 10px;
  flex-shrink: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  gap: 8px;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,.11);
}

.header-icon-btn {
  background: none; border: none; cursor: pointer;
  font-size: 22px; color: var(--accent-rose); padding: 4px 8px;
  border-radius: 8px; transition: box-shadow .15s; flex-shrink: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
  grid-row: 1;
  align-self: center;
}
.header-icon-btn:hover { box-shadow: 0 0 10px rgba(232, 123, 154, 0.15); }
#cal-toggle-btn { font-weight: 300; }
#right-panel-btn { letter-spacing: 0.08em; }

.header-center { display: contents; }
.artist-name-wrap { display: flex; align-items: center; justify-content: center; gap: 6px; grid-column: 2; grid-row: 1; width: 100%; place-self: center; }
.artist-name {
  font-size: 18px; font-weight: 700; color: var(--bubble-text);
  white-space: nowrap; font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
}
.alias-edit-btn {
  background: none; border: none; cursor: pointer;
  color: #c4a0a8; font-size: 13px; padding: 2px 4px;
  border-radius: 4px; transition: color .15s, background .15s;
}
.alias-edit-btn:hover { color: var(--accent-rose); background: #fff0f5; }

.artist-sub {
  font-size: 11px; color: #000; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 1px;
  grid-column: 1 / -1;
  grid-row: 2;
}
.artist-with-jw {
  font-family: 'Oleo Script', system-ui; font-weight: 700; font-size: 13px;
}
.fan-days-inline {
  vertical-align: baseline;
}
.online-dot { width: 6px; height: 6px; background: var(--online-dot); border-radius: 50%; flex-shrink: 0; }

.header-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; grid-column: 3; grid-row: 1; align-self: center; }

.fan-days-badge {
  background: #ffd6e7; color: var(--accent-rose);
  font-size: 11px; font-weight: 600;
  padding: 3px 9px; border-radius: 20px;
  white-space: nowrap; border: 1px solid #f5c0d6;
}
/* Inline variant inside the subtitle */
.fan-days-inline {
  display: inline; margin-left: 5px;
  font-weight: 700; color: #000;
  font-size: 12px; letter-spacing: -0.03em;
  position: relative; top: -1.5px;
}

/* Alias bar */
.alias-bar {
  background: #fff8fa; border-bottom: 1px solid #f0dde4;
  padding: 8px 16px; display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.alias-input-wrap {
  display: flex; align-items: center; gap: 6px;
  border-bottom: 1px solid #f5c0d6; margin-bottom: 10px;
}
.alias-input-wrap:focus-within { border-bottom-color: var(--accent-rose); }
.alias-input {
  flex: 1; font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif; font-size: 14px;
  border: none; outline: none; background: transparent;
  padding: 6px 0; color: var(--bubble-text);
}
.alias-clear-btn {
  background: none; border: none; cursor: pointer; padding: 2px 4px;
  font-size: 12px; color: #bbb; flex-shrink: 0; line-height: 1;
}
.alias-clear-btn:hover { color: var(--date-text); }
.alias-count { font-size: 11px; color: #bbb; white-space: nowrap; flex-shrink: 0; }
.alias-save, .alias-cancel {
  font-size: 12px; font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
  border-radius: 8px; padding: 6px 14px; cursor: pointer; border: none;
}
.alias-save { background: #2e4a2e; color: #d4ecc8; }
.alias-save:hover { background: #3a5e3a; }
.alias-cancel { background: none; color: var(--date-text); }
.alias-cancel:hover { background: #fff0f5; }

/* Story bar */
.story-bar {
  background: #ffffff; padding: 6px 16px;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0; border-bottom: none;
}
.story-btn {
  font-size: 12.5px; font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
  background: none; border: none;
  color: var(--date-text); border-radius: 20px; padding: 4px 10px;
  cursor: pointer; transition: color .15s, background .15s;
}
.story-btn:hover { color: var(--accent-rose); background: #fff3f7; }
.story-btn.primary { color: var(--accent-rose); font-weight: 500; }
.story-btn.primary:hover { background: #fff3f7; }
.story-progress { font-size: 12px; color: var(--date-text); }

/* ── Messages ── */
.messages {
  flex: 1; overflow-y: auto; padding: 20px 24px 32px;
  display: flex; flex-direction: column; gap: 2px;
}
.messages.story-active { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Ccircle cx='12' cy='12' r='10' fill='%232e4a2e' opacity='.35'/%3E%3Cpolygon points='9,7 19,12 9,17' fill='%23d4ecc8'/%3E%3C/svg%3E") 12 12, pointer; }
.messages::-webkit-scrollbar { width: 5px; }
.messages::-webkit-scrollbar-thumb { background: rgba(245, 192, 214, 0.5); border-radius: 3px; }

/* ── Date Divider ── */
.date-divider {
  display: flex; flex-direction: column; align-items: center;
  margin: 20px 0 10px; gap: 5px;
}
.messages > .date-divider:first-of-type {
  margin-top: 5px;
}
.date-divider::before {
  content: ''; width: 100%; height: 0.5px; background: #f0d8e0;
}
.date-divider::after { display: none; }
.date-divider span {
  white-space: nowrap; font-size: 10px; color: var(--date-text);
}

/* ── Message Bubble ── */
.message-row {
  display: flex; align-items: flex-start; gap: 10px;
  max-width: 92%; margin-bottom: 6px;
}
/* Story mode: CSS hides everything; JS only marks what's visible */
.messages.story-active > * { display: none !important; }
.messages.story-active > .story-visible { display: flex !important; animation: fadeUp .3s ease; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.msg-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  overflow: hidden;
}
.msg-avatar img { width: 100%; height: 100%; object-fit: cover; }
.msg-avatar-fallback {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #ffd6e7, #ffb3d1);
  color: var(--accent-rose); font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}

.bubble-wrap { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; max-width: 260px; }
.bubble-row { display: flex; align-items: flex-end; gap: 6px; min-width: 0; }

.sender-name { font-size: 11.5px; color: var(--date-text); padding-left: 4px; font-weight: 500; }

.bubble {
  background: var(--bubble-bg);
  border: 1px solid var(--bubble-border);
  border-radius: 4px 18px 18px 18px;
  padding: 9px 13px; word-break: break-word;
  position: relative;
  flex: 0 1 auto; min-width: 0;
}
.bubble.image-only { background: transparent; border: none; padding: 0; }
.bubble.video-only { background: transparent; border: none; padding: 0; }

.bubble-text { font-size: 14.5px; line-height: 1.55; color: var(--bubble-text); }

/* Images */
.bubble-img-wrap { margin-top: 8px; }
.bubble-img {
  border-radius: 12px; max-width: 260px; max-height: 340px;
  width: auto; height: auto;
  display: block; cursor: zoom-in;
  border: 1px solid rgba(0,0,0,.06);
  transition: opacity .15s, transform .15s;
}
.bubble-img:hover { opacity: .92; transform: scale(.99); }

/* Videos */
.bubble-video-wrap { margin-top: 8px; position: relative; display: inline-block; }
.bubble-video {
  border-radius: 12px; max-width: 100%; max-height: 280px;
  display: block; background: #000; cursor: pointer;
}
.bubble-video-thumb {
  border-radius: 12px; max-width: 260px; max-height: 340px;
  width: auto; height: auto;
  display: block; cursor: pointer;
  border: 1px solid rgba(0,0,0,.06);
  transition: opacity .15s;
}
.bubble-video-thumb:hover { opacity: .88; }
.play-overlay {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(0,0,0,.45); color: #fff;
  font-size: 20px; display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}

/* bubble-meta: translate btn + time, outside the bubble, aligned to bottom */
.bubble-meta {
  display: flex; flex-direction: column;
  align-items: flex-end; justify-content: flex-end;
  align-self: flex-end;
  gap: 3px; flex-shrink: 0;
}
.bubble-time { font-size: 11px; color: var(--date-text); white-space: nowrap; flex-shrink: 0; align-self: flex-end; }

.translate-btn {
  background: none; border: none; cursor: pointer;
  padding: 2px 4px; border-radius: 4px;
  color: var(--accent-gold); opacity: .55;
  display: inline-flex; align-items: center;
  transition: opacity .15s, color .15s;
}
.translate-btn:hover { opacity: 1; }
.translate-btn.active { opacity: 1; color: var(--accent-rose); }
.translate-btn:disabled { opacity: .3; cursor: default; }

.translation-block {
  margin-top: 7px; padding-top: 7px;
  border-top: 1px dashed #F9D2DE;
  font-size: 13.5px; color: var(--trans-text);
  line-height: 1.5; display: none;
}
.translation-block.visible { display: block; }

/* ── Comment (artist reply) row ── */
.message-row.is-comment {
  margin-left: 40px;
  margin-top: -2px;
  padding-left: 14px;
  position: relative;
}
.message-row.is-comment::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 1.7px;
  background: rgba(196, 160, 168, 0.34);
  border-radius: 2px;
}

/* ── Story mode button (lives in bottom bar) ── */
.appear-toggle {
  width: 34px; height: 34px; border-radius: 50%;
  background: #ffffff; color: #F9D2DE;
  border: 1.5px solid #F9D2DE; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .2s, border-color .2s, color .2s, transform .15s;
}
.appear-toggle svg { display: block; }
.appear-toggle:hover { background: #fff0f5; transform: scale(1.06); }
.appear-toggle.active { color: var(--accent-rose); border-color: var(--accent-rose); background: #fff0f5; }

/* ── Scroll-to-bottom FAB ── */
.scroll-bottom-btn {
  position: absolute; bottom: 72px; right: 16px;
  width: 36px; height: 36px;
  background: none; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
  color: var(--date-text);
  opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .15s;
}
.scroll-bottom-btn.visible { opacity: 1; pointer-events: all; }
.scroll-bottom-btn:hover { transform: scale(1.12); }

/* ── Decorative bottom bar / fake input ── */
.bottom-bar {
  height: 60px; background: var(--header-bg);
  border-top: none;
  display: flex; align-items: center;
  padding: 0 14px 8px; flex-shrink: 0;
  gap: 10px;
  box-shadow: 0 -2px 5px rgba(0,0,0,.11);
  border-radius: 10px 10px 0 0;
}
.fake-input {
  flex: 1; border: none; border-radius: 24px;
  padding: 10px 18px; font-size: 13.5px; color: #c4a0a8;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
  pointer-events: none; user-select: none;
  background: rgba(0,0,0,.03);
}

/* ── Lightbox ── */
.lightbox {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.9); z-index: 1000;
  align-items: center; justify-content: center;
}
.lightbox.open { display: flex; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.lightbox-inner { position: relative; max-width: 92vw; max-height: 92vh; }
.lightbox-inner img { max-width: 92vw; max-height: 92vh; border-radius: 12px; object-fit: contain; }
.lightbox-close {
  position: absolute; top: -42px; right: 0;
  background: none; border: none; color: rgba(255,255,255,.75);
  font-size: 22px; font-weight: 300; cursor: pointer; opacity: .85; transition: opacity .15s;
}
.lightbox-close:hover { opacity: 1; }

.lightbox-video-link {
  display: block; margin-top: 12px; text-align: center;
  color: #d4ecc8; font-size: 13px; font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
  background: rgba(255,255,255,.1); border-radius: 20px;
  padding: 8px 20px; text-decoration: none;
  transition: background .15s;
}
.lightbox-video-link:hover { background: rgba(255,255,255,.18); }

/* Loading dots inside lightbox (dark background variant) */
#lightbox-video-loading .loading-dots span { background: #8a9a80; }

/* ── Empty / Loading ── */
.empty-state {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: var(--date-text); gap: 10px;
}
.empty-state .flower { font-size: 36px; opacity: .45; }
.empty-state .empty-icon { color: var(--date-text); opacity: .7; margin-bottom: 4px; }
.empty-state p { font-size: 13px; color: #c0c0c0; }

.loading-dots { display: flex; gap: 5px; align-items: center; justify-content: center; padding: 32px; }
.loading-dots span {
  width: 6px; height: 6px; border-radius: 50%; background: #f5c0d6;
  animation: bounce 1.2s infinite;
}
.loading-dots span:nth-child(2) { animation-delay: .2s; }
.loading-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes bounce {
  0%,80%,100% { transform: scale(.7); opacity: .5; }
  40%          { transform: scale(1); opacity: 1; }
}

/* ── Favorites ── */
.fav-heart-indicator {
  position: absolute; bottom: -10px; left: 6px;
  font-size: 15px; line-height: 1; pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.15));
  z-index: 5;
}
.fav-heart-pop {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  font-size: 30px; pointer-events: none; animation: heartPop .55s ease forwards;
  z-index: 10;
}
@keyframes heartPop {
  0%   { opacity: 1; transform: translate(-50%,-55%) scale(.7); }
  45%  { opacity: 1; transform: translate(-50%,-68%) scale(1.5); }
  100% { opacity: 0; transform: translate(-50%,-88%) scale(1.1); }
}

/* ── Media grid overlay ── */
.media-grid-overlay {
  position: fixed; inset: 0; background: var(--chat-bg); z-index: 900;
  display: flex; flex-direction: column;
}
.mg-header {
  display: flex; align-items: center; padding: 16px 20px;
  border-bottom: 1px solid #f0dde4; background: var(--header-bg);
  flex-shrink: 0;
}
.mg-close {
  background: none; border: none; font-size: 20px; font-weight: 300; cursor: pointer;
  color: #B2936F; line-height: 1; padding: 0 10px 0 0; opacity: .85;
}
.mg-title { font-size: 15px; font-weight: 600; color: var(--bubble-text); }
.mg-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 2px; overflow-y: auto; flex: 1; padding: 2px;
}
.mg-item {
  aspect-ratio: 1; overflow: hidden; cursor: zoom-in; position: relative;
}
.mg-item img {
  width: 100%; height: 100%; object-fit: cover;
  transition: opacity .15s;
}
.mg-item:hover img { opacity: .85; }
.mg-item .mg-video-badge {
  position: absolute; bottom: 6px; right: 6px;
  background: rgba(0,0,0,.5); color: #fff; border-radius: 4px;
  font-size: 11px; padding: 2px 6px;
}
.mg-load-more {
  grid-column: 1 / -1; padding: 14px;
  background: #ffd6e7; border: none; border-radius: 20px;
  color: var(--accent-rose); font-size: 13px; font-weight: 500;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
  cursor: pointer; margin: 10px 4px 4px; transition: background .15s;
}
.mg-load-more:hover { background: #ffcadf; }

/* ── Our Box Overlay ── */
.ourbox-overlay {
  position: fixed; inset: 0; background: var(--chat-bg); z-index: 900;
  display: flex; flex-direction: column;
}
.ob-header {
  display: flex; align-items: center; padding: 16px 20px;
  border-bottom: 1px solid #f0dde4; background: var(--header-bg);
  flex-shrink: 0;
}
.ob-close {
  background: none; border: none; font-size: 20px; font-weight: 300; cursor: pointer;
  color: #B2936F; line-height: 1; padding: 0 10px 0 0; opacity: .85;
}
.ob-title { font-size: 15px; font-weight: 600; color: var(--bubble-text); }
.ob-hint { font-size: 11.5px; color: var(--date-text); padding: 8px 16px 4px; flex-shrink: 0; }
.ob-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: calc((100vw - 34px) / 3);
  gap: 5px; overflow-y: auto; flex: 1; padding: 8px 12px 16px;
}
.ob-grid-empty {
  text-align: center; color: var(--date-text); font-size: 13px;
  font-style: italic; padding: 40px 20px;
}
.ob-cell {
  overflow: hidden; cursor: pointer; position: relative;
  border-radius: 10px;
}
.ob-cell-img {
  width: 100%; height: 100%; object-fit: cover;
  transition: opacity .15s;
}
.ob-cell:active .ob-cell-img { opacity: .8; }
.ob-cell-text {
  width: 100%; height: 100%; background: #fff0f5; border-radius: 10px;
  display: flex; align-items: flex-start; justify-content: flex-start;
  padding: 10px 9px; overflow: hidden;
}
.ob-cell-text span {
  font-size: 11px; color: var(--bubble-text); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical;
  overflow: hidden; word-break: break-all;
}
.ob-cell-heart {
  position: absolute; top: 5px; right: 6px;
  font-size: 11px; opacity: .6;
}

/* Feedback link */
.rp-feedback {
  padding: 20px 20px 28px;
  text-align: center;
  margin-top: auto;
  flex-shrink: 0;
}
.rp-feedback-link {
  font-size: 11.5px; color: #c8c8c8; text-decoration: none;
  transition: color .15s;
}
.rp-feedback-link:hover { color: #a0a0a0; }
