/* ─── PROFILE (TikTok/Snapchat redesign) ─────── */
.profile-header { display: flex; align-items: center; gap: 10px; padding: 14px 16px; padding-top: calc(14px + env(safe-area-inset-top)); border-bottom: 1px solid var(--border); font-size: 16px; font-weight: 700; background: var(--bg); letter-spacing: -0.01em; }
.back-btn { background: none; border: none; color: var(--text-2); cursor: pointer; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: background 0.15s; }
.back-btn:hover { background: var(--surface-2); }
.profile-edit-btn { margin-left: auto; background: none; border: none; color: var(--accent-ink); padding: 6px 8px; font-size: 14px; font-weight: 700; cursor: pointer; border-radius: 8px; }

/* ─── PROFILE BODY ────────────────────────────── */
.profile-body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; align-items: center; padding: 20px 16px 40px; gap: 0; }

/* ─── STORY RING AVATAR ───────────────────────── */
.profile-story-ring {
  width: 108px; height: 108px;
  border-radius: 50%;
  padding: 3px;
  background: var(--story-ring);
  display: flex; align-items: center; justify-content: center;
}
.profile-avatar-big {
  width: 120px; height: 120px;
  background: var(--av-bg);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 58px;
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 3px var(--bg);
  overflow: hidden;
}
.profile-avatar-photo { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 3px solid var(--accent); box-shadow: 0 0 0 3px var(--bg); }

/* ─── PROFILE NAME & TAGS ─────────────────────── */
.profile-name { font-family: var(--font-display); font-size: 26px; font-weight: 800; letter-spacing: -0.03em; margin-top: 14px; margin-bottom: 10px; }
.profile-tags { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; margin-bottom: 20px; }
.profile-tag { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 5px 13px; font-size: 12px; font-weight: 700; color: var(--text-2); }
.profile-tag-vibe { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.profile-tag-lang { background: var(--surface-2); border-color: var(--border); color: var(--text-2); }

/* ─── STATS CARD ──────────────────────────────── */
.profile-stats { display: flex; gap: 0; width: 100%; height: 90px; background: var(--surface-2); border-radius: 16px; border: 1px solid var(--border-2); overflow: hidden; margin-bottom: 16px; flex-shrink: 0; }
.profile-stats .stat { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 16px 8px; position: relative; height: 100%; box-sizing: border-box; }
.profile-stats .stat:not(:last-child)::after { content: ''; position: absolute; right: 0; top: 15%; height: 70%; width: 1px; background: var(--border); }
.profile-stats .stat span { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; color: var(--text); line-height: 1; display: block; }
.profile-stats .stat label { font-size: 11px; color: var(--text-3); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; cursor: default; display: block; }

/* ─── SECTION TITLE ───────────────────────────── */
.profile-section-title { align-self: flex-start; font-size: 11px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-3); margin-top: 20px; margin-bottom: 8px; padding-left: 2px; }

/* ─── ACTION BUTTONS (TikTok list style) ─────── */
.profile-action-list { width: 100%; margin-top: 8px; background: var(--surface); border-radius: 14px; overflow: hidden; border: 1px solid var(--border); flex-shrink: 0; align-self: stretch; }
.profile-action-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 16px; background: none; border: none; border-bottom: 1px solid var(--border); cursor: pointer; font-family: inherit; text-align: left; transition: background 0.15s; }
.profile-action-row:last-child { border-bottom: none; }
.profile-action-row:hover { background: var(--surface-2); }
.profile-action-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.profile-action-label { flex: 1; font-size: 14px; font-weight: 600; color: var(--text); }

/* ─── SIDEBAR BOTTOM BAR ──────────────────────── */
.sidebar-bottom-bar {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
  display: flex; align-items: center; gap: 4px;
}
.sidebar-icon-btn {
  background: none; border: none; cursor: pointer; padding: 8px;
  color: var(--text-2); display: flex; align-items: center; justify-content: center;
  border-radius: 10px; transition: background 0.15s; flex-shrink: 0;
}
.sidebar-icon-btn:hover { background: rgba(255,255,255,0.07); }
.sidebar-user-btn {
  display: flex; align-items: center; gap: 12px;
  background: none; border: none; cursor: pointer;
  padding: 8px 10px; border-radius: 14px; flex: 1; min-width: 0;
  transition: background 0.15s;
}
.sidebar-user-btn:hover { background: var(--surface-2); }
.sidebar-user-ring {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--accent-soft); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.sidebar-user-avatar {
  width: 100%; height: 100%; background: transparent; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 19px;
  background-size: cover; background-position: center; overflow: hidden;
  color: #8b9cf7;
}
.sidebar-user-name {
  font-size: 15px; font-weight: 600; color: var(--text); flex: 1; text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.01em;
}

/* ─── COMPANION STORY RING (sidebar) ─────────── */
.companion-story-ring {
  width: 56px; height: 56px; border-radius: 50%;
  padding: 2px; background: var(--story-ring); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.companion-avatar {
  width: 52px; height: 52px; background: var(--av-bg); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 25px;
  outline: 2px solid var(--bg); outline-offset: -1px; overflow: hidden;
}

/* ─── USER PROFILE SCREEN ─────────────────────── */
.user-profile-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 14px 16px; width: 100%; margin-top: 16px;
}
.user-field-label { display: block; font-size: 11px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-3); margin-bottom: 8px; }
.user-field-input {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 11px 14px; color: var(--text); font-size: 16px;
  outline: none; transition: border-color 0.15s;
}
.user-field-input:focus { border-color: var(--accent); }
.user-field-input::placeholder { color: var(--text-3); }
.user-field-hint { font-size: 12px; color: var(--text-3); margin-top: 7px; }
.user-save-btn {
  width: 100%; margin-top: 20px; padding: 15px;
  background: var(--accent); border: none; border-radius: 16px;
  color: var(--on-accent); font-size: 16px; font-weight: 700;
  cursor: pointer; transition: all 0.15s;
}
.user-save-btn:hover { filter: brightness(1.1); transform: scale(1.01); }

/* ─── CREATE MODAL ───────────────────────────── */
.modal-overlay { position: fixed; inset: 0; z-index: 400; background: rgba(0,0,0,0.7); backdrop-filter: blur(8px); display: none; align-items: flex-end; justify-content: center; padding: 0; }
.modal-overlay.active { display: flex; }
.modal-card { background: var(--elev); border: 1px solid var(--border); border-radius: 24px 24px 0 0; width: 100%; max-width: 500px; max-height: 85vh; overflow-y: auto; padding: 20px; box-shadow: var(--shadow-pop); animation: slideUp 0.3s cubic-bezier(0.34,1.56,0.64,1); }
@keyframes slideUp { from{transform:translateY(100%);opacity:0} to{transform:translateY(0);opacity:1} }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal-header span { font-family: var(--font-display); font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.modal-close { background: var(--surface-2); border: none; border-radius: 50%; width: 34px; height: 34px; cursor: pointer; color: var(--text-2); font-size: 16px; }
.modal-step { display: none; flex-direction: column; gap: 12px; }
.modal-step.active { display: flex; }
.modal-label { font-size: 12px; color: var(--text-3); font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.modal-input { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 13px 14px; color: var(--text); font-size: 15px; font-family: inherit; outline: none; width: 100%; }
.modal-input:focus { border-color: var(--accent); }
.modal-input::placeholder { color: var(--text-3); }
.modal-avatar-picker { display: grid; grid-template-columns: repeat(6,1fr); gap: 8px; }
.avatar-opt { font-size: 24px; text-align: center; padding: 8px 4px; border-radius: 12px; cursor: pointer; background: var(--surface-2); border: 2px solid transparent; transition: all 0.15s; }
.avatar-opt:hover { background: var(--surface); }
.avatar-opt.selected { border-color: var(--accent); background: var(--accent-soft); }
.vibe-grid, .lang-grid, .gender-grid, .voice-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.vibe-btn, .lang-btn, .gender-btn, .voice-btn { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 9px 14px; color: var(--text-2); font-size: 13.5px; font-weight: 500; cursor: pointer; transition: all 0.15s; }
.vibe-btn.selected, .lang-btn.selected, .gender-btn.selected, .voice-btn.selected { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.personality-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.pers-btn { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 13px; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; cursor: pointer; transition: all 0.15s; text-align: left; }
.pers-btn span { font-size: 22px; }
.pers-btn b { font-size: 14.5px; color: var(--text); display: block; }
.pers-btn small { font-size: 11.5px; color: var(--text-2); }
.pers-btn.selected { background: var(--accent-soft); border-color: var(--accent); }
.pers-btn.selected b { color: var(--accent-ink); }
.modal-next-btn, .modal-create-btn { background: var(--accent); border: none; border-radius: var(--radius); padding: 15px; color: var(--on-accent); font-size: 15.5px; font-weight: 700; cursor: pointer; transition: all 0.15s; width: 100%; box-shadow: var(--shadow-card); }
.modal-next-btn:hover, .modal-create-btn:hover { filter: brightness(1.08); transform: scale(1.01); }
.modal-back-btn { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; color: var(--text-2); font-size: 14px; cursor: pointer; width: 100%; }

/* ─── TOAST ──────────────────────────────────── */
.toast { position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--elev); border: 1px solid var(--border); border-radius: 999px; padding: 9px 18px; font-size: 13px; color: var(--text); box-shadow: var(--shadow-pop); opacity: 0; transition: all 0.25s; z-index: 9999; white-space: nowrap; }
.toast.toast-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─── MOBILE ─────────────────────────────────── */
@media (max-width: 640px) {
  .app-shell { max-width: 100%; }
  .sidebar { position: fixed; inset: 0; z-index: 50; width: 100%; display: none; }
  .sidebar.sidebar-active { display: flex; }
  .chat-panel { display: none; width: 100%; }
  .chat-panel.panel-active { display: flex; }
  .back-to-sidebar { display: flex; }
}

/* ─── VOICE TRANSCRIPT ───────────────────────── */
.msg-voice-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: none !important;
  border: none !important;
  padding: 0 !important;
}

.voice-transcript-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: color-mix(in srgb, var(--on-accent) 65%, transparent);
  display: flex;
  align-items: center;
  padding: 0 2px;
  flex-shrink: 0;
  transition: color 0.15s;
}
.voice-transcript-btn:hover { color: var(--on-accent); }
.msg.ai .voice-transcript-btn { color: var(--text-3); }
.msg.ai .voice-transcript-btn:hover { color: var(--text); }

.voice-transcript {
  font-size: 12px;
  color: var(--text-2);
  padding: 6px 12px;
  background: var(--surface-2);
  border-radius: 10px;
  border-left: 2px solid var(--accent);
  line-height: 1.5;
  font-style: italic;
  animation: msgIn 0.2s ease forwards;
}

.msg.user .voice-transcript {
  border-left-color: color-mix(in srgb, var(--on-accent) 50%, transparent);
  color: color-mix(in srgb, var(--on-accent) 80%, transparent);
}

/* Japanese font support */

.lang-ja .msg { font-family: 'Noto Sans JP', sans-serif; }

/* ─── DELETE & EDIT BUTTONS ──────────────────── */
.msg-delete-btn { color: rgba(255,59,48,0.5); }
.msg-delete-btn:hover { color: #ff3b30 !important; background: rgba(255,59,48,0.15) !important; }

.msg-edit-btn { color: rgba(255,255,255,0.4); }
.msg-edit-btn:hover { color: var(--blue-light) !important; background: rgba(0,132,255,0.15) !important; }

.msg-row.editing .msg { 
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  opacity: 0.7;
}

.reply-bar.edit-mode {
  background: rgba(255,159,10,0.12);
  border-top-color: rgba(255,159,10,0.3);
}

.reply-bar.edit-mode .reply-bar-text { color: #ff9f0a; }

@keyframes msgOut {
  from { opacity: 1; transform: scale(1); max-height: 200px; }
  to   { opacity: 0; transform: scale(0.9); max-height: 0; margin: 0; padding: 0; }
}

/* ─── TIKTOK ACTION BUTTONS ──────────────────── */
.tik-action-btn {
  width: 30px !important;
  height: 30px !important;
  border-radius: 50% !important;
  background: rgba(255,255,255,0.08) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.15s !important;
  color: rgba(255,255,255,0.6) !important;
}

.tik-action-btn:hover {
  transform: scale(1.15) !important;
  background: rgba(255,255,255,0.14) !important;
}

/* Edit bar styling */
.reply-bar.edit-mode {
  background: rgba(255,159,10,0.12);
  border-top-color: rgba(255,159,10,0.3);
  gap: 8px;
}

.reply-bar.edit-mode::before {
  content: '✏️';
  font-size: 14px;
}

.reply-bar.edit-mode .reply-bar-text {
  color: #ff9f0a;
  font-style: italic;
}

/* Edited label */
.edited-label {
  font-size: 10px;
  opacity: 0.45;
  margin-left: 6px;
  font-style: italic;
}
/* ─── SELECT BAR BUTTONS ─────────────────────── */
.select-bar-cancel-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-2);
  transition: all 0.18s; flex-shrink: 0;
}
.select-bar-cancel-btn:hover {
  background: var(--surface);
  border-color: var(--border-2);
  color: var(--text);
  transform: scale(1.1);
}
.select-bar-cancel-btn:active { transform: scale(0.93); }

.select-bar-all-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--accent-ink);
  transition: all 0.18s; flex-shrink: 0;
}
.select-bar-all-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  filter: brightness(1.1);
  transform: scale(1.1);
}
.select-bar-all-btn:active { transform: scale(0.93); }

/* ─── SELECT BAR DELETE ──────────────────────── */
.select-bar-delete-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,59,48,0.1);
  border: 1px solid rgba(255,59,48,0.25);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.18s;
  flex-shrink: 0;
}
.select-bar-delete-btn:hover {
  background: rgba(255,59,48,0.22);
  border-color: rgba(255,59,48,0.5);
  transform: scale(1.1);
}
.select-bar-delete-btn:active { transform: scale(0.93); }

/* ─── MULTI-SELECT ───────────────────────────── */
.select-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(0,132,255,0.12);
  border-top: 1px solid rgba(0,132,255,0.25);
  gap: 12px;
}

.select-cancel-btn {
  background: none; border: none; color: rgba(255,255,255,0.6);
  cursor: pointer; font-size: 14px; padding: 4px 8px;
}

.select-count {
  flex: 1; text-align: center; font-size: 14px;
  color: rgba(255,255,255,0.85); font-weight: 500;
}

.select-action-btn {
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15);
  color: #fff; padding: 6px 14px; border-radius: 10px; cursor: pointer; font-size: 13px;
}

.select-delete-btn {
  background: rgba(255,59,48,0.2); border: 1px solid rgba(255,59,48,0.3);
  color: #ff3b30; padding: 6px 14px; border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 600;
}

.msg-checkbox {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--border-2);
  align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; transition: all 0.15s;
  color: transparent; background: transparent;
  margin: auto 4px;
}

.msg-checkbox.checked {
  background: var(--accent); border-color: var(--accent); color: var(--on-accent);
}

.msg-checkbox { width:22px;height:22px;border-radius:50%;border:2px solid var(--border-2);display:flex;align-items:center;justify-content:center;cursor:pointer;flex-shrink:0;color:transparent;background:transparent;transition:all 0.15s;margin:auto 4px; }
.msg-checkbox.checked { background:var(--accent);border-color:var(--accent);color:var(--on-accent); }
.msg-row.selected .msg { opacity:0.7;outline:2px solid var(--accent);outline-offset:2px;border-radius:14px; }

/* ─── MOOD RING ──────────────────────────────── */
.avatar { transition: box-shadow 0.4s ease; }

/* ─── TYPING STATUS ──────────────────────────── */
.dot { transition: background 0.3s, box-shadow 0.3s; }
.dot.dot-typing { background: #FF9F0A !important; box-shadow: 0 0 5px rgba(255,159,10,0.7) !important; }
#statusText { transition: opacity 0.2s; }

/* ─── STREAK BADGE ───────────────────────────── */
.streak-badge { font-size: 10px; font-weight: 800; color: #FF9F0A; margin-left: 4px; background: rgba(255,159,10,0.12); padding: 1px 5px; border-radius: 8px; }

/* ─── CHAT SEARCH HIGHLIGHT ──────────────────── */
.search-match .msg { outline: 2px solid rgba(255,215,0,0.3) !important; border-radius: 14px !important; }
.search-current .msg { outline: 2px solid #FFD60A !important; box-shadow: 0 0 14px rgba(255,214,10,0.35) !important; border-radius: 14px !important; }

/* ─── BOND / XP BAR ──────────────────────────── */
.bond-section { padding: 4px 0 14px; width: 100%; }
.bond-label-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; font-size: 13px; }
.bond-level { color: var(--accent-ink); font-weight: 600; }
.streak-count { font-weight: 800; font-size: 14px; background: linear-gradient(135deg, #FF9F0A, #ff0050); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.xp-track { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.xp-fill { height: 100%; background: linear-gradient(90deg, var(--tik-cyan), #0084FF, #8855ff, var(--tik-pink)); border-radius: 10px; width: 0%; transition: width 0.6s cubic-bezier(0.34,1.56,0.64,1); }

/* ─── APP THEME PICKER (Midnight / Aura / Paper) ── */
.app-theme-row { display: flex; gap: 12px; padding: 4px 0 14px; width: 100%; }
.app-theme-dot { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; background: transparent; border: none; cursor: pointer; padding: 0; }
.att-swatch {
  width: 100%; height: 46px; border-radius: 13px;
  background: var(--bg); border: 1px solid var(--border);
  position: relative; overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}
.att-swatch::before { content: ''; position: absolute; left: 9px; top: 10px; right: 26px; height: 7px; border-radius: 4px; background: var(--surface-2); }
.att-swatch::after  { content: ''; position: absolute; right: 9px; bottom: 9px; width: 17px; height: 17px; border-radius: 50%; background: var(--accent); }
.app-theme-dot.active .att-swatch { box-shadow: 0 0 0 2px var(--accent); transform: translateY(-1px); }
.app-theme-dot:hover .att-swatch { transform: translateY(-1px); }
.att-label { font-size: 11.5px; color: var(--text-muted); font-weight: 600; }
.app-theme-dot.active .att-label { color: var(--text); }

/* ─── BG THEME PICKER ────────────────────────── */
.bg-theme-row { display: flex; gap: 10px; padding: 4px 0 14px; width: 100%; }
.bg-dot { width: 28px; height: 28px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: all 0.18s; flex-shrink: 0; }
.bg-dot.active { border-color: var(--text); transform: scale(1.18); }
.bg-dot:hover { transform: scale(1.1); }
.bg-dot-upload { background: var(--surface-2) !important; font-size: 13px; display: flex; align-items: center; justify-content: center; }

/* ─── PROFILE PHOTO ──────────────────────────── */
.profile-avatar-wrap { position: relative; display: inline-flex; cursor: pointer; margin-bottom: 4px; }
.profile-avatar-photo { width: 92px; height: 92px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 5px var(--bg), 0 0 0 7px var(--accent); border: none; }
.photo-edit-badge { position: absolute; bottom: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 50%; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; font-size: 11px; pointer-events: none; }
.profile-avatar-wrap:hover .photo-edit-badge { background: var(--accent); }

/* ─── TOPBAR AVATAR PHOTO ────────────────────── */
.avatar-photo-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; position: absolute; inset: 0; }
.avatar { position: relative; overflow: hidden; }

/* ─── SIDEBAR COMPANION PHOTO ────────────────── */
.companion-photo-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* ─── SETTINGS SCREEN ───────────────────────── */
.settings-body { flex: 1; overflow-y: auto; padding: 8px 0 24px; }
.settings-section { margin: 12px 0; }
.settings-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 20px; background: none; border: none; border-bottom: 1px solid var(--border); cursor: pointer; font-family: inherit; text-align: left;
  transition: background 120ms ease-out; }
.settings-row:first-child { border-top: 1px solid var(--border); }
.settings-row:hover { background: var(--surface-2); }
.settings-row:active { background: var(--surface); }
.settings-row-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.settings-row-body { flex: 1; min-width: 0; }
.settings-row-title { font-size: 14px; font-weight: 600; color: var(--text); }
.settings-row-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.settings-row-chevron { color: var(--text-3); flex-shrink: 0; }

/* ─── BLOG SCREEN ───────────────────────────── */
.blog-body { flex: 1; overflow-y: auto; padding: 8px 0 32px; }
.blog-article-content { font-size: 15px; line-height: 1.75; color: var(--text-2); }
.blog-article-content p { margin-bottom: 16px; }
.blog-article-content h3 { font-size: 17px; font-weight: 700; color: var(--text); margin: 24px 0 10px; letter-spacing: -0.02em; }
.blog-article-content ul { padding-left: 20px; margin-bottom: 16px; }
.blog-article-content li { margin-bottom: 8px; }
.blog-article-content strong { color: var(--text); font-weight: 700; }
.blog-post { padding: 20px 20px 18px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.blog-post-meta { font-size: 11px; font-weight: 600; color: var(--accent); letter-spacing: .03em; text-transform: uppercase; }
.blog-post-title { font-size: 16px; font-weight: 700; color: var(--text); line-height: 1.4; text-wrap: balance; }
.blog-post-preview { font-size: 13px; color: var(--text-2); line-height: 1.6; text-wrap: pretty; }
.blog-post-read { align-self: flex-start; background: none; border: none; color: var(--accent); font-size: 13px; font-weight: 600; cursor: pointer; padding: 0; font-family: inherit;
  transition: opacity 120ms ease-out; }
.blog-post-read:hover { opacity: .75; }

/* ─── SERVICE SCREEN ────────────────────────── */
#serviceScreen { flex-direction: column; }

/* Tab bar */
.service-tabs { display: flex; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.service-tab { flex: 1; padding: 11px 0; background: none; border: none; border-bottom: 2px solid transparent; color: var(--text-3); font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; margin-bottom: -1px;
  transition: color 150ms, border-color 150ms; }
.service-tab:hover { color: var(--text-2); }
.service-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* Panel container */
.service-panel { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* Guide intro */
.service-intro { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 24px; gap: 10px; text-align: center; overflow-y: auto; }
.service-guide-avatar { width: 52px; height: 52px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font-size: 22px; display: flex; align-items: center; justify-content: center; }
.service-guide-name { font-size: 16px; font-weight: 700; color: var(--text); }
.service-guide-desc { font-size: 13px; color: var(--text-3); line-height: 1.55; max-width: 280px; text-wrap: pretty; }
.service-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 4px; }
.svc-chips-inline { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 14px 4px; }

/* Service input bar */
.svc-inputbar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--border); }
.svc-inputbox { flex: 1; background: var(--surface-2); border: 1.5px solid var(--border); border-radius: 22px; padding: 10px 16px; color: var(--text); font-size: 14px; font-family: inherit; outline: none; transition: border-color 150ms; }
.svc-inputbox:focus { border-color: var(--accent); }
.svc-inputbox::placeholder { color: var(--text-3); }
.svc-send-btn { width: 40px; height: 40px; border-radius: 50%; border: none; background: var(--accent); color: var(--on-accent); cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: filter 120ms, transform 120ms; }
.svc-send-btn:hover { filter: brightness(1.1); transform: scale(1.06); }
.service-chip { background: var(--surface-2); border: 1px solid var(--border); border-radius: 20px; padding: 7px 14px; font-size: 12px; color: var(--text-2); cursor: pointer; font-family: inherit;
  transition: background 120ms, border-color 120ms, color 120ms; }
.service-chip:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); border-color: var(--accent); color: var(--accent); }
.service-chip:active { transform: scale(0.96); }

/* Contact tab */
.svc-contact-body { flex: 1; overflow-y: auto; padding: 20px 20px 32px; display: flex; flex-direction: column; gap: 14px; }
.svc-contact-header { display: flex; gap: 14px; align-items: flex-start; padding: 16px; background: var(--surface-2); border-radius: 14px; }
.svc-contact-icon { width: 40px; height: 40px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.svc-contact-title { font-size: 14px; font-weight: 700; color: var(--text); }
.svc-contact-sub { font-size: 12px; color: var(--text-3); margin-top: 3px; line-height: 1.5; }
.svc-field-label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.svc-category-row { display: flex; flex-wrap: wrap; gap: 8px; }
.svc-cat-btn { padding: 7px 14px; border: 1px solid var(--border); border-radius: 20px; background: none; color: var(--text-3); font-size: 13px; font-weight: 500; cursor: pointer; font-family: inherit;
  transition: background 120ms, border-color 120ms, color 120ms; }
.svc-cat-btn:hover { color: var(--text-2); border-color: var(--text-3); }
.svc-cat-btn.active { background: color-mix(in srgb, var(--accent) 14%, transparent); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.svc-textarea { width: 100%; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; color: var(--text); font-size: 14px; font-family: inherit; line-height: 1.5; resize: none; outline: none; box-sizing: border-box;
  transition: border-color 150ms; }
.svc-textarea:focus { border-color: var(--accent); }
.svc-textarea::placeholder { color: var(--text-3); }
.svc-char-count { font-size: 11px; color: var(--text-3); text-align: right; margin-top: -8px; }
.svc-submit-btn { width: 100%; padding: 13px; background: var(--accent); color: #fff; border: none; border-radius: 12px; font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit;
  transition: background 120ms, transform 120ms; }
.svc-submit-btn:hover { background: color-mix(in srgb, var(--accent) 85%, #000); }
.svc-submit-btn:active { transform: scale(0.98); }
.svc-submit-btn:disabled { opacity: .5; cursor: not-allowed; }

/* Success state */
.svc-success { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 24px; gap: 10px; text-align: center; }
.svc-success-icon { width: 52px; height: 52px; border-radius: 50%; background: color-mix(in srgb, #22c55e 14%, transparent); color: #22c55e; font-size: 22px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.svc-success-title { font-size: 17px; font-weight: 700; color: var(--text); }
.svc-success-sub { font-size: 13px; color: var(--text-3); line-height: 1.55; max-width: 260px; }

/* ─── USER PHOTO BUTTON ──────────────────────── */
.user-photo-btn { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-size: 15px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.18s; background-size: cover; background-position: center; flex-shrink: 0; }
.user-photo-btn:hover { background-color: var(--accent-soft); border-color: var(--accent); }

/* ─── PAPER THEME OVERRIDES ──────────────────── */
.theme-paper #userProfileAvatarBig {
  border: 2px solid var(--border-2);
  border-radius: 20px;
  background: var(--surface) !important;
}
.theme-paper #userProfileAvatarBig svg {
  stroke: var(--accent-ink);
}
.theme-paper .photo-edit-badge {
  background: var(--surface);
  border-color: var(--border-2);
  color: var(--accent-ink);
}
.theme-paper .profile-avatar-wrap:hover #userProfileAvatarBig {
  border-color: var(--accent);
  background: var(--accent-soft) !important;
}

/* ── Help FAQ ─────────────────────────────── */
.help-faq-item {
  background: var(--surface-2);
  border-radius: 12px;
  margin-bottom: 2px;
  padding: 14px 16px;
}
.help-faq-item summary {
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  color: var(--text);
}
.help-faq-item summary::-webkit-details-marker { display: none; }
.help-faq-item p {
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.6;
  margin-top: 10px;
  margin-bottom: 0;
}

/* ── Relationship Dashboard ───────────────── */
.rel-dash-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface-2); border-radius: 14px;
  padding: 14px 16px; margin-bottom: 8px; cursor: pointer;
  transition: background .15s;
}
.rel-dash-row:hover { background: var(--accent-soft); }

/* ── Create Post mood buttons ─────────────── */
.post-mood-btn {
  background: var(--surface-2); border: 1.5px solid var(--border);
  border-radius: 20px; color: var(--text); padding: 6px 14px;
  font-size: 13px; cursor: pointer; transition: all .15s;
}
.post-mood-btn.active {
  background: var(--accent-soft); border-color: var(--accent);
  color: var(--accent);
}
