*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { transition: background-color 0.2s ease, color 0.2s ease; }
body, #app, .view, nav, .coach-panel { transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease; }

:root {
  --bg: #0a0908;
  --surface: #1a1610;
  --surface2: #252018;
  --border: rgba(255,255,255,0.11);
  --border2: rgba(255,255,255,0.07);
  --text: #ede4d4;
  --text-dim: rgba(237,228,212,0.64);
  --text-muted: rgba(237,228,212,0.40);
  --accent: #b08448;
  --accent-b: #d9b46a;
  --card-shadow: 0 2px 16px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.04);
  --nav-h: 64px;
  --serif: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  --display: 'Cinzel', 'Playfair Display', Georgia, serif;
  --radius: 16px;
  --radius-sm: 10px;
  --cal: #d9b46a;
  --pro: #6e9fd4;
  --carb: #6fd48e;
  --fat: #d46f6f;
}

html, body { height: 100%; overflow: hidden; }

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 95% 55% at 50% -2%, rgba(176,132,72,0.14) 0%, transparent 56%),
    radial-gradient(ellipse 55% 48% at 4% 72%, rgba(176,132,72,0.07) 0%, transparent 52%),
    radial-gradient(ellipse 50% 42% at 96% 88%, rgba(100,140,210,0.04) 0%, transparent 52%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', system-ui, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}


#app {
  max-width: 480px;
  margin: 0 auto;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.view {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: calc(var(--nav-h) + 80px);
}
.view::-webkit-scrollbar { width: 0; }

/* NAV */
nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: var(--nav-h);
  background: rgba(10,9,8,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: flex-start;
  padding-top: 8px;
  z-index: 100;
}

.ni {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  transition: color 0.2s;
  padding: 0;
  position: relative;
}
.ni svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: stroke-width 0.2s; }
.ni.active { color: var(--accent-b); }
.ni.active svg { stroke-width: 2; }
.ni.active::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 2px;
  background: var(--accent-b);
  border-radius: 0 0 3px 3px;
}

/* BACK */
.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  padding: 20px 24px 0;
}
.back svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.back:hover { color: var(--text); }

/* PULL-TO-REFRESH */
.ptr-indicator { position: fixed; top: -50px; left: 50%; transform: translateX(-50%); width: 36px; height: 36px; border-radius: 50%; background: var(--surface2); border: 1px solid var(--border2); display: flex; align-items: center; justify-content: center; z-index: 9999; transition: top 0.2s ease, transform 0.2s ease; box-shadow: 0 2px 12px rgba(0,0,0,0.3); }
.ptr-indicator.ptr-visible { top: 12px; }
.ptr-indicator.ptr-refreshing { top: 12px; }
.ptr-indicator svg { width: 18px; height: 18px; stroke: var(--accent-b); fill: none; stroke-width: 2; transition: transform 0.2s ease; }
.ptr-indicator.ptr-ready svg { transform: rotate(180deg); }
.ptr-indicator.ptr-refreshing svg { animation: ptrSpin 0.8s linear infinite; }
@keyframes ptrSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* RECOVERY BADGE */
.hm-card-recovery { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; letter-spacing: 0.5px; padding: 3px 8px; border-radius: 10px; margin-top: 4px; font-weight: 500; }
.recovery-fresh { background: rgba(111,212,142,0.12); color: #6fd48e; }
.recovery-moderate { background: rgba(184,157,104,0.12); color: #b89d68; }
.recovery-fatigued { background: rgba(212,111,111,0.12); color: #d46f6f; }

/* INTEGRATIONS */
.intg-list { display: flex; flex-direction: column; gap: 10px; }
.intg-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border2); border-radius: 10px; }
.intg-icon { flex-shrink: 0; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; background: var(--surface2); border-radius: 8px; padding: 4px; }
.intg-icon svg { width: 20px; height: 20px; }
.intg-info { flex: 1; min-width: 0; }
.intg-name { font-size: 13px; color: var(--text); font-weight: 500; }
.intg-status { font-size: 11px; color: var(--text-dim); margin-top: 1px; }
.intg-action { display: flex; gap: 6px; flex-shrink: 0; }
.intg-btn { border: none; border-radius: 6px; font-size: 12px; font-weight: 500; cursor: pointer; transition: all 0.2s; }
.intg-btn-conn { background: var(--accent); color: #0a0908; padding: 6px 14px; }
.intg-btn-conn:hover { opacity: 0.85; }
.intg-btn-sync { background: var(--surface2); color: var(--text-muted); padding: 6px 8px; border: 1px solid var(--border2); font-size: 14px; }
.intg-btn-disc { background: none; color: var(--text-muted); padding: 6px 8px; font-size: 16px; }
.intg-btn-disc:hover { color: #d46f6f; }
.intg-sync-all { display: block; width: 100%; margin-top: 12px; padding: 10px; background: var(--surface); border: 1px solid var(--border2); border-radius: 8px; color: var(--text-muted); font-size: 12px; font-weight: 500; cursor: pointer; transition: all 0.2s; }
.intg-sync-all:hover { border-color: var(--accent); color: var(--accent-b); }

/* SYNC DOT */
#sync-dot { position:fixed; top:14px; left:14px; width:6px; height:6px; border-radius:50%; z-index:9998; transition:background 0.4s; }
#sync-dot.sync-ok      { background:#6fd48e; }
#sync-dot.sync-pending { background:#b89d68; animation:pulse 1s ease infinite; }
#sync-dot.sync-offline { background:#d46f6f; }
#sync-dot.sync-away { background:rgba(255,255,255,0.2); }

/* ANIMATIONS */
@keyframes fu {
  from { opacity: 0; transform: translateY(18px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.ani { animation: fu 0.65s cubic-bezier(0.16, 1, 0.3, 1) both; }
.ani:nth-child(1) { animation-delay: 0s; }
.ani:nth-child(2) { animation-delay: 0.07s; }
.ani:nth-child(3) { animation-delay: 0.14s; }
.ani:nth-child(4) { animation-delay: 0.21s; }
.ani:nth-child(5) { animation-delay: 0.27s; }
.ani:nth-child(6) { animation-delay: 0.32s; }
.ani:nth-child(7) { animation-delay: 0.37s; }
.ani:nth-child(8) { animation-delay: 0.41s; }
@keyframes viewSlide {
  from { transform: translateX(24px) scale(0.983); opacity: 0; filter: blur(4px); }
  to   { transform: translateX(0) scale(1); opacity: 1; filter: blur(0); }
}
.view-slide-in { animation: viewSlide 0.42s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

/* SHARED */
.sec-lbl { font-family: var(--display); font-size: 10px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--text-dim); padding: 16px 24px 8px; font-weight: 500; }
.page-head { padding: 52px 24px 28px; }
.page-title { font-family: var(--display); font-size: 26px; color: var(--text); margin-bottom: 4px; font-weight: 400; letter-spacing: 0.5px; }
.page-sub { font-size: 13px; color: var(--text-dim); line-height: 1.5; }

/* HOME */
.h-head { padding: 48px 24px 28px; }
.h-eyebrow { font-size: 10px; letter-spacing: 3px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
.h-day { font-family: var(--display); font-size: 36px; color: var(--text); line-height: 1.1; letter-spacing: 1px; }
.h-prog { display: flex; align-items: center; gap: 12px; margin-top: 20px; }
.h-prog-track { flex: 1; height: 2px; background: var(--border); overflow: hidden; border-radius: 2px; }
.h-prog-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-b)); transition: width 0.6s ease; }
.h-prog-ct { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

.pillars { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 24px 24px; }

.pc {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 16px;
  padding: 24px 12px 18px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  cursor: pointer;
  transition: background 0.28s, border-color 0.28s, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}
.pc:hover {
  background: var(--surface2);
  border-color: rgba(176,132,72,0.22);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.55), 0 0 0 1px rgba(176,132,72,0.07), inset 0 1px 0 rgba(255,255,255,0.07);
}

.pc-ring { position: relative; width: 72px; height: 72px; }
.pc-ring > svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.pc-icon { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.pc-icon svg { width: 20px; height: 20px; stroke: var(--accent); fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.pc-name { font-family: var(--display); font-size: 15px; color: var(--text); text-align: center; letter-spacing: 0.3px; }
.pc-meta { font-size: 10px; color: var(--text-muted); text-align: center; line-height: 1.5; }

/* PILLAR DETAIL */
.pd-head { padding: 20px 24px 24px; display: flex; align-items: flex-start; gap: 18px; border-bottom: 1px solid var(--border2); }
.pd-ring { position: relative; width: 76px; height: 76px; flex-shrink: 0; }
.pd-ring > svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.pd-pct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 14px; color: var(--accent-b); }
.pd-info { flex: 1; padding-top: 4px; }
.pd-name { font-family: var(--display); font-size: 24px; color: var(--text); margin-bottom: 8px; letter-spacing: 0.5px; }
.pd-sep { width: 28px; height: 1px; background: var(--accent); margin-bottom: 10px; }
.pd-desc { font-size: 13px; color: var(--text-dim); line-height: 1.6; }

/* HABIT ROWS */
.hi { display: flex; align-items: center; padding: 15px 24px; border-bottom: 1px solid var(--border2); cursor: pointer; gap: 14px; transition: background 0.15s; }
.hi:hover { background: var(--surface2); }
.hi:last-child { border-bottom: none; }
.hi-info { flex: 1; min-width: 0; }
.hi-name { font-size: 15px; color: var(--text); line-height: 1.3; transition: color 0.2s; }
.hi-streak { font-size: 11px; color: var(--text-dim); margin-top: 3px; }
.hi-streak.hot { color: var(--accent); }
.hi-check { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,0.14); background: none; display: flex; align-items: center; justify-content: center; flex-shrink: 0; cursor: pointer; color: transparent; font-size: 11px; transition: all 0.25s; pointer-events: none; }
.habit-del-btn { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid rgba(212,111,111,0.4); background: rgba(212,111,111,0.1); color: #d46f6f; font-size: 18px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; cursor: pointer; transition: all 0.15s; line-height: 1; }
.habit-del-btn:hover { background: rgba(212,111,111,0.25); border-color: #d46f6f; }
.habit-edit-btn { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid rgba(176,132,72,0.4); background: rgba(176,132,72,0.1); color: var(--accent-b); font-size: 15px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; cursor: pointer; transition: all 0.15s; }
.habit-edit-btn:hover { background: rgba(176,132,72,0.25); border-color: var(--accent-b); }
#edit-habit-modal, #edit-name-modal { display: none; position: fixed; inset: 0; z-index: 3000; }
.edit-habit-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.6); }
.edit-habit-sheet { position: absolute; bottom: 0; left: 0; right: 0; background: var(--surface); border-radius: 20px 20px 0 0; padding: 28px 24px 40px; }
.edit-habit-title { font-family: var(--display); font-size: 20px; color: var(--text); margin-bottom: 20px; letter-spacing: 0.3px; }
.hi.done .hi-name { color: var(--text-muted); text-decoration: line-through; text-decoration-color: rgba(228,218,206,0.25); }
.hi.done .hi-check { background: rgba(176,132,72,0.18); border-color: var(--accent); color: var(--accent-b); }
@keyframes ck { 0%{transform:scale(1)} 40%{transform:scale(1.3)} 100%{transform:scale(1)} }
.pop { animation: ck 0.22s ease; }

/* ALL HABITS */
.ah-head { padding: 20px 24px 24px; }
.ah-title { font-family: var(--display); font-size: 26px; color: var(--text); margin-bottom: 4px; font-weight: 400; letter-spacing: 0.5px; }
.ah-sub { font-size: 13px; color: var(--text-dim); }

/* HABITS/ROUTINES TOGGLE */
.hab-toggle { display: flex; gap: 0; padding: 52px 24px 0; }
.hab-toggle-btn { flex: 1; padding: 10px 0; font-size: 13px; font-family: var(--body); font-weight: 500; letter-spacing: 0.5px; text-transform: uppercase; background: none; border: none; border-bottom: 2px solid transparent; color: var(--text-dim); cursor: pointer; transition: all 0.2s; }
.hab-toggle-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.routine-empty { padding: 16px 24px; font-size: 13px; color: var(--text-dim); font-style: italic; }

/* JOURNAL */
.jh { padding: 48px 24px 28px; }
.jh-title { font-family: var(--display); font-size: 28px; color: var(--text); margin-bottom: 4px; letter-spacing: 0.5px; }
.jh-sub { font-size: 13px; color: var(--text-dim); }
.j-body { padding: 0 24px 24px; }
.j-lbl { font-size: 10px; letter-spacing: 3px; text-transform: uppercase; color: var(--text-muted); padding: 16px 0 10px; }
.j-ta { width: 100%; background: var(--surface); border: 1px solid var(--border2); border-radius: 10px; color: var(--text); font-family: inherit; font-size: 14px; line-height: 1.7; padding: 14px 16px; resize: none; min-height: 90px; outline: none; transition: border-color 0.2s; }
.j-ta:focus { border-color: rgba(176,132,72,0.4); }
.j-ta::placeholder { color: var(--text-muted); }
.j-status { font-size: 11px; color: var(--text-muted); padding: 8px 0 20px; letter-spacing: 0.5px; transition: color 0.3s; }
.j-status.saved { color: var(--accent); }
.j-tog { width: 100%; background: none; border: 1px solid var(--border2); border-radius: 10px; color: var(--text-dim); font-size: 10px; letter-spacing: 2px; text-transform: uppercase; padding: 12px; cursor: pointer; transition: border-color 0.2s; margin-bottom: 16px; }
.j-tog:hover { border-color: var(--border); }
.j-past { display: none; }
.j-past.open { display: block; }
.jp-item { border-bottom: 1px solid var(--border2); padding: 14px 0; }
.jp-item:last-child { border-bottom: none; }
.jp-date { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.jp-field { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--text-muted); margin: 6px 0 2px; }
.jp-text { font-size: 13px; color: var(--text-dim); line-height: 1.6; white-space: pre-wrap; }

/* JOURNAL EDITOR */
.j-edit-btn { display: flex; align-items: center; background: none; border: 1px solid var(--border2); border-radius: 8px; color: var(--text-muted); font-size: 11px; letter-spacing: 0.5px; padding: 6px 12px; cursor: pointer; transition: all 0.2s; }
.j-edit-btn:hover { border-color: var(--accent); color: var(--accent); }
.jq-editor { padding: 8px 0 16px; }
.jq-edit-row { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--border2); }
.jq-edit-fields { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.jq-edit-input { width: 100%; background: var(--surface); border: 1px solid var(--border2); border-radius: 8px; color: var(--text); font-family: inherit; font-size: 13px; padding: 10px 12px; outline: none; transition: border-color 0.2s; }
.jq-edit-input:focus { border-color: rgba(176,132,72,0.4); }
.jq-edit-ph { font-size: 12px; color: var(--text-dim); }
.jq-edit-del { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 8px; font-size: 18px; line-height: 1; border-radius: 6px; transition: all 0.2s; }
.jq-edit-del:hover { color: var(--fat); background: rgba(255,100,100,0.1); }
.jq-add-btn { width: 100%; background: none; border: 1px dashed var(--border2); border-radius: 10px; color: var(--accent); font-size: 12px; letter-spacing: 1px; padding: 12px; cursor: pointer; margin-top: 12px; transition: all 0.2s; }
.jq-add-btn:hover { border-color: var(--accent); background: rgba(176,132,72,0.05); }
.jq-reset-btn { width: 100%; background: none; border: none; color: var(--text-muted); font-size: 11px; letter-spacing: 0.5px; padding: 10px; cursor: pointer; margin-top: 4px; transition: color 0.2s; }
.jq-reset-btn:hover { color: var(--text-dim); }

/* STATS */
.sh { padding: 52px 24px 24px; }
.sh-title { font-family: var(--display); font-size: 26px; color: var(--text); margin-bottom: 4px; font-weight: 400; letter-spacing: 0.5px; }
.sh-sub { font-size: 13px; color: var(--text-dim); }
.s-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 24px 24px; }
.s-card { background: var(--surface); border: 1px solid var(--border2); border-radius: var(--radius); padding: 20px 16px; }
.s-val { font-family: var(--serif); font-size: 34px; color: var(--accent-b); line-height: 1; margin-bottom: 6px; }
.s-lbl { font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-dim); font-weight: 500; }
.ps { padding: 0 24px 24px; }
.ps-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border2); }
.ps-row:last-child { border-bottom: none; }
.ps-name { font-size: 13px; color: var(--text-dim); width: 68px; flex-shrink: 0; }
.ps-track { flex: 1; height: 2px; background: var(--border); overflow: hidden; border-radius: 2px; }
.ps-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-b)); transition: width 0.6s; }
.ps-val { font-size: 11px; color: var(--text-dim); width: 36px; text-align: right; }
.q-block { margin: 0 24px 32px; background: var(--surface); border: 1px solid var(--border2); border-radius: 12px; padding: 24px; text-align: center; }
.q-mark { font-family: var(--serif); font-size: 36px; color: rgba(176,132,72,0.3); line-height: 0.9; margin-bottom: 12px; }
.q-text { font-family: var(--serif); font-size: 15px; font-style: italic; color: var(--text-dim); line-height: 1.7; margin-bottom: 10px; transition: opacity 0.25s; }
.q-auth { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 16px; }
.q-nav { display: flex; align-items: center; justify-content: center; gap: 12px; }
.q-btn { background: none; border: 1px solid var(--border2); color: var(--text-muted); width: 28px; height: 28px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 13px; transition: border-color 0.2s, color 0.2s; }
.q-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── WORKOUT ── */
.w-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 20px;
  margin: 0 24px 12px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.w-card:hover { background: var(--surface2); border-color: var(--border); }
.w-card:active { transform: scale(0.98); }
.w-card-name { font-family: var(--display); font-size: 18px; color: var(--text); margin-bottom: 4px; letter-spacing: 0.3px; }
.w-card-desc { font-size: 12px; color: var(--text-dim); line-height: 1.5; }
.w-card-days { font-size: 11px; color: var(--text-dim); margin-top: 8px; }
.w-card.active { border-color: rgba(176,132,72,0.4); background: rgba(176,132,72,0.04); }
/* Workout stats strip */
.w-stats-strip { display: flex; justify-content: space-around; padding: 0 24px 16px; gap: 8px; }
.w-stat-item { text-align: center; flex: 1; }
.w-stat-val { font-family: var(--display); font-size: 22px; color: var(--accent-b); font-weight: 700; letter-spacing: 0.3px; }
.w-stat-lbl { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1.2px; margin-top: 2px; }

/* Workout hero card */
.w-hero-card { background: var(--surface); border: 1px solid var(--border2); border-radius: var(--radius); padding: 24px; margin: 0 24px 16px; cursor: pointer; transition: background 0.2s, border-color 0.2s, transform 0.15s; position: relative; overflow: hidden; }
.w-hero-card:active { transform: scale(0.98); }
.w-hero-glow { position: absolute; top: -40px; right: -40px; width: 140px; height: 140px; background: radial-gradient(circle, rgba(176,132,72,0.08) 0%, transparent 70%); pointer-events: none; }
.w-muscle-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.w-muscle-tag { font-size: 10px; color: var(--accent); background: rgba(176,132,72,0.08); border: 1px solid rgba(176,132,72,0.15); padding: 3px 10px; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.8px; }
.w-hero-cta { margin-top: 14px; font-size: 13px; font-weight: 600; letter-spacing: 0.5px; color: var(--accent); }
.w-hero-cta.done { color: var(--accent-b); }

.w-ex-preview-list { margin-top: 12px; border-top: 1px solid rgba(255,255,255,0.06); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.w-ex-preview-item { display: flex; justify-content: space-between; align-items: center; }
.w-ex-preview-name { font-size: 12px; color: var(--text-dim); }
.w-ex-preview-muscle { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; }

.w-day-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px 12px;
}
.w-day-label {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
}
.w-day-arrow {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 22px;
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background .15s, border-color .15s;
}
.w-day-arrow:active { background: var(--surface2); border-color: var(--accent); }
.w-day-badge {
  display: inline-block;
  background: rgba(176,132,72,0.10);
  color: var(--accent-b);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 8px;
}

.w-ex {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 12px;
  margin: 0 24px 10px;
  overflow: hidden;
}
.w-ex-head {
  padding: 14px 16px 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.w-ex-name { font-size: 15px; color: var(--text); font-weight: 500; }
.w-ex-muscle { font-size: 10px; color: var(--text-dim); letter-spacing: 1px; text-transform: uppercase; margin-top: 2px; }

.w-set {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  font-size: 12px;
  color: var(--text-dim);
}
.w-set-num { width: 24px; color: var(--text-dim); font-size: 11px; }
.w-input {
  width: 56px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  padding: 6px 8px;
  text-align: center;
  outline: none;
  -moz-appearance: textfield;
}
.w-input::-webkit-inner-spin-button { display: none; }
.w-input:focus { border-color: rgba(176,132,72,0.4); }
.w-input-label { font-size: 10px; color: var(--text-dim); }
.w-set-check {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.12);
  background: none;
  color: transparent;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.w-set-check.done { background: rgba(176,132,72,0.18); border-color: var(--accent); color: var(--accent-b); }

.w-add-set {
  padding: 8px 16px 12px;
  font-size: 11px;
  color: var(--accent);
  cursor: pointer;
  background: none;
  border: none;
  letter-spacing: 0.5px;
}
.w-add-set:hover { color: var(--accent-b); }
.w-set-actions { display: flex; gap: 4px; }

/* Warmup sets */
.w-set-warmup { opacity: 0.55; }
.w-set-warmup .w-set-num { background: var(--surface2); color: var(--text-muted); font-size: 10px; font-weight: 700; }

/* Exercise action buttons (reorder, swap) */
.w-ex-actions { display: flex; gap: 6px; padding: 4px 0 6px; }
.w-ex-act-btn { background: var(--surface2); border: 1px solid var(--border2); border-radius: 6px; color: var(--text-dim); font-size: 13px; padding: 4px 10px; cursor: pointer; transition: all 0.2s; }
.w-ex-act-btn:hover { border-color: var(--accent); color: var(--accent-b); }

/* Workout notes */
.w-notes-wrap { padding: 8px 24px 0; }

.w-finish, .w-action-btn {
  display: block;
  width: calc(100% - 48px);
  margin: 16px 24px 24px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.w-finish:hover, .w-action-btn:hover { background: var(--surface2); border-color: var(--accent); }
.w-finish:active, .w-action-btn:active { background: rgba(176,132,72,0.12); }

.w-hist-item {
  padding: 14px 24px;
  border-bottom: 1px solid var(--border2);
}
.w-hist-date { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.w-hist-prog { font-size: 14px; color: var(--text); }
.w-hist-vol { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.w-repeat-btn {
  position: absolute; top: 12px; right: 12px;
  background: var(--surface2); border: 1px solid var(--border2); border-radius: 10px;
  color: var(--accent); font-size: 18px; width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.2s;
}
.w-repeat-btn:active { background: var(--accent); color: #fff; }

/* ── DIET ── */
.d-rings {
  display: flex;
  justify-content: space-around;
  padding: 8px 24px 24px;
}
.d-ring-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.d-ring-wrap { position: relative; width: 68px; height: 68px; }
.d-ring-wrap > svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.d-ring-val {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.d-ring-label { font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-dim); font-weight: 500; }

.d-meal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 12px;
  margin: 0 24px 10px;
  padding: 14px 16px;
}
.d-meal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.d-meal-name { font-size: 14px; color: var(--text); font-weight: 500; }
.d-meal-cal { font-size: 12px; color: var(--accent); }
.d-meal-macros { font-size: 11px; color: var(--text-dim); }
.d-meal-item { font-size: 12px; color: var(--text-dim); padding: 3px 0; border-top: 1px solid var(--border2); margin-top: 6px; }
.d-meal-item:first-of-type { margin-top: 8px; }

.d-del-btn {
  background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 14px; padding: 0 4px;
}
.d-del-btn:hover { color: var(--fat); }

.d-type-btns { display: flex; gap: 8px; padding: 0 24px 16px; flex-wrap: wrap; }
.d-type-btn {
  padding: 7px 16px;
  border-radius: 20px;
  border: 1px solid var(--border2);
  background: none;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.d-type-btn.active { background: rgba(176,132,72,0.12); border-color: rgba(176,132,72,0.3); color: var(--accent-b); }

.d-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.2s;
}
.d-input:focus { border-color: rgba(176,132,72,0.4); }
.d-input::placeholder { color: var(--text-muted); }

.d-input-row { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 8px; margin-top: 8px; }
.d-input-sm {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  padding: 8px;
  text-align: center;
  outline: none;
  width: 100%;
  -moz-appearance: textfield;
}
.d-input-sm::-webkit-inner-spin-button { display: none; }
.d-input-sm:focus { border-color: rgba(176,132,72,0.4); }
.d-input-sm::placeholder { color: var(--text-muted); font-size: 10px; }

.d-items-list { margin: 12px 0; }
.d-fi { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border2); font-size: 13px; color: var(--text-dim); }
.d-fi:last-child { border-bottom: none; }
.d-fi-macros { font-size: 11px; color: var(--text-muted); }

/* Recipe cards */
.d-recipe-grid { padding: 0 24px 24px; }
.d-recipe-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: background 0.2s;
}
.d-recipe-card:hover { background: var(--surface2); }
.d-recipe-name { font-size: 15px; color: var(--text); margin-bottom: 4px; }
.d-recipe-macros-row { font-size: 11px; color: var(--text-muted); }
.d-recipe-detail { padding: 0 24px 24px; }
.d-recipe-ing { font-size: 13px; color: var(--text-dim); line-height: 1.8; }
.d-recipe-steps { font-size: 13px; color: var(--text-dim); line-height: 1.7; margin-top: 12px; }
.d-goals-form { padding: 0 24px 24px; }
.d-goals-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border2); }
.d-goals-row:last-child { border-bottom: none; }
.d-goals-label { font-size: 13px; color: var(--text-dim); width: 80px; flex-shrink: 0; }
.d-goals-input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  padding: 8px 12px;
  outline: none;
  -moz-appearance: textfield;
}
.d-goals-input::-webkit-inner-spin-button { display: none; }
.d-goals-input:focus { border-color: rgba(176,132,72,0.4); }

/* ── LIBRARY ── */
.lib-tabs {
  display: flex;
  gap: 0;
  margin: 0 24px 20px;
  border-bottom: 1px solid var(--border2);
}
.lib-tab {
  flex: 1;
  background: none;
  border: none;
  padding: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.lib-tab.active { color: var(--accent-b); border-bottom-color: var(--accent-b); }

.book-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 18px;
  margin: 0 24px 10px;
}
.book-title { font-family: var(--display); font-size: 15px; color: var(--text); margin-bottom: 3px; letter-spacing: 0.2px; }
.book-author { font-size: 12px; color: var(--accent-b); margin-bottom: 6px; font-weight: 500; }
.book-desc { font-size: 12px; color: var(--text-dim); line-height: 1.55; }
.book-card-link { cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.book-card-link:hover { border-color: rgba(176,132,72,0.35); background: var(--surface2); }
.book-link-hint { font-size: 11px; color: var(--accent); margin-top: 8px; letter-spacing: .03em; }
.book-pillar-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 6px;
  vertical-align: middle;
}

/* ── HOME SUMMARY (legacy, kept for compat) ── */
.h-summary { display: flex; flex-direction: column; gap: 10px; padding: 0 24px 24px; }
.h-sum-card { background: var(--surface); border: 1px solid var(--border2); border-radius: 14px; padding: 16px 18px; cursor: pointer; transition: background 0.2s; }
.h-sum-label { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px; }
.h-sum-title { font-family: var(--serif); font-size: 17px; color: var(--text); }

/* ══ HOME REDESIGN ══════════════════════════════════════════════════════ */

/* Hero card */
.hm-hero { padding: 16px 16px 0; }
.hm-hero-card {
  background: linear-gradient(160deg, var(--surface) 0%, rgba(176,132,72,.06) 100%);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 22px 20px 20px;
  position: relative;
  overflow: hidden;
}
.hm-hero-glow {
  position: absolute; top: -60px; right: -60px;
  width: 180px; height: 180px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  opacity: 0.06; pointer-events: none;
}
.hm-hero-row { display: flex; align-items: flex-start; gap: 16px; }
.hm-hero-info { flex: 1; padding-top: 6px; }
.hm-hero-date { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px; font-weight: 500; }
.hm-hero-name { font-family: var(--display); font-size: 22px; color: var(--text); line-height: 1.15; margin-bottom: 2px; letter-spacing: 0.3px; }
.hm-hero-greet { font-size: 12px; color: var(--text-dim); margin-bottom: 8px; }
.hm-hero-lvl { display: inline-flex; align-items: center; gap: 5px; background: rgba(176,132,72,.10); border: 1px solid rgba(176,132,72,.18); border-radius: 20px; padding: 3px 10px; font-size: 10px; color: var(--accent-b); font-weight: 600; letter-spacing: .04em; }
.hm-xp-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.hm-xp-track { flex: 1; height: 4px; background: rgba(255,255,255,.07); border-radius: 2px; overflow: hidden; }
.hm-xp-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-b)); border-radius: 2px; transition: width .6s ease; }
.hm-xp-lbl { font-size: 10px; color: var(--text-muted); white-space: nowrap; }
.hm-score-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.hm-score-badge { display: flex; align-items: baseline; gap: 4px; }
.hm-score-num { font-family: var(--serif); font-size: 30px; font-weight: 700; line-height: 1; }
.hm-score-lbl { font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-muted); }
.hm-habits-bar { margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.06); }
.hm-habits-bar-hdr { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.hm-habits-bar-lbl { font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-muted); font-weight: 500; }
.hm-habits-bar-ct { font-size: 12px; color: var(--text-dim); font-weight: 600; }
.hm-habits-track { height: 4px; background: rgba(255,255,255,.06); border-radius: 2px; overflow: hidden; }
.hm-habits-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-b)); border-radius: 2px; transition: width .6s ease; }

/* Pillar strip */
.hm-pillars { display: flex; gap: 2px; padding: 14px 12px 4px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.hm-pillars::-webkit-scrollbar { display: none; }
.hm-pc { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 5px; cursor: pointer; padding: 10px 4px; border-radius: 14px; border: 1px solid transparent; transition: all .15s; }
.hm-pc:active { background: rgba(255,255,255,.03); }
.hm-pc-active { border-color: rgba(176,132,72,.20); background: rgba(176,132,72,.04); }
.hm-pc-ring { position: relative; width: 44px; height: 44px; }
.hm-pc-ring > svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.hm-pc-icon { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.hm-pc-icon svg { width: 17px; height: 17px; stroke: var(--accent-b); fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; opacity: 0.7; position: static; transform: none; }
.hm-pc-name { font-size: 10px; color: var(--text-dim); text-align: center; text-transform: uppercase; letter-spacing: .3px; font-weight: 500; }
.hm-pc-streak { font-size: 10px; color: var(--accent-b); font-weight: 600; }

/* Section heading */
.hm-sec { display: flex; align-items: center; justify-content: space-between; padding: 20px 16px 10px; }
.hm-sec-title { font-family: var(--display); font-size: 10px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--text-dim); font-weight: 500; }
.hm-sec-link { font-size: 11px; color: var(--accent-b); cursor: pointer; font-weight: 500; }

/* Today cards (2-col) */
.hm-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 16px; }
.hm-card { background: var(--surface); border: 1px solid var(--border2); border-radius: 20px; padding: 16px 14px 14px; cursor: pointer; transition: background .2s, border-color .2s, transform .15s; position: relative; overflow: hidden; }
.hm-card:active { background: var(--surface2); transform: scale(0.98); }
.hm-card-done { border-color: rgba(176,132,72,.25); }
.hm-card-glow { position: absolute; bottom: -20px; right: -20px; width: 70px; height: 70px; border-radius: 50%; opacity: 0.08; pointer-events: none; }
.hm-card-icon { font-size: 22px; margin-bottom: 10px; }
.hm-card-lbl { font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-dim); margin-bottom: 5px; font-weight: 500; }
.hm-card-val { font-family: var(--serif); font-size: 17px; color: var(--text); line-height: 1.25; }
.hm-card-sub { font-size: 10.5px; color: var(--text-dim); margin-top: 3px; line-height: 1.4; }
.hm-card-badges { font-size: 10px; color: var(--fg3); margin-top: 6px; line-height: 1.6; letter-spacing: .02em; }
.hm-card-status { font-size: 11px; font-weight: 600; margin-top: 10px; }
.hm-card-bar { height: 3px; background: rgba(255,255,255,.06); border-radius: 2px; overflow: hidden; margin-top: 10px; }
.hm-card-fill { height: 100%; border-radius: 2px; }

/* Vitals row */
.hm-vitals { display: flex; gap: 6px; margin: 10px 16px 0; flex-wrap: wrap; }
.hm-vital { flex: 1; min-width: 70px; background: var(--surface); border: 1px solid var(--border2); border-radius: 14px; padding: 10px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.hm-vital-icon { font-size: 14px; }
.hm-vital-val { font-family: var(--serif); font-size: 18px; color: var(--text); font-weight: 600; }
.hm-vital-lbl { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }

/* Quest list */
.hm-quest-list { margin: 0 16px; background: var(--surface); border: 1px solid var(--border2); border-radius: 20px; overflow: hidden; }
.hm-quest { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,.04); }
.hm-quest:last-child { border-bottom: none; }
.hm-quest-ico { width: 36px; height: 36px; background: rgba(255,255,255,.04); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.hm-quest-body { flex: 1; min-width: 0; }
.hm-quest-lbl { font-size: 13.5px; color: var(--text); line-height: 1.3; }
.hm-quest-xp { font-size: 10px; color: var(--accent-b); font-weight: 600; letter-spacing: .3px; margin-top: 2px; }
.hm-quest-done-row { opacity: .45; }
.hm-quest-done-row .hm-quest-lbl { text-decoration: line-through; }
.hm-quest-cb { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.18); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; color: transparent; }
.hm-quest-cb-done { background: var(--accent-b); border-color: var(--accent-b); color: var(--bg); }

/* Challenge cards */
.hm-chal-list { padding: 0 16px; display: flex; flex-direction: column; gap: 8px; }
.hm-chal { background: var(--surface); border: 1px solid var(--border2); border-radius: 16px; padding: 13px 16px; }
.hm-chal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.hm-chal-lbl { font-size: 13px; color: var(--text); }
.hm-chal-ct { font-size: 12px; font-weight: 700; color: var(--accent-b); }
.hm-chal-track { height: 4px; background: rgba(255,255,255,.06); border-radius: 2px; overflow: hidden; }
.hm-chal-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-b)); border-radius: 2px; transition: width .5s ease; }

/* ── DESCRIBE MEAL ── */
.dm-section {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 14px;
  padding: 16px;
  margin: 16px 0 4px;
}
.dm-header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.dm-icon { color: var(--accent); font-size: 14px; }
.dm-header-text { font-family: var(--serif); font-size: 15px; color: var(--text); flex: 1; }
.dm-header-sub { font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-muted); }
.dm-textarea {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  padding: 12px;
  resize: vertical;
  box-sizing: border-box;
  font-family: inherit;
}
.dm-textarea:focus { outline: none; border-color: var(--accent); }
.dm-textarea::placeholder { color: var(--text-muted); }
.dm-output { margin-top: 4px; }
.dm-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border2);
}
.dm-row:last-of-type { border-bottom: none; }
.dm-row-name { font-size: 13px; color: var(--text); flex: 1; }
.dm-row-macros { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.dm-remove {
  background: rgba(212,111,111,0.15);
  border: none;
  border-radius: 50%;
  color: #d46f6f;
  font-size: 16px;
  line-height: 1;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.dm-total { font-size: 12px; color: var(--accent); text-align: right; margin-top: 6px; }
.dm-hint { font-size: 12px; color: var(--text-muted); margin: 10px 0 0; line-height: 1.5; }
.dm-warn { color: #d4916f; }
.h-sum-status { font-size: 12px; color: var(--accent); margin-top: 4px; }

/* ── AI COACH ── */
.coach-fab {
  position: fixed;
  bottom: calc(var(--nav-h) + 12px);
  right: max(12px, calc(50% - 240px + 12px));
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--surface2);
  color: var(--accent-b);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
  z-index: 900;
  transition: transform 0.18s, box-shadow 0.18s, background 0.2s;
}
.coach-fab:hover { transform: scale(1.05); background: var(--accent); color: #0a0908; border-color: var(--accent); }
.coach-fab.coach-hidden { display: none; }

.coach-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: rgba(10,9,8,0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: opacity 0.22s;
}
.coach-overlay.coach-hidden { display: none; }

.coach-panel {
  background: var(--bg);
  border-top: 1px solid var(--border);
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  height: 82vh;
  max-height: 82vh;
  overflow: hidden;
}

.coach-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border2);
  flex-shrink: 0;
}
.coach-hdr-title {
  font-family: var(--serif);
  font-size: 17px;
  color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.coach-star { color: var(--accent); }
.coach-hdr-btn {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--text-dim);
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.coach-hdr-btn:hover { color: var(--text); border-color: var(--border); }

.coach-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.coach-bubble {
  max-width: 88%;
  padding: 12px 15px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.55;
}
.coach-bubble.user {
  background: var(--accent);
  color: #0a0908;
  align-self: flex-end;
  border-bottom-right-radius: 5px;
}
.coach-bubble.coach {
  background: var(--surface2);
  color: var(--text);
  align-self: flex-start;
  border-bottom-left-radius: 5px;
  border: 1px solid var(--border2);
}
.coach-bubble.coach ul { padding-left: 18px; margin: 6px 0; }
.coach-bubble.coach li { margin-bottom: 4px; }
.coach-bubble.coach strong { color: var(--accent-b); }

.coach-bubble.coach-action {
  background: rgba(176,132,72,0.10);
  border: 1px solid rgba(176,132,72,0.25);
  border-radius: 16px;
  padding: 10px 14px;
  margin: 4px 0;
  max-width: 92%;
}
.coach-action-item {
  font-size: 12px;
  color: var(--accent-b);
  padding: 4px 0;
  line-height: 1.5;
  letter-spacing: 0.02em;
}
.coach-action-item + .coach-action-item {
  border-top: 1px solid rgba(176,132,72,0.12);
  margin-top: 4px;
  padding-top: 8px;
}

.coach-typing {
  display: flex; gap: 5px; align-items: center;
  padding: 12px 15px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 18px;
  border-bottom-left-radius: 5px;
  align-self: flex-start;
  width: 56px;
}
.coach-typing span {
  width: 6px; height: 6px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: coach-bounce 1.2s ease-in-out infinite;
}
.coach-typing span:nth-child(2) { animation-delay: 0.18s; }
.coach-typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes coach-bounce { 0%,80%,100%{transform:translateY(0)} 40%{transform:translateY(-6px)} }

.coach-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--border2);
  flex-shrink: 0;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}
.coach-input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 14px;
  color: var(--text);
  font-size: 14px;
  padding: 11px 14px;
  resize: none;
  overflow: hidden;
  font-family: inherit;
  line-height: 1.5;
  max-height: 120px;
  overflow-y: auto;
}
.coach-input:focus { outline: none; border-color: var(--accent); }
.coach-input::placeholder { color: var(--text-muted); }
.coach-send {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: #0a0908;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s, transform 0.15s;
}
.coach-send:disabled { opacity: 0.4; cursor: default; }
.coach-send:not(:disabled):hover { transform: scale(1.08); }

.coach-welcome {
  text-align: center;
  padding: 32px 20px;
  color: var(--text-dim);
}
.coach-welcome-star { font-size: 32px; color: var(--accent); margin-bottom: 12px; }
.coach-welcome h3 { font-family: var(--display); font-size: 18px; color: var(--text); margin-bottom: 8px; letter-spacing: 0.3px; }
.coach-welcome p { font-size: 13px; line-height: 1.6; }
.coach-setup-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin: 20px;
  text-align: center;
}
.coach-setup-card h3 { font-family: var(--serif); font-size: 17px; color: var(--text); margin-bottom: 8px; }
.coach-setup-card p { font-size: 13px; color: var(--text-dim); line-height: 1.6; margin-bottom: 12px; }

/* ═══ REST TIMER ═══════════════════════════════════════════════════════════ */
.rt-bar {
  position: sticky;
  bottom: 80px;
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid rgba(176,132,72,0.3);
  border-radius: 16px;
  margin: 12px 24px;
  padding: 12px 16px;
  z-index: 10;
}
.rt-row { display: flex; align-items: center; gap: 12px; }
.rt-time {
  font-family: var(--serif);
  font-size: 24px;
  color: var(--accent-b);
  font-weight: 700;
  min-width: 52px;
}
.rt-track { flex: 1; height: 5px; background: rgba(255,255,255,0.06); border-radius: 3px; overflow: hidden; }
.rt-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.3s; }
.rt-skip {
  background: none; border: 1px solid var(--border); color: var(--text-dim);
  font-size: 11px; padding: 5px 12px; border-radius: 100px; cursor: pointer;
  transition: background 0.15s;
}
.rt-skip:active { background: var(--surface2); }
.rt-done {
  text-align: center; font-size: 12px; letter-spacing: 2px;
  text-transform: uppercase; color: var(--accent-b); font-weight: 700;
  animation: rt-pulse 0.5s ease;
}
@keyframes rt-pulse { 0% { transform: scale(0.9); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.rt-presets {
  display: flex; align-items: center; gap: 8px; padding: 8px 24px 16px; justify-content: center;
}
.rt-preset-btn {
  background: var(--surface); border: 1px solid var(--border2); color: var(--text-dim);
  font-size: 12px; padding: 7px 14px; border-radius: 100px; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.rt-preset-btn:active { background: var(--surface2); border-color: var(--accent); color: var(--accent-b); }

/* ═══ SLEEP TRACKING ═══════════════════════════════════════════════════════ */
.sl-q-row { display: flex; gap: 6px; }
.sl-q-btn {
  flex: 1; padding: 10px; text-align: center; font-size: 16px; font-weight: 700;
  background: var(--surface); border: 1px solid var(--border2); border-radius: 12px;
  color: var(--text-dim); cursor: pointer; transition: all 0.15s;
}
.sl-q-btn.active { background: rgba(176,132,72,0.15); border-color: var(--accent); color: var(--accent-b); }
.sl-bars { display: flex; gap: 4px; align-items: flex-end; height: 80px; }
.sl-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; height: 100%; }
.sl-bar-val { font-size: 10px; color: var(--text-muted); height: 14px; }
.sl-bar-track { flex: 1; width: 100%; background: rgba(255,255,255,0.04); border-radius: 4px; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; }
.sl-bar-fill { border-radius: 4px; transition: height 0.3s; min-height: 2px; }
.sl-bar-day { font-size: 10px; color: var(--text-muted); height: 14px; text-transform: uppercase; }

/* ═══ HEATMAP ══════════════════════════════════════════════════════════════ */
.hm-heatmap { display: flex; align-items: center; gap: 6px; padding: 8px 24px 16px; overflow-x: auto; }
.hm-heat-label { font-size: 10px; color: var(--text-muted); flex-shrink: 0; }
.hm-heat-grid {
  display: grid;
  grid-template-rows: repeat(7, 1fr);
  grid-auto-flow: column;
  gap: 2px;
}
.hm-heatcell { width: 10px; height: 10px; border-radius: 2px; }
.hm-heat-0 { background: rgba(255,255,255,0.04); }
.hm-heat-1 { background: rgba(176,132,72,0.2); }
.hm-heat-2 { background: rgba(176,132,72,0.4); }
.hm-heat-3 { background: rgba(176,132,72,0.65); }
.hm-heat-4 { background: rgba(176,132,72,0.9); }

/* ═══ HOME QUOTE ═══════════════════════════════════════════════════════════ */
.hm-quote {
  margin: 0 16px 16px; padding: 20px 20px;
  background: var(--surface); border: 1px solid var(--border2); border-radius: 20px;
  border-left: 2px solid rgba(176,132,72,0.3);
}
.hm-quote-text {
  font-family: var(--serif); font-size: 14px; font-style: italic;
  color: var(--text-dim); line-height: 1.7; margin-bottom: 8px;
}
.hm-quote-auth { font-size: 10.5px; color: var(--text-muted); letter-spacing: 0.3px; }

/* Share button */
.hm-share-btn { display: block; width: calc(100% - 48px); margin: 12px 24px; padding: 14px; background: rgba(176,132,72,0.06); border: 1px solid rgba(176,132,72,0.2); border-radius: var(--radius-sm); color: var(--accent-b); font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; text-align: center; cursor: pointer; transition: all 0.2s; }
.hm-share-btn:active { background: rgba(176,132,72,0.15); transform: scale(0.98); }

/* ═══ WEEK IN REVIEW ══════════════════════════════════════════════════════ */
.wir-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 24px; }
.wir-stat { background: var(--surface); border: 1px solid var(--border2); border-radius: var(--radius-sm); padding: 14px 12px; text-align: center; }
.wir-stat-val { font-family: var(--serif); font-size: 22px; color: var(--accent-b); margin-bottom: 4px; }
.wir-stat-lbl { font-size: 10px; color: var(--text-muted); letter-spacing: 0.5px; text-transform: uppercase; }
.wir-share-btn { background: none; border: none; color: var(--accent); font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; cursor: pointer; padding: 8px 16px; }
.wir-share-btn:active { opacity: 0.7; }

/* ═══ SPARKLINE ════════════════════════════════════════════════════════════ */
.w-sparkline { flex-shrink: 0; opacity: 0.8; }

/* ═══ LIGHT THEME ══════════════════════════════════════════════════════════ */
[data-theme="light"] {
  --bg:       #faf8f5;
  --bg2:      #f2ede4;
  --surface:  #ffffff;
  --surface2: #ede8df;
  --border:   rgba(0,0,0,0.09);
  --border2:  rgba(0,0,0,0.055);
  --accent:   #8a6830;
  --accent-b: #a07838;
  --accent-c: #6b5930;
  --card-shadow: 0 2px 12px rgba(0,0,0,0.07), inset 0 1px 0 rgba(255,255,255,0.9);
  --text:     #1a1810;
  --text-dim: #544e44;
  --text-muted: #968e82;
  --cal:      #a07838;
}
[data-theme="light"] nav {
  background: rgba(250,248,245,0.92) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
[data-theme="light"] .coach-panel {
  background: #fff;
  border-color: rgba(0,0,0,0.08);
}
[data-theme="light"] .coach-bubble.coach {
  background: #f4f1ec;
  border-color: rgba(0,0,0,0.06);
}
[data-theme="light"] .w-input {
  background: #f4f1ec;
  border-color: rgba(0,0,0,0.08);
  color: #1a1810;
}
[data-theme="light"] .hm-heat-0 { background: rgba(0,0,0,0.04); }
[data-theme="light"] .hm-heat-1 { background: rgba(138,104,48,0.15); }
[data-theme="light"] .hm-heat-2 { background: rgba(138,104,48,0.30); }
[data-theme="light"] .hm-heat-3 { background: rgba(138,104,48,0.50); }
[data-theme="light"] .hm-heat-4 { background: rgba(138,104,48,0.75); }
[data-theme="light"] .ob-welcome, [data-theme="light"] .ob-wrap {
  background: #faf8f5;
}

/* ═══ ONBOARDING GENDER ═══════════════════════════════════════════════════ */
.ob-gender-row { display: flex; gap: 16px; justify-content: center; margin-top: 24px; }
.ob-gender-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 24px;
  padding: 24px 32px;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
}
.ob-gender-card.active {
  border-color: var(--accent);
  background: rgba(176,132,72,0.08);
}
.ob-gender-card:active { transform: scale(0.97); }

/* ═══ FOOD PHOTO SCAN ═════════════════════════════════════════════════════ */
.photo-scan-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px; margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(176,132,72,0.15), rgba(176,132,72,0.06));
  border: 1.5px dashed var(--accent); border-radius: 16px;
  color: var(--accent); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background 0.2s, transform 0.15s;
}
.photo-scan-btn:active { transform: scale(0.97); }
.photo-scan-btn svg { flex-shrink: 0; }
.photo-preview {
  margin-bottom: 16px; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--border2); position: relative;
}
.food-photo-img {
  width: 100%; display: block; border-radius: 16px;
  max-height: 220px; object-fit: cover;
}
.photo-preview .spinner-overlay {
  position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center;
  background: rgba(0,0,0,0.45); border-radius: 16px;
  color: var(--accent); font-size: 13px; font-weight: 600;
  gap: 8px;
}
.photo-preview .spinner-overlay::before {
  content: ''; width: 20px; height: 20px;
  border: 2.5px solid rgba(176,132,72,0.3);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══ HABIT CHECK ANIMATION ═══════════════════════════════════════════════ */
.hi-check { position: relative; overflow: visible; }
.hi.done .hi-check::after {
  content: ''; position: absolute; inset: -8px; border-radius: 50%;
  background: rgba(176,132,72,0.25);
  animation: ripple-out 0.5s ease-out forwards;
  pointer-events: none;
}
@keyframes ripple-out {
  0% { transform: scale(0.5); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}
@keyframes check-bounce {
  0% { transform: scale(1); }
  30% { transform: scale(1.35); }
  50% { transform: scale(0.9); }
  70% { transform: scale(1.1); }
  100% { transform: scale(1); }
}
.pop { animation: check-bounce 0.35s ease !important; }

/* ═══ SKELETON LOADING ════════════════════════════════════════════════════ */
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface2) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 12px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skel-card { height: 120px; margin: 8px 16px; }
.skel-row { height: 52px; margin: 4px 24px; border-radius: 8px; }
.skel-circle { width: 72px; height: 72px; border-radius: 50%; margin: 12px auto; }
.skel-bar { height: 14px; margin: 8px 24px; width: 60%; }

/* ═══ UNDO TOAST ══════════════════════════════════════════════════════════ */
.undo-toast {
  position: fixed; bottom: calc(var(--nav-h) + 16px); left: 50%; transform: translateX(-50%);
  background: var(--surface2); border: 1px solid var(--border); border-radius: 14px;
  padding: 12px 20px; display: flex; align-items: center; gap: 14px;
  z-index: 2500; box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  animation: toast-in 0.3s ease;
  max-width: 360px; width: calc(100% - 48px);
}
.undo-toast-text { flex: 1; font-size: 13px; color: var(--text); }
.undo-toast-btn {
  background: none; border: none; color: var(--accent-b); font-weight: 700;
  font-size: 13px; cursor: pointer; text-transform: uppercase; letter-spacing: 0.5px;
  padding: 4px 8px; white-space: nowrap;
}
@keyframes toast-in {
  0% { transform: translateX(-50%) translateY(20px); opacity: 0; }
  100% { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* ═══ QUICK-LOG FAB ═══════════════════════════════════════════════════════ */
.quick-log-fab {
  position: fixed; bottom: calc(var(--nav-h) + 12px);
  left: max(12px, calc(50% - 240px + 12px));
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--surface2); color: var(--accent-b); border: 1px solid var(--border);
  font-size: 20px; font-weight: 300; display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 900;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
  transition: transform 0.18s, box-shadow 0.18s, background 0.2s;
}
.quick-log-fab:hover { transform: scale(1.05); background: var(--accent); color: #0a0908; border-color: var(--accent); }
.quick-log-fab:active { transform: scale(0.92); }
.quick-log-fab.open { transform: rotate(45deg); }
.quick-log-menu {
  position: fixed; bottom: calc(var(--nav-h) + 66px);
  left: max(12px, calc(50% - 240px + 12px));
  display: flex; flex-direction: column; gap: 8px; z-index: 1500;
  animation: fab-in 0.2s ease;
}
.quick-log-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 14px; padding: 10px 16px; cursor: pointer;
  font-size: 13px; color: var(--text); font-weight: 600;
  white-space: nowrap; transition: background 0.15s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.quick-log-item:active { background: var(--accent); color: #fff; }
@keyframes fab-in {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ═══ EVENING REMINDER BANNER ═════════════════════════════════════════════ */
.evening-banner {
  margin: 0 16px 12px; padding: 14px 18px;
  background: linear-gradient(135deg, rgba(184,157,104,0.12), rgba(184,157,104,0.04));
  border: 1px solid rgba(184,157,104,0.2); border-radius: 16px;
  display: flex; align-items: center; gap: 12px;
  animation: fade-in 0.4s ease;
}
.evening-banner-text { flex: 1; font-size: 13px; color: var(--text-dim); line-height: 1.5; }
.evening-banner-text strong { color: var(--accent-b); }
.evening-banner-close {
  background: none; border: none; color: var(--text-muted); font-size: 18px;
  cursor: pointer; padding: 4px;
}
@keyframes fade-in { 0% { opacity: 0; } 100% { opacity: 1; } }

/* ═══ STREAK MILESTONE TOAST ══════════════════════════════════════════════ */
.streak-toast {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: var(--bg); border: 2px solid var(--accent);
  border-radius: 24px; padding: 32px 40px; text-align: center;
  z-index: 5000; box-shadow: 0 0 80px rgba(176,132,72,0.3);
  animation: streak-pop 0.5s cubic-bezier(0.17,0.67,0.35,1.5);
}
.streak-toast-icon { font-size: 48px; margin-bottom: 8px; }
.streak-toast-title { font-family: var(--display); font-size: 22px; color: var(--accent-b); letter-spacing: 0.3px; }
.streak-toast-sub { font-size: 13px; color: var(--text-dim); margin-top: 4px; }
.streak-toast-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 4999; }
@keyframes streak-pop {
  0% { transform: translate(-50%,-50%) scale(0.3); opacity: 0; }
  100% { transform: translate(-50%,-50%) scale(1); opacity: 1; }
}

/* ═══ EMPTY STATES ════════════════════════════════════════════════════════ */
.empty-state {
  text-align: center; padding: 48px 32px;
}
.empty-state-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.6; }
.empty-state-title { font-family: var(--display); font-size: 16px; color: var(--text); margin-bottom: 6px; letter-spacing: 0.3px; }
.empty-state-sub { font-size: 13px; color: var(--text-dim); line-height: 1.6; margin-bottom: 20px; }
.empty-state-btn {
  display: inline-block; padding: 12px 24px; background: var(--accent);
  color: #fff; border: none; border-radius: 12px; font-size: 13px;
  font-weight: 600; cursor: pointer; letter-spacing: 0.5px;
}

/* ═══ PULL TO REFRESH ═════════════════════════════════════════════════════ */
.ptr-indicator {
  text-align: center; padding: 12px; font-size: 11px;
  color: var(--accent); letter-spacing: 1px;
  text-transform: uppercase; font-weight: 600;
}

/* ═══ ANIMATED AVATAR BREATHING ══════════════════════════════════════ */
.hm-hero-card svg { animation: avatar-breathe 3s ease-in-out infinite; transform-origin: bottom center; }
@keyframes avatar-breathe {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(1.02) translateY(-1px); }
}

/* ═══ QUICK-LOG FAB Z-INDEX ══════════════════════════════════════════ */
.quick-log-fab { z-index: 900; }

/* ═══ OFFLINE BANNER ═════════════════════════════════════════════════ */
.offline-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 2000;
  padding: 8px 16px; font-size: 12px; text-align: center;
  background: rgba(30,27,24,0.95); color: var(--accent);
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.3px;
}

/* ═══ WORKOUT ELAPSED TIMER ══════════════════════════════════════════ */
.workout-elapsed-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 100px; font-size: 13px;
  background: var(--surface2); color: var(--accent-b);
  font-variant-numeric: tabular-nums; font-weight: 600;
  margin-right: 24px; margin-top: 16px;
}
.workout-elapsed-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-b); animation: pulse-dot 1.5s ease infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ═══ SEARCH INPUT ═══════════════════════════════════════════════════ */
.search-input {
  width: 100%; padding: 10px 14px; border-radius: 10px;
  background: var(--surface2); border: 1px solid var(--border2);
  color: var(--text); font-size: 13px; outline: none;
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { border-color: var(--accent); }

/* ═══ TREND BADGES ═══════════════════════════════════════════════════ */
.trend-badge {
  font-size: 10px; font-weight: 700; padding: 2px 6px;
  border-radius: 6px; margin-top: 4px; display: inline-block;
}
.trend-up { color: #4ade80; background: rgba(74,222,128,0.1); }
.trend-down { color: #f87171; background: rgba(248,113,113,0.1); }
.trend-flat { color: var(--text-dim); background: var(--surface2); }

/* ═══ HABIT MOVE BUTTONS ═════════════════════════════════════════════ */
.habit-move-btn {
  width: 28px; height: 28px; border-radius: 6px;
  background: var(--surface2); border: 1px solid var(--border2);
  color: var(--text-dim); font-size: 10px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.habit-move-btn:disabled { opacity: 0.25; cursor: default; }
.habit-move-btn:active:not(:disabled) { background: var(--accent); color: #fff; }

/* ═══ SCHEDULE DAY PICKER ═══════════════════════════════════════════ */
.sched-day-row { display: flex; gap: 6px; }
.sched-day-btn {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface2); border: 1px solid var(--border2);
  color: var(--text-dim); font-size: 11px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.sched-day-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ═══ FOOD SEARCH RESULTS ═══════════════════════════════════════════ */
.food-result {
  padding: 10px 14px; border-radius: 10px;
  background: var(--surface2); border: 1px solid var(--border2);
  cursor: pointer; transition: border-color 0.15s;
}
.food-result:active { border-color: var(--accent); }
.food-result-name {
  font-size: 13px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.food-result-macros {
  font-size: 11px; color: var(--text-dim); margin-top: 2px;
}

/* ═══ PLATE CALCULATOR ══════════════════════════════════════════════ */
.plate-chip {
  display: inline-block; padding: 4px 10px; border-radius: 8px;
  background: var(--accent); color: #fff; font-size: 12px;
  font-weight: 700; margin: 3px 4px 3px 0;
}

/* ═══ PROGRESS PHOTOS ══════════════════════════════════════════════ */
.progress-photo-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
.progress-photo-card {
  background: var(--surface); border-radius: 12px; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.05); cursor: pointer;
  transition: transform 0.15s;
}
.progress-photo-card:active { transform: scale(0.97); }
.progress-photo-img {
  width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block;
}
.progress-photo-date {
  padding: 8px 10px 4px; font-size: 11px; color: var(--text-dim);
}
.progress-photo-note {
  padding: 0 10px 8px; font-size: 11px; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.w-ex-info {
  padding: 8px 0 4px; border-bottom: 1px solid rgba(255,255,255,0.04);
  margin-bottom: 4px;
}

/* ═══ STREAK BANNER ═══════════════════════════════════════════════ */
.hm-streak-banner {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 24px; margin: 4px 16px 4px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(217,180,106,0.10), rgba(217,180,106,0.03));
  border: 1px solid rgba(217,180,106,0.12);
}
.hm-streak-fire { font-size: 22px; }
.hm-streak-num {
  font-family: var(--serif); font-size: 28px; font-weight: 700;
  color: var(--accent-b); line-height: 1;
}
.hm-streak-lbl { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }

/* Welcome back banner */
.hm-wb-banner {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px; margin: 6px 16px 4px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(74,222,128,0.08), rgba(74,222,128,0.02));
  border: 1px solid rgba(74,222,128,0.12);
}
.hm-wb-icon { font-size: 24px; flex-shrink: 0; }
.hm-wb-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.hm-wb-text { font-size: 12px; color: var(--text-dim); line-height: 1.4; }

/* Streak at risk banner */
.hm-risk-banner {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px; margin: 6px 16px 4px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(248,113,113,0.08), rgba(248,113,113,0.02));
  border: 1px solid rgba(248,113,113,0.12);
  cursor: pointer;
}
.hm-risk-icon { font-size: 20px; flex-shrink: 0; }
.hm-risk-title { font-size: 13px; font-weight: 600; color: #f87171; margin-bottom: 2px; }

/* ═══ MILESTONE CELEBRATION ═══════════════════════════════════════════ */
.milestone-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 9999;
  background: rgba(0,0,0,0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: center;
  animation: milestone-in 0.4s ease-out;
}
@keyframes milestone-in { from { opacity: 0; } to { opacity: 1; } }
.milestone-card {
  text-align: center; padding: 48px 36px; max-width: 340px; width: 90%;
  background: var(--surface); border: 1px solid rgba(217,180,106,0.2);
  border-radius: 28px; position: relative; overflow: hidden;
}
.milestone-card::before {
  content: ''; position: absolute; top: -60px; left: 50%; transform: translateX(-50%);
  width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(217,180,106,0.15) 0%, transparent 70%);
  pointer-events: none;
}
.milestone-icon {
  font-size: 56px; margin-bottom: 16px; position: relative;
  animation: milestone-bounce 0.6s ease-out;
}
@keyframes milestone-bounce {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}
.milestone-title {
  font-family: var(--display); font-size: 26px; color: var(--accent-b);
  margin-bottom: 6px; letter-spacing: 0.5px;
}
.milestone-sub {
  font-size: 13px; color: var(--text-dim); margin-bottom: 12px;
}
.milestone-msg {
  font-family: var(--serif); font-size: 15px; color: var(--text);
  line-height: 1.6; font-style: italic; margin-bottom: 20px;
}
.milestone-xp {
  font-size: 14px; font-weight: 600; color: var(--accent-b);
  background: rgba(217,180,106,0.1); border: 1px solid rgba(217,180,106,0.15);
  display: inline-block; padding: 6px 20px; border-radius: 100px;
  margin-bottom: 24px; letter-spacing: 0.5px;
}
.milestone-btn {
  background: var(--accent); color: #0a0908; border: none; border-radius: 100px;
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 14px 36px; cursor: pointer; width: 100%;
}

/* ═══ FEATURE TOUR ════════════════════════════════════════════════════ */
.tour-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 9998;
  background: rgba(0,0,0,0.8); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  animation: milestone-in 0.3s ease-out;
}
.tour-card {
  text-align: center; padding: 40px 32px; max-width: 340px; width: 90%;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 24px;
}
.tour-step {
  font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 20px;
}
.tour-icon { font-size: 48px; margin-bottom: 16px; }
.tour-title {
  font-family: var(--display); font-size: 20px; color: var(--text);
  margin-bottom: 10px; letter-spacing: 0.3px;
}
.tour-desc {
  font-size: 14px; color: var(--text-dim); line-height: 1.65;
  margin-bottom: 28px;
}
.tour-btns { display: flex; gap: 10px; }
.tour-skip {
  flex: 1; background: none; border: 1px solid var(--border); border-radius: 100px;
  color: var(--text-muted); font-size: 12px; padding: 12px 0; cursor: pointer;
  font-family: var(--sans);
}
.tour-next {
  flex: 1; background: var(--accent); color: #0a0908; border: none; border-radius: 100px;
  font-family: var(--sans); font-size: 12px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; padding: 12px 0; cursor: pointer;
}
.hm-risk-text { font-size: 12px; color: var(--text-dim); line-height: 1.4; }

/* ═══ ANIMATED RINGS ═══════════════════════════════════════════════ */
@keyframes ring-fill {
  from { stroke-dashoffset: var(--ring-c); }
  to { stroke-dashoffset: var(--ring-off); }
}
.d-ring-wrap svg circle:last-child {
  animation: ring-fill 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.pc-ring svg circle:last-child,
.pd-ring svg circle:last-child,
.hm-pc-ring svg circle:last-child {
  animation: ring-fill 1.0s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ═══ PRO UPGRADE PROMPT ══════════════════════════════════════════ */
.pro-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.85);
  z-index: 4000; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 32px;
}
.pro-card {
  background: var(--surface); border: 1px solid rgba(217,180,106,0.2);
  border-radius: 20px; padding: 32px 24px; max-width: 360px; text-align: center;
}
.pro-star { font-size: 40px; margin-bottom: 12px; }
.pro-title {
  font-family: var(--serif); font-size: 24px; color: var(--text); margin-bottom: 8px;
}
.pro-sub { font-size: 13px; color: var(--text-dim); line-height: 1.5; margin-bottom: 20px; }
.pro-features { text-align: left; margin-bottom: 24px; }
.pro-feat {
  display: flex; align-items: center; gap: 10px; padding: 8px 0;
  font-size: 13px; color: var(--text); border-bottom: 1px solid rgba(255,255,255,0.04);
}
.pro-feat-icon { font-size: 16px; flex-shrink: 0; }
.pro-btn {
  width: 100%; padding: 16px; border: none; border-radius: 14px;
  background: linear-gradient(135deg, var(--accent-b), var(--accent)); color: #fff;
  font-size: 14px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; cursor: pointer; margin-bottom: 10px;
}
.pro-btn:active { transform: scale(0.98); }
.pro-skip {
  background: none; border: none; color: var(--text-dim); font-size: 12px;
  cursor: pointer; padding: 8px;
}

/* ═══ INVITE SHEET ════════════════════════════════════════════════ */
.invite-card {
  background: var(--surface); border-radius: 16px; padding: 24px;
  margin: 0 24px 16px; text-align: center;
  border: 1px solid rgba(255,255,255,0.05);
}
.invite-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.invite-sub { font-size: 12px; color: var(--text-dim); margin-bottom: 16px; }
.invite-btn {
  display: inline-block; padding: 12px 28px; border-radius: 12px;
  background: var(--accent); color: #fff; font-size: 13px; font-weight: 700;
  letter-spacing: 1px; border: none; cursor: pointer;
}
.invite-btn:active { transform: scale(0.97); }

/* ═══ ERROR BOUNDARY ══════════════════════════════════════════════ */
.error-boundary {
  position: fixed; inset: 0; background: var(--bg); z-index: 9999;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 40px; text-align: center;
}
.error-boundary h2 { color: var(--text); font-size: 20px; margin-bottom: 12px; }
.error-boundary p { color: var(--text-dim); font-size: 13px; margin-bottom: 24px; line-height: 1.5; }
.error-boundary button {
  padding: 14px 32px; border-radius: 12px; border: none;
  background: var(--accent); color: #fff; font-size: 13px; font-weight: 700;
  cursor: pointer;
}

/* ═══ GREEK / CLASSICAL IDENTITY ═════════════════════════════════ */

/* Greek key (meander) border — reusable class */
.meander-border {
  position: relative;
}
.meander-border::after {
  content: '';
  display: block;
  width: 60px;
  height: 2px;
  margin: 12px auto 0;
  background: linear-gradient(90deg,
    transparent 0%, var(--accent) 15%, var(--accent) 35%,
    transparent 36%, transparent 40%,
    var(--accent) 41%, var(--accent) 60%,
    transparent 61%, transparent 65%,
    var(--accent) 66%, var(--accent) 85%,
    transparent 100%);
  opacity: 0.35;
}

/* Laurel divider — small SVG-based decorative line */
.laurel-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 4px 24px 8px;
  opacity: 0.25;
}
.laurel-divider::before,
.laurel-divider::after {
  content: '';
  flex: 1;
  max-width: 40px;
  height: 1px;
  background: var(--accent);
}

/* Quote block — inscription style */
.hm-quote {
  margin: 8px 16px 24px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 16px;
  padding: 24px 20px 20px;
  text-align: center;
  position: relative;
}
.hm-quote::before {
  content: '※';
  display: block;
  font-size: 16px;
  color: var(--accent);
  opacity: 0.4;
  margin-bottom: 12px;
  letter-spacing: 8px;
}
.hm-quote-text {
  font-family: var(--serif);
  font-size: 14px;
  font-style: italic;
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 10px;
}
.hm-quote-auth {
  font-family: var(--display);
  font-size: 10px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── Install Banner ─────────────────────────────────────────────────────── */
#install-banner { position: fixed; bottom: 80px; left: 0; right: 0; z-index: 2500; padding: 0 12px; animation: slideUp .35s ease; }
.install-banner { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border2); border-radius: 16px; box-shadow: 0 8px 32px rgba(0,0,0,.4); }
.install-btn { padding: 8px 18px; border: none; border-radius: 10px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; letter-spacing: .5px; cursor: pointer; white-space: nowrap; }
.install-btn:active { transform: scale(.96); }
.install-dismiss { background: none; border: none; color: var(--text-dim); font-size: 16px; padding: 4px 2px; cursor: pointer; }

/* ── Challenges ────────────────────────────────────────────────────────── */
.chal-list, .chal-tmpl-list { padding: 0 16px; }
.chal-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
}
.chal-card-past { opacity: 0.6; }
.chal-card-head { display: flex; gap: 12px; align-items: flex-start; }
.chal-card-icon { font-size: 28px; flex-shrink: 0; margin-top: 2px; }
.chal-card-info { flex: 1; min-width: 0; }
.chal-card-name { font-family: var(--serif); font-size: 16px; color: var(--text); font-weight: 600; }
.chal-card-desc { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.chal-card-from { font-size: 11px; color: var(--accent); margin-top: 4px; }
.chal-prog { margin-top: 14px; }
.chal-prog-bar { height: 8px; background: rgba(255,255,255,0.06); border-radius: 4px; overflow: hidden; }
.chal-prog-fill { height: 100%; background: var(--accent); border-radius: 4px; transition: width 0.3s ease; }
.chal-prog-fill.chal-prog-done { background: var(--accent-b); }
.chal-prog-label { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11px; color: var(--text-dim); }
.chal-actions { display: flex; gap: 8px; margin-top: 12px; }
.chal-action-btn {
  flex: 1; padding: 8px; border: 1px solid var(--border2); border-radius: 8px;
  background: var(--surface2); color: var(--text-dim); font-size: 12px;
  cursor: pointer; text-align: center;
}
.chal-action-btn:active { transform: scale(0.97); }
.chal-action-remove { color: var(--fat); border-color: rgba(212,111,111,0.2); }
.chal-tmpl {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--border2); border-radius: var(--radius);
  margin-bottom: 8px; cursor: pointer; transition: transform 0.15s;
}
.chal-tmpl:active { transform: scale(0.98); }
.chal-tmpl-icon { font-size: 24px; flex-shrink: 0; }
.chal-tmpl-info { flex: 1; min-width: 0; }
.chal-tmpl-name { font-size: 14px; color: var(--text); font-weight: 600; }
.chal-tmpl-desc { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.chal-tmpl-go { font-size: 16px; color: var(--accent); flex-shrink: 0; }
@keyframes slideUp { from { transform: translateY(100px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ── Meal Item Edit ────────────────────────────────────────────────────── */
.dm-row-editing { flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--accent); border-radius: var(--radius); background: rgba(217,180,106,0.04); }
.dm-edit-input { width: 100%; padding: 8px 10px; border: 1px solid var(--border2); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 14px; }
.dm-edit-macros { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.dm-edit-field { display: flex; flex-direction: column; gap: 2px; }
.dm-edit-field span { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; }
.dm-edit-field input { width: 100%; padding: 6px 8px; border: 1px solid var(--border2); border-radius: 6px; background: var(--surface); color: var(--text); font-size: 14px; text-align: center; }
.dm-edit-field input:focus { border-color: var(--accent); outline: none; }
.dm-edit-actions { display: flex; gap: 8px; }
.dm-edit-save { flex: 1; padding: 8px; border: none; border-radius: 8px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; }
.dm-edit-cancel { flex: 1; padding: 8px; border: 1px solid var(--border2); border-radius: 8px; background: var(--surface); color: var(--text-dim); font-size: 13px; cursor: pointer; }

/* ── Leaderboard ───────────────────────────────────────────────────────── */
.lb-loading { padding: 0 24px; }
.lb-loader { text-align: center; padding: 40px 0; color: var(--text-dim); font-size: 13px; }
.lb-error { text-align: center; padding: 32px 24px; color: #d46f6f; font-size: 13px; }
.lb-group-card { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; margin: 0 24px 8px; background: var(--surface); border: 1px solid var(--border2); border-radius: var(--radius); cursor: pointer; transition: border-color .2s; }
.lb-group-card:active { border-color: var(--accent); }
.lb-group-info { flex: 1; }
.lb-group-name { font-family: var(--serif); font-size: 17px; color: var(--text); margin-bottom: 2px; }
.lb-group-code { font-size: 11px; color: var(--text-dim); letter-spacing: 1px; }
.lb-group-arrow { font-size: 18px; color: var(--text-muted); margin-left: 12px; }
.lb-actions { display: flex; gap: 10px; padding: 16px 24px; }
.lb-action-btn { flex: 1; padding: 14px; border: 1px solid var(--border2); border-radius: var(--radius); background: var(--surface); color: var(--text); font-size: 13px; font-weight: 600; text-align: center; cursor: pointer; transition: all .2s; }
.lb-action-btn:active { transform: scale(0.97); }
.lb-create-btn { background: var(--accent); color: #fff; border-color: var(--accent); }
.lb-code-input { font-family: monospace; }

/* Podium */
.lb-podium { display: flex; align-items: flex-end; justify-content: center; gap: 12px; padding: 24px 24px 0; margin-bottom: 20px; }
.lb-podium-col { display: flex; flex-direction: column; align-items: center; flex: 1; max-width: 110px; }
.lb-podium-medal { font-size: 28px; margin-bottom: 4px; }
.lb-podium-name { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100px; }
.lb-podium-me { color: var(--accent-b); }
.lb-podium-xp { font-size: 11px; color: var(--text-dim); margin-bottom: 6px; }
.lb-podium-bar { width: 100%; background: linear-gradient(180deg, var(--accent) 0%, rgba(176,132,72,0.2) 100%); border-radius: 8px 8px 0 0; min-height: 40px; }

/* Member list */
.lb-list { padding: 0 24px; }
.lb-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 6px; background: var(--surface); border: 1px solid var(--border2); border-radius: var(--radius-sm); }
.lb-row-me { border-color: var(--accent); background: rgba(217,180,106,0.06); }
.lb-rank { font-size: 18px; min-width: 32px; text-align: center; }
.lb-member-info { flex: 1; min-width: 0; }
.lb-member-name { font-size: 14px; color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-you { font-size: 11px; color: var(--accent-b); font-weight: 400; }
.lb-stale { font-size: 10px; color: var(--text-muted); font-weight: 400; opacity: .6; }
.lb-member-stats { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.lb-xp { text-align: right; font-family: var(--serif); font-size: 18px; color: var(--accent-b); font-weight: 700; white-space: nowrap; }
.lb-xp-label { font-size: 10px; font-weight: 400; color: var(--text-dim); font-family: -apple-system, system-ui, sans-serif; }

/* Group actions */
.lb-group-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 20px 24px; }
.lb-group-actions .lb-action-btn { flex: 1; min-width: calc(50% - 4px); padding: 12px; font-size: 12px; }
.lb-leave-btn { color: var(--fat) !important; border-color: rgba(239,68,68,0.2) !important; }

/* ── Home Stats Mini Bar ───────────────────────────────────────────────── */
.hm-stats-mini { display: flex; justify-content: space-around; margin: 0 16px 12px; padding: 10px 8px; background: var(--surface); border: 1px solid var(--border2); border-radius: var(--radius); cursor: pointer; transition: border-color .2s; }
.hm-stats-mini:active { border-color: var(--accent); }
.hm-sm-stat { text-align: center; flex: 1; }
.hm-sm-val { font-family: var(--serif); font-size: 20px; font-weight: 700; line-height: 1.2; }
.hm-sm-lbl { font-size: 10px; color: var(--text-muted); letter-spacing: 1px; text-transform: uppercase; margin-top: 2px; }

/* ── Character Profile Page ────────────────────────────────────────────── */
.char-hero { text-align: center; padding: 0 24px 20px; }
.char-avatar { width: 120px; height: 180px; margin: 0 auto 12px; position: relative; }
.char-name { font-family: var(--display); font-size: 28px; color: var(--text); margin-bottom: 4px; letter-spacing: 0.5px; }
.char-title { font-size: 16px; color: var(--accent-b); font-weight: 600; margin-bottom: 4px; }
.char-stage { font-size: 11px; color: var(--text-dim); margin-bottom: 14px; }
.char-xp-row { max-width: 260px; margin: 0 auto; }
.char-xp-track { height: 8px; background: rgba(255,255,255,0.06); border-radius: 4px; overflow: hidden; margin-bottom: 4px; }
.char-xp-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-b)); border-radius: 4px; transition: width .4s; }
.char-xp-label { font-size: 11px; color: var(--text-dim); }
.char-power { font-family: var(--serif); font-size: 18px; color: var(--accent-b); font-weight: 700; margin-top: 10px; }

.char-sec-title { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 14px; }

/* Stat bars */
.char-stat-list { display: flex; flex-direction: column; gap: 10px; }
.char-stat-row { display: flex; align-items: center; gap: 10px; }
.char-stat-icon { font-size: 16px; width: 24px; text-align: center; flex-shrink: 0; }
.char-stat-info { flex: 1; min-width: 0; }
.char-stat-name { font-size: 12px; color: var(--text-dim); margin-bottom: 3px; }
.char-stat-bar { height: 8px; background: rgba(255,255,255,0.06); border-radius: 4px; overflow: hidden; }
.char-stat-fill { height: 100%; border-radius: 4px; transition: width .4s; }
.char-stat-val { font-family: var(--serif); font-size: 16px; font-weight: 700; color: var(--text); min-width: 28px; text-align: right; }

/* Gear */
.char-gear-list { display: flex; flex-direction: column; gap: 6px; }
.char-gear-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: rgba(255,255,255,0.02); border: 1px solid var(--border2); border-radius: var(--radius-sm); }
.char-gear-icon { font-size: 20px; flex-shrink: 0; }
.char-gear-info { flex: 1; min-width: 0; }
.char-gear-name { font-size: 13px; color: var(--text); font-weight: 600; }
.char-gear-desc { font-size: 11px; color: var(--text-dim); }

/* ═══════════════════════════════════════════════════════════════════════════
   PREMIUM RESTYLE — card elevation, gradient fills, interaction polish
   ═══════════════════════════════════════════════════════════════════════════ */

/* Card depth — applied globally to all floating surfaces */
.pc, .hm-card, .w-card, .w-hero-card, .d-meal, .book-card,
.q-block, .s-card, .hm-chal, .chal-card, .w-ex,
.hm-quest-list, .rt-bar, .lb-group-card, .lb-row,
.h-sum-card, .invite-card, .tour-card, .install-banner {
  box-shadow: var(--card-shadow);
}

/* Hero card — richer gradient + stronger shadow */
.hm-hero-card {
  background: linear-gradient(160deg, var(--surface) 0%, rgba(176,132,72,.10) 100%);
  box-shadow: 0 4px 28px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.06);
}

/* Pillar card glow when active/selected */
.pc.active {
  box-shadow: var(--card-shadow), 0 0 20px rgba(176,132,72,0.12);
}
.hm-pc-active {
  box-shadow: 0 0 14px rgba(176,132,72,0.10);
}

/* Habit check — glow on completion */
.hi.done .hi-check {
  box-shadow: 0 0 10px rgba(176,132,72,0.35);
}

/* Workout set check — glow on completion */
.w-set-check.done {
  box-shadow: 0 0 8px rgba(176,132,72,0.30);
}

/* Quest checkbox done */
.hm-quest-cb-done {
  box-shadow: 0 0 8px rgba(176,132,72,0.35);
}

/* XP bar on home — thicker */
.hm-xp-track { height: 5px; }

/* Challenge progress bar — gradient */
.chal-prog-fill { background: linear-gradient(90deg, var(--accent), var(--accent-b)); }
.chal-prog-fill.chal-prog-done { background: var(--accent-b); }

/* Character XP bar — gradient already there, just keep consistent */

/* Coach panel — sits on surface, not raw bg */
.coach-panel { background: var(--surface); }
[data-theme="light"] .coach-panel { background: #fff; }

/* Pro button — use accent variables instead of hardcoded gold */
.pro-btn {
  background: linear-gradient(135deg, var(--accent-b), var(--accent));
  color: var(--bg);
}

/* Milestone & streak toast — tighter gold glow */
.streak-toast { box-shadow: 0 0 60px rgba(176,132,72,0.25), 0 8px 40px rgba(0,0,0,0.6); }

/* Light theme card shadow — much softer */
[data-theme="light"] .pc,
[data-theme="light"] .hm-card,
[data-theme="light"] .w-card,
[data-theme="light"] .w-hero-card,
[data-theme="light"] .d-meal,
[data-theme="light"] .book-card,
[data-theme="light"] .q-block,
[data-theme="light"] .s-card,
[data-theme="light"] .hm-chal,
[data-theme="light"] .chal-card,
[data-theme="light"] .w-ex,
[data-theme="light"] .hm-quest-list,
[data-theme="light"] .rt-bar {
  box-shadow: 0 2px 12px rgba(0,0,0,0.07), inset 0 1px 0 rgba(255,255,255,0.9);
}
[data-theme="light"] .hm-hero-card {
  background: linear-gradient(160deg, #ffffff 0%, rgba(176,132,72,.05) 100%);
  box-shadow: 0 4px 24px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,1);
}
[data-theme="light"] body {
  background-image: radial-gradient(ellipse 110% 60% at 50% 0%, rgba(176,132,72,0.04) 0%, transparent 65%);
}

/* ═══════════════════════════════════════════════════════════════════
   PRO MAX MOTION LAYER
   ═══════════════════════════════════════════════════════════════════ */

/* Progress bar entrance — scaleX sweep from left */
@keyframes progEnter {
  from { transform: scaleX(0); opacity: 0.5; }
  to   { transform: scaleX(1); opacity: 1; }
}
.h-prog-fill,
.hm-xp-fill,
.hm-habits-fill,
.ps-fill,
.hm-chal-fill,
.chal-prog-fill {
  transform-origin: left center;
  animation: progEnter 1.0s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Coach bubble slide-in — left for AI, right for user */
@keyframes bubbleInLeft {
  from { opacity: 0; transform: translateX(-14px) scale(0.94); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes bubbleInRight {
  from { opacity: 0; transform: translateX(14px) scale(0.94); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
.coach-bubble.coach { animation: bubbleInLeft  0.38s cubic-bezier(0.16, 1, 0.3, 1) both; }
.coach-bubble.user  { animation: bubbleInRight 0.38s cubic-bezier(0.16, 1, 0.3, 1) both; }

/* Workout card hover lift */
.w-card {
  transition: background 0.25s, border-color 0.25s, transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}
.w-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.06);
}
.w-card:active { transform: translateY(-1px) scale(0.985); }

/* Gold button shine sweep */
.pro-btn { position: relative; overflow: hidden; }
.pro-btn::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 55%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.22), transparent);
  transform: skewX(-18deg);
  transition: left 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.pro-btn:hover::after { left: 160%; }

/* Nav active indicator — gold top bar */
.ni.active::before {
  border-radius: 0 0 3px 3px;
  box-shadow: 0 0 8px rgba(217,180,106,0.5);
}

/* Pillar ring track — subtle accent tint */
.pc-ring svg circle:first-child,
.pd-ring svg circle:first-child {
  stroke: rgba(176,132,72,0.12);
}

/* Serif headings — bump size for Cormorant's taller x-height */
.pd-name       { font-size: 26px; }
.hm-hero-title { font-size: 22px; }

/* ═══════════════════════════════════════════════════════════════════
   VISUAL INTENSITY — GLASS · GLOW · GRADIENT · SHIMMER
   ═══════════════════════════════════════════════════════════════════ */

/* ── Glass morphism: pillar cards ───────────────────────────────── */
.pc {
  background: rgba(20, 16, 10, 0.82);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border-color: rgba(217, 180, 106, 0.12);
}

/* ── Gradient text: day heading ─────────────────────────────────── */
.h-day {
  font-size: 40px;
  letter-spacing: 0.4px;
  background: linear-gradient(172deg, #fff8ef 0%, var(--accent-b) 52%, #c07e28 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Gradient text: all page titles ────────────────────────────── */
.page-title {
  font-size: 29px;
  background: linear-gradient(155deg, var(--text) 20%, var(--accent-b) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Gradient text: home hero name ─────────────────────────────── */
.hm-hero-name {
  background: linear-gradient(145deg, var(--text) 0%, var(--accent-b) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Gradient text: XP score number ────────────────────────────── */
.hm-score-num {
  background: linear-gradient(140deg, var(--accent-b) 0%, #fff3cc 55%, var(--accent-b) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Gradient text: pillar card names ───────────────────────────── */
.pc-name {
  background: linear-gradient(180deg, rgba(237,228,212,0.95) 0%, var(--accent-b) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Gradient text: pillar detail % ────────────────────────────── */
.pd-pct {
  background: linear-gradient(135deg, var(--accent-b) 0%, #ffe8a0 60%, var(--accent-b) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 15px;
}

/* ── Ring progress arc — gold glow ─────────────────────────────── */
.pc-ring svg circle:last-child,
.pd-ring svg circle:last-child,
.hm-pc-ring svg circle:last-child,
.d-ring-wrap svg circle:last-child {
  filter: drop-shadow(0 0 5px rgba(217,180,106,0.72));
}

/* ── Progress bar — glow + animated shimmer ─────────────────────── */
@keyframes barShimmer {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}
.h-prog-track { height: 3px; background: rgba(255,255,255,0.07); }
.h-prog-fill {
  background-image: linear-gradient(90deg,
    var(--accent) 0%, var(--accent-b) 30%,
    rgba(255,248,210,0.95) 50%, var(--accent-b) 70%, var(--accent) 100%);
  background-size: 250% auto;
  box-shadow: 0 0 10px rgba(217,180,106,0.9), 0 0 26px rgba(217,180,106,0.42);
  animation: progEnter 0.9s cubic-bezier(0.16,1,0.3,1) both,
             barShimmer 5s 1s linear infinite;
}

/* ── XP bar — glow + shimmer ────────────────────────────────────── */
.hm-xp-fill {
  background-image: linear-gradient(90deg,
    var(--accent) 0%, var(--accent-b) 35%,
    rgba(255,248,210,0.9) 50%, var(--accent-b) 65%, var(--accent) 100%);
  background-size: 250% auto;
  box-shadow: 0 0 8px rgba(217,180,106,0.75), 0 0 20px rgba(217,180,106,0.32);
  animation: progEnter 0.9s cubic-bezier(0.16,1,0.3,1) both,
             barShimmer 6s 1.2s linear infinite;
}

/* ── Home hero card — rich glass atmosphere ─────────────────────── */
.hm-hero-card {
  background: linear-gradient(160deg, rgba(36,28,14,0.94) 0%, rgba(11,9,6,0.97) 100%);
  border: 1px solid rgba(217,180,106,0.18);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow:
    0 10px 50px rgba(0,0,0,0.72),
    inset 0 1px 0 rgba(255,255,255,0.09),
    inset 0 0 0 1px rgba(217,180,106,0.06);
}

/* ── Hero glow — bigger, more luminous ──────────────────────────── */
.hm-hero-glow {
  width: 300px; height: 300px;
  top: -110px; right: -90px;
  background: radial-gradient(circle, rgba(217,180,106,1) 0%, rgba(176,132,72,0.45) 35%, transparent 70%);
  opacity: 0.2;
}

/* ── Pillar card hover — gold bloom ─────────────────────────────── */
.pc:hover {
  box-shadow:
    0 20px 56px rgba(0,0,0,0.72),
    0 0 0 1px rgba(217,180,106,0.28),
    0 0 55px rgba(176,132,72,0.14),
    inset 0 1px 0 rgba(255,255,255,0.1);
}

/* ── Habit done row — golden wash ───────────────────────────────── */
.hi.done { background: linear-gradient(90deg, rgba(176,132,72,0.10) 0%, transparent 66%); }

/* ── Section labels — warm gold ─────────────────────────────────── */
.sec-lbl { color: rgba(217,180,106,0.68); }

/* ── Level badge — glowing border ───────────────────────────────── */
.hm-hero-lvl {
  background: rgba(176,132,72,0.16);
  border-color: rgba(217,180,106,0.32);
  box-shadow: 0 0 14px rgba(217,180,106,0.18);
}

/* ── Active nav icon — gold glow ────────────────────────────────── */
.ni.active { filter: drop-shadow(0 0 7px rgba(217,180,106,0.48)); }

/* ── Streak hot label — brighter ────────────────────────────────── */
.hi-streak.hot { color: var(--accent-b); font-weight: 600; }

/* ── Pillar separator line — gradient ───────────────────────────── */
.pd-sep { background: linear-gradient(90deg, var(--accent-b), transparent); width: 44px; }

/* ── Light theme overrides for gradient text ────────────────────── */
[data-theme="light"] .h-day {
  background: linear-gradient(172deg, #1a1208 0%, var(--accent) 55%, #7a5020 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
[data-theme="light"] .page-title,
[data-theme="light"] .hm-hero-name,
[data-theme="light"] .pc-name {
  background: none;
  -webkit-text-fill-color: var(--text);
}
[data-theme="light"] .hm-score-num {
  background: none;
  -webkit-text-fill-color: var(--accent);
}
[data-theme="light"] .pd-pct {
  background: none;
  -webkit-text-fill-color: var(--accent);
}
[data-theme="light"] .pc {
  background: rgba(255,252,246,0.88);
  border-color: rgba(140,104,48,0.18);
}
[data-theme="light"] .sec-lbl { color: var(--accent); }
[data-theme="light"] .ni.active { filter: drop-shadow(0 0 5px rgba(140,104,48,0.38)); }

/* ═══════════════════════════════════════════════════════════════════
   EXCLUSIVE EDITION — GRAIN · ANIMATED BORDERS · EDITORIAL
   ═══════════════════════════════════════════════════════════════════ */

/* ── Film grain — the #1 premium detail ─────────────────────────── */
#grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9997;
  opacity: 0.028;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='250' height='250'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.72' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='250' height='250' filter='url(%23g)'/%3E%3C/svg%3E");
}

/* ── CSS @property for animated conic-gradient borders ───────────── */
@property --ba {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}
@keyframes borderSpin { to { --ba: 360deg; } }

/* ── Pillar cards — spinning gold border ─────────────────────────── */
.pc {
  border: 1px solid transparent;
  background:
    rgba(18, 14, 9, 0.88) padding-box,
    conic-gradient(from var(--ba),
      rgba(217,180,106,0.04) 0%,
      rgba(217,180,106,0.38) 12%,
      rgba(255,245,180,0.72) 22%,
      rgba(217,180,106,0.38) 32%,
      rgba(217,180,106,0.04) 44%,
      rgba(217,180,106,0.04) 100%) border-box;
  animation: borderSpin 8s linear infinite;
}

/* ── Hero card — slower spinning gold border ─────────────────────── */
.hm-hero-card {
  border: 1px solid transparent;
  background:
    linear-gradient(160deg, rgba(34,26,13,0.96), rgba(11,9,6,0.98)) padding-box,
    conic-gradient(from var(--ba),
      rgba(217,180,106,0.04) 0%,
      rgba(217,180,106,0.28) 15%,
      rgba(255,245,180,0.55) 25%,
      rgba(217,180,106,0.28) 35%,
      rgba(217,180,106,0.04) 50%,
      rgba(217,180,106,0.04) 100%) border-box;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow:
    0 10px 50px rgba(0,0,0,0.72),
    inset 0 1px 0 rgba(255,255,255,0.09),
    inset 0 0 0 1px rgba(217,180,106,0.04);
  animation: borderSpin 14s linear infinite;
}

/* ── Ring glow — breathing pulse ────────────────────────────────── */
@keyframes ringGlow {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(217,180,106,0.55)); }
  50%       { filter: drop-shadow(0 0 11px rgba(255,230,140,0.95)); }
}
.pc-ring svg circle:last-child,
.pd-ring svg circle:last-child,
.hm-pc-ring svg circle:last-child,
.d-ring-wrap svg circle:last-child {
  animation: ring-fill 1.0s cubic-bezier(0.16,1,0.3,1) forwards,
             ringGlow 3.5s ease-in-out 1.2s infinite;
}

/* ── Editorial day heading — large & breathing ───────────────────── */
.h-day { font-size: 52px; letter-spacing: 0.3px; line-height: 1.02; }

/* ── Home head — gold ornamental rule below ─────────────────────── */
.h-head::after {
  content: '';
  display: block;
  width: 56px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(217,180,106,0.7), transparent);
  margin-top: 20px;
}

/* ── Eyebrow — warm gold, wider tracking ─────────────────────────── */
.h-eyebrow { color: rgba(217,180,106,0.62); letter-spacing: 4px; }

/* ── Nav active — gold pill glow behind icon ─────────────────────── */
.ni { z-index: 0; }
.ni.active::after {
  content: '';
  position: absolute;
  top: 0px; left: 50%;
  transform: translateX(-50%);
  width: 40px; height: 36px;
  background: rgba(176,132,72,0.13);
  border-radius: 12px;
  z-index: -1;
  box-shadow: 0 0 20px rgba(217,180,106,0.18);
}

/* ── Section labels — gold with ornamental dash ─────────────────── */
.sec-lbl {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(217,180,106,0.65);
  letter-spacing: 3px;
}
.sec-lbl::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 1px;
  background: rgba(217,180,106,0.45);
  flex-shrink: 0;
}

/* ── Deeper atmosphere — bottom vignette ────────────────────────── */
body {
  background-image:
    radial-gradient(ellipse 95% 55% at 50% -2%, rgba(176,132,72,0.14) 0%, transparent 56%),
    radial-gradient(ellipse 55% 48% at 4% 72%, rgba(176,132,72,0.07) 0%, transparent 52%),
    radial-gradient(ellipse 50% 42% at 96% 88%, rgba(100,140,210,0.04) 0%, transparent 52%),
    radial-gradient(ellipse 130% 60% at 50% 110%, rgba(0,0,0,0.38) 0%, transparent 60%);
}

/* ── Light theme overrides ───────────────────────────────────────── */
[data-theme="light"] #grain { opacity: 0.014; }
[data-theme="light"] .pc {
  background:
    rgba(255,252,246,0.92) padding-box,
    conic-gradient(from var(--ba),
      rgba(140,104,48,0.04) 0%,
      rgba(140,104,48,0.28) 14%,
      rgba(200,160,72,0.52) 24%,
      rgba(140,104,48,0.28) 34%,
      rgba(140,104,48,0.04) 46%,
      rgba(140,104,48,0.04) 100%) border-box;
  border: 1px solid transparent;
}
[data-theme="light"] .hm-hero-card {
  background:
    linear-gradient(160deg, rgba(255,252,246,0.97), rgba(248,243,236,0.98)) padding-box,
    conic-gradient(from var(--ba),
      rgba(140,104,48,0.04) 0%,
      rgba(140,104,48,0.22) 15%,
      rgba(200,160,72,0.42) 25%,
      rgba(140,104,48,0.22) 35%,
      rgba(140,104,48,0.04) 50%,
      rgba(140,104,48,0.04) 100%) border-box;
  border: 1px solid transparent;
}
[data-theme="light"] body {
  background-image:
    radial-gradient(ellipse 110% 60% at 50% 0%, rgba(176,132,72,0.04) 0%, transparent 65%),
    radial-gradient(ellipse 130% 60% at 50% 110%, rgba(0,0,0,0.06) 0%, transparent 60%);
}

/* ══ PAYWALL / PREMIUM ══════════════════════════════════════════════════ */
.pw-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(5,4,3,0.72); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity 0.28s ease;
  padding: 0;
}
.pw-overlay.pw-visible { opacity: 1; }
.pw-card {
  position: relative; width: 100%; max-width: 440px;
  background: linear-gradient(180deg, #221c14 0%, var(--surface) 100%);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 22px 22px 0 0;
  padding: 30px 24px calc(28px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 40px rgba(0,0,0,0.6);
  transform: translateY(24px); transition: transform 0.32s cubic-bezier(0.16,1,0.3,1);
  max-height: 92vh; overflow-y: auto;
}
.pw-visible .pw-card { transform: translateY(0); }
@media (min-width: 520px) {
  .pw-overlay { align-items: center; padding: 24px; }
  .pw-card { border-radius: 22px; border-bottom: 1px solid var(--border); }
}
.pw-close {
  position: absolute; top: 14px; right: 16px;
  width: 32px; height: 32px; border: none; background: rgba(255,255,255,0.06);
  color: var(--text-dim); border-radius: 50%; font-size: 22px; line-height: 1;
  cursor: pointer; transition: all 0.2s;
}
.pw-close:hover { background: rgba(255,255,255,0.12); color: var(--text); }
.pw-icon {
  font-size: 38px; text-align: center; margin-bottom: 12px;
  filter: drop-shadow(0 4px 12px rgba(176,132,72,0.4));
}
.pw-title {
  font-family: var(--display); font-size: 23px; font-weight: 500;
  text-align: center; color: var(--text); margin: 0 0 8px; letter-spacing: 0.4px;
}
.pw-sub {
  text-align: center; font-size: 14px; color: var(--text-dim);
  line-height: 1.55; margin: 0 6px 20px;
}
.pw-features {
  list-style: none; margin: 0 0 22px; padding: 0;
  display: grid; gap: 11px;
}
.pw-features li {
  display: flex; align-items: center; gap: 11px;
  font-size: 14px; color: var(--text);
}
.pw-features li svg { color: var(--accent-b); flex-shrink: 0; }
.pw-billing { display: flex; gap: 10px; margin-bottom: 18px; }
.pw-bill-opt {
  position: relative; flex: 1; cursor: pointer;
  background: var(--surface2); border: 1.5px solid var(--border2);
  border-radius: 14px; padding: 14px 10px 12px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  transition: all 0.2s; color: var(--text);
}
.pw-bill-opt.active { border-color: var(--accent-b); background: rgba(176,132,72,0.12); }
.pw-bill-name { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }
.pw-bill-price { font-family: var(--display); font-size: 22px; color: var(--text); }
.pw-bill-price small { font-size: 12px; color: var(--text-muted); font-family: inherit; }
.pw-bill-sub { font-size: 11px; color: var(--accent-b); }
.pw-bill-badge {
  position: absolute; top: -9px; left: 50%; transform: translateX(-50%);
  background: var(--accent-b); color: #1a1209; font-size: 9px; font-weight: 700;
  letter-spacing: 0.5px; padding: 2px 9px; border-radius: 20px; white-space: nowrap;
}
.pw-cta {
  display: block; width: 100%; border: none; cursor: pointer;
  background: linear-gradient(90deg, var(--accent), var(--accent-b));
  color: #1a1209; font-weight: 700; font-size: 16px; letter-spacing: 0.3px;
  padding: 16px; border-radius: 14px;
  box-shadow: 0 4px 18px rgba(176,132,72,0.35); transition: all 0.2s;
}
.pw-cta:hover { filter: brightness(1.06); }
.pw-cta:disabled { opacity: 0.6; cursor: default; }
.pw-cta-inline { font-size: 14px; padding: 13px; margin-top: 12px; box-shadow: none; }
.pw-fine { text-align: center; font-size: 11px; color: var(--text-muted); margin: 12px 0 0; }
.pw-restore {
  text-align: center; font-size: 12px; color: var(--text-dim);
  margin: 14px 0 0; cursor: pointer; text-decoration: underline;
}
.pw-restore:hover { color: var(--text); }
/* Profile status card */
.pw-status {
  border: 1px solid var(--border2); border-radius: var(--radius);
  padding: 16px; background: var(--surface);
}
.pw-status-founder { background: linear-gradient(135deg, rgba(176,132,72,0.16), rgba(217,180,106,0.06)); border-color: rgba(217,180,106,0.4); }
.pw-status-active { border-color: rgba(217,180,106,0.4); }
.pw-status-trial { background: linear-gradient(135deg, rgba(110,159,212,0.12), transparent); border-color: rgba(110,159,212,0.3); }
.pw-status-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pw-status-badge { font-family: var(--display); font-size: 15px; color: var(--accent-b); letter-spacing: 0.5px; }
.pw-badge-free { color: var(--text-dim); }
.pw-status-plan { font-size: 12px; color: var(--text-dim); }
.pw-status-note { font-size: 12px; color: var(--text-muted); line-height: 1.5; margin-top: 8px; }
