/* Meditation Copilot — styles */
:root {
  /* Science of Spirituality palette (sos.org): deep navy, gold, warm cream */
  --bg: #faf8f3;
  --bg-glow: #f7eedf;
  --card: #ffffff;
  --card-2: #f6f2ea;
  --text: #2b2b2b;
  --muted: #5e6b78;
  --line: #e5e5e5;
  --purple: #043a5b;        /* primary: SOS navy (variable name kept for compatibility) */
  --purple-2: #1e3a5f;
  --purple-soft: #e9eff4;
  --gold: #968743;
  --gold-ink: #7a6b2a;
  --gold-bright: #e1b93b;
  --gold-soft: #f7eedf;
  --ok: #2f7d4f;
  --ok-soft: #e3f4ea;
  --danger: #b3364a;
  --bar: #043a5b;
  --grid: #ebe7df;
  --shadow: 0 10px 30px rgba(4, 58, 91, 0.10), 0 2px 6px rgba(4, 58, 91, 0.05);
  --radius: 22px;
  --tabbar-h: 68px;
  --serif: Lusitana, "Adobe Caslon Pro", "Hoefler Text", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: Roboto, "PT Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

:root[data-theme="dark"] {
  --bg: #07192a; --bg-glow: #0d3352; --card: #0f2a40; --card-2: #143450;
  --text: #eef3f7; --muted: #a9bccb; --line: #214a68;
  --purple: #9fc5e4; --purple-2: #5f93bf; --purple-soft: #173b57;
  --gold: #e1b93b; --gold-ink: #e6c25f; --gold-bright: #f0d27a; --gold-soft: #3a3012;
  --ok: #7fd3a0; --ok-soft: #173326; --danger: #ff8a9b;
  --bar: #5f93bf; --grid: #1c3d58;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --bg: #07192a; --bg-glow: #0d3352; --card: #0f2a40; --card-2: #143450;
    --text: #eef3f7; --muted: #a9bccb; --line: #214a68;
    --purple: #9fc5e4; --purple-2: #5f93bf; --purple-soft: #173b57;
    --gold: #e1b93b; --gold-ink: #e6c25f; --gold-bright: #f0d27a; --gold-soft: #3a3012;
    --ok: #7fd3a0; --ok-soft: #173326; --danger: #ff8a9b;
    --bar: #5f93bf; --grid: #1c3d58;
    --shadow: 0 10px 30px rgba(0,0,0,0.45), 0 2px 6px rgba(0,0,0,0.3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh; min-height: 100dvh;
  font-family: var(--sans); color: var(--text);
  background: radial-gradient(1200px 600px at 50% -200px, var(--bg-glow), transparent 70%), var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  line-height: 1.5;
}
[hidden] { display: none !important; }
.wrap {
  max-width: 520px; margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 14px) 18px calc(env(safe-area-inset-bottom) + var(--tabbar-h) + 28px);
}

/* Header */
header.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-weight: 600; font-size: 1.1rem; }
.brand .logo { font-size: 1.4rem; }
.icon-btn {
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  width: 44px; height: 44px; border-radius: 50%; font-size: 1.15rem;
  display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow);
}

/* Tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar .inner { max-width: 520px; margin: 0 auto; display: grid; grid-template-columns: repeat(6, 1fr); }
.tab {
  height: var(--tabbar-h); border: 0; background: none; color: var(--muted); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font: inherit; font-size: .72rem; font-weight: 600; letter-spacing: .02em; text-decoration: none;
}
.tab svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab .ic { display: grid; place-items: center; width: 56px; height: 30px; border-radius: 99px; transition: background .2s; }
.tab.on { color: var(--purple); }
.tab.on .ic { background: var(--purple-soft); }
.tab.on svg { stroke-width: 2.2; }
@media (max-width: 360px) { .tab .ic { width: 46px; } .tab { font-size: .66rem; } }

/* Views & screens */
.view { display: none; animation: rise .4s ease both; }
.view.active { display: block; }
.screen { display: none; animation: rise .4s ease both; }
.screen.active { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .view, .screen { animation: none; } .ring-fg { transition: none !important; } }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px 20px; margin-bottom: 16px;
}
.card h3 { font-family: var(--serif); font-size: 1.2rem; margin: 0 0 12px; }
.section-title { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; margin: 0 0 12px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.center { text-align: center; }

/* Hero / welcome */
.hero { text-align: center; padding: 34px 22px 28px; }
.hero .lotus { font-size: 3.4rem; line-height: 1; filter: drop-shadow(0 6px 18px rgba(225,185,59,.45)); }
.hero h1 { font-family: var(--serif); font-weight: 600; font-size: 2.1rem; line-height: 1.15; margin: 14px 0 8px; color: var(--purple); }
.tagline { font-family: var(--serif); font-style: italic; color: var(--gold); font-size: 1.1rem; margin: 0 0 18px; }
.hero p.lead { color: var(--muted); margin: 0 auto 24px; max-width: 34ch; }
main a:not(.btn):not(.tab):not(.points-line) { color: var(--purple); }
.goal-badge {
  display: inline-flex; flex-direction: column; align-items: center;
  background: linear-gradient(135deg, var(--gold-soft), var(--purple-soft));
  border: 1px solid var(--line); border-radius: 18px; padding: 14px 26px; margin-bottom: 26px;
}
.goal-badge b { font-family: var(--serif); font-size: 2rem; color: var(--purple); line-height: 1.1; }
.goal-badge span { font-size: .85rem; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }

/* Progress */
.progress { display: flex; align-items: center; gap: 12px; margin: 6px 2px 16px; }
.progress .bar { flex: 1; height: 8px; border-radius: 99px; background: var(--purple-soft); overflow: hidden; }
.progress .fill { height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--purple-2), var(--gold-bright)); transition: width .4s ease; }
.progress .count { font-size: .85rem; color: var(--muted); white-space: nowrap; }
.meter { height: 10px; border-radius: 99px; background: var(--purple-soft); overflow: hidden; }
.meter > div { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--purple-2), var(--gold-bright)); transition: width 1s ease; }

/* Questions */
.q-num { font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); margin-bottom: 6px; }
.q-title { font-family: var(--serif); font-size: 1.6rem; line-height: 1.25; margin: 0 0 8px; font-weight: 600; }
.q-help { color: var(--muted); margin: 0 0 20px; font-size: .97rem; }

input[type="date"], input[type="time"], input[type="number"], textarea, select {
  width: 100%; font: inherit; font-size: 1.15rem; color: var(--text);
  background: var(--card-2); border: 2px solid var(--line); border-radius: 16px;
  padding: 14px 16px; min-height: 56px; outline: none; transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none; appearance: none;
}
textarea { min-height: 84px; font-size: 1rem; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--purple-2); box-shadow: 0 0 0 4px var(--purple-soft); }
.input-suffix { position: relative; }
.input-suffix input { padding-right: 110px; }
.input-suffix .suffix { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
label.field { display: block; font-size: .85rem; font-weight: 600; color: var(--muted); margin: 14px 2px 6px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.chip {
  border: 1.5px solid var(--line); background: var(--card-2); color: var(--text);
  border-radius: 99px; padding: 10px 16px; min-height: 44px; font: inherit; font-size: .95rem; cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
}
.chip.on { background: var(--purple-soft); border-color: var(--purple-2); color: var(--purple); font-weight: 600; }
.seg { font-family: var(--sans); display: inline-flex; flex: 0 0 auto; background: var(--purple-soft); border-radius: 99px; padding: 4px; gap: 2px; }
.seg button { white-space: nowrap; border: 0; background: none; color: var(--muted); font: inherit; font-size: .85rem; font-weight: 600; padding: 8px 12px; min-height: 36px; border-radius: 99px; cursor: pointer; }
.seg button.on { background: var(--card); color: var(--purple); box-shadow: 0 1px 4px rgba(0,0,0,.12); }

.error { color: var(--danger); font-size: .92rem; min-height: 1.4em; margin: 10px 2px 0; }

/* Slider */
.quality-value { text-align: center; margin: 4px 0 14px; }
.quality-value b { font-family: var(--serif); font-size: 3rem; color: var(--purple); line-height: 1; }
.quality-value span { display: block; color: var(--gold); font-weight: 600; letter-spacing: .04em; margin-top: 4px; }
.quality-value.sm b { font-size: 2rem; }
input[type="range"] { width: 100%; height: 44px; background: transparent; -webkit-appearance: none; appearance: none; margin: 0; }
input[type="range"]::-webkit-slider-runnable-track {
  height: 10px; border-radius: 99px;
  background: linear-gradient(90deg, var(--gold-bright) 0, var(--gold-bright) var(--pct, 75%), var(--purple-soft) var(--pct, 75%));
}
input[type="range"]::-moz-range-track { height: 10px; border-radius: 99px; background: var(--purple-soft); }
input[type="range"]::-moz-range-progress { height: 10px; border-radius: 99px; background: var(--gold-bright); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 34px; height: 34px; border-radius: 50%; margin-top: -12px;
  background: var(--purple-2); border: 4px solid #fff; box-shadow: 0 3px 10px rgba(4,58,91,.35); cursor: pointer;
}
input[type="range"]::-moz-range-thumb { width: 28px; height: 28px; border-radius: 50%; background: var(--purple-2); border: 4px solid #fff; box-shadow: 0 3px 10px rgba(4,58,91,.35); cursor: pointer; }
.formula { margin-top: 18px; padding: 14px 16px; border-radius: 16px; background: var(--gold-soft); font-size: .95rem; border: 1px solid var(--line); }
.formula b { color: var(--purple); }

/* Buttons */
.actions { display: flex; gap: 12px; margin-top: 22px; }
.btn {
  flex: 1; border: 0; border-radius: 16px; min-height: 56px; padding: 14px 18px;
  font: inherit; font-size: 1.05rem; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .1s ease, filter .2s, box-shadow .2s; text-decoration: none;
}
.btn:active { transform: scale(.98); }
.btn-primary { color: #fff; background: linear-gradient(135deg, #1e4d73, #043a5b); box-shadow: 0 8px 20px rgba(4,58,91,.32); }
:root[data-theme="dark"] .btn-primary { background: linear-gradient(135deg, #3f7fb0, #1e4d73); }
.btn-gold { color: #2b2b2b; background: linear-gradient(135deg, #f3d777, #e1b93b); box-shadow: 0 8px 20px rgba(225,185,59,.35); }
.btn-ghost { flex: 0 0 auto; min-width: 96px; background: transparent; color: var(--muted); border: 1.5px solid var(--line); }
.btn-soft { background: var(--purple-soft); color: var(--purple); }
.btn-danger { flex: 0 0 auto; background: transparent; color: var(--danger); border: 1.5px solid var(--line); }
.btn-whatsapp { color: #fff; background: linear-gradient(135deg, #2bd06a, #128c4a); box-shadow: 0 8px 20px rgba(18,140,74,.3); }
.btn-block { width: 100%; }
.btn-xl { min-height: 64px; font-size: 1.15rem; border-radius: 20px; }
.btn-sm { min-height: 44px; font-size: .92rem; padding: 10px 14px; border-radius: 14px; }
.stack { display: grid; gap: 12px; margin-top: 18px; }

/* Ring */
.ring-wrap { display: grid; place-items: center; margin: 8px 0 18px; position: relative; }
.ring { width: 190px; height: 190px; transform: rotate(-90deg); }
/* Today: compact progress ring (the large dial lives on the Timer) */
.ring.xs { width: 84px; height: 84px; }
.ring-wrap.xs { margin: 0; flex: 0 0 auto; }
.ring-center.xs b { font-size: 1.35rem; }
.today-row { display: flex; align-items: center; gap: 16px; }
.today-text { flex: 1 1 auto; }
.today-big { font-family: var(--serif); font-size: 1.15rem; color: var(--text); line-height: 1.3; }
.today-big b { font-size: 1.6rem; color: var(--purple); }
.today-text .target-link { margin-top: 4px; display: inline-block; }
.stars { display: flex; gap: 6px; justify-content: center; margin: 4px 0 12px; }
.stars button { font: inherit; font-size: 2rem; line-height: 1; background: none; border: 0; color: var(--line); cursor: pointer; padding: 4px; }
.stars button.on { color: var(--gold-bright); }
.vid-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.vid-row:first-child { border-top: 0; }
.vid-row img { width: 64px; height: 36px; object-fit: cover; border-radius: 6px; background: #000; flex: 0 0 auto; }
.vid-row .ag-main { flex: 1 1 auto; }
.ring.lg { width: 260px; height: 260px; }
.ring.sm { width: 150px; height: 150px; }
.ring-bg { stroke: var(--purple-soft); }
.ring-fg { stroke: url(#ringGrad); transition: stroke-dashoffset 1.2s cubic-bezier(.2,.8,.2,1); }
.ring-center { position: absolute; text-align: center; }
.ring-center b { display: block; font-family: var(--serif); font-size: 2rem; color: var(--purple); line-height: 1.1; }
.ring-center span { font-size: .8rem; color: var(--muted); }

/* Status */
.status { border-radius: 18px; padding: 16px 18px; margin-bottom: 18px; text-align: center; font-weight: 600; font-size: 1.05rem; }
.status.ahead { background: var(--ok-soft); color: var(--ok); }
.status.behind { background: var(--gold-soft); color: var(--gold-ink); }
.status small { display: block; font-weight: 400; color: var(--text); margin-top: 6px; font-size: .97rem; line-height: 1.45; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stats.three { grid-template-columns: repeat(3, 1fr); }
.stat { background: var(--card-2); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; min-width: 0; }
.stat .k { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.stat .v { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; margin-top: 2px; overflow-wrap: anywhere; }
.stat .v small { font-family: var(--sans); font-size: .78rem; font-weight: 400; color: var(--muted); }
.stat.wide { grid-column: 1 / -1; }
.stat.hl { background: linear-gradient(135deg, var(--gold-soft), var(--purple-soft)); }
.stats.three .stat { padding: 10px 10px; text-align: center; }
.stats.three .stat .v { font-size: 1.15rem; }

.quote {
  margin: 20px 0 4px; padding: 18px 20px; border-left: 4px solid var(--gold-bright);
  background: var(--card-2); border-radius: 0 16px 16px 0;
  font-family: var(--serif); font-style: italic; font-size: 1.12rem;
}
.quote cite { display: block; margin-top: 6px; font-style: normal; font-family: var(--sans); font-size: .82rem; color: var(--muted); }
.quote.flat { margin: 0; }

.links { display: flex; justify-content: center; gap: 18px; margin-top: 18px; flex-wrap: wrap; }
.link { background: none; border: 0; color: var(--purple); font: inherit; font-size: .95rem; cursor: pointer; padding: 10px 6px; text-decoration: underline; text-underline-offset: 3px; }
.note { font-size: .85rem; color: var(--muted); background: var(--card-2); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin: 0 0 14px; }

.install-banner { display: none; margin-top: 16px; padding: 14px 16px; border-radius: 16px; border: 1px dashed var(--gold-bright); background: var(--card); font-size: .93rem; color: var(--muted); }
.install-banner.show { display: block; }
.install-banner b { color: var(--text); }

/* Home */
.greet { font-family: var(--serif); font-size: 1.6rem; font-weight: 600; margin: 4px 2px 2px; }
.greet-sub { color: var(--muted); margin: 0 2px 16px; }
.today-card { text-align: center; }
.target-link { background: none; border: 0; color: var(--muted); font: inherit; font-size: .88rem; cursor: pointer; padding: 6px 10px; border-radius: 99px; }
.target-link b { color: var(--purple); }
.last-session { display: flex; justify-content: space-between; gap: 10px; align-items: center; }

/* Milestones */
.milestones { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ms { border-radius: 99px; padding: 6px 12px; font-size: .82rem; font-weight: 600; border: 1.5px solid var(--line); color: var(--muted); background: var(--card-2); }
.ms.done { border-color: var(--gold-bright); background: var(--gold-soft); color: var(--gold-ink); }
.ms.next { border-color: var(--purple-2); color: var(--purple); }

/* Timer */
.timer-display { text-align: center; }
.timer-time { font-family: var(--serif); font-size: 3.2rem; font-weight: 600; color: var(--purple); line-height: 1; font-variant-numeric: tabular-nums; }
.timer-label { font-size: .85rem; color: var(--muted); margin-top: 6px; }
.timer-time.over { color: var(--gold); }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); margin-top: 16px; }
.switch { position: relative; width: 52px; height: 32px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; inset: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line); transition: background .2s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + span { background: var(--purple-2); }
.switch input:checked + span::after { transform: translateX(20px); }

body.focus header.top, body.focus .tabbar { display: none; }
body.focus .wrap { padding-bottom: calc(env(safe-area-inset-bottom) + 28px); }
body.focus .run-card { background: transparent; border-color: transparent; box-shadow: none; }

/* Insights chart */
.chart-wrap { position: relative; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid line { stroke: var(--grid); stroke-width: 1; }
.chart .axis text { fill: var(--muted); font-size: 10px; font-family: var(--sans); }
.chart .axis text.today { fill: var(--text); font-weight: 700; }
.chart .bar { fill: var(--bar); pointer-events: none; }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .hit:hover + .bar, .chart .bar.hover { filter: brightness(1.15); }
.chart .target { stroke: var(--gold-bright); stroke-width: 2; stroke-dasharray: 5 4; }
.chart .target-label { fill: var(--gold-ink); font-size: 10px; font-weight: 700; font-family: var(--sans); }
.tip {
  position: absolute; pointer-events: none; z-index: 3; min-width: 120px;
  background: var(--text); color: var(--bg); border-radius: 12px; padding: 8px 10px; font-size: .8rem; line-height: 1.35;
  transform: translate(-50%, -100%); box-shadow: var(--shadow); white-space: nowrap;
}
.tip b { display: block; }

/* Log */
.log-day { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 16px 2px 8px; }
.log-item {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  background: var(--card-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 8px;
  font: inherit; color: var(--text); cursor: pointer;
}
.log-item .t { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .88rem; min-width: 64px; }
.log-item .m { font-weight: 700; }
.log-item .q { margin-left: auto; font-size: .82rem; color: var(--gold-ink); font-weight: 600; white-space: nowrap; }
.log-item .n { display: block; font-size: .82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 52vw; }
.empty { text-align: center; color: var(--muted); padding: 18px 8px; }
.tool-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.tool-row.two { grid-template-columns: 1fr 1fr; }

/* Dialog */
dialog.sheet {
  border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 520px;
  background: var(--card); color: var(--text); border-radius: 24px 24px 0 0;
  box-shadow: 0 -10px 40px rgba(0,0,0,.3); max-height: 92vh; max-height: 92dvh;
}
@media (min-width: 600px) { dialog.sheet { margin: auto; border-radius: 24px; } }
dialog.sheet::backdrop { background: rgba(18, 10, 31, .55); backdrop-filter: blur(2px); }
dialog.sheet[open] { animation: sheetUp .3s ease both; }
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-body { padding: 22px 20px calc(env(safe-area-inset-bottom) + 20px); overflow-y: auto; max-height: inherit; }
.sheet-title { font-family: var(--serif); font-size: 1.4rem; font-weight: 600; margin: 0 0 4px; }

footer { text-align: center; color: var(--muted); font-size: .8rem; margin-top: 18px; line-height: 1.5; }
footer p { margin: 4px 0; }
footer a { color: var(--purple); }
.disclaimer { background: var(--gold-soft); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; color: var(--text); }
.proto-pill { font-family: var(--sans); font-size: .62rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gold-ink); background: var(--gold-soft); border: 1px solid var(--gold-bright); border-radius: 99px; padding: 2px 8px; }

/* Linear roadmap track */
.track-card { margin: 4px 0 18px; }
.track-head { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.track-head b { font-family: var(--serif); font-size: 2rem; color: var(--purple); line-height: 1; }
.track-head span { color: var(--muted); font-size: .9rem; }
.track-head em { margin-left: auto; font-style: normal; font-weight: 600; color: var(--gold-ink); font-size: .9rem; }
.track { position: relative; height: 92px; margin: 0 16px; }
.track-line { position: absolute; left: 0; right: 0; top: 46px; height: 10px; border-radius: 99px; background: var(--purple-soft); overflow: hidden; }
.track-fill { height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--purple-2), var(--gold-bright)); transition: width 1.4s cubic-bezier(.2,.8,.2,1); }
.stop { position: absolute; top: 40px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; }
.stop i { width: 22px; height: 22px; border-radius: 50%; background: var(--card); border: 3px solid var(--line); box-sizing: border-box; }
.stop.done i { background: var(--gold-bright); border-color: var(--card); box-shadow: 0 0 0 2px var(--gold-bright); }
.stop.next i { border-color: var(--purple-2); }
.stop span { margin-top: 6px; font-size: .7rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.stop.done span { color: var(--gold-ink); }
.stop.finish i { width: 30px; height: 30px; margin-top: -4px; border-radius: 8px; border: 0;
  background: repeating-conic-gradient(var(--text) 0 25%, var(--card) 0 50%) 0 0 / 10px 10px; box-shadow: 0 0 0 2px var(--text); }
.stop.finish.done i { box-shadow: 0 0 0 3px var(--gold-bright); }
.track-me { position: absolute; top: 0; transform: translateX(-50%); transition: left 1.4s cubic-bezier(.2,.8,.2,1); display: flex; flex-direction: column; align-items: center; z-index: 2; }
.track-me span { background: var(--purple-2); color: #fff; font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 99px; white-space: nowrap; box-shadow: 0 3px 10px rgba(91,42,134,.35); }
.track-me::after { content: ""; width: 2px; height: 14px; background: var(--purple-2); }

/* Learn */
.search { display: flex; gap: 8px; margin-bottom: 16px; }
.search input { flex: 1; min-width: 0; font: inherit; font-size: 1.05rem; color: var(--text); background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px; min-height: 52px; outline: none; -webkit-appearance: none; appearance: none; box-shadow: var(--shadow); }
.search input:focus { border-color: var(--purple-2); }
.search .btn { flex: 0 0 auto; min-height: 52px; padding: 10px 16px; }
.topic-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.topic {
  text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px; box-shadow: var(--shadow);
  font: inherit; color: var(--text); cursor: pointer; display: flex; flex-direction: column; gap: 4px; min-height: 120px;
}
.topic .ti { font-size: 1.6rem; line-height: 1; }
.topic b { font-family: var(--serif); font-size: 1.02rem; line-height: 1.25; }
.topic small { color: var(--muted); font-size: .8rem; line-height: 1.35; }
.topic-row { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; font: inherit; color: var(--text); cursor: pointer; }
.topic-row .ti { font-size: 1.3rem; }
.topic-row small { display: block; color: var(--muted); font-size: .8rem; }
.result { width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 10px; font: inherit; color: var(--text); cursor: pointer; box-shadow: var(--shadow); }
.result b { font-family: var(--serif); font-size: 1.05rem; }
.result .cat { font-size: .72rem; font-weight: 700; color: var(--gold-ink); text-transform: uppercase; letter-spacing: .05em; }
.result p { margin: 4px 0 0; font-size: .88rem; color: var(--muted); }
mark { background: var(--gold-soft); color: var(--text); border-radius: 3px; padding: 0 2px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 18px; }
.pager .btn { flex: 0 0 auto; }
.article h1 { font-family: var(--serif); font-size: 1.8rem; line-height: 1.2; color: var(--purple); margin: 6px 0 4px; }
.article p { margin: 0 0 14px; font-size: 1.02rem; }
.article ul { margin: 0 0 14px; padding-left: 20px; }
.article li { margin-bottom: 6px; }
.article .cat { font-size: .75rem; font-weight: 700; color: var(--gold-ink); text-transform: uppercase; letter-spacing: .05em; }

.toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + var(--tabbar-h) + 16px); transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 99px; font-size: .92rem;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 20; max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--gold-bright); outline-offset: 2px; }

/* Account button (header) */
.account-btn {
  position: relative; border: 1px solid var(--line); background: var(--card); color: var(--text);
  height: 40px; padding: 0 14px; border-radius: 99px; font: inherit; font-size: .85rem; font-weight: 600;
  cursor: pointer; box-shadow: var(--shadow); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px;
}
.account-btn .dot { position: absolute; top: 4px; right: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--gold-bright); box-shadow: 0 0 0 2px var(--card); }
.brand-text { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; line-height: 1.1; }
.brand-name { white-space: nowrap; }
@media (max-width: 350px) { .brand { font-size: 1rem; } }

/* Welcome overlay */
.welcome {
  position: fixed; inset: 0; z-index: 30; overflow-y: auto;
  background: radial-gradient(900px 500px at 50% -120px, var(--bg-glow), transparent 70%), var(--bg);
  padding: calc(env(safe-area-inset-top) + 40px) 22px calc(env(safe-area-inset-bottom) + 30px);
}
.welcome-inner { max-width: 420px; margin: 0 auto; text-align: center; }
.welcome .lotus { font-size: 3.6rem; filter: drop-shadow(0 6px 18px rgba(217,174,54,.45)); }
.welcome h1 { font-family: var(--serif); font-size: 2.2rem; color: var(--purple); margin: 12px 0 6px; }
body.welcome-open { overflow: hidden; }
.btn-signin {
  width: 100%; min-height: 54px; background: var(--card); color: var(--text); border: 1.5px solid var(--line);
  box-shadow: var(--shadow); justify-content: center; font-size: 1rem;
}
.btn-signin small { font-weight: 500; color: var(--muted); font-size: .78rem; margin-left: 4px; }
.btn-signin[disabled] { opacity: .65; cursor: not-allowed; box-shadow: none; }
.g-logo { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 800; font-size: .85rem; color: #fff;
  background: conic-gradient(#ea4335 0 25%, #fbbc05 0 50%, #34a853 0 75%, #4285f4 0); }
.ms-logo { display: inline-grid; grid-template-columns: 9px 9px; gap: 2px; }
.ms-logo i { width: 9px; height: 9px; display: block; }
.ms-logo i:nth-child(1) { background: #f25022; } .ms-logo i:nth-child(2) { background: #7fba00; }
.ms-logo i:nth-child(3) { background: #00a4ef; } .ms-logo i:nth-child(4) { background: #ffb900; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .85rem; margin: 18px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Guest */
.ack { display: flex; gap: 10px; align-items: center; font-weight: 600; padding: 12px 14px; border-radius: 14px; background: var(--gold-soft); border: 1px solid var(--line); cursor: pointer; }
.ack input { width: 22px; height: 22px; accent-color: var(--purple-2); flex: 0 0 auto; }
.guest-warn { background: var(--gold-soft); border: 1px solid var(--gold-bright); border-radius: 16px; padding: 12px 14px; }
.backup-banner { border-color: var(--gold-bright); }

/* Signed-in state & sync */
.signed-card { background: var(--ok-soft); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.sync-ic { font-size: .8rem; font-weight: 700; }
.sync-ok { color: var(--ok); }
.sync-needs-auth, .sync-error { color: var(--danger); }
.sync-offline { color: var(--muted); }
.sync-syncing, .sync-connecting { display: inline-block; animation: spin 1s linear infinite; color: var(--purple); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .sync-syncing, .sync-connecting { animation: none; } }

/* 42-day challenge (seekers) */
.ch-day-title { font-family: var(--serif); font-size: 2.6rem; color: var(--purple); margin: 4px 0 10px; line-height: 1; }
.ch-day-title span { font-size: 1rem; color: var(--muted); font-family: var(--sans); }
.ch-dots { display: flex; justify-content: center; gap: 18px; margin: 6px auto 16px; flex-wrap: wrap; }
.ch-group { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ch-glabel { font-size: .7rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.ch-grid { display: grid; grid-template-columns: repeat(7, 14px); gap: 5px; }
.ch-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--purple-soft); border: 1.5px solid var(--line); box-sizing: border-box; }
.ch-dot.p2 { border-radius: 3px; }
.ch-dot.done { background: var(--gold-bright); border-color: var(--gold-bright); }
.ch-dot.done.p2 { background: var(--purple-2); border-color: var(--purple-2); }
.ch-dot.now { border-color: var(--purple-2); box-shadow: 0 0 0 2px var(--purple-soft); }
.ch-today { background: var(--card-2); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; text-align: left; }
.ch-today b { display: block; }
.ch-today span { font-size: .88rem; color: var(--muted); }
.ch-today.met { background: var(--ok-soft); }
.ch-today.met b { color: var(--ok); }
.ch-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.ch-day { text-align: center; border-radius: 12px; padding: 8px 2px; background: var(--card-2); border: 1px solid var(--line); font-size: .72rem; }
.ch-day b { display: block; font-size: .72rem; }
.ch-day span { display: block; color: var(--muted); }
.ch-day i { font-style: normal; font-weight: 800; }
.ch-day.met i { color: var(--ok); }
.ch-day.miss i { color: var(--danger); }
.ch-phases { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ch-phases div { background: var(--card-2); border: 1px solid var(--line); border-radius: 16px; padding: 12px; }
.ch-phases b { display: block; font-family: var(--serif); color: var(--purple); }
.ch-phases span { display: block; font-size: .8rem; color: var(--muted); }
.ch-phases em { font-style: normal; font-weight: 600; color: var(--gold-ink); }
details.ch-rules summary, details.rw-more summary { cursor: pointer; font-weight: 600; color: var(--purple); padding: 6px 0; }
details.ch-rules ul { padding-left: 18px; margin: 6px 0 0; }
details.ch-rules li { margin-bottom: 6px; }

/* Points & rewards */
.points-line { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 12px 14px; margin-bottom: 16px; box-shadow: var(--shadow); font-size: .95rem; }
.points-line b { font-family: var(--serif); font-size: 1.2rem; color: var(--purple); }
.pl-ic { font-size: 1.2rem; }
.pl-lvl { background: var(--gold-soft); color: var(--gold-ink); border-radius: 99px; padding: 2px 10px; font-size: .78rem; font-weight: 700; }
.pl-next { margin-left: auto; color: var(--muted); font-size: .8rem; white-space: nowrap; }
.rw-total b { font-family: var(--serif); font-size: 2.2rem; color: var(--purple); }
.rw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 14px; }
.rw { border: 1px solid var(--line); background: var(--card-2); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 2px; opacity: .75; }
.rw.earned { opacity: 1; background: linear-gradient(135deg, var(--gold-soft), var(--purple-soft)); border-color: var(--gold-bright); }
.rw-ic { font-size: 1.4rem; }
.rw b { font-size: .88rem; }
.rw small { font-size: .74rem; color: var(--muted); }
.profile-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--card-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }

/* Calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-head b { font-family: var(--serif); font-size: 1.2rem; }
.cal-nav { width: 40px; height: 40px; box-shadow: none; font-size: 1.3rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal-wd { font-size: .72rem; font-weight: 700; color: var(--muted); padding: 4px 0; }
.cal-day { aspect-ratio: 1; border: 0; border-radius: 12px; background: transparent; color: var(--text); font: inherit; font-size: .9rem; cursor: pointer; position: relative; }
.cal-day.some { background: var(--purple-soft); }
.cal-day.met { background: var(--gold-bright); color: #2b2b2b; font-weight: 700; }
.cal-day.future { color: var(--muted); }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--purple-2); }
.cal-day.sel { outline: 3px solid var(--purple-2); outline-offset: 1px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; }
.cal-legend .lg { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 6px; vertical-align: -2px; }
.lg.met { background: var(--gold-bright); } .lg.some { background: var(--purple-soft); border: 1px solid var(--line); }
.ag-row, .sch-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.sch-row { width: 100%; background: none; border-left: 0; border-right: 0; border-bottom: 0; font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.sch-row.off { opacity: .55; }
.ag-time { min-width: 70px; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--purple); font-size: .9rem; }
.ag-main { flex: 1; min-width: 0; }
.ag-main b { display: block; }
.ag-main small { color: var(--muted); font-size: .8rem; }
.ag-st { font-size: .75rem; font-weight: 700; border-radius: 99px; padding: 3px 10px; white-space: nowrap; }
.ag-st.ok { background: var(--ok-soft); color: var(--ok); }
.ag-st.miss { background: var(--purple-soft); color: var(--muted); }
.ag-st.now { background: var(--gold-soft); color: var(--gold-ink); }
.ag-st.up { background: var(--card-2); color: var(--muted); border: 1px solid var(--line); }
.chip.preset { border-style: dashed; }
.text-input { width: 100%; font: inherit; font-size: 1rem; color: var(--text); background: var(--card-2); border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px; min-height: 52px; outline: none; }
.text-input:focus { border-color: var(--purple-2); box-shadow: 0 0 0 4px var(--purple-soft); }
.next-sit { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 12px; font-size: .9rem; color: var(--text); text-decoration: none; }
.next-sit.now { justify-content: space-between; background: var(--gold-soft); border-radius: 14px; padding: 8px 10px 8px 14px; text-align: left; }
.next-sit .btn { flex: 0 0 auto; }
@media (max-width: 400px) { .tab { font-size: .64rem; } .tab .ic { width: 44px; } }

/* SOS events */
.ev-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); text-decoration: none; color: var(--text); }
.ev-date { width: 48px; height: 52px; border-radius: 12px; background: var(--purple-soft); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: .7rem; text-transform: uppercase; color: var(--purple); font-weight: 700; flex: 0 0 auto; }
.ev-date b { font-family: var(--serif); font-size: 1.3rem; line-height: 1; }
.ev-link { text-decoration: none; color: var(--text); }
.cal-day.ev::after { content: ""; position: absolute; left: 50%; bottom: 4px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--purple-2); }
.cal-day.met.ev::after { background: #2b2b2b; }
.lg.ev { background: var(--purple-2); border-radius: 50%; }
.ev-format { font-size: .75rem; font-weight: 700; color: var(--gold-ink); text-transform: uppercase; letter-spacing: .04em; }
.ev-title { font-family: var(--serif); font-size: 1.7rem; line-height: 1.2; color: var(--purple); margin: 6px 0 6px; }
.ev-when { margin: 0; font-weight: 600; }
.rsvp-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rsvp-seg button { min-height: 48px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card-2); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.rsvp-seg button.on { background: var(--purple-2); border-color: var(--purple-2); color: #fff; }
.ck-row { display: flex; gap: 10px; }
.ck-row input { flex: 1; min-width: 0; font: inherit; font-size: 1.6rem; letter-spacing: .4em; text-align: center; color: var(--text); background: var(--card-2); border: 2px solid var(--line); border-radius: 16px; padding: 10px; min-height: 56px; }
.ck-row .btn { flex: 0 0 auto; }
.ck-done { background: var(--ok-soft); color: var(--ok); font-weight: 700; }
.admin-card { border: 2px dashed var(--gold-bright); }
.door { text-align: center; padding: 8px 0 4px; }
.door-code { font-family: var(--serif); font-size: 3.4rem; font-weight: 700; letter-spacing: .25em; color: var(--purple); line-height: 1.1; }
.door-qr { width: 220px; max-width: 70%; margin: 10px auto; background: #fff; padding: 8px; border-radius: 12px; }
.door-qr svg { width: 100%; height: auto; display: block; }
.ad-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }

/* ---- Events v0.11: repeats, cancelled, contact, center check-in ---- */
.notice { background: var(--card-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; line-height: 1.45; }
.ack.soft { background: transparent; font-weight: 400; align-items: flex-start; padding: 4px 2px; border: 0; font-size: .9rem; }
.ack.soft input { margin-top: 2px; }
.ef-dates { max-height: 168px; overflow-y: auto; }
.ef-dates .chip { font-size: .8rem; padding: 6px 10px; }
.ef-dates .chip:not(.on) { text-decoration: line-through; opacity: .55; }
.cal-day.evx::after { content: ""; position: absolute; left: 50%; bottom: 4px; width: 6px; height: 6px; margin-left: -4px; border-radius: 50%; border: 1.5px solid var(--muted); }
.lg.evx { border: 1.5px solid var(--muted); border-radius: 50%; background: transparent; }
.cx b { text-decoration: line-through; color: var(--muted); }
.ev-repeat { display: inline-block; margin-left: 6px; color: var(--muted); font-weight: 600; }
.ck-big { text-align: center; padding: 28px 18px; }
.ck-big .ck-icon { font-size: 3rem; line-height: 1; }
.ck-big h1 { font-family: var(--serif, Georgia, serif); color: var(--purple); margin: 12px 0 6px; font-size: 1.6rem; }
.ck-choose { display: grid; gap: 10px; margin-top: 14px; }

/* ---- Events v0.12: access badges, flyers, featured video, messages, people ---- */
.badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--line); color: var(--muted); vertical-align: middle; white-space: nowrap; }
.badge.satsang { color: var(--purple); border-color: var(--purple); background: transparent; }
.badge.initiates { color: #8a5a00; border-color: #c9a227; background: transparent; }
.ev-thumb { width: 44px; height: 56px; object-fit: cover; border-radius: 8px; flex: 0 0 auto; margin-right: 10px; background: var(--card-2); }
.ev-row .ev-date { flex: 0 0 auto; }
.flyer { display: block; width: 100%; border-radius: 14px; margin: 0 0 12px; max-height: 70vh; object-fit: contain; background: var(--card-2); }
.flyer-prev { margin-top: 8px; }
.flyer-prev img { display: block; max-width: 160px; max-height: 200px; border-radius: 10px; border: 1px solid var(--line); margin-bottom: 4px; }
.featured { display: flex; gap: 12px; align-items: center; text-decoration: none; color: inherit; margin-bottom: 16px; }
.featured img { width: 128px; height: 72px; object-fit: cover; border-radius: 10px; flex: 0 0 auto; background: #000; }
.featured .ft-site { display: flex; width: 128px; height: 72px; align-items: center; justify-content: center; font-size: 2rem; background: var(--purple-soft); border-radius: 10px; }
.featured .ft-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.6rem; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.featured .ft-img { position: relative; flex: 0 0 auto; }
.featured b { display: block; line-height: 1.25; }
.featured small { color: var(--muted); display: block; margin-top: 2px; }
.social-row { display: flex; gap: 10px; align-items: center; margin: 0 0 10px; }
.like-btn { border: 1px solid var(--line); background: var(--card-2); border-radius: 999px; padding: 6px 14px; font: inherit; cursor: pointer; color: inherit; }
.like-btn.on { background: var(--purple); color: #fff; border-color: var(--purple); }
.msg { padding: 10px 0; border-top: 1px solid var(--line); }
.msg:first-child { border-top: 0; }
.msg .msg-head { display: flex; justify-content: space-between; gap: 8px; font-size: .8rem; color: var(--muted); }
.msg .msg-body { white-space: pre-wrap; margin: 4px 0 0; overflow-wrap: anywhere; }
.msg-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: start; margin-bottom: 8px; }
.msg-form textarea { min-height: 44px; }
.msg-count { font-size: .75rem; color: var(--muted); text-align: right; margin: -4px 0 8px; }
.pp-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.pp-row:first-child { border-top: 0; }
.pp-row .ag-main { flex: 1 1 160px; }
.pp-row select { width: auto; padding: 6px 28px 6px 10px; font-size: .85rem; }
.pp-row.blocked .ag-main b { text-decoration: line-through; color: var(--muted); }

/* ---- v0.13: presence, buddies, challenges ---- */
.presence { padding: 12px 16px; margin-bottom: 16px; }
.pr-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--line); margin-right: 6px; vertical-align: middle; }
.pr-dot.on { background: #2e9e5b; } .pr-dot.med { background: var(--purple); box-shadow: 0 0 0 3px rgba(4,58,91,.18); }
.bd-row { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.bd-row:first-of-type { border-top: 0; }
.bd-row .ag-main { flex: 1 1 auto; }
.goal { padding: 12px 0; border-top: 1px solid var(--line); }
.goal:first-of-type { border-top: 0; }
.goal-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.goal-head b { font-size: 1rem; }
.goal-meta { font-size: .8rem; color: var(--muted); margin: 2px 0 6px; }
.goal .bar { height: 8px; background: var(--card-2); border-radius: 999px; overflow: hidden; }
.goal .bar .fill { height: 100%; background: var(--purple); border-radius: 999px; transition: width .4s ease; }
.goal .bar .fill.ok { background: #2e9e5b; } .goal .bar .fill.bad { background: #b23b3b; }
.goal-foot { display: flex; justify-content: space-between; align-items: center; font-size: .8rem; color: var(--muted); margin-top: 6px; }
.goal-done { opacity: .85; }
.gtype { display: grid; gap: 8px; }
.gtype button { text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card-2); font: inherit; color: inherit; cursor: pointer; }
.gtype button.on { border-color: var(--purple); background: transparent; box-shadow: inset 0 0 0 1px var(--purple); }
.gtype small { display: block; color: var(--muted); margin-top: 2px; }

/* v0.14: Featured today as the visual centrepiece of Today */
#featured .featured { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px; }
#featured .featured .ft-img { width: 100%; }
#featured .featured img, #featured .featured .ft-site { width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 14px; }
#featured .featured .ft-play { font-size: 2.6rem; }
#featured .featured b { font-family: var(--serif); font-size: 1.15rem; }

/* ===================== v0.15: Today, points, admin ===================== */
/* Header: points always visible (tap opens Rewards) */
header.top { position: relative; }
.top-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.points-pill {
  display: inline-flex; align-items: center; gap: 4px; height: 40px; padding: 0 12px; border-radius: 99px; text-decoration: none;
  background: var(--gold-soft); border: 1px solid var(--gold-bright); color: var(--gold-ink); font-weight: 700; font-size: .9rem; white-space: nowrap;
  box-shadow: var(--shadow);
}
.points-pill b { font-family: var(--serif); font-size: 1rem; color: var(--text); }
.points-pill .pp-lvl { display: none; font-size: .72rem; font-weight: 700; margin-left: 4px; text-transform: uppercase; letter-spacing: .04em; }
html.mc-desktop .points-pill .pp-lvl { display: inline; }
@media (max-width: 420px) {
  header.top .account-btn { max-width: 104px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .top-actions { gap: 6px; }
  .points-pill { padding: 0 10px; }
}
#rewardsCard.flash { animation: flash 1.6s ease; }
@keyframes flash { 0%, 100% { box-shadow: var(--shadow); } 30% { box-shadow: 0 0 0 4px var(--gold-bright), var(--shadow); } }

/* Who's here (counts only) */
.pr-row { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: .86rem; }
.pr-item b { font-family: var(--serif); font-size: 1.05rem; color: var(--purple); margin-right: 2px; }
.pr-note { flex-basis: 100%; font-size: .78rem; color: var(--muted); }

/* Today's plan inside the Today card */
.today-plan { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.today-plan .log-day:first-child { margin-top: 0; }

/* Upcoming events and hero article on Today */
.home-sec { margin: 6px 2px 10px; }
.home-sec .link { font-family: var(--sans); font-size: .85rem; }
.hero-ev, .hero-art { display: flex; flex-direction: column; padding: 0; overflow: hidden; text-decoration: none; color: var(--text); }
.hero-ev .he-img, .hero-art .ha-img { display: block; background: linear-gradient(135deg, var(--purple-soft), var(--gold-soft)); aspect-ratio: 16 / 9; overflow: hidden; }
.hero-ev .he-img img, .hero-art .ha-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.he-ph { display: grid !important; place-items: center; font-size: 3.2rem; }
.he-body, .ha-body { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px 18px; }
.he-kicker { font-size: .74rem; font-weight: 700; color: var(--gold-ink); text-transform: uppercase; letter-spacing: .06em; }
.he-title { font-family: var(--serif); font-size: 1.3rem; line-height: 1.25; color: var(--purple); }
.he-when { font-weight: 600; font-size: .92rem; }
.he-meta, .he-desc { font-size: .85rem; color: var(--muted); }
.he-cta { margin-top: 8px; }
.ev-next { padding-top: 6px; padding-bottom: 6px; }
.ev-next .ev-row:first-child { border-top: 0; }
.home-more { margin: -4px 0 18px; }

/* Timer: "Meditation in Progress" */
.mip {
  font-family: var(--serif); font-weight: 600; text-align: center; color: var(--purple); margin: 6px 0 14px;
  font-size: clamp(1.7rem, 7vw, 2.6rem); line-height: 1.15; letter-spacing: .01em;
}
.mip::after { content: ""; display: block; width: 72px; height: 3px; margin: 12px auto 0; border-radius: 3px; background: linear-gradient(90deg, var(--gold), var(--gold-bright)); }
body.focus .wrap > footer { display: none; }
html.mc-desktop body.focus .wrap > footer { display: block; }

/* Admin */
.adm-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 12px; }
.adm-who { flex-basis: 100%; }
.role-badge { text-transform: capitalize; background: var(--purple-soft); color: var(--purple); border-color: transparent; }
.demo-badge { background: var(--gold-soft); color: var(--gold-ink); border-color: var(--gold-bright); }
.adm-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 10px; margin-bottom: 6px; scrollbar-width: thin; }
.adm-tabs button { flex: 0 0 auto; font: inherit; font-size: .86rem; font-weight: 600; padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; }
.adm-tabs button.on { background: var(--purple); border-color: var(--purple); color: var(--card); }
.adm-grid { display: grid; grid-template-columns: 1fr; gap: 0 16px; align-items: start; }
.adm-gate { text-align: center; }
.adm-ev { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--line); }
.adm-ev.cx .adm-ev-main b { text-decoration: line-through; color: var(--muted); }
.adm-ev-main { display: flex; flex-direction: column; min-width: 0; flex: 1 1 260px; }
.adm-ev-main small { color: var(--muted); }
.adm-ev-act { display: flex; flex-wrap: wrap; gap: 6px; }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .86rem; }
.tbl th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl a { color: var(--purple); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 14px; font-size: .9rem; align-items: center; }
.kv > span:nth-child(odd) { color: var(--muted); font-size: .8rem; }
.kv a { color: var(--purple); overflow-wrap: anywhere; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 90px; padding: 0 2px; }
.bars .bar { flex: 1; background: linear-gradient(180deg, var(--gold-bright), var(--gold)); border-radius: 6px 6px 2px 2px; position: relative; min-height: 4px; }
.bars .bar i { position: absolute; top: -18px; left: 0; right: 0; text-align: center; font-style: normal; font-size: .72rem; color: var(--muted); }
.bars-x { display: flex; justify-content: space-between; margin-top: 4px; }
.radio-list { display: flex; flex-direction: column; gap: 6px; }
.radio-list label { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; background: var(--card); }
.radio-list label:has(input:checked) { border-color: var(--purple-2); background: var(--purple-soft); }
.radio-list span { display: flex; flex-direction: column; }
.radio-list small { color: var(--muted); }
.ha-mini { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--card-2); }
.ha-mini img { width: 96px; height: 64px; object-fit: cover; border-radius: 10px; }
.ha-mini span { display: flex; flex-direction: column; }
.hero-toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; margin: 0 0 12px; border-radius: 14px; background: var(--gold-soft); border: 1px solid var(--line); }
.ad-filter { margin: 0 0 10px; }
.person-row { text-decoration: none; color: var(--text); }
.adm-sheet textarea { width: 100%; font: inherit; }
.wa-preview { background: #e7ddd3; border-radius: 14px; padding: 12px; }
.wa-bubble { background: #dcf8c6; color: #1f2c34; border-radius: 10px 10px 10px 2px; padding: 10px 12px; font-size: .86rem; max-width: 92%; box-shadow: 0 1px 1px rgba(0,0,0,.12); }
.welcome-links a { color: var(--purple); }
.today-plan { text-align: left; }
.he-ph { aspect-ratio: 5 / 2 !important; font-size: 2.6rem; }
html.mc-desktop .hero-ev .he-ph { aspect-ratio: auto !important; }
.adm-ev-main > .ag-st { align-self: flex-start; margin: 3px 0 2px; }
.kv select { width: auto; min-height: 0; padding: 6px 30px 6px 10px; font-size: .9rem; border-radius: 10px; }
.hero-toggle .btn { flex: 0 0 auto; }

/* v0.16: link card to the center events site (sosmn.org) */
.center-link { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--text); }
.center-link .cl-ic { font-size: 1.6rem; flex: 0 0 auto; }
.center-link .cl-body { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.center-link .cl-body small { color: var(--muted); font-size: .84rem; line-height: 1.4; margin-top: 2px; }
.center-link .cl-go { flex: 0 0 auto; font-weight: 700; color: var(--purple, #3b2466); font-size: .9rem; white-space: nowrap; }
