/* ========== TheMedBubble — design tokens ========== */
:root {
  /* Original rose palette — accents, labels, eyebrows */
  --rose: #E94B86;
  --rose-soft: #F4789F;
  --rose-deep: #C9356F;
  --blush: #FFF1F6;
  --champagne: #FFF5DE;
  --lavender: #EDE7FF;
  --mint: #E8F8EF;
  --cream: #FAF6EF;
  --cream-2: #F4EFE5;
  --navy: #2E2A4F;
  --navy-soft: #5A5577;
  --navy-faint: #9692A8;
  --ink: #2E2A4F;
  /* Brand navy — used ONLY for action buttons + active nav items */
  --brand: #2A3D7C;
  --brand-soft: #4761A3;
  --brand-deep: #1E2D5C;
  --line: rgba(46, 42, 79, 0.08);
  --line-strong: rgba(46, 42, 79, 0.14);
  --shadow-sm: 0 2px 10px rgba(46, 42, 79, 0.05);
  --shadow: 0 6px 28px rgba(46, 42, 79, 0.07);
  --shadow-lg: 0 18px 56px rgba(46, 42, 79, 0.12);
  --radius: 14px;
  --radius-lg: 22px;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-script: 'Allura', cursive;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--cream);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  font-size: 14.5px;
  line-height: 1.55;
}
body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(circle at 12% 8%,  rgba(255, 241, 246, 0.9) 0, transparent 25%),
    radial-gradient(circle at 88% 5%,  rgba(255, 245, 222, 0.8) 0, transparent 28%),
    radial-gradient(circle at 95% 92%, rgba(237, 231, 255, 0.7) 0, transparent 30%),
    radial-gradient(circle at 5% 88%,  rgba(232, 248, 239, 0.7) 0, transparent 28%);
  pointer-events: none;
  z-index: -1;
}

/* ========== Layout ========== */
.layout { display: grid; grid-template-columns: 1fr; min-height: 100vh; }
.sidebar { display: none; }
.main { padding: 18px 16px 110px; max-width: 100%; }
.top-bar { display: none; }

/* ========== Logo ========== */
.logo { display: flex; justify-content: center; padding: 8px 0 18px; }
.logo-img {
  width: 110px;
  height: 110px;
  display: block;
}

/* ========== Screen ========== */
.screen { animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.two-col { display: grid; gap: 16px; grid-template-columns: 1fr; }

/* ========== Cards ========== */
.card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  margin-bottom: 16px;
}
.card.lift { transition: box-shadow 0.2s ease, transform 0.2s ease; }
.card.lift:hover { box-shadow: var(--shadow-lg); }
.card-eyebrow {
  color: var(--rose);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0 0 8px;
}
.card h2 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 24px;
  color: var(--navy);
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.card h3 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 18px;
  color: var(--navy);
  margin: 0 0 10px;
}
.caption { color: var(--navy-soft); font-size: 13.5px; margin: 0 0 16px; }
.mini-label {
  color: var(--rose);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 10px;
}
.card-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.card-head-row h3 { margin: 0; }
.edit-btn {
  background: transparent;
  border: none;
  color: var(--rose);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: inherit;
}
.edit-btn:hover { color: var(--rose-deep); }

/* ========== Mood grid ========== */
.mood-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 4px 0 18px;
}
.mood-btn {
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--navy);
  font-size: 14px;
  font-weight: 500;
  padding: 14px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: left;
  font-family: inherit;
}
.mood-btn .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--rose); flex-shrink: 0; }
.mood-btn[data-tone="mint"]      { background: var(--mint); }
.mood-btn[data-tone="blush"]     { background: var(--blush); }
.mood-btn[data-tone="champagne"] { background: var(--champagne); }
.mood-btn[data-tone="lavender"]  { background: var(--lavender); }
.mood-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.mood-btn.selected {
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(233, 75, 134, 0.18);
}
.mood-btn[data-tone="cream"]     { background: var(--cream-2); }
.mood-other-btn { font-style: italic; }

/* Custom-mood input row */
.mood-other-row {
  display: flex; gap: 8px; align-items: center;
  margin: 0 0 14px;
}
.mood-other-row .text-input { flex: 1; }

/* Selected moods preview pills */
.mood-selected-row {
  display: flex; flex-wrap: wrap; gap: 8px;
  align-items: center; margin: 4px 0 14px;
}
.mood-selected-row #mood-selected-list {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.mood-pill {
  background: var(--blush); color: var(--rose);
  border-radius: 999px;
  padding: 4px 10px 4px 11px;
  font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 6px;
}
.mood-pill button {
  background: transparent; border: none;
  color: var(--rose); font-weight: 800; cursor: pointer;
  font-family: inherit; padding: 0; line-height: 1;
}

/* ========== Buttons ========== */
.btn-primary {
  width: 100%;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(42, 61, 124, 0.28);
  transition: all 0.18s ease;
  font-family: inherit;
}
.btn-primary:hover:not(:disabled) { background: var(--brand-deep); transform: translateY(-1px); }
.btn-primary:disabled { background: #C8CFE2; box-shadow: none; cursor: not-allowed; }

.btn-secondary {
  width: 100%;
  background: var(--champagne);
  color: var(--navy);
  border: 1.5px solid #F0E1B8;
  border-radius: 12px;
  padding: 13px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
  font-family: inherit;
}
.btn-secondary:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-secondary:hover:not(:disabled) { background: #FFEFC2; }

.btn-ghost {
  background: transparent;
  color: var(--rose);
  border: none;
  padding: 10px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.btn-ghost:hover { color: var(--rose-deep); }

.btn-back {
  background: transparent;
  border: none;
  color: var(--navy-soft);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0;
  margin-bottom: 8px;
  font-family: inherit;
  align-self: flex-start;       /* sit on the left of flex-column containers */
  text-align: left;
}
.btn-back:hover { color: var(--rose); }

/* ========== Recommendation ========== */
.empty { text-align: center; padding: 40px 20px; color: var(--navy-faint); }
.empty-illo { font-size: 40px; color: var(--rose); opacity: 0.45; margin-bottom: 8px; }
.empty p { margin: 0; font-size: 13.5px; }
.rec-block {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px; background: var(--lavender);
  border-radius: 14px; margin-bottom: 14px;
}
.rec-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: var(--rose); flex-shrink: 0;
}
.rec-body { color: var(--navy-soft); font-size: 13.5px; margin: 0; line-height: 1.5; }
.tile-row { display: grid; gap: 10px; margin-top: 12px; grid-template-columns: 1fr; }
.tile { background: var(--blush); border-radius: 14px; padding: 14px; }
.tile-mint { background: var(--mint); }
.tile-lavender { background: var(--lavender); }
.tile-title { font-weight: 600; font-size: 13.5px; color: var(--navy); margin: 0 0 3px; }
.tile-body { color: var(--navy-soft); font-size: 13px; margin: 0; }

/* ========== Forms ========== */
.field-label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--navy); margin: 14px 0 6px;
}
textarea, .text-input, .select {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  font-family: inherit;
  font-size: 14px;
  color: var(--navy);
  background: #fff;
}
textarea { resize: vertical; }
textarea.input-blush     { background: var(--blush); }
textarea.input-champagne { background: var(--champagne); }
textarea:focus, .text-input:focus, .select:focus {
  outline: none; border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(42, 61, 124, 0.12);
}

/* ========== Stats ========== */
.stat-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin: 18px 0; }
.stat { text-align: center; padding: 14px 8px; border-radius: 14px; }
.stat-blush { background: var(--blush); }
.stat-lavender { background: var(--lavender); }
.stat-mint { background: var(--mint); }
.stat-num {
  font-family: var(--font-serif); font-weight: 700;
  font-size: 28px; color: var(--navy); line-height: 1;
}
.stat-lbl { color: var(--navy-soft); font-size: 11.5px; margin-top: 4px; }

/* ========== Week chart ========== */
.week-chart { padding: 16px; background: var(--blush); border-radius: 14px; margin-bottom: 16px; }
.bars {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px;
  height: 100px; align-items: end; margin-top: 10px;
}
.bar { background: var(--rose); border-radius: 6px 6px 2px 2px; min-height: 6px; opacity: 0.45; }
.bar.high { opacity: 1; }
.bar-empty {
  height: 8px; min-height: 8px;
  background: var(--cream-2); opacity: 1;
  border-radius: 999px;
  align-self: end;
}
.bar-stack {
  display: flex; flex-direction: column-reverse;
  border-radius: 6px 6px 2px 2px;
  overflow: hidden; min-height: 14px;
  box-shadow: 0 2px 8px rgba(46,42,79,0.05);
}
.bar-seg { min-height: 4px; }
.bar-yellow { background: #F2C94C; }
.bar-green  { background: #6BCB77; }
.bar-red    { background: var(--rose); }
.bar-blue   { background: #9B7BFF; }
.bar-other  { background: #C8C8D0; }

/* Mood-meter legend */
.quad-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 14px; margin-top: 12px;
  font-size: 11.5px; font-weight: 600; color: var(--navy-soft);
}
.quad-item {
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.quad-swatch {
  width: 12px; height: 12px;
  border-radius: 3px;
  display: inline-block;
  flex-shrink: 0;
}
.quad-yellow { background: #F2C94C; }
.quad-green  { background: #6BCB77; }
.quad-red    { background: var(--rose); }
.quad-blue   { background: #9B7BFF; }
.quad-credit { margin: 8px 0 0; font-size: 11.5px; }
.quad-credit a { color: var(--rose); text-decoration: none; }
.day-labels {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px;
  margin-top: 8px; font-size: 11.5px; color: var(--navy-soft);
  text-align: center; font-weight: 600;
}
/* Check-in history list — capped scroll, paginates via Show more */
#history-list {
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
  margin-bottom: 8px;
}
#thread-feed {
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
}
#comment-list {
  max-height: 440px;
  overflow-y: auto;
  padding-right: 4px;
}
.btn-show-more {
  background: transparent;
  border: none;
  color: #9a9ab0;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  padding: 6px 0;
}
.btn-show-more:hover { color: #5a5a78; }
.history-item {
  display: flex; gap: 12px; padding: 12px;
  background: var(--cream-2); border-radius: 12px;
  margin-bottom: 8px; align-items: flex-start;
}
.history-day {
  background: #fff; border-radius: 10px; padding: 6px 10px;
  font-size: 11.5px; font-weight: 600; color: var(--navy);
  flex-shrink: 0; min-width: 64px; text-align: center;
}
.history-mood { font-weight: 600; color: var(--navy); font-size: 14px; }
.history-action { color: var(--rose); font-size: 12.5px; font-weight: 600; margin: 2px 0; }
.history-note { color: var(--navy-soft); font-size: 12.5px; font-style: italic; margin-top: 3px; line-height: 1.4; }
.history-note .hn-label { color: var(--rose); font-style: normal; font-weight: 700; margin-right: 4px; letter-spacing: 0.01em; }

/* ========== Events ========== */
.rec-banner {
  background: linear-gradient(135deg, var(--rose), var(--rose-soft));
  color: #fff; display: flex; align-items: center;
  justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.rec-banner .rec-banner-title {
  font-weight: 700; font-size: 13px; margin: 0 0 4px;
  letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.85;
}
.rec-banner .rec-banner-body {
  font-family: var(--font-serif); font-size: 19px;
  margin: 0; font-weight: 600; letter-spacing: -0.01em;
}
.banner-cta {
  background: #fff; color: var(--rose); border: none;
  border-radius: 999px; padding: 10px 20px;
  font-size: 13.5px; font-weight: 700; cursor: pointer;
  flex-shrink: 0; font-family: inherit;
}
.event-grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 14px; }
.event-card {
  background: #fff; border-radius: var(--radius-lg); padding: 18px;
  box-shadow: var(--shadow); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 12px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.event-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.event-card-top { display: flex; align-items: center; gap: 12px; }
.event-icon {
  width: 44px; height: 44px; border-radius: 12px; background: var(--blush);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: var(--rose); font-weight: 700; flex-shrink: 0;
}
.event-card[data-tone="champagne"] .event-icon { background: var(--champagne); }
.event-card[data-tone="mint"] .event-icon      { background: var(--mint); }
.event-card[data-tone="lavender"] .event-icon  { background: var(--lavender); }
.event-title { font-weight: 600; color: var(--navy); font-size: 15px; line-height: 1.3; }
.event-meta { color: var(--rose); font-size: 12.5px; font-weight: 600; margin-top: 2px; }
.event-desc { color: var(--navy-soft); font-size: 13px; line-height: 1.5; }
.event-cta {
  background: var(--brand); color: #fff; border: none;
  border-radius: 999px; padding: 8px 18px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  align-self: flex-start; font-family: inherit;
}
.event-cta:hover { background: var(--brand-deep); }
.event-cta.secondary { background: var(--champagne); color: var(--navy); border: 1px solid #F0E1B8; }
.premium-tile {
  background: var(--lavender); display: flex; align-items: center;
  justify-content: center; gap: 10px; font-size: 13.5px;
  color: var(--navy); font-weight: 600; padding: 16px;
}
.premium-dot { color: var(--rose); font-size: 16px; }

/* ========================================================
   ============   BUBBLES (forum)   =======================
   ======================================================== */
.bubbles-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.bubble-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.bubble-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.bubble-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.bubble-emoji {
  width: 56px; height: 56px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; flex-shrink: 0; background: var(--blush);
  color: var(--rose);
}
.bubble-emoji-lg {
  width: 72px; height: 72px; border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; flex-shrink: 0; background: var(--blush);
  color: var(--rose);
}
.bubble-card[data-tone="mint"] .bubble-emoji,
.bubble-card[data-tone="mint"] .bubble-emoji-lg { background: var(--mint); }
.bubble-card[data-tone="champagne"] .bubble-emoji { background: var(--champagne); }
.bubble-card[data-tone="lavender"] .bubble-emoji { background: var(--lavender); }
.bubble-card[data-tone="cream"] .bubble-emoji { background: var(--cream-2); }
.bubble-info { flex: 1; min-width: 0; }
.bubble-name {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 18px;
  color: var(--navy);
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.bubble-desc {
  color: var(--navy-soft); font-size: 13px;
  margin: 0 0 6px; line-height: 1.5;
}
.bubble-meta {
  color: var(--navy-faint);
  font-size: 12px;
  font-weight: 600;
  margin: 0;
  letter-spacing: 0.02em;
}

.bubble-detail-head {
  display: flex;
  flex-direction: column;
}
.bubble-head-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.bubble-head-row h2 { margin: 0 0 4px; }
.bubble-head-row > div:nth-child(2) { flex: 1; min-width: 0; }

/* Thread feed */
.thread-feed { display: flex; flex-direction: column; gap: 10px; }
.thread-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.18s ease;
}
.thread-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  border-color: var(--line-strong);
}
.thread-card-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.thread-title-row {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 17px;
  color: var(--navy);
  margin: 0 0 6px;
  line-height: 1.3;
  letter-spacing: -0.005em;
}
.thread-preview {
  color: var(--navy-soft);
  font-size: 13px;
  line-height: 1.55;
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.thread-footer {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--navy-faint);
  font-weight: 600;
  align-items: center;
}
.thread-foot-icon { color: var(--rose); }
.thread-tag {
  background: var(--blush);
  color: var(--rose);
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Thread detail */
.thread-detail-card { padding: 26px; }
.thread-bubble-tag {
  background: var(--blush);
  color: var(--rose);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  display: inline-block;
  margin: 6px 0 12px;
}
.thread-detail-card h2 {
  font-size: 26px;
  font-family: var(--font-serif);
  font-weight: 700;
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}
.thread-author-row {
  display: flex; align-items: center; gap: 12px; margin-bottom: 18px;
}
.thread-author-row > div:nth-child(2) { flex: 1; }
.thread-author-name { font-weight: 600; color: var(--navy); font-size: 14px; }
.thread-author-meta { color: var(--navy-faint); font-size: 12px; }
.thread-like {
  background: var(--blush);
  border: none;
  color: var(--rose);
  font-weight: 700;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
}
.thread-like.liked { background: var(--brand); color: #fff; }
.thread-body {
  color: var(--navy);
  font-size: 15px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.thread-divider {
  margin: 24px 0;
  border: none;
  border-top: 1px solid var(--line);
}
.comments-h {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 14px;
}
.composer {
  display: flex; gap: 10px; align-items: flex-start;
  margin-bottom: 10px;
}
.composer textarea { flex: 1; }
.comment-list { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.comment-item {
  display: flex; gap: 12px; padding: 12px;
  background: var(--cream-2); border-radius: 12px;
}
.comment-body { flex: 1; min-width: 0; }
.comment-author { font-weight: 600; color: var(--navy); font-size: 13px; }
.comment-time { color: var(--navy-faint); font-size: 11.5px; margin-left: 6px; }
.comment-text { color: var(--navy-soft); font-size: 13.5px; margin-top: 2px; line-height: 1.55; white-space: pre-wrap; word-wrap: break-word; }

/* ========================================================
   ============   AVATAR   ================================
   ======================================================== */
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rose), var(--rose-soft));
  color: #fff;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  text-transform: uppercase;
  flex-shrink: 0;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-lg { width: 56px; height: 56px; font-size: 18px; }
.avatar-xl {
  width: 104px; height: 104px; font-size: 36px;
  border: 3px solid #fff;
  box-shadow: var(--shadow);
}

/* ========================================================
   ============   PROFILE   ===============================
   ======================================================== */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.profile-header {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.profile-photo-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.photo-change {
  background: transparent; border: none; color: var(--rose);
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  font-family: inherit;
}
.photo-change:hover { color: var(--rose-deep); }
.profile-id { flex: 1; min-width: 0; }
.profile-id h2 {
  font-family: var(--font-serif); font-weight: 700;
  font-size: 30px; color: var(--navy); margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.profile-specialty {
  color: var(--navy-soft); font-size: 14px;
  margin: 0 0 4px; font-weight: 500;
}
.profile-school {
  color: var(--navy-faint); font-size: 13px; margin: 0 0 12px;
}
.profile-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.chip {
  background: var(--cream-2);
  color: var(--navy-soft);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* key-value grid for profile sections */
.kv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.kv-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
}
.kv-value {
  color: var(--navy-soft);
  font-size: 14px;
  word-break: break-word;
}

/* progress */
.progress-row {
  display: flex; justify-content: space-between;
  font-size: 13px; color: var(--navy-soft);
  margin-bottom: 8px; font-weight: 600;
}
.progress-pct { color: var(--navy); }
.progress-bar {
  height: 8px;
  background: var(--cream-2);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 14px;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--rose), var(--rose-soft));
  border-radius: 999px;
  transition: width 0.4s ease;
}
.progress-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.progress-list li {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 13px; color: var(--navy-soft);
}
.progress-list li.done { color: var(--navy); }
.progress-list .pl-icon {
  width: 18px; height: 18px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
  flex-shrink: 0; margin-top: 2px;
}
.progress-list li.done .pl-icon { color: #2ECC71; }
.progress-list li:not(.done) .pl-icon { color: #E0B341; }

.qa-btn {
  width: 100%;
  background: var(--cream-2);
  border: 1px solid var(--line);
  color: var(--navy);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  padding: 12px 14px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-family: inherit;
  transition: all 0.18s;
}
.qa-btn:hover { background: var(--blush); border-color: rgba(42,61,124,0.2); }
.qa-btn:last-child { margin-bottom: 0; }
.qa-danger { color: #C9356F; }
.qa-danger:hover { background: var(--blush); }

/* ========================================================
   ============   MOBILE BOTTOM NAV   =====================
   ======================================================== */
.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-around;
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom, 0));
  z-index: 50;
}
.bottom-nav .nav-btn {
  flex: 1;
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 2px;
  color: var(--navy-soft);
  cursor: pointer;
  border-radius: 12px;
  font-family: inherit;
}
.bottom-nav .nav-btn.active { background: var(--brand); color: #fff; }
.bottom-nav .nav-icon {
  font-size: 16px;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
}
.bottom-nav .nav-icon svg { width: 18px; height: 18px; }
.bottom-nav .nav-lbl { font-size: 10px; font-weight: 600; }

/* ========================================================
   ============   MODALS   ================================
   ======================================================== */
.modal {
  position: fixed; inset: 0;
  background: rgba(46, 42, 79, 0.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}
.modal-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-wide { max-width: 540px; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.modal-head h3 { margin: 0; font-family: var(--font-serif); font-size: 20px; }
.modal-close {
  background: transparent; border: none; font-size: 18px;
  color: var(--navy-soft); cursor: pointer; padding: 4px 8px;
  border-radius: 8px; font-family: inherit;
}
.modal-close:hover { color: var(--navy); background: var(--cream-2); }
.modal-actions {
  display: flex; justify-content: flex-end;
  gap: 10px; margin-top: 18px;
}
.modal-actions .btn-primary { width: auto; }

/* Tone picker (for new Bubble modal) */
.tone-picker {
  display: flex; gap: 10px; margin-top: 6px;
}
.tone-swatch {
  width: 38px; height: 38px;
  border-radius: 12px;
  border: 2px solid var(--line);
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s, border-color 0.15s;
}
.tone-swatch:hover { transform: translateY(-2px); }
.tone-swatch.selected {
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(42, 61, 124, 0.18);
}

/* Breathing modal */
#breath-modal .modal-card { text-align: center; }
.breath-ring {
  width: 120px; height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--lavender) 0%, var(--blush) 100%);
  border: 3px solid var(--rose);
  margin: 0 auto 18px;
  transform: scale(0.7);                       /* start small so first inhale visibly grows */
  transition: transform 4s ease-in-out;
}
.breath-ring.inhale { transform: scale(1.15); transition-duration: 4s; }
.breath-ring.hold   { transform: scale(1.15); transition-duration: 4s; }
.breath-ring.exhale { transform: scale(0.7);  transition-duration: 6s; }
.breath-state {
  font-family: var(--font-serif); font-size: 24px; font-weight: 600;
  color: var(--navy); margin: 0 0 4px;
}
.breath-cycle { color: var(--navy-soft); font-size: 13px; margin: 0 0 20px; }

/* ========================================================
   ============   RESOURCES   =============================
   ======================================================== */
.resource-toolbar { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.res-cat-row {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.res-chip {
  background: var(--cream-2);
  color: var(--navy-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12.5px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  transition: all 0.15s ease;
}
.res-chip:hover { background: var(--blush); color: var(--navy); }
.res-chip.active {
  background: var(--brand); color: #fff; border-color: var(--brand);
  box-shadow: 0 6px 14px rgba(42, 61, 124, 0.2);
}
.res-grid {
  display: grid; grid-template-columns: 1fr;
  gap: 14px; margin-top: 16px;
}
.res-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 8px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.res-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.res-card-head {
  display: flex; align-items: center; gap: 12px;
}
.res-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--blush); color: var(--rose);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; flex-shrink: 0;
}
.res-card[data-tone="mint"]      .res-icon { background: var(--mint); }
.res-card[data-tone="champagne"] .res-icon { background: var(--champagne); }
.res-card[data-tone="lavender"]  .res-icon { background: var(--lavender); }
.res-name {
  font-family: var(--font-serif);
  font-weight: 700; font-size: 17px;
  color: var(--navy); margin: 0; letter-spacing: -0.005em;
}
.res-cat-tag {
  display: inline-block;
  background: var(--cream-2);
  color: var(--navy-soft);
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-top: 3px;
}
.res-desc { color: var(--navy-soft); font-size: 13.5px; margin: 0; line-height: 1.55; }
.res-meta {
  display: flex; flex-wrap: wrap; gap: 14px;
  color: var(--navy-faint); font-size: 12.5px; font-weight: 600;
  margin-top: 2px;
}
.res-meta a {
  color: var(--rose); text-decoration: none;
}
.res-meta a:hover { text-decoration: underline; }

/* ========================================================
   ============   INBOX / DMs   ===========================
   ======================================================== */
.inbox-tabs {
  display: flex; gap: 4px;
  background: var(--cream-2);
  padding: 4px; border-radius: 14px;
  margin: 14px 0 18px;
  flex-wrap: wrap;
}
.inbox-tab {
  background: transparent; border: none;
  padding: 9px 14px;
  font-size: 13px; font-weight: 600;
  color: var(--navy-soft);
  cursor: pointer; border-radius: 10px;
  font-family: inherit;
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
  flex: 1 1 auto;
  justify-content: center;
}
@media (max-width: 899px) {
  .inbox-tab { padding: 8px 8px; font-size: 12px; gap: 4px; flex-basis: calc(50% - 4px); }
  .inbox-tabs { padding: 3px; gap: 3px; }
  .tab-count { font-size: 10px; padding: 0 6px; min-width: 16px; }
}
.inbox-tab.active {
  background: #fff; color: var(--navy);
  box-shadow: var(--shadow-sm);
}
.tab-count {
  background: var(--rose); color: #fff;
  font-size: 10.5px; font-weight: 700;
  padding: 1px 7px; border-radius: 999px;
  min-width: 18px; text-align: center;
}
.tab-count.zero { background: var(--cream-2); color: var(--navy-faint); }

.inbox-pane { display: flex; flex-direction: column; gap: 6px; }

.conv-item, .req-item, .friend-item, .user-result {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.conv-item:hover, .friend-item:hover, .user-result:hover {
  border-color: var(--line-strong);
  background: var(--cream);
}
.conv-info, .friend-info { flex: 1; min-width: 0; }
.conv-name, .friend-name {
  font-weight: 700; color: var(--navy); font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.conv-preview {
  color: var(--navy-soft); font-size: 12.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.conv-time { color: var(--navy-faint); font-size: 11.5px; font-weight: 600; flex-shrink: 0; }
.conv-unread {
  background: var(--rose); color: #fff;
  font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
}

.req-actions, .frq-actions, .user-actions {
  display: flex; gap: 6px; flex-shrink: 0;
}
.btn-mini {
  background: var(--brand); color: #fff;
  border: none; padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px; font-weight: 700;
  cursor: pointer; font-family: inherit;
}
.btn-mini:hover { background: var(--brand-deep); }
.btn-mini.secondary {
  background: var(--cream-2); color: var(--navy-soft);
}
.btn-mini.secondary:hover { background: #E8E2D3; color: var(--navy); }
.btn-mini:disabled { opacity: 0.6; cursor: default; }

.empty-inbox {
  text-align: center;
  padding: 32px 14px;
  color: var(--navy-faint);
  font-size: 13.5px;
}

.conv-header {
  display: flex; align-items: center; gap: 14px;
  padding-bottom: 16px; border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.msg-list {
  display: flex; flex-direction: column; gap: 8px;
  min-height: 240px; max-height: 56vh; overflow-y: auto;
  padding: 4px 0 12px;
}
.msg {
  max-width: 76%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.msg-me {
  background: var(--brand); color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 6px;
}
.msg-them {
  background: var(--cream-2); color: var(--navy);
  align-self: flex-start;
  border-bottom-left-radius: 6px;
}
.msg-time {
  font-size: 10.5px; color: var(--navy-faint);
  align-self: center; margin: 6px 0;
}
.msg-composer {
  display: flex; gap: 10px; align-items: flex-end;
  padding-top: 14px; border-top: 1px solid var(--line);
}
.msg-composer textarea { flex: 1; resize: none; }

/* sidebar inbox badge */
.side-badge {
  margin-left: auto;
  background: var(--rose); color: #fff;
  font-size: 10.5px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
  min-width: 20px; text-align: center;
}
.side-link.active .side-badge { background: rgba(255,255,255,0.25); }

/* ========================================================
   ============   HOME (dashboard)   ======================
   ======================================================== */
.home-hero {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
}
.home-hero h2 {
  font-family: var(--font-serif); font-weight: 700;
  font-size: 28px; color: var(--navy); margin: 0 0 6px;
  letter-spacing: -0.015em;
}
.home-streak {
  background: var(--blush);
  border-radius: 16px;
  padding: 12px 18px;
  text-align: center;
  min-width: 100px;
}
.home-streak .streak-num {
  font-family: var(--font-serif);
  font-size: 32px; font-weight: 700;
  color: var(--rose); line-height: 1;
}
.home-streak .streak-lbl {
  color: var(--navy-soft); font-size: 11px;
  font-weight: 600; margin-top: 4px;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.home-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
.home-col  { display: flex; flex-direction: column; gap: 16px; }
.home-col .card { margin-bottom: 0; }
.home-mini-row {
  display: flex; gap: 10px; padding: 10px 0;
  border-top: 1px solid var(--line);
  align-items: center;
}
.home-mini-row:first-child { border-top: none; padding-top: 4px; }
.home-mini-row:last-child  { padding-bottom: 4px; }
.home-mini-body { flex: 1; min-width: 0; }
.home-mini-title {
  font-weight: 700; color: var(--navy); font-size: 13.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.home-mini-meta {
  color: var(--navy-soft); font-size: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.home-empty { color: var(--navy-faint); font-size: 13px; margin: 8px 0 0; }

/* Today's mood pills on the home check-in card — colored by Yale quadrant */
.today-mood-row {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 0 0 14px;
}
.today-mood-pill {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12.5px; font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.01em;
}
.quad-bg-yellow { background: #FFE9A8; color: #6B4F00; }
.quad-bg-green  { background: #C8EFD3; color: #185F35; }
.quad-bg-red    { background: var(--blush); color: var(--rose-deep); }
.quad-bg-blue   { background: var(--lavender); color: #4B3088; }
.quad-bg-other  { background: var(--cream-2); color: var(--navy-soft); }

/* logo button */
.logo-btn {
  border: none; background: transparent; cursor: pointer;
  padding: 0; font-family: inherit;
  display: flex; justify-content: center; width: 100%;
}
.logo-btn:hover .logo-img { transform: scale(1.03); transition: transform 0.18s; }

/* ========================================================
   ============   TOP-BAR SEARCH   ========================
   ======================================================== */
.top-search-wrap {
  position: relative;
  flex: 1; max-width: 320px;
}
.top-search {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--navy);
  box-shadow: var(--shadow-sm);
}
.top-search::placeholder { color: var(--navy-faint); }
.top-search:focus {
  outline: none; border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(233, 75, 134, 0.12);
}
.top-search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: #fff; border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  max-height: 420px; overflow-y: auto;
  z-index: 50;
  padding: 6px;
}
.tsr-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 10px;
  cursor: pointer;
}
.tsr-item:hover { background: var(--cream); }
.tsr-info { flex: 1; min-width: 0; }
.tsr-name { font-weight: 700; color: var(--navy); font-size: 13.5px; }
.tsr-meta { color: var(--navy-soft); font-size: 12px; }

/* ========================================================
   ============   MONTHLY INSIGHTS   ======================
   ======================================================== */
.quad-mix-bar {
  display: flex; width: 100%; height: 28px;
  border-radius: 999px; overflow: hidden;
  background: var(--cream-2);
  margin: 14px 0 18px;
  box-shadow: inset 0 1px 3px rgba(46,42,79,0.06);
}
.quad-mix-bar .seg { height: 100%; }
.quad-mix-row {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 8px;
}
.quad-mix-row .qrow {
  display: flex; align-items: center; gap: 10px;
  background: var(--cream); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px;
}
.quad-mix-row .qlabel { font-weight: 700; color: var(--navy); font-size: 13px; }
.quad-mix-row .qsub   { color: var(--navy-soft); font-size: 11.5px; }
.quad-mix-row .qcount { margin-left: auto; font-weight: 700; color: var(--navy); }

.ins-mood-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-top: 1px solid var(--line);
}
.ins-mood-row:first-child { border-top: none; padding-top: 4px; }
.ins-mood-label { width: 140px; font-weight: 700; color: var(--navy); font-size: 13.5px; flex-shrink: 0; }
.ins-mood-bar   { flex: 1; height: 10px; background: var(--cream-2); border-radius: 999px; overflow: hidden; display: block; }
.ins-mood-fill  { height: 100%; border-radius: 999px; display: block; min-width: 4px; }
.ins-mood-count { color: var(--navy-soft); font-weight: 700; font-size: 12.5px; width: 28px; text-align: right; }

.ins-dow {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px;
  height: 100px; align-items: end; margin-top: 8px;
}
.ins-dow .bar-stack { background: var(--blush); }
.ins-dow + .day-labels { margin-top: 10px; }

/* Scrollable journal entries list inside Insights */
.ins-journal-list {
  margin-top: 10px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}
.ins-journal-item {
  background: var(--cream-2);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
}
.ins-journal-date {
  font-size: 11.5px; font-weight: 700;
  color: var(--rose); letter-spacing: 0.04em;
  text-transform: uppercase; margin-bottom: 6px;
}
.ins-journal-line {
  font-size: 13.5px; color: var(--navy); margin: 4px 0;
  line-height: 1.5;
}
.ins-journal-line .ij-label {
  color: var(--navy-soft); font-weight: 700; margin-right: 6px;
  font-size: 12px;
}
.ins-journal-empty {
  color: var(--navy-faint); font-size: 13px;
  text-align: center; padding: 24px 12px;
}
.ins-journal-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px;
}
.ins-journal-head .ins-journal-date { margin-bottom: 0; }
.ins-journal-actions { display: flex; gap: 4px; }
.ins-journal-edit textarea { margin-bottom: 6px; }

/* Public user profile */
.up-info-grid { display: flex; flex-direction: column; gap: 8px; }
.up-info-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 10px 12px; background: var(--cream-2); border-radius: 10px;
  font-size: 13.5px;
}
.up-info-k { color: var(--navy-soft); font-weight: 600; }
.up-info-v { color: var(--navy); text-align: right; word-break: break-word; }

/* Compose new-message modal results */
.compose-results {
  margin-top: 10px;
  max-height: 380px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px;
}

/* App footer (legal links + medical disclaimer) */
.app-footer {
  text-align: center;
  margin-top: 40px;
  padding: 24px 16px 32px;
  border-top: 1px solid var(--line);
}
.app-footer-links {
  font-size: 11.5px;
  margin-bottom: 6px;
}
.app-footer-links a {
  color: var(--navy-soft);
  text-decoration: none;
  font-weight: 600;
}
.app-footer-links a:hover { color: var(--rose); }
.app-footer-disclaimer {
  font-size: 10.5px;
  color: var(--navy-faint);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.5;
}

/* Like button on thread cards in the bubble feed */
.thread-feed-like {
  background: transparent; border: none; padding: 0;
  font: inherit; cursor: pointer;
  color: var(--navy-soft);
  display: inline-flex; align-items: center; gap: 4px;
}
.thread-feed-like .like-heart { font-size: 16px; line-height: 1; }
.thread-feed-like:hover { color: var(--rose); }
.thread-feed-like.liked { color: var(--rose); }

/* Custom brand-styled dropdown (replaces native <select> in modals so the
   popup actually matches the app instead of using the OS picker). */
.custom-select { position: relative; }
.custom-select-trigger {
  width: 100%;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--navy);
  cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.custom-select-trigger:hover { border-color: var(--rose); }
.custom-select-trigger:focus,
.custom-select.open .custom-select-trigger {
  outline: none;
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(233, 75, 134, 0.12);
}
.custom-select-label {
  flex: 1; text-align: left;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.custom-select-caret { color: var(--navy-soft); font-size: 12px; }
.custom-select-menu {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  max-height: 280px;
  overflow-y: auto;
  z-index: 100;
}
.custom-select-option {
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--navy);
  border-radius: 8px;
  cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  transition: background 0.12s ease;
}
.custom-select-option:hover { background: var(--cream-2); }
.custom-select-option.selected {
  background: var(--rose); color: #fff;
}
.custom-select-option-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  border-radius: 6px;
  background: rgba(42, 61, 124, 0.06);
  font-size: 13px;
  flex-shrink: 0;
}
.custom-select-option.selected .custom-select-option-icon {
  background: rgba(255, 255, 255, 0.25);
}

/* Medically Verified badge — small rose checkmark pill next to a name */
.verified-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--rose); color: #fff;
  width: 18px; height: 18px;
  border-radius: 999px;
  font-size: 11px; font-weight: 800;
  vertical-align: middle;
  margin-left: 4px;
  flex-shrink: 0;
}

/* ========================================================
   ============   TOGGLE SWITCH   =========================
   ======================================================== */
.switch {
  position: relative; display: inline-block;
  width: 46px; height: 26px;
  flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer;
  inset: 0; background: #D8D5E0;
  border-radius: 999px;
  transition: background 0.18s ease;
}
.slider::before {
  content: ""; position: absolute;
  width: 20px; height: 20px;
  left: 3px; top: 3px;
  background: #fff; border-radius: 50%;
  transition: transform 0.18s ease;
  box-shadow: 0 1px 4px rgba(46,42,79,0.18);
}
.switch input:checked + .slider { background: var(--brand); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* ========================================================
   ============   DROPLET (profile card)   ================
   ======================================================== */
#droplet-card .card-head-row h3 { font-size: 17px; }
.droplet-match-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  background: var(--blush);
  border-radius: 14px;
  margin-bottom: 8px;
}
.droplet-match-row .avatar { flex-shrink: 0; }
.droplet-match-body { flex: 1; min-width: 0; }
.droplet-match-title {
  font-weight: 700; color: var(--navy); font-size: 13.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.droplet-match-sub {
  color: var(--navy-soft); font-size: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.droplet-pool { margin: 4px 0 0; font-size: 12px; }

/* ========================================================
   ============   PRIVACY MODAL   =========================
   ======================================================== */
.privacy-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.privacy-row:first-of-type { border-top: none; padding-top: 4px; }
.privacy-row > div:first-child { flex: 1; min-width: 0; }
.privacy-title { font-weight: 700; color: var(--navy); font-size: 14px; }
.privacy-sub   { color: var(--navy-soft); font-size: 12.5px; }

/* ========================================================
   ============   THREAD + COMMENT OWNER ACTIONS   ========
   ======================================================== */
.thread-owner-actions {
  display: flex; gap: 6px;
  margin: 0 0 14px;
}
.thread-edit-form { margin-bottom: 12px; }
.thread-edit-form .field-label:first-child { margin-top: 4px; }

.comment-owner-actions { margin-left: 8px; }
.comment-action-btn {
  background: transparent; border: none;
  color: var(--navy-soft);
  font-size: 11.5px; font-weight: 600;
  cursor: pointer; padding: 0 4px;
  font-family: inherit;
}
.comment-action-btn:hover { color: var(--rose); }
.comment-action-btn.danger:hover { color: var(--rose-deep); }
.comment-edit-row { margin-top: 6px; }
.comment-edit-row textarea {
  width: 100%; border: 1.5px solid var(--line);
  border-radius: 10px; padding: 8px; font-family: inherit;
  font-size: 13.5px; color: var(--navy); background: #fff;
  resize: vertical;
}

/* ========== Utility ========== */
.hidden { display: none !important; }

/* ========================================================
   ============   AUTH GATE   =============================
   ======================================================== */
.auth-gate {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--cream);
  padding: 24px;
  z-index: 1000;
  overflow-y: auto;
}
.auth-gate::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(circle at 8% 6%,  rgba(255, 241, 246, 0.9) 0, transparent 30%),
    radial-gradient(circle at 92% 4%, rgba(255, 245, 222, 0.85) 0, transparent 30%),
    radial-gradient(circle at 95% 96%, rgba(237, 231, 255, 0.85) 0, transparent 32%),
    radial-gradient(circle at 6% 94%, rgba(232, 248, 239, 0.85) 0, transparent 30%);
  pointer-events: none;
}
.auth-card {
  position: relative;
  background: #fff;
  border-radius: 24px;
  padding: 32px 28px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
  max-width: 420px;
  width: 100%;
  text-align: center;
}
.auth-logo { width: 100px; height: 100px; margin: 0 auto 8px; display: block; }
.auth-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 26px;
  color: var(--navy);
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.auth-sub {
  color: var(--navy-soft);
  font-size: 13.5px;
  margin: 0 0 22px;
}
.auth-tabs {
  display: flex;
  background: var(--cream-2);
  padding: 4px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.auth-tab {
  flex: 1;
  background: transparent;
  border: none;
  padding: 9px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--navy-soft);
  cursor: pointer;
  border-radius: 999px;
  font-family: inherit;
}
.auth-tab.active {
  background: #fff;
  color: var(--navy);
  box-shadow: var(--shadow-sm);
}
.auth-field { text-align: left; margin-bottom: 4px; }
.auth-field .field-label { margin-top: 8px; }
.auth-error {
  color: var(--rose-deep);
  background: var(--blush);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  margin: 12px 0 0;
  text-align: left;
}
.auth-card .btn-primary { margin-top: 16px; }
.auth-foot {
  color: var(--navy-faint);
  font-size: 11.5px;
  margin: 18px 0 0;
}

/* ========================================================
   ============   DESKTOP (>= 900px)   ====================
   ======================================================== */
@media (min-width: 900px) {
  body { font-size: 15px; }

  .layout {
    grid-template-columns: 280px 1fr;
    max-width: 1280px;
    margin: 0 auto;
    gap: 24px;
    padding: 24px;
    align-items: stretch;
  }

  .sidebar {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 22px 18px;
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
    position: sticky;
    top: 24px;
    align-self: flex-start;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
  }
  .logo-img { width: 130px; height: 130px; }
  .side-nav {
    display: flex; flex-direction: column; gap: 4px;
    margin-top: 14px; flex: 1;
  }
  .side-link {
    background: transparent;
    border: none;
    text-align: left;
    color: var(--navy-soft);
    font-size: 14.5px;
    font-weight: 600;
    padding: 12px 14px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: inherit;
    transition: all 0.18s ease;
  }
  .side-link:hover { background: var(--blush); color: var(--navy); }
  .side-link.active {
    background: var(--brand); color: #fff;
    box-shadow: 0 8px 18px rgba(42, 61, 124, 0.25);
  }
  .side-icon {
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 9px;
    background: rgba(46, 42, 79, 0.06);
    font-size: 14px;
    color: var(--navy-soft);
  }
  .side-icon svg { width: 17px; height: 17px; }
  .side-link.active .side-icon {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
  }
  .side-link:hover .side-icon { color: var(--rose); }
  .side-link.active:hover .side-icon { color: #fff; }

  .sidebar-footer {
    padding-top: 18px;
    border-top: 1px solid var(--line);
  }
  .sidebar-user {
    width: 100%;
    background: var(--cream-2);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 10px 12px;
    display: flex; align-items: center; gap: 10px;
    cursor: pointer;
    margin-bottom: 10px;
    font-family: inherit;
    text-align: left;
  }
  .sidebar-user:hover { background: var(--blush); }
  .side-user-info { flex: 1; min-width: 0; }
  .side-user-name {
    font-weight: 700; color: var(--navy); font-size: 13px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .side-user-meta {
    color: var(--navy-faint); font-size: 11.5px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .streak-mini {
    background: var(--blush);
    border-radius: 14px;
    padding: 12px;
    text-align: center;
  }
  .streak-num {
    font-family: var(--font-serif);
    font-size: 30px; font-weight: 700;
    color: var(--rose); line-height: 1;
  }
  .streak-lbl {
    color: var(--navy-soft); font-size: 11px;
    font-weight: 600; margin-top: 4px;
    text-transform: uppercase; letter-spacing: 0.05em;
  }

  /* Hide main-area logo on desktop (sidebar has it) */
  .main { padding: 0; padding-bottom: 40px; }

  .top-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 4px 4px 24px; gap: 16px;
  }
  .top-title-wrap { flex: 0 1 auto; min-width: 0; }
  .home-grid { grid-template-columns: 1.1fr 1fr; align-items: start; }
  .top-eyebrow {
    color: var(--rose); font-size: 11.5px; font-weight: 700;
    letter-spacing: 0.14em; text-transform: uppercase; margin: 0 0 4px;
  }
  .top-title {
    font-family: var(--font-serif); font-weight: 700;
    font-size: 32px; color: var(--navy); margin: 0;
    letter-spacing: -0.015em;
  }
  .top-btn {
    background: var(--navy); color: #fff; border: none;
    border-radius: 999px; padding: 11px 22px;
    font-size: 13.5px; font-weight: 600; cursor: pointer;
    font-family: inherit;
  }
  .top-btn:hover { background: #1F1B36; }

  .two-col { grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
  .journal-cols { grid-template-columns: 1.05fr 1fr; }
  .card { padding: 28px; }
  .card h2 { font-size: 26px; }
  .mood-grid { grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
  .mood-btn { padding: 16px; font-size: 14.5px; }
  .tile-row { grid-template-columns: 1fr 1fr 1fr; }
  .event-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; }

  /* Bubbles desktop: 2 col grid */
  .bubble-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
  .thread-feed { gap: 12px; }

  /* Resources desktop: 2 col grid */
  .res-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
  .resource-toolbar { flex-direction: row; align-items: center; }
  .resource-toolbar .text-input { max-width: 320px; }

  /* Profile: two cols, main left + sidebar right */
  .profile-grid {
    grid-template-columns: 1fr 320px;
    gap: 18px;
    align-items: start;
  }

  .bottom-nav { display: none; }
}

@media (min-width: 1400px) {
  .layout { max-width: 1340px; }
  .top-title { font-size: 36px; }
}

/* Mobile-only: show in-main logo at top */
@media (max-width: 899px) {
  .logo { padding: 4px 0 14px; }
  .logo-img { width: 88px; height: 88px; }
  .top-search-wrap { display: none; }
  .profile-photo-wrap { width: 100%; align-items: center; flex-direction: row; justify-content: flex-start; gap: 14px; }
  .kv-grid { grid-template-columns: 1fr; gap: 14px; }
  .profile-id h2 { font-size: 24px; }
  .bubbles-hero { flex-direction: column; align-items: flex-start; }
  .bubbles-hero .btn-primary { width: 100% !important; max-width: 100% !important; }
  .bubble-head-row .btn-primary { width: 100% !important; max-width: 100% !important; margin-top: 8px; }
}
