/* LEVITY Client Portal — shared brand styles.
   Palette/fonts/button conventions ported verbatim from index.html so the
   portal matches the marketing site and plan documents exactly. */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --white: #FEFCF8;
  --white-warm: #F4F0E6;
  --sage: #7A9E7E;
  --sage-light: #A8C5AC;
  --sage-dark: #4A6E4E;
  --gold: #C8A84B;
  --gold-light: #E2C878;
  --charcoal: #2A2320;
  --muted: #9A8F87;
  --blush: #E8D5C4;
  --rose: #C97B63;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--white);
  color: var(--charcoal);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .heading {
  font-family: 'Playfair Display', serif;
  color: var(--charcoal);
  margin: 0 0 0.5em;
  line-height: 1.25;
}

.eyebrow {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--sage);
  font-weight: 600;
}

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

/* Top bar (dashboard/checkin/plan chrome) */
.top-bar {
  background: var(--charcoal);
  color: var(--white-warm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
}
.top-bar .brand {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--white);
  text-decoration: none;
}
.top-bar a.signout {
  color: var(--gold-light);
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.top-bar a.signout:hover { color: var(--gold); }

/* Cards */
.card {
  background: var(--white-warm);
  border: 1px solid rgba(122, 158, 126, 0.16);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 20px;
}
.card .label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin-bottom: 8px;
}

/* Buttons */
.btn {
  display: inline-block;
  border: none;
  border-radius: 100px;
  padding: 14px 30px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  text-decoration: none;
  cursor: pointer;
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn-primary {
  background: var(--sage-dark);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--sage);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(74, 110, 78, 0.25);
}
.btn-secondary {
  background: transparent;
  color: var(--sage-dark);
  border: 1.5px solid var(--sage-light);
}
.btn-secondary:hover { background: var(--sage-dark); color: var(--white); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.btn-block { display: block; width: 100%; }

/* Form fields */
label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 6px;
}
input[type="text"], input[type="email"], input[type="number"], input[type="password"], select, textarea {
  width: 100%;
  background: var(--white-warm);
  border: 1.5px solid transparent;
  border-radius: 8px;
  padding: 14px 18px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.95rem;
  color: var(--charcoal);
  margin-bottom: 18px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--sage);
  background: var(--white);
}
textarea { min-height: 90px; resize: vertical; }

.field-hint { font-size: 0.78rem; color: var(--muted); margin-top: -12px; margin-bottom: 18px; }

/* Toggle-pill groups (unit toggles, scale ratings) */
.toggle-group { display: inline-flex; border-radius: 100px; background: var(--white-warm); padding: 4px; margin-bottom: 18px; }
.toggle-option {
  border: none;
  background: transparent;
  border-radius: 100px;
  padding: 8px 16px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  color: var(--muted);
}
.toggle-option.active { background: var(--sage-dark); color: var(--white); }

.scale-group { display: flex; gap: 8px; margin-bottom: 18px; }
.scale-option {
  flex: 1;
  border: 1.5px solid var(--sage-light);
  background: var(--white-warm);
  border-radius: 10px;
  padding: 12px 0;
  text-align: center;
  font-weight: 700;
  cursor: pointer;
  color: var(--charcoal);
}
.scale-option.active { background: var(--sage-dark); border-color: var(--sage-dark); color: var(--white); }

/* Photo upload slots */
.photo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 18px; }
.photo-slot {
  border: 1.5px dashed var(--sage-light);
  border-radius: 12px;
  padding: 18px 10px;
  text-align: center;
  background: var(--white-warm);
  cursor: pointer;
  position: relative;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.photo-slot .slot-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-top: 6px; }
.photo-slot img { max-width: 100%; max-height: 90px; border-radius: 8px; }
.photo-slot input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* Empty states */
.empty-state { text-align: center; padding: 24px 12px; color: var(--muted); font-size: 0.9rem; }

/* Status / error text */
.status-msg { font-size: 0.85rem; margin: 8px 0 0; }
.status-msg.error { color: var(--rose); }
.status-msg.success { color: var(--sage-dark); }

/* Auth screens (login/callback) center card */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-card {
  max-width: 400px;
  width: 100%;
  background: var(--white-warm);
  border-radius: 16px;
  padding: 40px 32px;
  text-align: center;
  border: 1px solid rgba(122, 158, 126, 0.16);
}
.auth-card .logo { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 1.6rem; margin-bottom: 4px; }
.auth-card .tagline { font-size: 0.85rem; color: var(--muted); margin-bottom: 28px; }

/* ============================================================
   PHASE 2 - navigation, community, questions, progress
   ============================================================ */

/* Top-bar nav. Wraps to its own full-width row on phones. */
.top-bar { flex-wrap: wrap; gap: 8px 16px; }
.top-bar .nav {
  display: flex;
  gap: 4px;
  order: 3;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.top-bar .nav a {
  color: rgba(244, 240, 230, 0.66);
  text-decoration: none;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 100px;
  white-space: nowrap;
}
.top-bar .nav a:hover { color: var(--white); background: rgba(255, 255, 255, 0.06); }
.top-bar .nav a.active { color: var(--charcoal); background: var(--sage-light); }

@media (min-width: 720px) {
  .top-bar .nav { order: 0; width: auto; flex: 1; justify-content: center; }
}

/* Page header block */
.page-head { margin: 24px 0 20px; }
.page-head h1 { margin-bottom: 4px; }
.page-head p { color: var(--muted); margin: 0; font-size: 0.92rem; }

/* Board tabs / filter row */
.tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.tab {
  border: 1.5px solid var(--sage-light);
  background: transparent;
  color: var(--sage-dark);
  border-radius: 100px;
  padding: 8px 18px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.tab.active { background: var(--sage-dark); border-color: var(--sage-dark); color: var(--white); }
.tab .count { opacity: 0.7; font-weight: 500; }

/* Avatar - first letter of the display name, tinted by role */
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex: 0 0 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 700;
  background: var(--blush);
  color: var(--charcoal);
  text-transform: uppercase;
}
.avatar.coach { background: var(--sage-dark); color: var(--white); }

/* Post list */
.post-item {
  display: block;
  background: var(--white-warm);
  border: 1px solid rgba(122, 158, 126, 0.16);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 12px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.post-item:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(42, 35, 32, 0.07); }
.post-link { display: block; text-decoration: none; color: inherit; }
.post-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.post-author { font-weight: 700; font-size: 0.86rem; }
.post-meta { font-size: 0.76rem; color: var(--muted); }
.post-title { font-family: 'Playfair Display', serif; font-size: 1.12rem; font-weight: 600; margin: 0 0 6px; line-height: 1.35; }
.post-excerpt { color: var(--charcoal); opacity: 0.8; font-size: 0.92rem; margin: 0; }
.post-body { white-space: pre-wrap; margin: 0; }
.post-foot { display: flex; align-items: center; gap: 16px; margin-top: 14px; font-size: 0.8rem; color: var(--muted); }

/* Small pills: coach, pinned, answered */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 3px 9px;
  border-radius: 100px;
  white-space: nowrap;
}
.pill-coach { background: var(--sage-dark); color: var(--white); }
.pill-pinned { background: var(--gold-light); color: var(--charcoal); }
.pill-answered { background: var(--sage-light); color: var(--charcoal); }
.pill-open { background: var(--blush); color: var(--charcoal); }

/* Heart / reaction button */
.react-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.8rem;
  color: var(--muted);
}
.react-btn .heart { font-size: 1rem; line-height: 1; filter: grayscale(1) opacity(0.55); transition: transform 0.15s ease, filter 0.15s ease; }
.react-btn.on { color: var(--rose); font-weight: 700; }
.react-btn.on .heart { filter: none; transform: scale(1.12); }

/* Composer */
.composer textarea { min-height: 110px; margin-bottom: 12px; }
.composer .row { display: flex; gap: 10px; align-items: center; justify-content: flex-end; }
.composer .btn { padding: 12px 24px; }

/* Thread view */
.reply {
  background: var(--white-warm);
  border: 1px solid rgba(122, 158, 126, 0.16);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 12px;
}
.reply.coach { border-color: var(--sage-light); background: rgba(168, 197, 172, 0.14); }
.reply.answer { border-color: var(--sage-dark); box-shadow: 0 0 0 1.5px var(--sage-dark); }
.reply-body { white-space: pre-wrap; margin: 0; font-size: 0.95rem; }
.link-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.76rem;
  color: var(--sage-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.link-btn.danger { color: var(--rose); }

/* Modal (display-name gate) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(42, 35, 32, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}
.modal {
  background: var(--white);
  border-radius: 16px;
  padding: 32px 28px;
  max-width: 420px;
  width: 100%;
}
.modal h2 { font-size: 1.4rem; }
.modal p { color: var(--muted); font-size: 0.9rem; }

/* ---------- Progress page ---------- */

.streak-card {
  background: linear-gradient(150deg, var(--sage-dark), var(--sage));
  color: var(--white);
  border-radius: 18px;
  padding: 28px 24px;
  text-align: center;
  margin-bottom: 20px;
}
.streak-number {
  font-family: 'Playfair Display', serif;
  font-size: 3.4rem;
  line-height: 1;
  font-weight: 700;
  display: block;
}
.streak-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.2em; opacity: 0.85; }
.streak-note { font-size: 0.9rem; margin: 14px 0 0; opacity: 0.92; }

/* Week dots */
.dots { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: transparent;
  border: 1.5px solid var(--sage-light);
}
.dot.filled { background: var(--sage-dark); border-color: var(--sage-dark); }
.dot.current { background: var(--gold); border-color: var(--gold); }

/* Badges */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.badge {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border: 1px solid rgba(122, 158, 126, 0.2);
  border-radius: 12px;
  padding: 12px 14px;
}
.badge .icon { font-size: 1.4rem; line-height: 1; }
.badge .name { font-size: 0.8rem; font-weight: 700; line-height: 1.3; }
.badge .sub { font-size: 0.7rem; color: var(--muted); }
.badge.locked { opacity: 0.42; }
.badge.locked .icon { filter: grayscale(1); }

/* Trend rows */
.trend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-top: 1px solid rgba(122, 158, 126, 0.16);
}
.trend-row:first-child { border-top: none; }
.trend-val { font-weight: 700; }
.trend-up { color: var(--sage-dark); }
.trend-down { color: var(--rose); }
.trend-flat { color: var(--muted); }

/* Collapsible weight chart */
details.weight-toggle { margin-top: 4px; }
details.weight-toggle > summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sage-dark);
  padding: 10px 0;
}
details.weight-toggle > summary::-webkit-details-marker { display: none; }
details.weight-toggle > summary::before { content: '\25B8 '; }
details.weight-toggle[open] > summary::before { content: '\25BE '; }
/* Check-in: weight + photos are opt-in, collapsed by default */
details.optin-extras > summary {
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  color: var(--sage-dark);
}
details.optin-extras > summary::-webkit-details-marker { display: none; }
details.optin-extras > summary::before { content: '\25B8 '; }
details.optin-extras[open] > summary::before { content: '\25BE '; }
details.optin-extras[open] > summary { margin-bottom: 8px; }
.chart-wrap { overflow-x: auto; }
.chart-note { font-size: 0.78rem; color: var(--muted); margin: 8px 0 0; }

/* ============================================================
   THE LEVITY MAP (map.html, coach only) - one metro line per
   area of the business, one station per thing built.
   ============================================================ */

.container-wide { max-width: 1120px; }

.map-summary { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.map-progress {
  flex: 1 1 300px;
  background: var(--charcoal);
  color: var(--white-warm);
  border-radius: 14px;
  padding: 18px 20px;
}
.map-progress-top { display: flex; justify-content: space-between; font-size: 0.9rem; margin-bottom: 10px; }
.map-progress-top strong { font-family: 'Playfair Display', serif; font-size: 1.4rem; color: var(--white); }
.map-bar { height: 8px; border-radius: 100px; background: rgba(244, 240, 230, 0.14); overflow: hidden; }
.map-bar-fill { height: 100%; border-radius: 100px; background: linear-gradient(90deg, var(--sage), var(--gold)); }
.map-stats { display: flex; gap: 12px; flex: 1 1 300px; }
.map-stat {
  flex: 1;
  background: var(--white-warm);
  border: 1px solid rgba(122, 158, 126, 0.16);
  border-radius: 14px;
  padding: 14px 10px;
  text-align: center;
}
.map-stat .n { display: block; font-family: 'Playfair Display', serif; font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.map-stat .l { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); }

.map-lines {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
  align-items: start;
  margin-bottom: 20px;
}
.map-line {
  background: var(--white-warm);
  border: 1px solid rgba(122, 158, 126, 0.16);
  border-top: 4px solid var(--line);
  border-radius: 14px;
  padding: 18px 18px 8px;
}
.map-line-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.map-line-head h2 { font-size: 1.15rem; margin: 0; }
.map-line-count { font-size: 0.76rem; font-weight: 700; color: var(--muted); }

/* The track: a vertical line in the area's colour, stations sitting on it. */
.stops { list-style: none; margin: 0; padding: 0; }
.stop { position: relative; padding: 0 0 0 26px; }
.stop::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--line);
}
.stop:first-child::before { top: 14px; }
.stop:last-child::before { bottom: calc(100% - 14px); }
.stop:only-child::before { display: none; }
/* Track goes faint once the line runs past the last finished station. */
.stop:not(.stop-done)::before { opacity: 0.3; }

.stop-dot {
  position: absolute;
  left: 1px;
  top: 7px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--line);
  border: 3px solid var(--white-warm);
  box-shadow: 0 0 0 2px var(--line);
}
.stop-in_progress .stop-dot,
.stop-next .stop-dot { background: var(--white); }
.stop-waiting .stop-dot { background: var(--gold-light); box-shadow: 0 0 0 2px var(--gold); }
.stop-parked .stop-dot { background: var(--white); box-shadow: 0 0 0 2px var(--muted); opacity: 0.6; }

.stop-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 4px 0 12px;
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--charcoal);
}
.stop-title { display: block; font-weight: 600; font-size: 0.9rem; line-height: 1.4; }
.stop-btn:hover .stop-title { color: var(--sage-dark); }
.stop-parked .stop-title { color: var(--muted); }
.stop-meta { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.stop-date { font-size: 0.74rem; color: var(--muted); }

.stop-pill-in_progress, .stop-pill-next { background: var(--sage-light); color: var(--charcoal); }
.stop-pill-waiting { background: var(--gold-light); color: var(--charcoal); }
.stop-pill-parked { background: transparent; color: var(--muted); border: 1px solid var(--muted); }

.stop-detail {
  background: var(--white);
  border-radius: 10px;
  padding: 12px 14px 2px;
  margin: -4px 0 14px;
}
.stop-detail p { margin: 0 0 12px; font-size: 0.86rem; }
.stop-detail select { padding: 10px 14px; font-size: 0.85rem; margin-bottom: 12px; }
.stop-empty { font-size: 0.82rem; color: var(--muted); padding: 4px 0 14px; }

.map-add > summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sage-dark);
}
.map-add > summary::-webkit-details-marker { display: none; }
.map-add[open] > summary { margin-bottom: 16px; }
.map-add input, .map-add select, .map-add textarea { background: var(--white); }
.map-add-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 12px; }
.map-add input[type="date"] {
  width: 100%;
  border: 1.5px solid transparent;
  border-radius: 8px;
  padding: 13px 18px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.95rem;
  color: var(--charcoal);
  margin-bottom: 18px;
}

/* ============================================================
   DECORATIVE ACCENTS - a light touch pulled from the logo itself
   (its gold arc + star, its botanical bowl), used quietly: page
   titles, the login wordmark, and earned badges only. Not a
   theme change - every card, button and layout above is untouched.
   ============================================================ */

/* Gold arc + sparkle under the page title and the LEVITY wordmark
   on login/callback. One shared motif, drawn once as inline SVG so
   no image asset is needed and it never touches any file's text
   encoding. */
.page-title::after,
.auth-card .logo::after {
  content: '';
  display: block;
  width: 84px;
  height: 16px;
  margin-top: 8px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='84' height='16' viewBox='0 0 84 16'%3E%3Cpath d='M2 12 Q 40 1 68 9' fill='none' stroke='%23C8A84B' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M76 2 L78 8 L76 14 L74 8 Z' fill='%23C8A84B'/%3E%3Cpath d='M70 8 L76 6 L82 8 L76 10 Z' fill='%23C8A84B'/%3E%3C/svg%3E") no-repeat left center;
  background-size: contain;
}
.auth-card .logo::after { margin: 8px auto 0; background-position: center; }

/* Small sparkle on an EARNED badge only - the same 4-point shape as the
   arc's tip above, at corner scale. Locked badges stay plain. */
.badge:not(.locked)::after {
  content: '';
  position: absolute;
  top: -5px;
  right: -5px;
  width: 14px;
  height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='M7 0 L9 5 L14 7 L9 9 L7 14 L5 9 L0 7 L5 5 Z' fill='%23C8A84B'/%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
}

/* ============================================================
   LEVITATION LAYER (2026-09-24)
   Everything floats: a fixed, slowly drifting backdrop sits far
   behind the page, cards hover above it on layered shadows, and
   interactive cards tilt toward the cursor with a light sheen.
   Comes last in the file on purpose - it overrides the flat card
   and top-bar styles above without editing them.
   ============================================================ */

:root {
  --glass: rgba(255, 253, 248, 0.74);
  --glass-edge: rgba(255, 255, 255, 0.75);
  --float: 0 1px 2px rgba(42, 35, 32, 0.04),
           0 10px 28px -10px rgba(42, 35, 32, 0.12),
           0 28px 56px -28px rgba(74, 110, 78, 0.22),
           inset 0 1px 0 rgba(255, 255, 255, 0.85);
  --float-high: 0 2px 4px rgba(42, 35, 32, 0.05),
                0 22px 44px -14px rgba(42, 35, 32, 0.2),
                0 48px 90px -34px rgba(74, 110, 78, 0.34),
                inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --ease-float: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* The backdrop: soft colour fields fixed to the viewport, so content
   scrolls over them instead of sitting on them. */
html { background: var(--white); }
body { background: transparent; min-height: 100vh; }
body::before {
  content: '';
  position: fixed;
  inset: -12%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(40% 36% at 12% 10%, rgba(168, 197, 172, 0.7), transparent 70%),
    radial-gradient(36% 32% at 90% 16%, rgba(232, 213, 196, 0.95), transparent 70%),
    radial-gradient(42% 38% at 74% 94%, rgba(226, 200, 120, 0.42), transparent 70%),
    radial-gradient(32% 30% at 8% 86%, rgba(201, 123, 99, 0.22), transparent 70%),
    radial-gradient(30% 26% at 50% 50%, rgba(168, 197, 172, 0.18), transparent 70%),
    var(--white);
  filter: blur(8px);
  animation: backdrop-drift 48s ease-in-out infinite alternate;
}
@keyframes backdrop-drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-2%, 1.5%, 0) scale(1.05); }
}

/* Top bar: dark glass that stays put while the page floats under it. */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(42, 35, 32, 0.88);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: 0 10px 30px -12px rgba(42, 35, 32, 0.45);
}

/* Every surface floats. */
.card, .post-item, .reply, .map-line, .map-stat, .badge {
  position: relative;
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--float);
}
.map-line { border-top: 4px solid var(--line); }
.reply.coach { background: rgba(232, 240, 233, 0.78); border-color: var(--sage-light); }
.reply.answer { box-shadow: 0 0 0 1.5px var(--sage-dark), var(--float); }
.map-progress { box-shadow: var(--float-high); }
.streak-card { position: relative; box-shadow: 0 30px 60px -28px rgba(74, 110, 78, 0.7), 0 10px 24px -12px rgba(42, 35, 32, 0.3); }
.auth-card { background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: var(--float-high); border-color: var(--glass-edge); }
.modal { box-shadow: var(--float-high); }

/* Form fields read as slightly sunk into the floating card. */
input[type="text"], input[type="email"], input[type="number"], input[type="password"], input[type="date"], select, textarea {
  background: rgba(244, 240, 230, 0.8);
  box-shadow: inset 0 1px 3px rgba(42, 35, 32, 0.07);
}

/* Buttons get a little lift of their own. */
.btn-primary {
  background: linear-gradient(160deg, #56805A, var(--sage-dark));
  box-shadow: 0 6px 16px -6px rgba(74, 110, 78, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn-secondary { background: rgba(255, 253, 248, 0.6); }
.tab { background: rgba(255, 253, 248, 0.6); }
.tab.active { box-shadow: 0 6px 16px -6px rgba(74, 110, 78, 0.55); }

/* ---------- Tilt + sheen (the "opens up" hover) ----------
   Cards listed here tilt toward the cursor (portal-common.js sets
   --rx/--ry/--mx/--my) and lift. The sheen is a light overlay that
   follows the pointer, so the card reads as a physical surface. */
.tilt, .post-item, .streak-card, .badge, .map-stat {
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift, 0px));
  transition: transform 0.45s var(--ease-float), box-shadow 0.45s var(--ease-float), border-color 0.3s ease;
  will-change: transform;
}
.tilt:hover, .post-item:hover, .streak-card:hover, .badge:hover, .map-stat:hover {
  --lift: -6px;
  /* Restated so it beats the older flat `.post-item:hover` translate. */
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift, 0px));
  box-shadow: var(--float-high);
  border-color: rgba(168, 197, 172, 0.9);
  transition: transform 0.15s ease-out, box-shadow 0.45s var(--ease-float), border-color 0.3s ease;
}
.streak-card:hover { box-shadow: 0 40px 70px -26px rgba(74, 110, 78, 0.8), 0 12px 28px -12px rgba(42, 35, 32, 0.32); }

.tilt::before, .post-item::before, .streak-card::before, .badge::before, .map-stat::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(480px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, 0.5), transparent 42%),
    linear-gradient(180deg, transparent 55%, rgba(74, 110, 78, 0.06));
  opacity: 0;
  transition: opacity 0.35s ease;
}
.tilt:hover::before, .post-item:hover::before, .streak-card:hover::before, .badge:hover::before, .map-stat:hover::before { opacity: 1; }
/* Content sits above the sheen so text never washes out. */
.tilt > *, .post-item > *, .streak-card > *, .badge > *, .map-stat > * { position: relative; z-index: 1; }
/* Badge name + sub were inheriting the body's 1.7 line height and wrapping loosely. */
.badge > span:last-child { line-height: 1.3; }

/* ---------- Rise-in on load ----------
   Uses the separate `translate` property so it never fights the tilt
   `transform` above. */
.rise { animation: rise-in 0.7s var(--ease-float) backwards; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes rise-in {
  from { opacity: 0; translate: 0 18px; }
  to   { opacity: 1; translate: 0 0; }
}

/* ---------- Wide layouts: main column left, community right ---------- */
.container-wide { max-width: 1160px; }

.home-grid, .board-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0 28px;
  align-items: start;
}
@media (min-width: 900px) {
  .home-grid { grid-template-columns: minmax(0, 1fr) minmax(340px, 420px); }
  .board-layout { grid-template-columns: minmax(0, 1fr) 320px; }
  .home-side, .board-side { position: sticky; top: 96px; }
}

.home-side .community-panel { min-height: 420px; display: flex; flex-direction: column; }
.community-panel #community-card-body { flex: 1; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.panel-head h2 { font-size: 1.35rem; margin: 0; }

.side-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.side-card p { font-size: 0.88rem; color: var(--charcoal); opacity: 0.82; margin: 0 0 12px; }
.rules { list-style: none; margin: 0; padding: 0; }
.rules li { position: relative; padding: 0 0 10px 22px; font-size: 0.88rem; }
.rules li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  width: 11px;
  height: 11px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='M7 0 L9 5 L14 7 L9 9 L7 14 L5 9 L0 7 L5 5 Z' fill='%23C8A84B'/%3E%3C/svg%3E") no-repeat center / contain;
}
.side-stat { font-family: 'Playfair Display', serif; font-size: 2rem; font-weight: 700; line-height: 1; }

/* Community rows inside the home panel */
.panel-row {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 12px 12px;
  margin: 0 -12px;
  border-radius: 10px;
  border-top: 1px solid rgba(122, 158, 126, 0.14);
  transition: background 0.2s ease, translate 0.2s ease;
}
.panel-row:hover { background: rgba(255, 255, 255, 0.7); translate: 4px 0; }
.panel-row .t { font-weight: 600; font-size: 0.92rem; line-height: 1.4; }

@media (prefers-reduced-motion: reduce) {
  body::before, .rise { animation: none; }
  .tilt, .post-item, .streak-card, .badge, .map-stat { transform: none !important; transition: box-shadow 0.3s ease; }
}

/* ============================================================
   COMMUNITY v2 (2026-09-24) - member count, topics, search,
   stars, sparkles, and the "you're doing great" pop-up.
   ============================================================ */

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Glowing member count, top right */
.glow-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--sage-light);
  box-shadow: 0 0 0 0 rgba(168, 197, 172, 0.7), 0 0 10px 2px rgba(168, 197, 172, 0.8);
  animation: glow-pulse 2.4s ease-in-out infinite;
  vertical-align: middle;
}
@keyframes glow-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(168, 197, 172, 0.65), 0 0 10px 2px rgba(168, 197, 172, 0.8); }
  70%  { box-shadow: 0 0 0 9px rgba(168, 197, 172, 0), 0 0 14px 4px rgba(226, 200, 120, 0.55); }
  100% { box-shadow: 0 0 0 0 rgba(168, 197, 172, 0), 0 0 10px 2px rgba(168, 197, 172, 0.8); }
}
.member-count {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 6px 14px;
  border-radius: 100px;
  background: rgba(168, 197, 172, 0.12);
  border: 1px solid rgba(168, 197, 172, 0.3);
  color: var(--white-warm);
  text-decoration: none;
  font-size: 0.78rem;
  white-space: nowrap;
}
.member-count strong { font-family: 'Playfair Display', serif; font-size: 1rem; color: var(--white); }
.member-count:hover { background: rgba(168, 197, 172, 0.22); }
#panel-sub .glow-dot { margin: 0 4px 0 2px; }
@media (max-width: 480px) { .member-count .mc-label { display: none; } }
@media (min-width: 720px) { .member-count { margin-left: 0; } }

/* Topic chips (scroll sideways on phones instead of wrapping into a wall) */
.topic-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 12px;
  margin-bottom: 8px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.topic-chips::-webkit-scrollbar { display: none; }
.topic-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--glass-edge);
  background: var(--glass);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px -6px rgba(42, 35, 32, 0.18);
  color: var(--charcoal);
  border-radius: 100px;
  padding: 8px 14px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: translate 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.topic-chip:hover { translate: 0 -2px; box-shadow: 0 8px 18px -8px rgba(74, 110, 78, 0.4); }
.topic-chip.active { background: var(--sage-dark); border-color: var(--sage-dark); color: var(--white); }
.topic-chips-compact { flex-wrap: wrap; overflow: visible; padding-bottom: 4px; }
.topic-chips-compact .topic-chip { padding: 5px 11px; font-size: 0.74rem; }

.composer .row { flex-wrap: wrap; }
.topic-select { flex: 1 1 180px; max-width: 260px; margin: 0 auto 0 0; padding: 11px 14px; font-size: 0.85rem; }

/* Search */
.search-row { display: flex; gap: 10px; margin-bottom: 10px; }
.search-row input[type="search"] {
  flex: 1;
  min-width: 0;
  margin: 0;
  border: 1px solid var(--glass-edge);
  border-radius: 100px;
  padding: 12px 20px 12px 42px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.92rem;
  color: var(--charcoal);
  background: var(--glass) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239A8F87' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 16px center;
  box-shadow: var(--float);
}
.search-row input[type="search"]:focus { outline: none; border-color: var(--sage); }
.search-row select { width: auto; flex: 0 0 auto; margin: 0; border-radius: 100px; padding: 12px 16px; font-size: 0.85rem; box-shadow: var(--float); }
.search-banner {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(168, 197, 172, 0.18);
  border-radius: 12px;
  padding: 10px 16px;
  margin-bottom: 14px;
  font-size: 0.88rem;
}

/* Names are clickable: see everything that person shared */
.name-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
}
.name-link:hover { color: var(--sage-dark); text-decoration: underline; text-underline-offset: 2px; }
.name-stars {
  margin-left: 4px;
  color: var(--gold);
  letter-spacing: 1px;
  font-size: 0.85em;
  text-shadow: 0 0 8px rgba(226, 200, 120, 0.7);
}
.pill-topic { background: rgba(255, 255, 255, 0.7); color: var(--charcoal); border: 1px solid rgba(122, 158, 126, 0.25); text-transform: none; letter-spacing: 0.02em; font-weight: 600; font-size: 0.7rem; }

.star-legend { list-style: none; margin: 0; padding: 0; font-size: 0.86rem; }
.star-legend li { padding: 4px 0; }
.star-legend .name-stars { display: inline-block; min-width: 46px; margin: 0; }

/* Sparkle burst off the Post/Ask/Send button */
.sparkle-burst { position: fixed; width: 0; height: 0; pointer-events: none; z-index: 70; }
.spark {
  position: absolute;
  left: -4px;
  top: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 8px var(--c);
  animation: spark-fly 0.95s cubic-bezier(0.15, 0.7, 0.3, 1) both;
}
.spark.star {
  width: 14px;
  height: 14px;
  left: -7px;
  top: -7px;
  border-radius: 0;
  background: var(--c);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M7 0 L9 5 L14 7 L9 9 L7 14 L5 9 L0 7 L5 5 Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M7 0 L9 5 L14 7 L9 9 L7 14 L5 9 L0 7 L5 5 Z'/%3E%3C/svg%3E") center / contain no-repeat;
}
@keyframes spark-fly {
  0%   { transform: translate(0, 0) scale(0.3) rotate(0deg); opacity: 1; }
  70%  { opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(1) rotate(var(--rot)); opacity: 0; }
}

/* "You're doing great" pop-up */
.cheer {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 16px 20px;
  border-radius: 18px;
  background: linear-gradient(150deg, var(--sage-dark), #5E8662);
  color: var(--white);
  box-shadow: 0 30px 60px -20px rgba(42, 35, 32, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
  transform: translate(-50%, 30px) scale(0.96);
  opacity: 0;
  transition: transform 0.45s var(--ease-float), opacity 0.35s ease;
}
.cheer.in { transform: translate(-50%, 0) scale(1); opacity: 1; }
.cheer-icon { font-size: 1.7rem; line-height: 1; animation: cheer-spin 1.2s ease-out; }
.cheer-title { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 1.05rem; color: var(--gold-light); }
.cheer-msg { font-size: 0.9rem; line-height: 1.45; }
@keyframes cheer-spin { from { transform: rotate(-30deg) scale(0.4); } to { transform: rotate(0) scale(1); } }

@media (prefers-reduced-motion: reduce) {
  .glow-dot, .cheer-icon { animation: none; }
  .cheer { transition: opacity 0.2s ease; }
}

/* Community v3 (2026-09-24): home nudge + coach starter posts */
.nudge-card { border-left: 4px solid var(--gold); }
.nudge-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 14px; }
.starter-card { border: 1.5px dashed var(--sage-light); }
.starter-card textarea { min-height: 100px; margin-bottom: 12px; }
.reply .post-foot { align-items: center; }
#coach-card-body a, .card p a { color: var(--sage-dark); font-weight: 600; text-underline-offset: 2px; }

/* ============================================================
   STARS (step 3, 2026-09-25) - daily star log, your week,
   the Showing Up wall and Big Sisters.
   ============================================================ */

.star-log-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.day-toggle { margin: 0; background: rgba(255, 255, 255, 0.6); }
.day-toggle .toggle-option { padding: 6px 14px; }

.log-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.log-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 8px 12px;
  border-radius: 14px;
  border: 1.5px solid rgba(122, 158, 126, 0.3);
  background: rgba(255, 255, 255, 0.65);
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--charcoal);
  cursor: pointer;
  transition: translate 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.log-btn:hover { translate: 0 -2px; box-shadow: 0 10px 20px -10px rgba(74, 110, 78, 0.45); }
.log-btn:focus-visible, .meal-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.log-btn .log-icon { font-size: 1.6rem; line-height: 1; }
.log-btn .log-label { font-size: 0.8rem; font-weight: 700; }
.log-btn.on {
  background: linear-gradient(150deg, var(--sage-dark), #5E8662);
  border-color: var(--sage-dark);
  color: var(--white);
  box-shadow: 0 10px 22px -10px rgba(74, 110, 78, 0.7);
}
.log-btn.on .log-label::after { content: ' \2605'; color: var(--gold-light); }
.log-btn.on .private-tag { color: rgba(255, 255, 255, 0.75); }
.private-tag { font-size: 0.66rem; font-weight: 600; color: var(--muted); letter-spacing: 0.02em; white-space: nowrap; }

.pr-note { margin: 12px 0 0; font-size: 0.9rem; font-weight: 600; color: var(--sage-dark); }
.pr-form { margin-top: 14px; padding: 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.6); border: 1px dashed var(--sage-light); }
.pr-form input { margin-bottom: 10px; }
.pr-actions { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.pr-actions .btn { padding: 10px 20px; }

.meal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(122, 158, 126, 0.16);
}
.meal-row > div:first-child { flex: 1 1 220px; }
.meal-title { font-weight: 700; font-size: 0.9rem; }
.meal-btns { display: flex; gap: 8px; }
.meal-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1.5px solid var(--sage-light);
  background: rgba(255, 255, 255, 0.7);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  color: var(--charcoal);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.meal-btn:hover { transform: scale(1.06); }
.meal-btn.on { background: var(--sage-dark); border-color: var(--sage-dark); color: var(--white); }

.week-totals { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.week-big { font-family: 'Playfair Display', serif; font-size: 2rem; font-weight: 700; line-height: 1; }
.week-unit { font-size: 0.82rem; color: var(--muted); font-weight: 600; }
.week-sep { color: var(--muted); margin: 0 6px; }
.week-compare { margin: 4px 0 10px; font-size: 0.9rem; color: var(--sage-dark); font-weight: 600; }
.wall-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 4px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
}
.wall-toggle input { width: 18px; height: 18px; margin: 0; accent-color: var(--sage-dark); }

/* The wall (board sidebar). The list scrolls inside the card so a busy week
   can't push the sticky sidebar past the bottom of the screen. */
.wall-list { list-style: none; margin: 0; padding: 0; max-height: 240px; overflow-y: auto; }
.wall-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-top: 1px solid rgba(122, 158, 126, 0.14);
  font-size: 0.88rem;
}
.wall-list li:first-child { border-top: none; }
.wall-name { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.wall-icons { display: flex; gap: 3px; flex: none; font-size: 0.9rem; }
.wall-quiet { margin: 8px 0 0; }
.wall-legend { font-size: 0.72rem; color: var(--muted); margin: 10px 0 0 !important; }
.wall-link { display: inline-block; margin-top: 10px; font-size: 0.84rem; font-weight: 700; color: var(--sage-dark); text-decoration: none; }
.wall-link:hover { text-decoration: underline; text-underline-offset: 2px; }
.sister-mark { font-size: 0.8em; }
.sisters { margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(200, 168, 75, 0.35); }
.sisters h3 { font-size: 1rem; margin-bottom: 4px; }
.sisters p { margin: 0 0 10px; }
.sister-names { display: flex; flex-wrap: wrap; gap: 6px; }
.sister-chip {
  padding: 5px 12px;
  border-radius: 100px;
  background: linear-gradient(150deg, rgba(226, 200, 120, 0.45), rgba(200, 168, 75, 0.3));
  border: 1px solid rgba(200, 168, 75, 0.5);
  font-size: 0.8rem;
  font-weight: 700;
}

@media (max-width: 420px) {
  .log-grid { gap: 8px; }
  .log-btn { padding: 14px 4px 10px; }
  .meal-btn { width: 38px; height: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  .log-btn, .meal-btn { transition: none; }
  .log-btn:hover { translate: none; }
  .meal-btn:hover { transform: none; }
}
/* ============================================================
   LEVITY ASSISTANT (step 4, 2026-09-25) - labeled replies in
   threads, and the coach-only assistant.html page.
   ============================================================ */

.avatar.assistant {
  background: linear-gradient(150deg, var(--gold-light), var(--gold));
  color: var(--charcoal);
  font-size: 1rem;
}
.reply.assistant { background: rgba(250, 244, 226, 0.82); border-color: rgba(200, 168, 75, 0.45); }
.pill-assistant { background: rgba(226, 200, 120, 0.4); color: var(--charcoal); text-transform: none; letter-spacing: 0.02em; }

.asst-panel[hidden] { display: none; }
.asst-h { font-size: 1.2rem; margin: 26px 0 4px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.asst-sub { margin: 0 0 12px; }
.asst-clear { text-align: center; }

.review-card { border-left: 4px solid var(--sage-light); }
.review-card.review-hard_stop { border-left-color: var(--rose); }
.review-card.review-hand_off { border-left-color: var(--gold); }
.review-card.review-error { border-left-color: var(--rose); border-style: dashed; }
.review-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.decision-pill { background: rgba(168, 197, 172, 0.35); color: var(--charcoal); text-transform: none; letter-spacing: 0.02em; }
.decision-hard_stop { background: var(--rose); color: var(--white); }
.decision-hand_off { background: var(--gold-light); }
.review-title { display: block; font-family: 'Playfair Display', serif; font-weight: 700; font-size: 1.1rem; color: var(--charcoal); text-decoration: none; margin-bottom: 4px; }
a.review-title:hover { color: var(--sage-dark); }
.review-q { font-size: 0.88rem; margin: 0 0 8px; color: var(--charcoal); opacity: 0.85; overflow-wrap: anywhere; }
.review-lead { font-size: 0.86rem; font-weight: 600; color: var(--sage-dark); margin: 0 0 8px; }
.review-card.review-hard_stop .review-lead { color: var(--rose); }
.review-note { font-size: 0.85rem; background: rgba(255, 255, 255, 0.6); border-radius: 10px; padding: 8px 12px; margin: 0 0 12px; }
.review-note span { color: var(--gold); margin-right: 4px; }
.review-body { min-height: 120px; }
.matched-line { margin: -8px 0 10px; }
.matched { display: inline-block; padding: 1px 8px; border-radius: 100px; background: rgba(168, 197, 172, 0.25); font-size: 0.72rem; cursor: help; }
.teach-check { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 0.84rem; margin: 0 0 12px; cursor: pointer; }
.teach-check input, .route-toggle input { width: 16px; height: 16px; margin: 0; accent-color: var(--sage-dark); }
.review-actions { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.review-actions .btn { padding: 11px 20px; }
.draft-box { background: rgba(255, 255, 255, 0.6); border-radius: 10px; padding: 10px 14px; margin-bottom: 10px; }
.draft-box p { margin: 0; white-space: pre-wrap; font-size: 0.92rem; }
.asst-history summary { cursor: pointer; font-weight: 700; }
.asst-history .trend-row .review-title { font-size: 0.92rem; margin: 0; }

.teach-top .teach-meter-text { display: flex; justify-content: space-between; gap: 10px; font-size: 0.86rem; margin-bottom: 8px; flex-wrap: wrap; }
.teach-cat { margin-bottom: 8px; }
.teach-q { padding: 18px 20px 14px; border-left: 4px solid transparent; }
.teach-q.done { border-left-color: var(--sage); }
.teach-q.route-abbi { border-left-color: var(--rose); }
.teach-head { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.teach-text { font-size: 0.98rem; font-weight: 600; margin: 0 0 8px; flex: 1; }
.core-tag { font-size: 0.64rem; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700; color: var(--gold); white-space: nowrap; padding-top: 4px; }
.core-tag.need { color: var(--rose); }
.teach-hint { font-size: 0.84rem; color: var(--muted); margin: 0 0 10px; }
.teach-hint b { color: var(--sage-dark); font-weight: 600; }
.teach-q textarea { margin-bottom: 8px; }
.teach-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.route-toggle { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 0.82rem; font-weight: 500; color: var(--muted); cursor: pointer; }
.route-toggle input:checked + span { color: var(--rose); font-weight: 700; }
.saved { font-size: 0.75rem; color: var(--sage-dark); opacity: 0; transition: opacity 0.3s ease; }
.saved.show { opacity: 1; }
.saved.error { color: var(--rose); }

.switch-card { border-left: 4px solid var(--muted); }
.switch-card.on { border-left-color: var(--sage-dark); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ready-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid rgba(122, 158, 126, 0.14); font-size: 0.9rem; }
.ready-row:first-of-type { border-top: none; }
.ready-dot {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 2px;
}
.ready-row.ok .ready-dot { background: var(--sage-dark); border-color: var(--sage-dark); color: var(--white); }
.wait-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wait-row input { width: 110px; margin: 0; }
.wait-row .btn { padding: 11px 20px; }
@media (prefers-reduced-motion: reduce) { .saved { transition: none; } }
/* ============================================================
   PRIVATE MESSAGES (messages.html, messages-schema.sql)
   ============================================================ */

/* Unread badge on the Messages nav link */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 6px;
  border-radius: 100px;
  background: var(--gold);
  color: var(--charcoal);
  font-size: 0.66rem;
  letter-spacing: 0;
  line-height: 1;
}
.nav-badge.urgent { background: var(--rose); color: var(--white); }

.safety-note {
  background: rgba(232, 213, 196, 0.45);
  border-left: 4px solid var(--rose);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 0.88rem;
}
.safety-note a { color: var(--charcoal); font-weight: 700; }

.inbox-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 24px; align-items: start; }
@media (min-width: 900px) {
  .inbox-layout.coach { grid-template-columns: 300px minmax(0, 1fr); }
  .inbox-layout.coach .inbox-list { position: sticky; top: 96px; }
}

.inbox-row {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-top: 1px solid rgba(122, 158, 126, 0.14);
  border-radius: 10px;
  padding: 10px 40px 10px 12px;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.inbox-row:hover { background: rgba(255, 255, 255, 0.7); }
.inbox-row.active { background: rgba(168, 197, 172, 0.25); }
.inbox-row.urgent { box-shadow: inset 3px 0 0 var(--rose); }
.inbox-name { display: block; font-weight: 600; font-size: 0.92rem; }
.inbox-unread {
  position: absolute;
  right: 12px;
  top: 50%;
  translate: 0 -50%;
  min-width: 22px;
  height: 22px;
  border-radius: 100px;
  background: var(--sage-dark);
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pill-urgent { background: var(--rose); color: var(--white); }
.pill-private { background: rgba(42, 35, 32, 0.08); color: var(--charcoal); text-transform: none; letter-spacing: 0.02em; }

.thread-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.urgent-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: rgba(201, 123, 99, 0.12);
  border: 1px solid rgba(201, 123, 99, 0.45);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}
.urgent-banner .btn { padding: 10px 18px; }

.thread {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 60vh;
  overflow-y: auto;
}
.bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(122, 158, 126, 0.18);
}
.bubble.mine { align-self: flex-end; background: rgba(168, 197, 172, 0.28); border-color: var(--sage-light); }
.bubble.theirs { align-self: flex-start; }
.bubble.from-assistant { background: rgba(250, 244, 226, 0.9); border-color: rgba(200, 168, 75, 0.45); }
.bubble.urgent { box-shadow: inset 3px 0 0 var(--rose); }
.bubble-who { font-size: 0.8rem; font-weight: 600; margin-bottom: 4px; }
.bubble-body { margin: 0; white-space: pre-wrap; font-size: 0.95rem; overflow-wrap: anywhere; }
.moved-note { font-size: 0.78rem; color: var(--muted); margin-bottom: 6px; }
.moved-note a { color: var(--sage-dark); }

/* A post that has been moved off the board */
.private-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: rgba(168, 197, 172, 0.2);
  border: 1px solid var(--sage-light);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}
.private-banner .btn { padding: 10px 18px; }
/* Coaching-only features shown locked to members */
.top-bar .nav a.locked { opacity: 0.8; }
.nav-lock { font-size: 0.7em; margin-left: 5px; opacity: 0.85; }
.teaser { padding: 36px 24px; }
.teaser-lock { font-size: 2rem; line-height: 1; }
.teaser .btn { margin-top: 8px; }
/* ============================================================
   WAVE 4 (portal lane): XP bar, badge shelf, days-active chip, video library.
   ============================================================ */
.days-chip {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(122, 158, 126, 0.16);
  color: var(--sage-dark);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  vertical-align: middle;
}

.xp-bar { display: block; }
.xp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.xp-level { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 1.25rem; color: var(--charcoal); }
.xp-num { font-size: 0.82rem; font-weight: 700; color: var(--sage-dark); }
.xp-track { height: 12px; border-radius: 999px; background: rgba(122, 158, 126, 0.18); overflow: hidden; }
.xp-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--sage), var(--gold));
  transition: width 0.7s var(--ease-float, ease);
}
.xp-note { margin-top: 8px; font-size: 0.84rem; color: var(--muted); }
.xp-compact .xp-level { font-size: 1.05rem; }
.xp-compact .xp-track { height: 9px; }
.xp-compact .xp-note { margin: 6px 0 10px; }

.shelf-section { margin-top: 18px; }
.shelf-title { font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; font-weight: 700; }
button.shelf-badge {
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  width: 100%;
}
button.shelf-badge:focus-visible { outline: 2px solid var(--sage-dark); outline-offset: 2px; }
.badge-detail {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-height: 44px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(244, 240, 230, 0.7);
  margin-bottom: 4px;
}
.badge-detail p { margin: 4px 0 0; font-size: 0.88rem; }
.badge-detail .detail-icon { font-size: 1.8rem; line-height: 1; }
.badge-detail .detail-status { color: var(--muted); font-weight: 600; }
.badge-detail .detail-status.on { color: var(--sage-dark); }

.library-cat { margin-bottom: 28px; }
.library-cat-title { margin: 0 0 12px; }
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.video-card { padding: 14px; }
.video-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--sage-dark), var(--sage));
}
.video-stage.playing { background: #000; }
.video-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-play {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: 0; cursor: pointer; color: var(--white);
}
.video-play-icon {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(254, 252, 248, 0.22); font-size: 1.4rem; padding-left: 4px;
  transition: transform 0.2s ease, background 0.2s ease;
}
.video-play:hover .video-play-icon, .video-play:focus-visible .video-play-icon { transform: scale(1.1); background: rgba(254, 252, 248, 0.38); }
.video-title { margin: 12px 0 4px; font-size: 1.02rem; }
.video-desc { margin: 0 0 10px; color: var(--muted); font-size: 0.88rem; }
.video-locked .video-stage { background: linear-gradient(135deg, #cfc6bc, #b8aea3); }
.video-lock { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 2rem; }

#library-admin { margin-bottom: 24px; }
#library-admin textarea, #library-admin select { width: 100%; font: inherit; }
.admin-video { display: flex; gap: 14px; justify-content: space-between; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid rgba(122, 158, 126, 0.16); }
.admin-video:first-of-type { border-top: none; }
.admin-video.draft { opacity: 0.72; }
.admin-video-main { flex: 1 1 260px; min-width: 0; }
.admin-video-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.admin-video-actions .btn { padding: 6px 12px; font-size: 0.8rem; }
.admin-stage { margin-top: 10px; max-width: 420px; }
/* END WAVE 4 (portal lane) */
/* ============================================================
   WAVE 4b (portal lane): the Levity lock, Filming soon cards, library strip.
   ============================================================ */
.lock-float { display: inline-block; transition: transform 0.35s var(--ease-float, ease); }
.lock-float:hover, .video-locked:hover .lock-float, .teaser:hover .lock-float { transform: translateY(-4px); }
.lock-seal {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #FFFDF8, var(--white-warm));
  border: 1.5px solid var(--gold);
  box-shadow: 0 8px 14px -6px rgba(42, 35, 32, 0.28), inset 0 0 0 3px rgba(200, 168, 75, 0.12);
  animation: lock-bob 4.5s ease-in-out infinite;
}
.seal-l { font-family: 'Playfair Display', Georgia, serif; font-size: 2rem; line-height: 1; color: #4F6B3A; }
.seal-lock {
  position: absolute; right: -5px; bottom: -3px;
  box-sizing: content-box; padding: 5px; border-radius: 50%;
  background: var(--sage-dark); border: 2px solid var(--white);
}
@keyframes lock-bob {
  0%, 100% { transform: translateY(0); box-shadow: 0 8px 14px -6px rgba(42, 35, 32, 0.28), inset 0 0 0 3px rgba(200, 168, 75, 0.12); }
  50% { transform: translateY(-5px); box-shadow: 0 16px 20px -10px rgba(42, 35, 32, 0.2), inset 0 0 0 3px rgba(200, 168, 75, 0.12); }
}
.lock-small .lock-seal { width: 30px; height: 30px; border-width: 1px; animation-duration: 5s; }
.lock-small .seal-l { font-size: 1rem; }
.lock-small .seal-lock { padding: 2px; right: -4px; bottom: -3px; border-width: 1px; }
.lock-small .seal-lock { width: 8px; height: 8px; }
.locked-label { display: flex; align-items: center; gap: 12px; }
.teaser-lock { margin-bottom: 6px; padding: 8px 0 12px; }
.teaser-kicker, .locked-kicker { font-family: 'Playfair Display', Georgia, serif; font-style: italic; color: var(--sage-dark); margin: 6px 0 10px; }
.teaser-ask { font-weight: 700; margin: 0 0 10px; color: var(--charcoal); }

.video-locked .video-stage { background: linear-gradient(135deg, #F4F0E6, #D9E6DA); }
.video-locked .video-lock { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.soon-stage { background: linear-gradient(135deg, #E9EFE3, #F4F0E6 55%, #EADFC6); }
.soon-stage::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.55) 50%, transparent 65%);
  background-size: 250% 100%; animation: soon-sheen 4.2s ease-in-out infinite;
}
.soon-leaf { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 2.4rem; color: var(--gold); opacity: 0.45; }
.soon-ribbon {
  position: absolute; top: 12px; left: 0; z-index: 2;
  padding: 4px 14px 4px 12px; border-radius: 0 999px 999px 0;
  background: linear-gradient(110deg, var(--gold) 0%, var(--gold-light) 45%, var(--gold) 90%);
  background-size: 220% 100%; animation: soon-shimmer 3.4s ease-in-out infinite;
  color: var(--charcoal); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.04em;
  box-shadow: 0 4px 10px -4px rgba(42, 35, 32, 0.3);
}
@keyframes soon-shimmer { 0%, 100% { background-position: 0% 0; } 50% { background-position: 100% 0; } }
@keyframes soon-sheen { 0% { background-position: 130% 0; } 60%, 100% { background-position: -30% 0; } }

.strip-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid rgba(122, 158, 126, 0.16); }
.strip-row:first-child { border-top: none; }
.strip-dot { color: var(--gold); width: 30px; text-align: center; }
.strip-title { flex: 1; font-weight: 600; font-size: 0.92rem; }
.strip-tag { font-size: 0.7rem; font-weight: 700; color: var(--sage-dark); background: rgba(226, 200, 120, 0.35); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  .lock-seal, .soon-ribbon, .soon-stage::after { animation: none; }
  .lock-float { transition: none; }
  .lock-float:hover, .video-locked:hover .lock-float, .teaser:hover .lock-float { transform: none; }
}
/* END WAVE 4b (portal lane) */
/* ============================================================
   WAVE 4c (portal lane): review fixes. AA contrast for the new body text,
   bigger chip, reduced motion for the bar fill and play icon.
   ============================================================ */
:root { --muted-aa: #6B6159; }
.days-chip { font-size: 0.75rem; }
.video-desc, .xp-note, .shelf-title, .shelf-badge .sub, .badge-detail .post-meta,
.badge-detail .detail-status, .strip-tag { color: var(--muted-aa); }
.xp-note { font-size: 0.88rem; }
.badge-detail .detail-status.on { color: var(--sage-dark); }
.strip-tag { color: #3F5C43; }
/* Locked shelf badges stay readable: only the icon fades, not the words. */
.shelf-badge.locked { opacity: 1; background: rgba(244, 240, 230, 0.6); }
.shelf-badge.locked .icon { filter: grayscale(1); opacity: 0.55; }
.shelf-badge.locked .name { color: #4A423C; }
@media (prefers-reduced-motion: reduce) {
  .xp-fill, .video-play-icon { transition: none; }
  .video-play:hover .video-play-icon, .video-play:focus-visible .video-play-icon { transform: none; }
}
/* END WAVE 4c (portal lane) */

/* ===== LIVE COMMUNITY (live.js, live-settings.html) - Live Community lane ===== */
.live-here {
  display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 6px 0 0; padding: 4px 12px 4px 10px;
  background: rgba(168, 197, 172, 0.2); border: 1px solid var(--sage-light);
  border-radius: 999px; font-size: 0.82rem; color: var(--charcoal);
}
.live-here .glow-dot { margin: 0; }
.live-avs { display: inline-flex; }
.live-av {
  width: 22px; height: 22px; border-radius: 50%; margin-left: -6px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--sage); color: var(--white); font-size: 0.7rem; font-weight: 600;
  border: 2px solid var(--white); line-height: 1;
}
.live-av:first-child { margin-left: 0; }
.live-av.coach { background: var(--gold); }
.live-av.more { background: var(--blush); color: var(--charcoal); }
.live-here-text { font-weight: 600; }
#panel-sub + .live-here { margin: 0 0 10px; }

.typing-row { display: flex; align-items: center; gap: 10px; margin: 8px 2px; font-size: 0.85rem; color: var(--muted); }
.typing-row[hidden] { display: none; }
.typing-bubble {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--white-warm); border-radius: 16px; padding: 9px 12px;
}
.typing-bubble i {
  display: block; width: 7px; height: 7px; border-radius: 50%; background: var(--muted);
  animation: typingDot 1.2s infinite ease-in-out;
}
.typing-bubble i:nth-child(2) { animation-delay: 0.15s; }
.typing-bubble i:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingDot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30% { transform: translateY(-4px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .typing-bubble i { animation: none; opacity: 0.7; }
}

.live-wrap { margin: 6px 0 10px; }
.live-privacy { font-size: 0.78rem; color: var(--muted); margin-top: 4px; }
.live-privacy .link-btn { font-size: 0.78rem; }
.live-prefs { margin-top: 28px; text-align: center; }
#panel-sub + .live-wrap .live-here { margin: 0; }
/* ===== end LIVE COMMUNITY ===== */


/* ============================================================
   NIGHT + GLOW (2026-10-07)
   A darker backdrop so the cream cards pop, glowing outlines on
   every button (green, gold, terracotta), a livelier dashboard,
   and the level-up growth animation. Comes last on purpose: it
   overrides the earlier light styles without editing them. Remove
   this whole section to go back to the light look.
   ============================================================ */

:root {
  --night: #100E0C;
  --night-2: #1A1613;
  --ring-green: #5E8A62;
  --ring-gold: #E2C878;
  --ring-terra: #D07A5E;
  --glass: rgba(254, 252, 248, 0.96);
  --glass-edge: rgba(255, 255, 255, 0.92);
  --float: 0 1px 2px rgba(0, 0, 0, 0.35),
           0 14px 34px -12px rgba(0, 0, 0, 0.6),
           0 30px 70px -30px rgba(94, 138, 98, 0.5),
           inset 0 1px 0 rgba(255, 255, 255, 0.95);
  --float-high: 0 2px 4px rgba(0, 0, 0, 0.4),
                0 26px 54px -16px rgba(0, 0, 0, 0.7),
                0 52px 100px -34px rgba(226, 200, 120, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 1);
}

html { background: var(--night); }
body { color: var(--white); }
body::before {
  background:
    radial-gradient(42% 38% at 10% 8%, rgba(94, 138, 98, 0.5), transparent 70%),
    radial-gradient(36% 32% at 92% 14%, rgba(208, 122, 94, 0.34), transparent 70%),
    radial-gradient(42% 38% at 78% 96%, rgba(226, 200, 120, 0.32), transparent 70%),
    radial-gradient(34% 30% at 6% 90%, rgba(208, 122, 94, 0.22), transparent 70%),
    radial-gradient(30% 26% at 50% 46%, rgba(94, 138, 98, 0.22), transparent 70%),
    linear-gradient(180deg, var(--night-2), var(--night));
  filter: blur(6px);
}
/* A very slow drift of tiny lights, far behind everything. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.55;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 22%, rgba(226, 200, 120, 0.9), transparent 60%),
    radial-gradient(1.5px 1.5px at 38% 64%, rgba(168, 197, 172, 0.8), transparent 60%),
    radial-gradient(1.2px 1.2px at 66% 30%, rgba(226, 200, 120, 0.7), transparent 60%),
    radial-gradient(1.8px 1.8px at 84% 72%, rgba(208, 122, 94, 0.7), transparent 60%),
    radial-gradient(1.2px 1.2px at 24% 88%, rgba(168, 197, 172, 0.7), transparent 60%),
    radial-gradient(1.4px 1.4px at 92% 10%, rgba(226, 200, 120, 0.8), transparent 60%);
  background-size: 520px 520px;
  animation: lights-rise 90s linear infinite;
}
@keyframes lights-rise { from { background-position: 0 0; } to { background-position: 0 -520px; } }

/* Text that sits straight on the dark page is light; everything inside a surface stays dark. */
h1, h2, h3, .heading { color: var(--white); }
.eyebrow { color: var(--sage-light); }
.card, .post-item, .reply, .map-line, .map-stat, .badge, .modal, .auth-card, .cheer, .levelup-panel,
.card h1, .card h2, .card h3, .card .heading, .modal h2, .modal h3, .auth-card h1, .auth-card h2, .post-item h3,
.levelup-panel h2 { color: var(--charcoal); }
.card .eyebrow, .auth-card .eyebrow, .modal .eyebrow { color: var(--sage); }
.page-title { text-shadow: 0 2px 28px rgba(226, 200, 120, 0.28); }
.empty-state { color: var(--blush); }
.card .empty-state, .card .post-meta { color: var(--muted); }
.page-header p, .page-sub, .lede { color: var(--blush); }
.card p { color: inherit; }
.top-bar { background: rgba(16, 14, 12, 0.9); box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.7); border-bottom: 1px solid rgba(226, 200, 120, 0.16); }
.tab { color: var(--sage-dark); }
.tab.active { color: var(--white); }
.status-msg { color: var(--blush); }
.card .status-msg, .auth-card .status-msg, .modal .status-msg { color: inherit; }

/* ---------- Illuminated outlines on every button ----------
   A ring of green, gold and terracotta travels around the edge, with
   a soft glow behind it. Faster and brighter on hover. Still when the
   person has asked for reduced motion. */
@property --spin { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.btn, .tab, .react-btn, .meal-btn, .log-btn { position: relative; --ring-w: 2px; --glow: 0.5; --spin-time: 7s; }
.btn::before, .tab::before, .react-btn::before, .meal-btn::before, .log-btn::before,
.btn::after, .tab::after, .react-btn::after, .meal-btn::after, .log-btn::after {
  content: '';
  position: absolute;
  inset: calc(var(--ring-w) * -1);
  border-radius: inherit;
  padding: var(--ring-w);
  background: conic-gradient(from var(--spin), var(--ring-green), var(--ring-gold), var(--ring-terra), var(--ring-gold), var(--ring-green));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
  animation: ring-spin var(--spin-time) linear infinite;
}
.btn::after, .tab::after, .react-btn::after, .meal-btn::after, .log-btn::after {
  inset: calc(var(--ring-w) * -2.2);
  padding: calc(var(--ring-w) * 2.4);
  filter: blur(8px);
  opacity: var(--glow);
  transition: opacity 0.3s ease;
}
@keyframes ring-spin { to { --spin: 360deg; } }
.btn:hover, .tab:hover, .react-btn:hover, .meal-btn:hover, .log-btn:hover { --glow: 0.95; --spin-time: 2.6s; }
.btn:focus-visible, .tab:focus-visible, .react-btn:focus-visible, .meal-btn:focus-visible, .log-btn:focus-visible { outline: none; --glow: 1; --ring-w: 3px; }
.btn:disabled::before, .btn:disabled::after { opacity: 0.25; animation: none; }
.btn:disabled::after { display: none; }
.react-btn, .meal-btn, .log-btn, .tab { --glow: 0.32; }
.tab.active, .react-btn.on, .meal-btn.on, .log-btn.on { --glow: 0.7; }

/* The hero button: thicker ring, a breathing glow, and a light that sweeps across. */
.btn-glow { --ring-w: 3px; --glow: 0.8; --spin-time: 5s; overflow: visible; }
.btn-glow::after { animation: ring-spin var(--spin-time) linear infinite, glow-breathe 2.8s ease-in-out infinite; }
@keyframes glow-breathe { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
.btn-glow {
  --sweep: linear-gradient(110deg, transparent 38%, rgba(226, 200, 120, 0.45) 50%, transparent 62%);
  background-size: 250% 100%, 100% 100%;
  background-repeat: no-repeat;
  background-position: 130% 0, 0 0;
  animation: btn-sweep 4.2s ease-in-out infinite;
}
.btn-glow.btn-primary { background-image: var(--sweep), linear-gradient(160deg, #56805A, var(--sage-dark)); }
.btn-glow.btn-secondary { background-image: var(--sweep), linear-gradient(rgba(255, 253, 248, 0.7), rgba(255, 253, 248, 0.7)); }
@keyframes btn-sweep { 0% { background-position: 130% 0, 0 0; } 60%, 100% { background-position: -60% 0, 0 0; } }
.btn-glow:hover { --glow: 1; --spin-time: 2s; }

/* ---------- Dashboard: livelier, with the same floating depth as the storefront ---------- */
#client-view .card, #coach-view .card { animation: rise-in 0.75s var(--ease-float) backwards; }
#client-view .card:nth-child(1) { animation-delay: 60ms; }
#client-view .card:nth-child(2) { animation-delay: 140ms; }
#client-view .card:nth-child(3) { animation-delay: 220ms; }
#client-view .card:nth-child(4) { animation-delay: 300ms; }
#client-view .card:nth-child(5) { animation-delay: 380ms; }
#client-view .card:nth-child(6) { animation-delay: 460ms; }
#client-view .card:nth-child(n+7) { animation-delay: 540ms; }
#greeting { font-size: clamp(2rem, 5.4vw, 2.9rem); letter-spacing: 0.01em; }
#xp-card, .xp-card {
  box-shadow: var(--float), 0 0 0 1px rgba(226, 200, 120, 0.5), 0 20px 70px -20px rgba(226, 200, 120, 0.55);
}
.card:hover { border-color: rgba(226, 200, 120, 0.6); }
.home-grid .card .label, .xp-card .label { color: var(--sage-dark); }

/* The level bar: it grows in on every visit, with a lit leading edge. */
.xp-track { background: rgba(42, 35, 32, 0.12); box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2); overflow: hidden; }
.xp-fill {
  position: relative;
  background: linear-gradient(90deg, var(--sage-dark), var(--ring-green), var(--ring-gold), var(--ring-terra));
  box-shadow: 0 0 16px rgba(226, 200, 120, 0.75);
  transform-origin: left center;
  animation: xp-grow 1.4s var(--ease-float) 0.25s backwards;
}
.xp-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%);
  background-size: 220% 100%;
  animation: xp-shine 3.6s ease-in-out 1.8s infinite;
}
@keyframes xp-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes xp-shine { 0% { background-position: 140% 0; } 55%, 100% { background-position: -60% 0; } }
.xp-glyph { display: inline-grid; place-items: center; color: var(--sage-dark); filter: drop-shadow(0 0 6px rgba(226, 200, 120, 0.65)); animation: glyph-sway 5s ease-in-out infinite; transform-origin: 50% 100%; }
.xp-glyph .gl { width: 1.5em; height: 1.5em; }
@keyframes glyph-sway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }

/* ---------- Icons ---------- */
.gl { width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex: none; }
.badge .icon, .badge .detail-icon, .detail-icon { display: inline-grid; place-items: center; color: var(--sage-dark); }
.badge .icon .gl, .detail-icon .gl { width: 1.7rem; height: 1.7rem; }
.badge:not(.locked) .icon { color: var(--gold); filter: drop-shadow(0 0 6px rgba(226, 200, 120, 0.55)); }
.badge.locked .icon { color: var(--muted); opacity: 0.55; }
.log-icon .gl { width: 1.6rem; height: 1.6rem; }
.cheer-icon .gl { width: 1.4rem; height: 1.4rem; color: var(--gold); }
.private-tag .gl, .pill .gl, .week-unit .gl, .wall-legend .gl, .wall-icons .gl, .pr-note .gl { width: 1em; height: 1em; }
.wall-icons { color: var(--sage-dark); }
.empty-glyph { display: grid; place-items: center; color: var(--sage); margin-bottom: 4px; }
.topic-chip .gl, .sister-mark .gl { color: var(--gold); }

/* ---------- Level-up: a plant grows, a star opens, the number counts up ---------- */
.levelup {
  position: fixed; inset: 0; z-index: 400;
  display: grid; place-items: center; padding: 16px;
  background: rgba(10, 8, 7, 0.86);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: 0; transition: opacity 0.4s ease;
}
.levelup.in { opacity: 1; }
.levelup-panel {
  position: relative; width: min(430px, 100%); text-align: center;
  padding: 18px 26px 30px; border-radius: 24px;
  background: var(--white);
  box-shadow: 0 0 0 1px rgba(226, 200, 120, 0.5), 0 30px 90px -20px rgba(226, 200, 120, 0.55), 0 40px 80px -30px rgba(0, 0, 0, 0.8);
  transform: translateY(18px) scale(0.95);
  transition: transform 0.6s var(--ease-float);
}
.levelup.in .levelup-panel { transform: none; }
.levelup-panel::before {
  content: ''; position: absolute; inset: -3px; border-radius: inherit; padding: 3px; z-index: -1;
  background: conic-gradient(from var(--spin), var(--ring-green), var(--ring-gold), var(--ring-terra), var(--ring-gold), var(--ring-green));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: ring-spin 5s linear infinite;
}
.lu-art { width: 250px; max-width: 70vw; height: auto; display: block; margin: 0 auto -4px; overflow: visible; }
.lu-ring { fill: none; stroke: var(--gold); stroke-width: 2; opacity: 0; transform-box: view-box; transform-origin: 120px 100px; }
.levelup.in .lu-ring { animation: lu-ring 2s ease-out forwards; }
.levelup.in .lu-r2 { animation-delay: 0.4s; }
.levelup.in .lu-r3 { animation-delay: 0.8s; }
@keyframes lu-ring { 0% { opacity: 0.95; transform: scale(0.3); } 100% { opacity: 0; transform: scale(3.6); } }
.lu-ground { fill: rgba(94, 138, 98, 0.22); transform-box: fill-box; transform-origin: center; }
.levelup.in .lu-ground { animation: lu-ground 0.9s ease-out backwards; }
@keyframes lu-ground { from { transform: scaleX(0); opacity: 0; } to { transform: scaleX(1); opacity: 1; } }
.lu-stem { fill: none; stroke: var(--sage-dark); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.levelup.in .lu-stem { animation: lu-draw 1.15s 0.2s ease-out forwards; }
@keyframes lu-draw { to { stroke-dashoffset: 0; } }
.lu-leaf { opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(0); }
.lu-leaf ellipse { fill: var(--ring-green); }
.lu-new ellipse { fill: var(--gold); filter: drop-shadow(0 0 8px rgba(226, 200, 120, 0.95)); }
.levelup.in .lu-leaf { animation: lu-pop 0.75s var(--d, 0.6s) cubic-bezier(0.2, 1.5, 0.4, 1) forwards; }
@keyframes lu-pop { 0% { opacity: 0; transform: scale(0); } 60% { opacity: 1; } 100% { opacity: 1; transform: scale(1); } }
.lu-star { fill: var(--gold); opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(0) rotate(-90deg); filter: drop-shadow(0 0 12px rgba(226, 200, 120, 1)); }
.levelup.in .lu-star { animation: lu-star 1.1s 1.15s cubic-bezier(0.2, 1.4, 0.4, 1) forwards; }
@keyframes lu-star { 0% { opacity: 0; transform: scale(0) rotate(-90deg); } 100% { opacity: 1; transform: scale(1) rotate(0); } }
.lu-spark { fill: var(--gold); opacity: 0; }
.levelup.in .lu-spark { animation: lu-spark 1.5s var(--d, 1.4s) ease-out forwards; }
@keyframes lu-spark { 0% { opacity: 0; transform: translate(0, 0) scale(1); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.2); } }
.lu-eyebrow { font-size: 0.7rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--sage); font-weight: 700; }
.lu-level { font-size: 2.7rem; margin: 2px 0 0; line-height: 1.1; }
.lu-count { display: inline-block; color: var(--sage-dark); }
.lu-count.pop { animation: lu-numpop 0.6s cubic-bezier(0.2, 1.6, 0.4, 1); color: var(--gold); text-shadow: 0 0 18px rgba(226, 200, 120, 0.7); }
@keyframes lu-numpop { 0% { transform: scale(0.5); } 100% { transform: scale(1); } }
.lu-name { font-family: 'Playfair Display', serif; font-style: italic; font-size: 1.4rem; color: var(--sage-dark); margin-top: 2px; }
.lu-line { color: var(--muted); max-width: 32ch; margin: 10px auto 18px; font-size: 0.95rem; }
.levelup.in .lu-eyebrow, .levelup.in .lu-level, .levelup.in .lu-name, .levelup.in .lu-line, .levelup.in .lu-btn { animation: lu-fade 0.7s ease backwards; }
.levelup.in .lu-eyebrow { animation-delay: 0.9s; }
.levelup.in .lu-level { animation-delay: 1.1s; }
.levelup.in .lu-name { animation-delay: 1.5s; }
.levelup.in .lu-line { animation-delay: 1.8s; }
.levelup.in .lu-btn { animation-delay: 2.1s; }
@keyframes lu-fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
/* Reduced motion: show the finished scene, nothing moves. */
.levelup.still .lu-stem { stroke-dashoffset: 0; }
.levelup.still .lu-leaf, .levelup.still .lu-star { opacity: 1; transform: none; }
.levelup.still .lu-ring, .levelup.still .lu-spark { display: none; }

@media (max-width: 749px) {
  body::after { animation: none; }
}
@media (prefers-reduced-motion: reduce) {
  body::after, .btn::before, .btn::after, .tab::before, .tab::after, .react-btn::before, .react-btn::after,
  .meal-btn::before, .meal-btn::after, .log-btn::before, .log-btn::after, .btn-glow, .btn-glow::after,
  .xp-fill, .xp-fill::after, .xp-glyph, .levelup-panel::before, #client-view .card, #coach-view .card { animation: none !important; }
  .levelup, .levelup-panel { transition: none; }
}
/* Notes that were see-through on the light page get a solid surface on the dark one. */
.safety-note { background: var(--glass); color: var(--charcoal); box-shadow: var(--float); }

/* The install banner is built in js/pwa.js with inline styles, so these rules use !important. */
#install-card {
  background: var(--glass) !important; color: var(--charcoal) !important;
  font-family: 'Plus Jakarta Sans', sans-serif !important; border-radius: 20px !important;
  border: 1px solid rgba(226, 200, 120, 0.7);
  box-shadow: var(--float), 0 0 28px -6px rgba(226, 200, 120, 0.55) !important;
}
#install-card strong { font-family: 'Playfair Display', serif; font-size: 1.15rem; }
#install-card #install-no { color: var(--sage-dark) !important; font-family: inherit; font-weight: 700; cursor: pointer; min-height: 44px; }
#install-card #install-yes {
  position: relative; cursor: pointer; font-family: inherit; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  min-height: 44px; background: linear-gradient(160deg, #56805A, var(--sage-dark)) !important; --ring-w: 2px; --glow: 0.6; --spin-time: 7s;
}
#install-card #install-yes::before, #install-card #install-yes::after {
  content: ''; position: absolute; inset: -2px; border-radius: inherit; padding: 2px; pointer-events: none;
  background: conic-gradient(from var(--spin), var(--ring-green), var(--ring-gold), var(--ring-terra), var(--ring-gold), var(--ring-green));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: ring-spin var(--spin-time) linear infinite;
}
#install-card #install-yes::after { inset: -4.4px; padding: 4.8px; filter: blur(8px); opacity: var(--glow); }
/* END NIGHT + GLOW */
