/* Streako redesign layer (2026-11): dark athletic theme, workout session UI,
   motion. Loaded after styles.css, so it overrides it. */

:root { --nav-bg: rgba(255,255,255,0.92); --ease-out: cubic-bezier(.2,.9,.3,1); --ease-spring: cubic-bezier(.34,1.56,.64,1); }

:root[data-theme="dark"] {
  --bg: #0a0a0b;
  --surface: #151517;
  --surface-2: #1d1d20;
  --surface-3: #2a2a2f;
  --border: #242428;
  --border-strong: #33333a;
  --text: #f7f6f3;
  --text-mid: #a6a5ab;
  --text-dim: #6c6b73;
  --accent: #3d8bff;
  --accent-dim: #1e3a6e;
  --accent-soft: rgba(61,139,255,0.14);
  --success: #2fd08a;
  --success-soft: rgba(47,208,138,0.13);
  --nav-bg: rgba(12,12,13,0.88);
  color-scheme: dark;
}
:root[data-theme="dark"] .card { box-shadow: none; border: 1px solid var(--border); }
:root[data-theme="dark"] .ex-row { box-shadow: none; }
:root[data-theme="dark"] .btn-ghost { background: var(--surface-2); border-color: var(--border-strong); }
:root[data-theme="dark"] .hero-band { background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%); box-shadow: 0 10px 30px rgba(37,99,235,0.25); }
:root[data-theme="dark"] .stat-card { background: var(--surface-2); }
:root[data-theme="dark"] #coachNudgeCard { background: var(--surface-2) !important; border: 1px solid var(--border); }
:root[data-theme="dark"] .fuel-macro-bar { background: rgba(255,255,255,0.1); }

/* Bottom nav: was hard-coded white, so it stayed white in dark mode */
#bottomNav { background: var(--nav-bg) !important; backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%); }
.tab-btn { font-size: 10px; letter-spacing: 0.02em; text-transform: none; font-weight: 600; position: relative; }
.tab-btn .tab-icon { font-size: 20px; transition: transform .25s var(--ease-spring), color .15s; }
.tab-btn.active .tab-icon { transform: translateY(-2px) scale(1.08); }
.tab-btn.active::after { content: ""; position: absolute; top: -8px; left: 50%; width: 22px; height: 3px; margin-left: -11px; border-radius: 0 0 3px 3px; background: var(--accent); animation: tabbar .3s var(--ease-out); }
@keyframes tabbar { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.ss-gear { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-mid); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.ss-gear:active { transform: scale(.92); }

/* ---------- motion ---------- */
.btn-primary, .btn-ghost, .btn-outline-accent, .filter-btn, .theme-opt, .btn-icon, .ss-prog, .ss-start, .ss-plus { transition: transform .18s var(--ease-spring), filter .15s, background .15s, border-color .15s; }
.btn-primary:active, .btn-ghost:active, .btn-outline-accent:active, .filter-btn:active, .theme-opt:active, .btn-icon:active, .ss-prog:active, .ss-start:active { transform: scale(0.96); }

.view.active > * { animation: rise .42s var(--ease-out) both; }
.view.active > *:nth-child(2) { animation-delay: .04s; }
.view.active > *:nth-child(3) { animation-delay: .08s; }
.view.active > *:nth-child(4) { animation-delay: .12s; }
.view.active > *:nth-child(5) { animation-delay: .16s; }
.view.active > *:nth-child(n+6) { animation-delay: .2s; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.modal-bg.active { animation: fadeIn .22s ease both; }
.modal-bg.active > .modal { animation: sheetUp .38s var(--ease-out) both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetUp { from { transform: translateY(60px); opacity: .4; } to { transform: none; opacity: 1; } }
.modal { padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
.modal::before { content: ""; display: block; width: 38px; height: 5px; border-radius: 3px; background: var(--border-strong); margin: -10px auto 14px; }
@media (min-width: 600px) { .modal::before { display: none; } }

#toast { z-index: 95 !important; bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important; }
.toast { animation: toastIn .4s var(--ease-spring); }

.streak-circle.hit { animation: pop .45s var(--ease-spring) both; }
.streak-circle.hit:nth-child(2) { animation-delay: .05s; } .streak-circle.hit:nth-child(3) { animation-delay: .1s; }
.streak-circle.hit:nth-child(4) { animation-delay: .15s; } .streak-circle.hit:nth-child(5) { animation-delay: .2s; }
.streak-circle.hit:nth-child(6) { animation-delay: .25s; } .streak-circle.hit:nth-child(7) { animation-delay: .3s; }
@keyframes pop { 0% { transform: scale(.4); } 70% { transform: scale(1.18); } 100% { transform: scale(1); } }
.ring-fg { transition: stroke-dashoffset 1.1s var(--ease-out); }
.cal-day { transition: transform .2s var(--ease-spring), background .2s; }
.cal-day:active { transform: scale(.9); }

/* ---------- exercise tiles ---------- */
.ss-tile { flex-shrink: 0; border-radius: 13px; display: flex; align-items: center; justify-content: center; color: var(--tc); background: color-mix(in srgb, var(--tc) 15%, transparent); font-size: 17px; }
.ss-plus { width: 36px; height: 36px; border-radius: 11px; border: none; background: var(--accent-soft); color: var(--accent); cursor: pointer; flex-shrink: 0; }
.ss-plus:active { transform: scale(.88); }

/* ---------- workout hub ---------- */
.ss-start { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 18px; border-radius: 18px; border: none; cursor: pointer; font: inherit; font-weight: 800; font-size: 16px; color: #fff; background: linear-gradient(135deg, var(--accent), #06b6d4); box-shadow: 0 10px 28px rgba(37,99,235,.3); }
.ss-resume { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-radius: 18px; color: #fff; background: linear-gradient(135deg, var(--accent), #06b6d4); cursor: pointer; animation: glow 2.4s ease-in-out infinite; }
.ss-resume-btn { background: rgba(255,255,255,.22); padding: 9px 14px; border-radius: 11px; font-weight: 700; font-size: 13px; }
@keyframes glow { 0%,100% { box-shadow: 0 8px 24px rgba(37,99,235,.25); } 50% { box-shadow: 0 8px 34px rgba(37,99,235,.5); } }
.ss-progs { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; }
.ss-progs::-webkit-scrollbar { display: none; }
.ss-prog { scroll-snap-align: start; flex: 0 0 72%; max-width: 260px; text-align: left; display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 18px; border: 1px solid var(--border); background: linear-gradient(160deg, color-mix(in srgb, var(--pc) 22%, var(--surface)) 0%, var(--surface) 70%); color: var(--text); font: inherit; cursor: pointer; min-height: 150px; }
.ss-prog-tag { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--pc); }
.ss-prog-name { font-family: 'Archivo', sans-serif; font-weight: 800; font-size: 20px; letter-spacing: -.02em; line-height: 1.1; }
.ss-prog-desc { font-size: 12px; color: var(--text-mid); flex: 1; }
.ss-prog-foot { font-size: 12px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.ss-recent, .ss-routine { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.ss-routine { display: block; background: var(--surface-2); }

/* ---------- live session screen ---------- */
body.ss-lock { overflow: hidden; }
.ss-screen { position: fixed; inset: 0; z-index: 70; background: var(--bg); display: flex; flex-direction: column; transform: translateY(100%); visibility: hidden; transition: transform .42s var(--ease-out), visibility 0s .42s; padding-top: env(safe-area-inset-top, 0px); }
.ss-screen.open { transform: none; visibility: visible; transition: transform .42s var(--ease-out); }
.ss-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.ss-head-mid { flex: 1; min-width: 0; }
.ss-name { background: transparent !important; border: none !important; padding: 2px 0 !important; font-family: 'Archivo', sans-serif; font-weight: 800; font-size: 18px; color: var(--text); }
.ss-clock { font-size: 12px; color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }
.ss-iconbtn { width: 40px; height: 40px; border-radius: 12px; border: none; background: var(--surface-2); color: var(--text); cursor: pointer; flex-shrink: 0; }
.ss-iconbtn.sm { width: 34px; height: 34px; background: transparent; color: var(--text-dim); }
.ss-finish { border: none; background: var(--success); color: #fff; font: inherit; font-weight: 800; padding: 10px 18px; border-radius: 12px; cursor: pointer; }
.ss-finish:active { transform: scale(.95); }
.ss-stats { display: grid; grid-template-columns: repeat(3, 1fr); padding: 10px 16px; gap: 8px; border-bottom: 1px solid var(--border); }
.ss-stat { font-family: 'Archivo', sans-serif; font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }
.ss-body { flex: 1; overflow-y: auto; padding: 14px 14px 0; -webkit-overflow-scrolling: touch; max-width: 720px; width: 100%; margin: 0 auto; }
.ss-ex { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 14px 12px 8px; margin-bottom: 12px; animation: rise .35s var(--ease-out) both; }
.ss-ex-head { display: flex; align-items: center; gap: 11px; margin-bottom: 10px; }
.ss-ex-name { font-weight: 800; font-size: 16px; color: var(--accent); }
.ss-row { display: grid; grid-template-columns: 34px 1fr 64px 56px 40px; gap: 6px; align-items: center; padding: 5px 4px; border-radius: 10px; transition: background .25s; }
.ss-row.ss-bw { grid-template-columns: 34px 1fr 72px 40px; }
.ss-row.ss-cardio { grid-template-columns: 34px 1fr 72px 40px; }
.ss-row-h span { font-size: 10px; font-weight: 700; letter-spacing: .08em; color: var(--text-dim); text-align: center; }
.ss-row-h span:nth-child(2) { text-align: left; }
.ss-row input { padding: 8px 4px; text-align: center; font-size: 15px; font-weight: 700; border-radius: 9px; background: var(--surface-2); border-color: transparent; }
.ss-row input::placeholder { color: var(--text-dim); font-weight: 600; }
.ss-setno { border: none; background: var(--surface-2); color: var(--text-mid); font-weight: 800; border-radius: 9px; height: 34px; cursor: pointer; font-family: 'Archivo', sans-serif; }
.ss-prev { font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-check { position: relative; height: 34px; border-radius: 9px; border: none; background: var(--surface-3); color: var(--text-dim); cursor: pointer; transition: background .2s, color .2s, transform .25s var(--ease-spring); }
.ss-row.done { background: var(--success-soft); }
.ss-row.done input { background: transparent; }
.ss-row.done .ss-check { background: var(--success); color: #fff; }
.ss-row.ss-pop .ss-check { animation: pop .4s var(--ease-spring); }
.ss-pr { position: absolute; top: -8px; right: -8px; background: #ffb020; color: #1a1a1a; font-size: 9px; font-weight: 900; padding: 2px 5px; border-radius: 6px; animation: pop .5s var(--ease-spring) both; }
.ss-addset { width: 100%; margin-top: 6px; padding: 10px; border: none; border-radius: 10px; background: var(--surface-2); color: var(--text-mid); font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; }
.ss-addset:active { transform: scale(.98); }
.ss-discard { width: 100%; margin-top: 10px; padding: 12px; border: none; background: transparent; color: var(--danger); font: inherit; font-weight: 700; cursor: pointer; }
.ss-empty { text-align: center; padding: 48px 16px 24px; color: var(--text-mid); }
.ss-empty i { font-size: 40px; color: var(--accent); opacity: .8; }

.ss-rest { position: absolute; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); max-width: 696px; margin: 0 auto; display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 18px; background: #111; color: #fff; overflow: hidden; box-shadow: 0 12px 34px rgba(0,0,0,.4); animation: sheetUp .35s var(--ease-out); }
:root[data-theme="dark"] .ss-rest { background: #232327; }
.ss-rest-fill { position: absolute; inset: 0; background: linear-gradient(90deg, var(--accent), #06b6d4); opacity: .35; transform-origin: left; transition: transform .25s linear; }
.ss-rest > *:not(.ss-rest-fill) { position: relative; }
.ss-rest-mid { flex: 1; text-align: center; }
.ss-rest-time { font-family: 'Archivo', sans-serif; font-weight: 800; font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }
.ss-rest-btn { border: none; background: rgba(255,255,255,.14); color: #fff; font: inherit; font-weight: 700; padding: 10px 12px; border-radius: 11px; cursor: pointer; }
.ss-rest-skip { background: #fff; color: #111; }

.ss-z2 { z-index: 80; }
#ssPickCats { flex-shrink: 0; }
#ssPickCats .filter-btn, .ss-progs > * { flex-shrink: 0; }
.ss-picker { display: flex; flex-direction: column; max-height: 88vh; }
.ss-pick-list { overflow-y: auto; flex: 1; min-height: 200px; margin: 0 -4px; padding: 0 4px; }
.ss-pick { display: flex; align-items: center; gap: 11px; padding: 9px 8px; border-radius: 12px; cursor: pointer; transition: background .15s; }
.ss-pick.on { background: var(--accent-soft); }
.ss-pick-check { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border-strong); display: flex; align-items: center; justify-content: center; color: transparent; font-size: 12px; transition: all .2s var(--ease-spring); }
.ss-pick.on .ss-pick-check { background: var(--accent); border-color: var(--accent); color: #fff; transform: scale(1.1); }

.ss-mini { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 41; display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 999px; border: none; color: #fff; font: inherit; font-weight: 700; font-size: 13px; background: linear-gradient(135deg, var(--accent), #06b6d4); box-shadow: 0 10px 26px rgba(37,99,235,.4); cursor: pointer; animation: sheetUp .35s var(--ease-out); white-space: nowrap; }
.ss-mini-dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: pulse 1.4s infinite; }
.ss-mini-time { font-variant-numeric: tabular-nums; opacity: .9; }

.ss-trophy { width: 76px; height: 76px; margin: 0 auto; border-radius: 24px; display: flex; align-items: center; justify-content: center; font-size: 34px; color: #fff; background: linear-gradient(135deg, #ffb020, var(--accent)); box-shadow: 0 12px 30px rgba(255,140,40,.4); animation: trophy .7s var(--ease-spring) both; }
@keyframes trophy { 0% { transform: scale(.2) rotate(-25deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
.ss-prbox { background: rgba(255,176,32,.12); border: 1px solid rgba(255,176,32,.35); border-radius: 14px; padding: 12px 14px; }
.ss-sumrow { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--border); }
.ss-spark { width: 100%; height: 110px; display: block; }
.ss-spark-line { stroke-dasharray: 1000; stroke-dashoffset: 1000; animation: draw 1.2s var(--ease-out) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.ss-confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 100; }
.ss-spark-dot { position: fixed; width: 7px; height: 7px; margin: -3.5px; border-radius: 50%; background: #ffb020; z-index: 100; pointer-events: none; animation: sparkfly .6s ease-out forwards; }
@keyframes sparkfly { to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ================= SOCIAL FEED ================= */
.so-plain { background: none; border: none; padding: 0; cursor: pointer; color: inherit; }
.so-av { border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; color: #fff; font-weight: 800; font-family: 'Archivo', sans-serif;
  background: linear-gradient(135deg, var(--ac), color-mix(in srgb, var(--ac) 55%, #000)); }
.so-av img { width: 100%; height: 100%; object-fit: cover; }
.so-av.ring { box-shadow: 0 0 0 2.5px var(--bg), 0 0 0 4.5px var(--accent); }
.so-demo { display: inline-block; vertical-align: middle; font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 2px 6px; border-radius: 6px; background: var(--surface-3); color: var(--text-mid); margin-left: 4px; font-family: 'Inter', sans-serif; }
.so-newbtn { border: none; background: var(--accent); color: #fff; font: inherit; font-weight: 800; font-size: 14px; padding: 0 16px; height: 40px; border-radius: 12px; cursor: pointer; box-shadow: 0 6px 18px rgba(37,99,235,.3); }
.so-newbtn:active { transform: scale(.95); }

.so-stories { display: flex; gap: 14px; overflow-x: auto; margin: 0 -16px 14px; padding: 6px 16px 4px; scrollbar-width: none; }
.so-stories::-webkit-scrollbar { display: none; }
.so-story { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: none; cursor: pointer; color: var(--text); flex-shrink: 0; animation: rise .4s var(--ease-out) both; }
.so-story:active .so-av { transform: scale(.92); }
.so-story .so-av { transition: transform .2s var(--ease-spring); }
.so-story-name { font-size: 11px; font-weight: 600; color: var(--text-mid); max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.so-story-add { position: absolute; top: 40px; right: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 10px; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 3px var(--bg); }

.so-tabs { position: relative; display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border-radius: 12px; padding: 4px; }
.so-tabs button { position: relative; z-index: 1; border: none; background: none; font: inherit; font-weight: 700; font-size: 14px; padding: 9px; color: var(--text-mid); cursor: pointer; transition: color .2s; }
.so-tabs button.active { color: var(--text); }
.so-tab-ind { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 9px; background: var(--surface); box-shadow: 0 2px 8px rgba(0,0,0,.15); transition: transform .3s var(--ease-out); }
:root[data-theme="dark"] .so-tab-ind { background: var(--surface-3); }
.so-tabs[data-active="discover"] .so-tab-ind { transform: translateX(100%); }

.so-post { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 14px; margin-bottom: 12px; animation: rise .4s var(--ease-out) both; }
.so-post-head { display: flex; align-items: center; gap: 11px; }
.so-name { font-weight: 800; font-size: 15px; }
.so-more { color: var(--text-dim); width: 34px; height: 34px; }
.so-follow-sm { border: 1.5px solid var(--accent); background: transparent; color: var(--accent); font: inherit; font-weight: 800; font-size: 12px; padding: 6px 14px; border-radius: 999px; cursor: pointer; transition: all .2s var(--ease-spring); flex-shrink: 0; }
.so-follow-sm.on { background: var(--accent); color: #fff; }
.so-follow-sm:active { transform: scale(.92); }
.so-text { margin: 12px 2px 0; font-size: 15px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.so-img { position: relative; margin-top: 12px; border-radius: 14px; overflow: hidden; background: var(--surface-2); }
.so-img img { width: 100%; display: block; max-height: 520px; object-fit: cover; }
.so-img-x { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 50%; border: none; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; }
.so-wk { position: relative; overflow: hidden; margin-top: 12px; padding: 14px; border-radius: 14px; background: linear-gradient(150deg, var(--accent-soft), var(--surface-2) 60%); border: 1px solid var(--border); }
.so-wk-name { font-weight: 800; font-size: 15px; color: var(--accent); }
.so-wk-name i { margin-right: 4px; }
.so-wk-stats { display: flex; gap: 22px; margin-bottom: 10px; }
.so-wk-stats p:last-child { font-family: 'Archivo', sans-serif; font-weight: 800; font-size: 19px; margin-top: 2px; }
.so-wk-line { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 6px 0; border-top: 1px solid var(--border); }
.so-wk-line span:last-child { color: var(--text-mid); white-space: nowrap; }
.so-prchip { font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; background: rgba(255,176,32,.16); color: #ffb020; }
.so-bigheart { position: absolute; left: 50%; top: 50%; font-size: 80px; color: #fff; filter: drop-shadow(0 6px 20px rgba(255,45,85,.6)); transform: translate(-50%,-50%) scale(0); opacity: 0; pointer-events: none; }
.so-bigheart.pop { animation: bigheart .8s var(--ease-spring); }
@keyframes bigheart { 0% { transform: translate(-50%,-50%) scale(0); opacity: 0; } 25% { transform: translate(-50%,-50%) scale(1.15); opacity: 1; } 60% { transform: translate(-50%,-50%) scale(1); opacity: 1; } 100% { transform: translate(-50%,-80%) scale(.9); opacity: 0; } }
.so-actions { display: flex; gap: 6px; margin-top: 10px; }
.so-act { display: flex; align-items: center; gap: 7px; border: none; background: none; color: var(--text-mid); font: inherit; font-weight: 700; font-size: 14px; padding: 8px 10px; border-radius: 10px; cursor: pointer; transition: transform .2s var(--ease-spring); }
.so-act:last-child { margin-left: auto; }
.so-act i { font-size: 19px; }
.so-act.liked { color: #ff2d55; }
.so-act.bump { animation: pop .4s var(--ease-spring); }
.so-act:active { transform: scale(.88); }

.so-sugs { display: flex; gap: 10px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; }
.so-sugs::-webkit-scrollbar { display: none; }
.so-sug { flex: 0 0 138px; text-align: center; padding: 14px 10px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; }
.so-sug p { max-width: 100%; }
.so-empty { text-align: center; padding: 48px 20px; color: var(--text-mid); }
.so-empty i { font-size: 40px; color: var(--accent); }
.so-skel { height: 220px; border-radius: 20px; margin-bottom: 12px; background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.so-profile-sheet { padding-top: 0 !important; overflow-x: hidden; }
.so-profile-sheet::before { position: relative; z-index: 2; margin-top: 10px !important; background: rgba(255,255,255,.5); }
.so-prof-banner { height: 110px; margin: -15px -20px 0; background: radial-gradient(120% 140% at 0% 0%, var(--ac), transparent 70%), linear-gradient(135deg, color-mix(in srgb, var(--ac) 60%, #000), var(--surface)); }
.so-prof-top { display: flex; justify-content: space-between; align-items: flex-end; margin-top: -46px; }
.so-prof-top .so-av { box-shadow: 0 0 0 4px var(--surface); }
.so-prof-stats { display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; background: var(--surface-2); border-radius: 14px; padding: 12px 4px; }
.so-prof-stats .stat-num { font-family: 'Archivo', sans-serif; font-size: 20px; }
.so-swatch { width: 32px; height: 32px; border-radius: 50%; border: none; cursor: pointer; transition: transform .2s var(--ease-spring); }
.so-swatch.on { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--text); transform: scale(1.1); }
.so-cmt { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); animation: rise .3s var(--ease-out) both; }
.so-switch { width: 46px !important; height: 28px; appearance: none; -webkit-appearance: none; border-radius: 999px; background: var(--surface-3); border: none; padding: 0 !important; position: relative; cursor: pointer; transition: background .2s; flex-shrink: 0; }
.so-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .25s var(--ease-spring); }
.so-switch:checked { background: var(--accent); }
.so-switch:checked::after { transform: translateX(18px); }

/* ---------- media ---------- */
.so-media { position: relative; margin-top: 12px; border-radius: 16px; overflow: hidden; background: var(--surface-2); }
.so-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.so-track::-webkit-scrollbar { display: none; }
.so-slide { flex: 0 0 100%; scroll-snap-align: center; position: relative; aspect-ratio: 4 / 5; max-height: 560px; cursor: zoom-in; }
.so-slide img, .so-slide video { width: 100%; height: 100%; object-fit: cover; display: block; }
.so-vid { cursor: pointer; }
.so-vid-badge { position: absolute; right: 12px; bottom: 12px; width: 32px; height: 32px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; pointer-events: none; }
.so-count { position: absolute; top: 12px; right: 12px; padding: 4px 10px; border-radius: 999px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; font-weight: 700; backdrop-filter: blur(6px); }
.so-dots { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.so-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.45); transition: all .25s var(--ease-spring); }
.so-dots i.on { background: #fff; width: 20px; border-radius: 4px; }

.so-draft-media { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.so-thumb { position: relative; flex: 0 0 96px; height: 120px; border-radius: 12px; overflow: hidden; background: var(--surface-2); animation: pop .35s var(--ease-spring); }
.so-thumb img { width: 100%; height: 100%; object-fit: cover; }
.so-thumb .so-img-x { width: 26px; height: 26px; top: 6px; right: 6px; font-size: 12px; }
.so-thumb-badge { position: absolute; left: 6px; bottom: 6px; font-size: 11px; font-weight: 800; color: #fff; background: rgba(0,0,0,.6); padding: 2px 7px; border-radius: 999px; }
.so-comp-tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.so-tool { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; transition: transform .18s var(--ease-spring); }
.so-tool i { font-size: 18px; color: var(--accent); }
.so-tool:active { transform: scale(.94); }
.so-progress { height: 6px; margin-top: 14px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.so-progress > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), #06b6d4); transition: width .2s; }

.so-viewer { position: fixed; inset: 0; z-index: 96; background: #000; display: flex; flex-direction: column; opacity: 0; visibility: hidden; transition: opacity .25s, visibility 0s .25s; }
.so-viewer.open { opacity: 1; visibility: visible; transition: opacity .25s; }
.so-viewer-track { flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.so-viewer-track::-webkit-scrollbar { display: none; }
.so-viewer-slide { flex: 0 0 100%; scroll-snap-align: center; display: flex; align-items: center; justify-content: center; }
.so-viewer-slide img, .so-viewer-slide video { max-width: 100%; max-height: 100%; object-fit: contain; }
.so-viewer.open .so-viewer-slide img { animation: zoomIn .35s var(--ease-out); }
@keyframes zoomIn { from { transform: scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
.so-viewer-x { position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); right: 14px; z-index: 2; width: 42px; height: 42px; border-radius: 50%; border: none; background: rgba(255,255,255,.15); color: #fff; font-size: 18px; cursor: pointer; backdrop-filter: blur(8px); }
.so-viewer-foot { display: flex; align-items: center; gap: 10px; padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px)); color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.8)); }

.so-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; border-radius: 14px; overflow: hidden; }
.so-grid-tile { position: relative; aspect-ratio: 1; border: none; padding: 0; background: var(--surface-2); cursor: pointer; overflow: hidden; }
.so-grid-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.so-grid-tile:active img { transform: scale(.95); }
.so-grid-ic { position: absolute; top: 8px; right: 8px; color: #fff; font-size: 14px; filter: drop-shadow(0 1px 3px rgba(0,0,0,.6)); }
.so-grid-wk { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2px; background: linear-gradient(150deg, var(--accent-soft), var(--surface-2)); text-align: center; padding: 6px; cursor: default; }
.so-grid-wk p { font-size: 11px; font-weight: 700; color: var(--accent); }
.so-grid-wk b { font-family: 'Archivo', sans-serif; font-size: 22px; }
.so-grid-wk span { font-size: 11px; color: var(--text-mid); }

/* ---------- iPhone: stop the screen shaking/moving ---------- */
/* 1) No sideways drift: nothing may scroll horizontally except our carousels.
   2) No zoom-on-tap: iOS zooms into inputs under 16px, which moved the screen.
   3) No double-tap zoom or rubber-band bounce showing a light background. */
html, body { overflow-x: hidden; width: 100%; max-width: 100%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overscroll-behavior: none; background: var(--bg); }
body { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
#app, .container, .view { max-width: 100%; }
.container { overflow-x: clip; padding-top: calc(18px + env(safe-area-inset-top, 0px)); }
#authScreen > div { padding-top: calc(24px + env(safe-area-inset-top, 0px)) !important; }
input, select, textarea, .ss-row input, .set-row input { font-size: 16px !important; }
.ss-progs, .so-stories, .so-sugs { overscroll-behavior-x: contain; }
.modal { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
img, video, svg, canvas { max-width: 100%; }

/* ---------- Safety: post menus, report, rules ---------- */
.so-more { width: 34px; height: 34px; border-radius: 10px; color: var(--text-dim); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.so-more:active { background: var(--surface-2); }
.so-cmt-more { color: var(--text-dim); width: 28px; height: 28px; flex-shrink: 0; align-self: center; }
.so-menu { display: flex; flex-direction: column; gap: 6px; }
.so-menu-item { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 14px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-weight: 600; font-size: 15px; cursor: pointer; transition: transform .15s var(--ease-out), background .15s; }
.so-menu-item i { width: 20px; text-align: center; color: var(--text-mid); }
.so-menu-item:active { transform: scale(.98); background: var(--surface-3); }
.so-menu-item.danger, .so-menu-item.danger i { color: #ff5f5f; }
.so-rules { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.so-rules li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.4; padding: 12px; border-radius: 13px; background: var(--surface-2); }
.so-rules li i { color: var(--accent); width: 18px; text-align: center; margin-top: 2px; }
.so-rules-icon { width: 64px; height: 64px; border-radius: 20px; margin: 0 auto; display: flex; align-items: center; justify-content: center; font-size: 28px; color: #fff; background: linear-gradient(135deg, #2563eb, #06b6d4); box-shadow: 0 10px 24px rgba(37,99,235,.3); }

/* ---------- Habits: freeze, at risk, today's workout ---------- */
.rt-freeze { margin-top: 8px; display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.2); color: #fff; font-weight: 800; font-size: 12px; border: 1px solid rgba(255,255,255,.3); cursor: pointer; }
.rt-freeze i { color: #bfe8ff; }
.streak-circle.frozen { background: rgba(255,255,255,.18) !important; border: 2px solid #fff !important; display: flex; align-items: center; justify-content: center; }
.streak-circle.frozen::after { content: "\f2dc"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: 11px; color: #fff; }
.rt-ice-hero { text-align: center; padding: 18px 0 6px; }
.rt-ice-hero > i { font-size: 44px; color: #7cc8ff; filter: drop-shadow(0 6px 18px rgba(124,200,255,.45)); animation: rt-spin 6s linear infinite; }
@keyframes rt-spin { to { transform: rotate(360deg); } }
.rt-risk { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 16px; margin-bottom: 12px; cursor: pointer;
  background: linear-gradient(135deg, rgba(61,139,255,.18), rgba(6,182,212,.12)); border: 1px solid rgba(61,139,255,.45); animation: rise .4s var(--ease-out) both; }
.rt-risk > i { font-size: 26px; color: var(--accent); animation: rt-flicker 1.4s ease-in-out infinite; }
@keyframes rt-flicker { 0%,100% { transform: scale(1) rotate(-3deg); } 50% { transform: scale(1.12) rotate(3deg); } }
.rt-today { position: relative; overflow: hidden; padding: 16px; border-radius: 18px; margin-bottom: 16px; background: var(--surface); border: 1px solid var(--border); animation: rise .45s var(--ease-out) both; }
.rt-today::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--pc, var(--accent)); }
.rt-pc { color: var(--pc, var(--accent)) !important; }
.rt-today-name { font-family: 'Archivo', sans-serif; font-weight: 900; font-size: 24px; line-height: 1.1; margin-top: 4px; letter-spacing: -.01em; }
.rt-play { width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0; border: none; color: #fff; font-size: 18px; cursor: pointer; background: var(--pc, var(--accent)); box-shadow: 0 8px 22px color-mix(in srgb, var(--pc, #2563eb) 45%, transparent); transition: transform .2s var(--ease-spring); }
.rt-play:active { transform: scale(.9); }
.rt-play i { margin-left: 3px; }
.rt-today.rt-live { display: flex; align-items: center; gap: 12px; cursor: pointer; background: linear-gradient(135deg, #2563eb, #06b6d4); border: none; color: #fff; }
.rt-today.rt-live .mono-label { color: rgba(255,255,255,.8); }
.rt-today.rt-live::before { display: none; }
.rt-go { font-weight: 800; white-space: nowrap; }
.rt-today.rt-done { display: flex; align-items: center; gap: 12px; }
.rt-today.rt-done::before { background: var(--success); }
.rt-check { width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--success-soft, rgba(47,208,138,.13)); color: var(--success, #2fd08a); font-size: 18px; }

/* ---------- Settings: reminders + delete ---------- */
.rt-set { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); cursor: pointer; }
.rt-set:first-of-type { border-top: none; }
.rt-danger-link { display: block; width: 100%; margin-top: 12px; padding: 10px; background: none; border: none; color: #ff5f5f; font-weight: 700; font-size: 14px; cursor: pointer; }
.rt-danger { background: #e5484d; color: #fff; border: none; border-radius: 14px; padding: 14px; font-weight: 800; font-size: 15px; cursor: pointer; }
.rt-danger:disabled { opacity: .4; cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) { .rt-ice-hero > i, .rt-risk > i { animation: none; } }
.so-pending { color: var(--accent); font-weight: 700; }
