/* Auth, onboarding, Today, Community, Progress, You. */

/* ---------- auth + onboarding ---------- */
.auth-wrap { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 22px; }
.auth-hero { text-align: center; display: flex; flex-direction: column; gap: 8px; }
.auth-hero h1 { font-size: 2.1rem; }
.auth-hero p { color: var(--text-2); font-size: 1.05rem; }
.auth-card { gap: 12px; padding: 20px; }
.auth-hint { font-size: 0.84rem; color: var(--text-3); text-align: center; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 0.84rem; font-weight: 650; margin: 2px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }
.auth-switch { text-align: center; color: var(--text-2); }
.onboard-wrap { width: 100%; max-width: 520px; display: flex; flex-direction: column; gap: 18px; padding-bottom: 8px; }
.onboard-head { text-align: center; display: flex; flex-direction: column; gap: 8px; }
.pick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pick { position: relative; background: var(--paper); border: 2px solid var(--line); border-radius: var(--r-lg); padding: 14px 12px; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; min-height: 104px; transition: transform 0.12s, border-color 0.15s, background 0.15s; }
.pick-emoji { font-size: 30px; line-height: 1.2; }
.pick-name { font-weight: 700; }
.pick-sub { font-size: 0.8rem; color: var(--text-2); }
.pick-check { position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; transform: scale(0); transition: transform 0.25s cubic-bezier(.3, 1.6, .5, 1); }
.pick.on { border-color: var(--accent); background: var(--accent-soft); }
.pick.on .pick-check { transform: scale(1); }
.onboard-foot { position: sticky; bottom: 0; display: flex; flex-direction: column; gap: 8px; padding: 12px 0 calc(8px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--canvas) 22%); }

/* ---------- Today ---------- */
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.wday { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 0; min-height: 60px; border-radius: 14px; color: var(--text-3); font-size: 0.72rem; font-weight: 700; transition: transform 0.12s; }
.wday-dot { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 0.9rem; font-weight: 700; color: var(--text-2); background: var(--paper); border: 2px solid var(--line); font-variant-numeric: tabular-nums; }
.wday.some .wday-dot { border-color: var(--accent); color: var(--accent-strong); }
.wday.perfect .wday-dot { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.wday.on { color: var(--accent); }
.wday.on .wday-dot { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent); }

.hero { flex-direction: row; align-items: center; gap: 16px; position: relative; overflow: hidden; }
.hero-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.hero-line { font-weight: 700; font-size: 1.02rem; line-height: 1.3; }
.xp-cap { font-size: 0.78rem; color: var(--text-3); font-weight: 650; margin-top: -3px; }
.hero.all-done { background: linear-gradient(140deg, color-mix(in srgb, #EEB333 22%, var(--paper)), var(--paper) 55%, color-mix(in srgb, var(--ember) 16%, var(--paper))); border-color: color-mix(in srgb, var(--ember) 45%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, #EEB333 30%, transparent), 0 10px 30px color-mix(in srgb, var(--ember) 22%, transparent); }
.hero-sun { position: absolute; top: 8px; right: 12px; font-size: 26px; line-height: 1; }

.habit-list { display: flex; flex-direction: column; gap: 10px; }
.habit { display: flex; align-items: stretch; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; transition: transform 0.14s ease, background 0.25s; }
.habit-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 12px 4px 12px 14px; min-height: 68px; }
.habit-emoji { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; flex-shrink: 0; background: color-mix(in srgb, var(--habit, var(--accent)) 16%, var(--paper)); line-height: 1; }
.habit-emoji.sm { width: 32px; height: 32px; border-radius: 10px; font-size: 16px; }
.habit-emoji.lg { width: 56px; height: 56px; border-radius: 18px; font-size: 28px; }
.habit-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.habit-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.habit-sub { font-size: 0.84rem; color: var(--text-2); display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.mini-streak { display: inline-flex; align-items: center; gap: 2px; color: var(--ember-strong); font-weight: 700; }
.mini-streak.paused { opacity: 0.6; }
.mini-shared { display: inline-flex; color: var(--text-3); }
.check { width: 64px; display: grid; place-items: center; flex-shrink: 0; color: transparent; position: relative; }
.check::before { content: ""; position: absolute; width: 40px; height: 40px; border-radius: 50%; border: 2.5px solid color-mix(in srgb, var(--habit, var(--accent)) 55%, transparent); transition: background 0.2s, border-color 0.2s, transform 0.2s; }
.check svg { position: relative; transform: scale(0.4); opacity: 0; transition: transform 0.25s cubic-bezier(.3, 1.8, .5, 1), opacity 0.15s; }
.check.on { color: #fff; }
.check.on::before { background: var(--habit, var(--accent)); border-color: var(--habit, var(--accent)); }
.check.on svg { transform: scale(1); opacity: 1; }
.habit.done { background: color-mix(in srgb, var(--habit, var(--accent)) 7%, var(--paper)); }
.habit.done .habit-name { color: var(--text-2); }
.habit.skipped { opacity: 0.75; }

.stepper { display: flex; align-items: center; justify-content: center; gap: 14px; }
.stepper-mid { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: 1; max-width: 170px; }
.stepper-input { font-size: 2rem; font-weight: 800; text-align: center; min-height: 64px; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.stepper-input::-webkit-outer-spin-button, .stepper-input::-webkit-inner-spin-button, .big-number::-webkit-outer-spin-button, .big-number::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.big-number { -moz-appearance: textfield; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 8px; }
.choice { height: 46px; border-radius: 13px; background: var(--sunken); font-size: 22px; display: grid; place-items: center; border: 2px solid transparent; transition: transform 0.12s; line-height: 1; }
.choice.on { border-color: var(--accent); background: var(--accent-soft); }
.swatch { height: 46px; border-radius: 50%; width: 46px; display: grid; place-items: center; color: #fff; border: 3px solid transparent; justify-self: center; transition: transform 0.12s; }
.swatch.on { border-color: var(--paper); box-shadow: 0 0 0 3px var(--text); }

/* ---------- Community ---------- */
.feed { display: flex; flex-direction: column; gap: 12px; }
.feed-card { gap: 10px; border-left: 4px solid var(--habit, var(--accent)); }
.feed-top { display: flex; align-items: center; gap: 10px; }
.feed-who { flex: 1; min-width: 0; }
.feed-who p { overflow-wrap: anywhere; }
.feed-emoji { font-size: 26px; line-height: 1; }
.feed-amount { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.feed-note { border-left: 3px solid var(--accent-soft); padding: 2px 0 2px 12px; color: var(--text-2); font-style: italic; overflow-wrap: anywhere; }
.feed-actions { display: flex; gap: 8px; }
.react { display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); padding: 0 14px; border-radius: var(--r-pill); background: var(--sunken); color: var(--text-2); font-weight: 700; font-size: 0.88rem; transition: transform 0.12s, background 0.15s; }
.react.on { background: var(--ember-soft); color: var(--ember-strong); }
.react.on svg { fill: currentColor; animation: pop 0.4s cubic-bezier(.3, 1.8, .5, 1); }
.comments { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.comment { display: flex; gap: 8px; align-items: flex-start; }
.comment-body { flex: 1; min-width: 0; background: var(--sunken); border-radius: 14px; padding: 8px 12px; overflow-wrap: anywhere; }
.comment-form { display: flex; gap: 8px; }
.comment-form .input { flex: 1; min-width: 0; min-height: var(--tap); padding: 8px 12px; }
.group-card { gap: 12px; }
.group-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.group-hero h1 { font-size: 1.5rem; }
.invite { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: var(--sunken); border-radius: var(--r-md); padding: 12px; }
.member-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.member { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: var(--r-pill); background: var(--sunken); font-size: 0.86rem; font-weight: 650; }

/* ---------- Progress ---------- */
.level-card { flex-direction: row; align-items: center; gap: 16px; }
.level-badge { width: 84px; height: 84px; border-radius: 26px; background: linear-gradient(145deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #EEB333)); color: var(--on-accent); display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; line-height: 1; box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 30%, transparent); }
.level-badge span { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.85; }
.level-badge strong { font-size: 2.3rem; font-weight: 800; }
.level-card .xpbar { margin-top: 8px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { gap: 2px; padding: 14px; }
.stat-icon { color: var(--accent); margin-bottom: 4px; display: inline-flex; }
.stat.ember .stat-icon, .stat.ember strong { color: var(--ember-strong); }
.stat strong { font-size: 1.8rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { font-weight: 700; font-size: 0.9rem; }
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; }
.bar-col { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bar-num { font-size: 0.7rem; color: var(--text-3); font-weight: 700; min-height: 1em; font-variant-numeric: tabular-nums; }
.bar-track { width: 100%; max-width: 30px; height: 96px; border-radius: 10px; background: var(--sunken); display: flex; align-items: flex-end; overflow: hidden; }
.bar-track i { display: block; width: 100%; border-radius: 10px; background: var(--accent); transform-origin: bottom; animation: grow-up 0.6s cubic-bezier(.3, 1.2, .5, 1) backwards; }
.bar-track i.perfect { background: linear-gradient(var(--ember), #EEB333); }
.bar-day { font-size: 0.74rem; font-weight: 700; color: var(--text-3); }
.bar-col.today .bar-day { color: var(--accent); }
.heat { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cell { aspect-ratio: 1; max-height: 30px; border-radius: 7px; background: var(--sunken); }
.cell.part { background: color-mix(in srgb, var(--habit) 35%, var(--sunken)); }
.cell.full { background: var(--habit); }
.cell.rest { background: repeating-linear-gradient(45deg, var(--sunken), var(--sunken) 3px, var(--line-strong) 3px, var(--line-strong) 5px); }
.cell.today { box-shadow: 0 0 0 2px var(--text-3); }
.xp-how li { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.xp-how .xp-pill { min-width: 44px; justify-content: center; }

/* ---------- You ---------- */
.profile-card { flex-direction: row; align-items: center; gap: 14px; }
.profile-card h2 { font-size: 1.3rem; overflow-wrap: anywhere; }
.profile-card .chips { margin-top: 6px; }
