:root {
  --bg-primary: #0d0d1a;
  --bg-card: #13131f;
  --bg-card2: #1a1a2e;
  --accent: #7c3aed;
  --accent2: #4f46e5;
  --accent-glow: rgba(124, 58, 237, 0.35);
  --text-primary: #f1f5f9;
  --text-muted: #94a3b8;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --border: rgba(255,255,255,0.08);
}

* { box-sizing: border-box; }
body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
}

/* ---- AUTH ---- */
#auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(124,58,237,0.18) 0%, transparent 60%);
}
.auth-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 0 60px var(--accent-glow);
}
.logo-text {
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, #a78bfa, #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---- LAYOUT ---- */
#app-screen { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}
.sidebar-logo {
  padding: 0 1.25rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 800;
  background: linear-gradient(135deg, #a78bfa, #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all 0.2s;
  text-decoration: none;
}
.nav-item:hover { color: var(--text-primary); background: rgba(124,58,237,0.1); }
.nav-item.active {
  color: #a78bfa;
  border-left-color: #a78bfa;
  background: rgba(124,58,237,0.12);
}
.nav-item i { font-size: 1.1rem; width: 20px; }

.sidebar-bottom {
  margin-top: auto;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
}
.user-pill {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
}
.avatar {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.8rem;
}

.main-content {
  margin-left: 220px;
  flex: 1;
  padding: 2rem;
  max-width: calc(100vw - 220px);
}

/* ---- CARDS ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
}
.card-sm { padding: 1rem 1.25rem; }
.stat-card {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
}

/* ---- HABIT CARD ---- */
.habit-card {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.2s;
  margin-bottom: 0.75rem;
}
.habit-card:hover { border-color: rgba(124,58,237,0.4); box-shadow: 0 0 20px rgba(124,58,237,0.1); }
.habit-card.completed { opacity: 0.65; }

/* ---- MARK DONE BUTTON ---- */
.mark-done-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 12px;
  border: 2px solid rgba(16,185,129,0.6);
  background: rgba(16,185,129,0.12);
  color: #10b981;
  font-weight: 700;
  font-size: .88rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(.34,1.56,.64,1);
  white-space: nowrap;
}
.mark-done-btn i { font-size: 1rem; }
.mark-done-btn:hover {
  background: rgba(16,185,129,0.28);
  border-color: #10b981;
  transform: scale(1.06);
  box-shadow: 0 0 18px rgba(16,185,129,0.35);
}
.mark-done-btn:active { transform: scale(0.97); }
.mark-done-btn.done {
  background: rgba(16,185,129,0.2);
  border-color: #10b981;
  color: #10b981;
  cursor: default;
  box-shadow: 0 0 12px rgba(16,185,129,0.25);
}

/* small icon-only edit/delete buttons */
.btn-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.18s;
  font-size: .85rem;
}
.btn-icon:hover { border-color: rgba(124,58,237,.5); color: var(--text-primary); background: rgba(124,58,237,.1); }
.btn-icon.danger:hover { border-color: rgba(239,68,68,.5); color: #ef4444; background: rgba(239,68,68,.1); }

/* timing chips on habit card */
.timing-chip {
  font-size: .72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
}
.timing-chip.on-time { background: rgba(16,185,129,.15); color: #10b981; border: 1px solid rgba(16,185,129,.3); }
.timing-chip.late    { background: rgba(245,158,11,.12); color: #f59e0b; border: 1px solid rgba(245,158,11,.3); }

/* legacy checkin-btn kept for backwards compat */
.checkin-btn { display: none; }

/* User search results dropdown */
.user-search-results {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-top: 4px;
  max-height: 220px;
  overflow-y: auto;
}
.user-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.user-result-item:last-child { border-bottom: none; }
.user-result-item:hover { background: rgba(124,58,237,0.12); }
.user-result-item.selected { background: rgba(124,58,237,0.2); border: 1px solid rgba(124,58,237,0.4); border-radius: 8px; }

.streak-badge {
  background: rgba(245,158,11,0.15);
  border: 1px solid rgba(245,158,11,0.3);
  color: var(--warning);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.difficulty-bar {
  display: flex; gap: 3px;
}
.diff-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--border);
}
.diff-dot.filled { background: var(--accent); }

/* ---- PROGRESS RING ---- */
.progress-ring-wrap {
  position: relative;
  width: 120px; height: 120px;
  flex-shrink: 0;
}
.progress-ring-wrap svg { transform: rotate(-90deg); }
.progress-ring-text {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}
.progress-pct { font-size: 1.8rem; font-weight: 800; }
.progress-label { font-size: 0.7rem; color: var(--text-muted); }

/* ---- COMPETITION CARD ---- */
.comp-card {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
  margin-bottom: 0.75rem;
}
.vs-badge {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 6px;
  padding: 2px 10px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 1px;
}
.score-bar-wrap { background: rgba(255,255,255,0.06); border-radius: 8px; height: 8px; overflow: hidden; }
.score-bar { height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width 0.5s; }

/* ---- BATTLE ARENA ---- */
.battle-card {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem;
  margin-bottom: .75rem;
  cursor: pointer;
  transition: all 0.2s;
}
.battle-card:hover { border-color: rgba(124,58,237,.4); box-shadow: 0 0 24px rgba(124,58,237,.12); }
.battle-card.active-battle { border-color: rgba(245,158,11,.35); }

/* War progress bar */
.war-bar-outer {
  background: rgba(255,255,255,.06);
  border-radius: 12px;
  height: 22px;
  position: relative;
  overflow: hidden;
  margin: .5rem 0;
}
.war-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #7c3aed, #4f46e5);
  border-radius: 12px 0 0 12px;
  transition: width .6s ease;
  position: relative;
}
.war-bar-divider {
  position: absolute;
  left: 50%; top: 0; bottom: 0;
  width: 2px;
  background: rgba(255,255,255,.2);
  transform: translateX(-50%);
}
.war-bar-sword {
  position: absolute;
  top: 50%; left: var(--pos, 50%);
  transform: translate(-50%, -50%);
  font-size: 1.1rem;
  transition: left .6s ease;
  z-index: 2;
  filter: drop-shadow(0 0 6px rgba(245,158,11,.8));
}

/* AI persona card */
.persona-card {
  display: flex; align-items: center; gap: 14px;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, rgba(124,58,237,.12), rgba(79,70,229,.12));
  border: 1px solid rgba(124,58,237,.3);
  border-radius: 14px;
}
.persona-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}
.persona-strength { display: flex; gap: 3px; margin-top: 4px; }
.str-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.str-dot.filled { background: #f59e0b; }

/* Chat bubbles */
.chat-bubble {
  display: flex; gap: 8px; align-items: flex-start;
  animation: fadeIn .2s ease;
}
.chat-bubble.mine { flex-direction: row-reverse; }
.bubble-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700; flex-shrink: 0;
  color: #fff !important;
}
.bubble-avatar.ai { background: linear-gradient(135deg, #f59e0b, #ef4444); color: #fff !important; }
.bubble-text {
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px 12px 12px 4px;
  padding: .55rem .9rem;
  font-size: .85rem;
  max-width: 75%;
  color: #f1f5f9;
  line-height: 1.5;
}
.chat-bubble.mine .bubble-text {
  border-radius: 12px 12px 4px 12px;
  background: rgba(124,58,237,.25);
  border-color: rgba(124,58,237,.4);
  color: #e9d5ff;
}

/* Kingdom card */
.kingdom-card {
  border-radius: 12px;
  padding: .75rem;
  border: 1px solid var(--border);
  background: var(--bg-card2);
  text-align: center;
  transition: all .2s;
}
.kingdom-card.owned { border-color: rgba(245,158,11,.4); background: rgba(245,158,11,.06); }
.kingdom-card.mine  { border-color: rgba(16,185,129,.4); background: rgba(16,185,129,.06); }

/* ---- TYPING BUBBLE ---- */
.typing-name-row {
  display: flex; align-items: center; gap: 5px;
  font-size: .72rem; margin-bottom: 5px;
}
.typing-name  { color: #a78bfa; font-weight: 700; }
.typing-label { color: var(--text-muted); font-style: italic; }
.typing-ellipsis span {
  color: #a78bfa;
  animation: ellipsis-fade 1.2s ease-in-out infinite;
  display: inline-block;
}
.typing-ellipsis span:nth-child(1) { animation-delay: 0s; }
.typing-ellipsis span:nth-child(2) { animation-delay: 0.2s; }
.typing-ellipsis span:nth-child(3) { animation-delay: 0.4s; }
@keyframes ellipsis-fade {
  0%,100% { opacity: .2; transform: translateY(0); }
  50%      { opacity: 1;  transform: translateY(-2px); }
}

.typing-bubble {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(167,139,250,.1);
  border: 1px solid rgba(167,139,250,.25);
  border-radius: 12px 12px 12px 4px;
  padding: 10px 16px;
  width: fit-content;
}
.typing-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #94a3b8;
  animation: dot-bounce 1.4s ease-in-out infinite;
  display: inline-block;
}
.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.25s; }
.typing-dot:nth-child(3) { animation-delay: 0.5s; }

@keyframes dot-bounce {
  0%, 60%, 100% { transform: translateY(0);    background: #94a3b8; }
  30%            { transform: translateY(-8px); background: #a78bfa; box-shadow: 0 0 8px #a78bfa; }
}

/* Force dark text everywhere in battle detail */
#battle-detail, #battle-detail * { color: var(--text-primary); }
#battle-detail .text-muted-sm { color: var(--text-muted) !important; }
#chat-messages { background: rgba(0,0,0,.15); border-radius: 10px; padding: .75rem; }
#chat-input { background: rgba(255,255,255,.06) !important; color: #f1f5f9 !important; border-color: var(--border) !important; }
#chat-input::placeholder { color: var(--text-muted) !important; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---- LEADERBOARD ---- */
.lb-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.lb-row:last-child { border-bottom: none; }
.rank-num { font-weight: 800; font-size: 1rem; width: 28px; text-align: center; }
.rank-1 { color: #fbbf24; }
.rank-2 { color: #94a3b8; }
.rank-3 { color: #cd7c2b; }

/* ---- XP BAR ---- */
.xp-bar-wrap { background: rgba(255,255,255,0.06); border-radius: 20px; height: 6px; overflow: hidden; margin-top: 4px; }
.xp-bar { height: 100%; background: linear-gradient(90deg, #a78bfa, #60a5fa); border-radius: 20px; transition: width 0.5s; }

/* ---- BADGE ---- */
.badge-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(124,58,237,0.15);
  border: 1px solid rgba(124,58,237,0.3);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #a78bfa;
  margin: 3px;
}

/* ---- FORMS ---- */
.form-control, .form-select {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 10px;
}
.form-control:focus, .form-select:focus {
  background: rgba(255,255,255,0.07);
  border-color: var(--accent);
  color: var(--text-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-select option { background: #1a1a2e; }

/* ---- BUTTONS ---- */
.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
  border: none;
  border-radius: 10px;
  padding: 0.5rem 1.25rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}
.btn-accent:hover { opacity: 0.9; transform: translateY(-1px); color: white; }
.btn-accent:active { transform: translateY(0); }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 10px;
  padding: 0.5rem 1.25rem;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-ghost:hover { border-color: rgba(124,58,237,0.5); color: var(--text-primary); }

/* ---- MODAL ---- */
.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-primary);
}
.modal-header, .modal-footer { border-color: var(--border); }

/* ---- TOAST ---- */
#toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999; }
.toast-msg {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1.2rem;
  margin-top: 0.5rem;
  min-width: 260px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: slideIn 0.3s ease;
}
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.toast-success { border-left: 3px solid var(--success); }
.toast-error   { border-left: 3px solid var(--danger); }
.toast-info    { border-left: 3px solid var(--accent); }

/* ---- MISC ---- */
.page { display: none; }
.page.active { display: block; }
.section-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 1.25rem; }
.text-accent { color: #a78bfa; }
.text-muted-sm { color: var(--text-muted); font-size: 0.82rem; }
.dot-online { width: 8px; height: 8px; border-radius: 50%; background: var(--success); display: inline-block; }

/* ---- STATUS BADGES ---- */
.status-badge {
  display: inline-flex; align-items: center; gap: 4px;
  border-radius: 20px; padding: 2px 9px;
  font-size: .72rem; font-weight: 700; white-space: nowrap;
}
.status-done     { background: rgba(16,185,129,.15); color: #10b981; border: 1px solid rgba(16,185,129,.3); }
.status-due_now  { background: rgba(245,158,11,.18); color: #f59e0b; border: 1px solid rgba(245,158,11,.4); animation: pulse-badge 1.2s ease-in-out infinite; }
.status-due_soon { background: rgba(96,165,250,.12); color: #60a5fa; border: 1px solid rgba(96,165,250,.3); }
.status-overdue  { background: rgba(239,68,68,.15);  color: #ef4444; border: 1px solid rgba(239,68,68,.35); }
.status-upcoming { background: rgba(148,163,184,.1); color: #94a3b8; border: 1px solid rgba(148,163,184,.2); }
.status-pending  { background: rgba(148,163,184,.1); color: #94a3b8; border: 1px solid rgba(148,163,184,.2); }

@keyframes pulse-badge {
  0%,100% { box-shadow: 0 0 0 0 rgba(245,158,11,.4); }
  50%      { box-shadow: 0 0 0 5px rgba(245,158,11,0); }
}

/* ---- TIMING ROW ---- */
.timing-row { display:flex; align-items:center; gap:6px; font-size:.75rem; color:var(--text-muted); margin-top:3px; }
.timing-row .dot { width:5px;height:5px;border-radius:50%;background:currentColor;flex-shrink:0; }

/* ---- SCORE GUIDE ---- */
.score-guide { display:flex; gap:6px; flex-wrap:wrap; margin-top:.5rem; }
.score-pill  { background:rgba(255,255,255,.05); border:1px solid var(--border); border-radius:20px; padding:3px 10px; font-size:.72rem; }

/* ---- INSIGHT CARD ---- */
.insight-card {
  background: rgba(124,58,237,0.08);
  border: 1px solid rgba(124,58,237,0.2);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.6rem;
  font-size: 0.875rem;
}
.insight-card.warning { background: rgba(245,158,11,0.08); border-color: rgba(245,158,11,0.25); }

/* ---- IDENTITY CARD ---- */
.identity-card {
  background: linear-gradient(135deg, rgba(124,58,237,0.15), rgba(79,70,229,0.15));
  border: 1px solid rgba(124,58,237,0.3);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
}

/* ---- HABITS TIME SECTION HEADERS ---- */
.habits-section-header {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  padding: .5rem 0 .3rem;
  margin-top: .5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: .5rem;
}
.habits-section-header:first-child { margin-top: 0; }

/* ---- DASHBOARD CLICKABLE CARDS ---- */
.dash-clickable {
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  position: relative;
}
.dash-clickable:hover {
  border-color: rgba(124,58,237,0.5);
  box-shadow: 0 0 0 1px rgba(124,58,237,0.3), 0 4px 20px rgba(124,58,237,0.15);
  transform: translateY(-1px);
}
.dash-card-hint {
  position: absolute;
  top: 8px; right: 10px;
  font-size: .65rem;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.2s;
}
.dash-clickable:hover .dash-card-hint { opacity: 1; }

/* ---- REPORT MODAL ---- */
.report-habit-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: .85rem;
}
.report-habit-row:last-child { border-bottom: none; }
.report-status-icon { font-size: 1rem; flex-shrink: 0; width: 22px; text-align: center; }
.report-score { font-weight: 700; color: #a78bfa; margin-left: auto; flex-shrink: 0; }
.report-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 1rem;
}
.report-stat-box {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .75rem 1rem;
  text-align: center;
}
.report-stat-box .rs-val { font-size: 1.4rem; font-weight: 800; }
.report-stat-box .rs-label { font-size: .72rem; color: var(--text-muted); margin-top: 2px; }
.level-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 10px;
  font-size: .85rem;
  margin-bottom: 4px;
}
.level-row.current-level {
  background: rgba(124,58,237,0.15);
  border: 1px solid rgba(124,58,237,0.35);
  font-weight: 700;
}
.habit-cal-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: .5rem;
}
.cal-dot {
  width: 20px; height: 20px;
  border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  font-size: .55rem;
  cursor: default;
  transition: transform 0.1s;
}
.cal-dot:hover { transform: scale(1.3); }
.cal-dot.done { background: rgba(16,185,129,0.25); border: 1px solid rgba(16,185,129,0.5); }
.cal-dot.on-time { background: rgba(167,139,250,0.3); border: 1px solid rgba(167,139,250,0.6); }
.cal-dot.missed { background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.25); }
.cal-dot.future { background: rgba(255,255,255,0.04); border: 1px solid var(--border); }

/* ---- EMOJI PICKER ---- */
.chat-input-wrap { position: relative; }

.emoji-trigger {
  font-size: 1.1rem;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}
.emoji-trigger:hover { background: rgba(255,255,255,0.1); }

.emoji-picker {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  z-index: 200;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  width: 280px;
}
.emoji-picker .ep-category {
  grid-column: 1 / -1;
  font-size: .65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 4px 2px 2px;
}
.emoji-picker button {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  border-radius: 6px;
  padding: 3px;
  line-height: 1;
  transition: background 0.1s, transform 0.1s;
}
.emoji-picker button:hover {
  background: rgba(255,255,255,0.1);
  transform: scale(1.2);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .sidebar-logo, .nav-item span, .sidebar-bottom .user-pill span { display: none; }
  .main-content { margin-left: 60px; padding: 1rem; max-width: calc(100vw - 60px); }
  .emoji-picker { width: 240px; grid-template-columns: repeat(6, 1fr); }
}


/* ===================== COACH SESSION ===================== */
.coach-session-wrap { margin-top: 0.5rem; }

/* ── Entry card ── */
.coach-entry-card {
  background: linear-gradient(135deg, #1a0d2e 0%, #1a1a2e 60%, #0d1a2e 100%);
  border: 1px solid rgba(167,139,250,0.25);
  border-radius: 20px;
  padding: 3rem 2rem;
  text-align: center;
}
.coach-entry-avatar {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  animation: coach-pulse 2.5s ease-in-out infinite;
}
@keyframes coach-pulse {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(1.09); }
}
.coach-entry-title {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #e879f9, #a78bfa, #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.75rem;
}
.coach-entry-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 520px;
  margin: 0 auto 1.5rem;
  line-height: 1.65;
}
.coach-entry-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 2rem;
}
.coach-feature-pill {
  background: rgba(167,139,250,0.1);
  border: 1px solid rgba(167,139,250,0.2);
  border-radius: 20px;
  padding: 0.3rem 1rem;
  font-size: 0.8rem;
  color: #c4b5fd;
}
.btn-coach-start {
  background: linear-gradient(135deg, #9333ea, #6366f1);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 1rem 2.75rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: opacity 0.2s, transform 0.15s;
  box-shadow: 0 4px 24px rgba(147,51,234,0.38);
}
.btn-coach-start:hover  { opacity: 0.88; transform: translateY(-2px); }
.btn-coach-start:active { transform: translateY(0); }
.btn-coach-start:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ── Session panel ── */
.coach-session-panel {
  background: linear-gradient(170deg, #11071e 0%, #0d1525 100%);
  border: 1px solid rgba(167,139,250,0.18);
  border-radius: 20px;
  overflow: hidden;
}

/* Stage progress bar */
.coach-stage-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.5rem;
  background: rgba(126,34,206,0.1);
  border-bottom: 1px solid rgba(167,139,250,0.1);
}
.coach-stage-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #c4b5fd;
  white-space: nowrap;
  min-width: 140px;
}
.coach-stage-track {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  overflow: hidden;
}
.coach-stage-fill {
  height: 100%;
  background: linear-gradient(90deg, #e879f9, #a78bfa);
  border-radius: 4px;
  transition: width 0.6s ease;
}
.coach-stage-num {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Aria speech card */
.coach-speech-card {
  display: flex;
  gap: 1rem;
  padding: 2rem 1.75rem 1.5rem;
  align-items: flex-start;
  animation: fadeInUp 0.35s ease;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.coach-speech-avatar {
  width: 44px;
  height: 44px;
  min-width: 44px;
  background: linear-gradient(135deg, #7e22ce, #4f46e5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 0 18px rgba(147,51,234,0.35);
}
.coach-speech-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: #a78bfa;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.coach-speech-text {
  font-size: 1.05rem;
  line-height: 1.7;
  color: #f3e8ff;
  font-weight: 400;
}

/* Typing indicator */
.coach-typing-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.75rem 1.25rem;
  animation: fadeInUp 0.2s ease;
}
.coach-typing-dots {
  display: flex;
  gap: 5px;
  align-items: center;
}
.coach-typing-dots span {
  width: 8px;
  height: 8px;
  background: #a78bfa;
  border-radius: 50%;
  animation: coach-dot 1.2s ease-in-out infinite;
}
.coach-typing-dots span:nth-child(2) { animation-delay: 0.18s; }
.coach-typing-dots span:nth-child(3) { animation-delay: 0.36s; }
@keyframes coach-dot {
  0%,80%,100% { transform: scale(0.55); opacity: 0.35; }
  40%         { transform: scale(1);    opacity: 1; }
}

/* User response echo */
.coach-user-echo {
  margin: 0 1.75rem 1.25rem;
  padding: 0.7rem 1.1rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  font-size: 0.88rem;
  color: var(--text-muted);
  font-style: italic;
  animation: fadeInUp 0.25s ease;
}
.coach-user-echo::before {
  content: 'You said: ';
  font-style: normal;
  font-weight: 600;
  color: #94a3b8;
}

/* Response option buttons */
.coach-options-area {
  padding: 0.25rem 1.75rem 1.5rem;
  animation: fadeInUp 0.4s ease;
}
.coach-option-btns {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.1rem;
}
.coach-option-btn {
  background: rgba(126,34,206,0.1);
  border: 1.5px solid rgba(167,139,250,0.22);
  border-radius: 14px;
  padding: 0.9rem 1.25rem;
  text-align: left;
  color: #e9d5ff;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, transform 0.12s;
  line-height: 1.4;
}
.coach-option-btn:hover {
  background: rgba(126,34,206,0.22);
  border-color: rgba(167,139,250,0.5);
  transform: translateX(4px);
}
.coach-option-btn:active { transform: translateX(2px); }
.coach-option-btn.selected {
  background: rgba(126,34,206,0.3);
  border-color: #a78bfa;
  color: #fff;
}

/* Or divider + text input */
.coach-or-divider {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin: 0.85rem 0 0.85rem;
  letter-spacing: 0.05em;
}
.coach-text-row {
  display: flex;
  gap: 0.6rem;
}
.coach-text-input {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(167,139,250,0.18);
  border-radius: 12px;
  color: var(--text-primary);
  padding: 0.65rem 1rem;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s;
}
.coach-text-input:focus  { border-color: rgba(167,139,250,0.5); }
.coach-text-input::placeholder { color: var(--text-muted); }
.btn-session-send {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #9333ea, #6366f1);
  border: none;
  border-radius: 11px;
  color: #fff;
  cursor: pointer;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.2s;
}
.btn-session-send:hover { opacity: 0.85; }

/* Session done state */
.coach-session-done {
  padding: 3rem 2rem;
  text-align: center;
  animation: fadeInUp 0.4s ease;
}
.coach-done-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #e9d5ff;
  margin-bottom: 0.4rem;
}
.coach-done-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Footer */
.coach-session-footer {
  padding: 0.6rem 1.75rem 1rem;
  display: flex;
  justify-content: flex-end;
}
.btn-end-session {
  background: transparent;
  border: 1px solid rgba(239,68,68,0.2);
  color: rgba(248,113,113,0.7);
  border-radius: 8px;
  padding: 0.3rem 0.9rem;
  font-size: 0.75rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.btn-end-session:hover {
  border-color: rgba(239,68,68,0.5);
  color: #f87171;
}

/* ===================== VOICE INTERACTION ===================== */

/* TTS toggle in stage bar */
.btn-voice-ctrl {
  width: 30px;
  height: 30px;
  background: rgba(167,139,250,0.1);
  border: 1px solid rgba(167,139,250,0.2);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}
.btn-voice-ctrl.active {
  background: rgba(167,139,250,0.2);
  border-color: rgba(167,139,250,0.45);
  color: #c4b5fd;
}
.btn-voice-ctrl:hover { background: rgba(167,139,250,0.25); }

/* Aria avatar wrapper */
.coach-speech-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

/* Sound wave bars around Aria's avatar while speaking */
.aria-soundwave {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}
.aria-soundwave.active { opacity: 1; }
.aria-soundwave span {
  width: 3px;
  height: 8px;
  background: #e879f9;
  border-radius: 3px;
  animation: soundbar 0.9s ease-in-out infinite;
}
.aria-soundwave span:nth-child(1) { animation-delay: 0s;    height: 6px; }
.aria-soundwave span:nth-child(2) { animation-delay: 0.15s; height: 12px; }
.aria-soundwave span:nth-child(3) { animation-delay: 0.3s;  height: 16px; }
.aria-soundwave span:nth-child(4) { animation-delay: 0.15s; height: 12px; }
.aria-soundwave span:nth-child(5) { animation-delay: 0s;    height: 6px; }
@keyframes soundbar {
  0%,100% { transform: scaleY(0.4); opacity: 0.5; }
  50%      { transform: scaleY(1);   opacity: 1; }
}

/* "speaking…" label next to Aria's name */
.aria-speaking-label {
  font-size: 0.68rem;
  color: #e879f9;
  font-weight: 400;
  margin-left: 0.4rem;
  font-style: italic;
  opacity: 0;
  transition: opacity 0.3s;
}
.aria-speaking-label.visible { opacity: 1; }

/* Microphone button */
.btn-mic {
  width: 42px;
  height: 42px;
  background: rgba(167,139,250,0.1);
  border: 1.5px solid rgba(167,139,250,0.25);
  border-radius: 11px;
  color: #c4b5fd;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.btn-mic:hover {
  background: rgba(167,139,250,0.2);
  border-color: rgba(167,139,250,0.5);
}
.btn-mic.listening {
  background: rgba(239,68,68,0.15);
  border-color: rgba(239,68,68,0.5);
  color: #f87171;
  animation: mic-pulse 1s ease-in-out infinite;
}
@keyframes mic-pulse {
  0%,100% { transform: scale(1);    box-shadow: 0 0 0 0   rgba(239,68,68,0.4); }
  50%      { transform: scale(1.06); box-shadow: 0 0 0 8px rgba(239,68,68,0); }
}

/* Listening indicator bar */
.listening-indicator {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding: 0.6rem 1rem;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: 12px;
  font-size: 0.83rem;
  color: #fca5a5;
  animation: fadeInUp 0.2s ease;
}
.listening-pulse {
  width: 10px;
  height: 10px;
  background: #ef4444;
  border-radius: 50%;
  flex-shrink: 0;
  animation: mic-pulse 1s ease-in-out infinite;
}
.btn-stop-listen {
  margin-left: auto;
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.3);
  color: #f87171;
  border-radius: 8px;
  padding: 0.2rem 0.7rem;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-stop-listen:hover { background: rgba(239,68,68,0.25); }

/* ===================== ARIA HABIT SUGGESTIONS ===================== */
.coach-habit-suggestions {
  margin: 0 1.75rem 1.25rem;
  animation: fadeInUp 0.35s ease;
}
.habit-suggest-header {
  font-size: 0.78rem;
  font-weight: 600;
  color: #c4b5fd;
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.habit-suggest-icon { font-size: 0.95rem; }
.coach-habit-cards {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.coach-habit-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: linear-gradient(135deg, rgba(126,34,206,0.12), rgba(79,70,229,0.08));
  border: 1.5px solid rgba(167,139,250,0.28);
  border-radius: 14px;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, transform 0.12s;
}
.coach-habit-card:hover {
  background: linear-gradient(135deg, rgba(126,34,206,0.22), rgba(79,70,229,0.15));
  border-color: rgba(167,139,250,0.55);
  transform: translateX(3px);
}
.habit-card-emoji {
  font-size: 1.4rem;
  flex-shrink: 0;
}
.habit-card-info { flex: 1; min-width: 0; }
.habit-card-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: #f3e8ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.habit-card-meta {
  font-size: 0.74rem;
  color: #a78bfa;
  margin-top: 0.1rem;
}
.btn-add-habit-card {
  background: linear-gradient(135deg, #9333ea, #6366f1);
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 0.35rem 0.8rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity 0.2s;
}
.btn-add-habit-card:hover { opacity: 0.85; }
.btn-add-habit-card.added {
  background: rgba(16,185,129,0.2);
  border: 1px solid rgba(16,185,129,0.4);
  color: #6ee7b7;
}

/* ===================== 7-DAY PLAN CARDS ===================== */
/* ── In-session plan section ── */
.coach-plan-section {
  margin: 0 1.75rem 1.25rem;
  animation: fadeInUp 0.4s ease;
}
.plan-section-header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
}
.plan-section-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #f3e8ff;
}
.plan-section-theme {
  font-size: 0.78rem;
  color: #a78bfa;
  font-style: italic;
  margin-top: 0.1rem;
}
.session-plan-days { display: flex; flex-direction: column; gap: 0.65rem; }

/* Day group card */
.plan-day-card {
  background: rgba(15,10,30,0.6);
  border: 1.5px solid rgba(167,139,250,0.2);
  border-radius: 14px;
  overflow: hidden;
}
.plan-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1rem;
  background: rgba(126,34,206,0.12);
  cursor: pointer;
  user-select: none;
}
.plan-day-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #a78bfa;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.plan-day-title {
  font-weight: 600;
  font-size: 0.88rem;
  color: #e9d5ff;
  margin-top: 0.1rem;
}
.plan-day-toggle {
  color: var(--text-muted);
  font-size: 0.75rem;
  transition: transform 0.2s;
}
.plan-day-toggle.open { transform: rotate(180deg); }
.plan-day-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.55rem;
  border-radius: 20px;
  font-weight: 600;
}
.plan-day-badge.done   { background: rgba(16,185,129,0.15); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.25); }
.plan-day-badge.active { background: rgba(245,158,11,0.15); color: #fcd34d; border: 1px solid rgba(245,158,11,0.25); }
.plan-day-badge.future { background: rgba(148,163,184,0.1);  color: #94a3b8; border: 1px solid rgba(148,163,184,0.15); }

/* Task rows */
.plan-day-tasks { display: none; }
.plan-day-tasks.open { display: block; }
.plan-task-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  border-top: 1px solid rgba(167,139,250,0.08);
  transition: background 0.15s;
}
.plan-task-row:hover { background: rgba(126,34,206,0.06); }
.plan-task-emoji { font-size: 1.2rem; flex-shrink: 0; margin-top: 1px; }
.plan-task-body  { flex: 1; min-width: 0; }
.plan-task-name  { font-weight: 600; font-size: 0.88rem; color: #f3e8ff; }
.plan-task-detail {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
  line-height: 1.4;
}
.plan-task-progress {
  display: flex;
  gap: 4px;
  margin-top: 0.35rem;
}
.plan-task-day-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
  border: 1.5px solid transparent;
}
.plan-task-day-dot.done    { background: rgba(16,185,129,0.2); border-color: #10b981; color: #6ee7b7; }
.plan-task-day-dot.today   { background: rgba(245,158,11,0.15); border-color: #f59e0b; color: #fcd34d; }
.plan-task-day-dot.future  { background: rgba(148,163,184,0.08); border-color: rgba(148,163,184,0.2); color: #64748b; }
.plan-task-day-dot.missed  { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.3); color: #f87171; }

.btn-plan-add-habit {
  background: rgba(147,51,234,0.12);
  border: 1px solid rgba(167,139,250,0.28);
  color: #c4b5fd;
  border-radius: 9px;
  padding: 0.3rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.18s, border-color 0.18s;
}
.btn-plan-add-habit:hover { background: rgba(147,51,234,0.22); border-color: rgba(167,139,250,0.5); }
.btn-plan-add-habit.added { background: rgba(16,185,129,0.12); border-color: rgba(16,185,129,0.35); color: #6ee7b7; cursor: default; }

/* ── Profile plan monitor ── */
#plan-monitor-content .plan-day-card { margin-bottom: 0.5rem; }
#plan-monitor-content .plan-day-card:last-child { margin-bottom: 0; }

/* ===================== NEGATIVE / BAD HABITS ===================== */

/* Habit type toggle in modal */
.habit-type-toggle {
  display: flex;
  gap: 0.5rem;
}
.habit-type-btn {
  flex: 1;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
  transition: all 0.18s;
}
.habit-type-btn .habit-type-hint {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  margin-top: 2px;
  opacity: 0.7;
}
.habit-type-btn.active[id="habit-type-pos"] {
  border-color: #10b981;
  background: rgba(16,185,129,0.1);
  color: #6ee7b7;
}
.habit-type-btn.active[id="habit-type-neg"] {
  border-color: #ef4444;
  background: rgba(239,68,68,0.1);
  color: #f87171;
}
.habit-type-btn:hover { background: rgba(255,255,255,0.08); }

/* Bad habits section header */
.bad-habits-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(239,68,68,0.06);
  border: 1px solid rgba(239,68,68,0.15);
  border-radius: 12px;
}

/* Bad habit card */
.bad-habit-card {
  background: rgba(239,68,68,0.05);
  border: 1.5px solid rgba(239,68,68,0.18);
  border-radius: 14px;
  padding: 0.9rem 1.1rem;
  margin-bottom: 0.6rem;
  transition: border-color 0.2s;
}
.bad-habit-card:hover { border-color: rgba(239,68,68,0.35); }
.bad-habit-card.done-today {
  background: rgba(239,68,68,0.1);
  border-color: rgba(239,68,68,0.4);
}
.bad-habit-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: #fca5a5;
}
.bad-habit-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}
.bad-habit-avoid-streak {
  font-size: 0.75rem;
  color: #6ee7b7;
  font-weight: 600;
}
.btn-confess {
  background: rgba(239,68,68,0.12);
  border: 1.5px solid rgba(239,68,68,0.3);
  color: #f87171;
  border-radius: 10px;
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
}
.btn-confess:hover { background: rgba(239,68,68,0.22); border-color: rgba(239,68,68,0.55); }
.btn-confess:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-confess.confessed {
  background: rgba(239,68,68,0.2);
  border-color: rgba(239,68,68,0.5);
  color: #fca5a5;
}

/* ===================== GUARDRAIL WARNING ===================== */
.guardrail-warning {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: 12px;
  padding: 0.6rem 0.9rem;
  font-size: 0.82rem;
  color: #fca5a5;
  margin: 4px 0;
  animation: fadeInUp 0.2s ease;
}
.guardrail-icon { font-size: 1rem; flex-shrink: 0; }
