/* BiStrong Phase 17.8 — Student App Shell + Progress Core
   Presentation only. Domain/load/coaching engines stay authoritative. */
:root{
  --bsp-surface:var(--bs-surface,#fff);
  --bsp-surface-2:var(--bs-surface-2,#f5f7ff);
  --bsp-surface-3:color-mix(in srgb,var(--bs-surface-2,#f5f7ff) 70%,var(--bs-line,#dde5f3));
  --bsp-text:var(--bs-text,#12192e);
  --bsp-muted:var(--bs-muted,#69758e);
  --bsp-faint:var(--bs-faint,#8d96aa);
  --bsp-line:var(--bs-line,#dde5f3);
  --bsp-lilac:var(--bs-lilac,#7650ef);
  --bsp-pink:#cf69a9;
  --bsp-green:var(--bs-green,#1f8053);
  --bsp-red:var(--bs-red,#b83849);
  --bsp-cyan:#55b9c7;
  --bsp-shadow:0 1px 0 rgba(255,255,255,.9) inset,0 12px 32px rgba(54,62,110,.09),0 30px 70px rgba(104,80,190,.055);
  --bsp-shadow-soft:0 1px 0 rgba(255,255,255,.82) inset,0 7px 20px rgba(54,62,110,.07);
}
html[data-theme="dark"]{
  --bsp-surface:#171d2a;--bsp-surface-2:#1d2738;--bsp-surface-3:#253248;
  --bsp-text:#f7f8ff;--bsp-muted:#b1bad0;--bsp-faint:#8490a8;--bsp-line:#2d3a52;
  --bsp-lilac:#a88cff;--bsp-pink:#df80b8;--bsp-green:#69cf98;--bsp-red:#f18499;--bsp-cyan:#65c6d0;
  --bsp-shadow:0 1px 0 rgba(255,255,255,.045) inset,0 18px 44px rgba(0,0,0,.30),0 38px 78px rgba(0,0,0,.16);
  --bsp-shadow-soft:0 1px 0 rgba(255,255,255,.035) inset,0 10px 28px rgba(0,0,0,.20);
}
body.bs-app-ready{padding-bottom:112px!important}
.bs-app-view[hidden]{display:none!important}
.bs-app-view{max-width:760px;margin:0 auto;animation:bspFade var(--bs-state,200ms) ease-out both}
@keyframes bspFade{from{opacity:0}to{opacity:1}}

/* Global header becomes context-aware. Training controls remain untouched when Train is active. */
body[data-bs-view="home"] .bs-today-status,
body[data-bs-view="home"] .nav-row,
body[data-bs-view="home"] .top-row,
body[data-bs-view="home"] #viewTabs,
body[data-bs-view="progress"] .bs-greeting,
body[data-bs-view="progress"] .bs-today-status,
body[data-bs-view="progress"] .nav-row,
body[data-bs-view="progress"] .top-row,
body[data-bs-view="progress"] #viewTabs,
body[data-bs-view="more"] .bs-greeting,
body[data-bs-view="more"] .bs-today-status,
body[data-bs-view="more"] .nav-row,
body[data-bs-view="more"] .top-row,
body[data-bs-view="more"] #viewTabs,
body[data-bs-view="train"] .bs-greeting,
body[data-bs-view="train"] .bs-today-status,
body[data-bs-view="train"] #viewTabs{display:none!important}
body[data-bs-view="home"] header{padding-bottom:2px!important}
body[data-bs-view="progress"] header,
body[data-bs-view="more"] header{padding-bottom:2px!important}

/* Theme button: vector icon, no ambiguous glyphs. */
#themeToggleBtn{display:grid!important;place-items:center;line-height:0!important}
#themeToggleBtn svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

/* Bottom navigation */
.bs-bottom-nav{display:none;position:fixed;z-index:80;left:50%;bottom:max(12px,env(safe-area-inset-bottom));transform:translateX(-50%);width:min(calc(100% - 28px),730px);height:74px;padding:7px;background:color-mix(in srgb,var(--bsp-surface) 94%,transparent);border:1px solid color-mix(in srgb,var(--bsp-line) 82%,transparent);border-radius:26px;box-shadow:0 18px 48px rgba(37,47,80,.16),0 3px 10px rgba(37,47,80,.08);backdrop-filter:blur(20px) saturate(1.08);-webkit-backdrop-filter:blur(20px) saturate(1.08)}
body.bs-app-ready .bs-bottom-nav{display:grid;grid-template-columns:repeat(4,1fr);gap:4px}
.bs-bottom-nav button{border:0;background:transparent;color:var(--bsp-faint);border-radius:19px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;font-size:9px;font-weight:700;transition:transform var(--bs-press,160ms) var(--bs-ease,ease),opacity var(--bs-state,200ms),background var(--bs-state,200ms),color var(--bs-state,200ms)}
.bs-bottom-nav button:active{transform:scale(.965);opacity:.9}
.bs-bottom-nav button.active{background:color-mix(in srgb,var(--bsp-lilac) 10%,var(--bsp-surface));color:var(--bsp-lilac)}
.bs-bottom-nav svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.bs-bottom-nav .bs-more-dots circle{fill:currentColor;stroke:none}

/* Shared app-shell typography */
.bsp-heading{margin:12px 2px 22px}.bsp-eyebrow{margin:0 0 7px;color:var(--bsp-lilac);font-size:10px;letter-spacing:.15em;font-weight:800;text-transform:uppercase}.bsp-heading h1{font-size:39px;line-height:1;letter-spacing:-.045em;margin:0 0 9px;color:var(--bsp-text)}.bsp-heading p{margin:0;color:var(--bsp-muted);font-size:13px;line-height:1.55;max-width:560px}
.bsp-card{background:var(--bsp-surface);border:1px solid var(--bsp-line);border-radius:26px;box-shadow:var(--bsp-shadow)}
.bsp-section{background:var(--bsp-surface);border:1px solid var(--bsp-line);border-radius:26px;box-shadow:var(--bsp-shadow);padding:21px;margin-top:17px}
.bsp-section-head{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;margin-bottom:17px}.bsp-section-head h2{font-size:25px;line-height:1.05;letter-spacing:-.035em;margin:0;color:var(--bsp-text)}
.bsp-quiet-badge{padding:9px 12px;border-radius:999px;background:var(--bsp-surface-2);color:var(--bsp-muted);font-size:10px;font-weight:800;white-space:nowrap}

/* Home */
.bsp-home{padding-top:2px}.bsp-today-card{padding:21px}.bsp-today-kicker,.bsp-mini>span,.bsp-next-session>div>span{font-size:9px;letter-spacing:.14em;font-weight:800;color:var(--bsp-lilac);text-transform:uppercase}.bsp-today-card h2{font-size:27px;letter-spacing:-.035em;margin:7px 0 6px}.bsp-today-card>p{margin:0;color:var(--bsp-muted);font-size:12px;line-height:1.5}.bsp-next-session{margin-top:18px;padding:14px 15px;background:var(--bsp-surface-2);border-radius:18px;display:flex;align-items:center;justify-content:space-between;gap:12px}.bsp-next-session strong{display:block;font-size:17px;margin:3px 0 2px}.bsp-next-session small{display:block;color:var(--bsp-muted);font-size:9px;line-height:1.4}.bsp-action{border:0;background:var(--bs-ink,#12192e);color:var(--bs-bg,#f6f8ff);border-radius:999px;padding:10px 13px;font-size:9px;font-weight:800;white-space:nowrap;transition:transform var(--bs-press,160ms),opacity var(--bs-state,200ms)}.bsp-action:active{transform:scale(.97);opacity:.9}.bsp-home-grid{display:grid;grid-template-columns:1fr 1fr;gap:13px;margin-top:15px}.bsp-mini{padding:18px;background:var(--bsp-surface);border:1px solid var(--bsp-line);border-radius:22px;box-shadow:var(--bsp-shadow-soft)}.bsp-mini strong{display:block;font-size:22px;letter-spacing:-.035em;margin:8px 0 3px}.bsp-mini small{display:block;color:var(--bsp-muted);font-size:9px;line-height:1.45}.bsp-mini.accent{background:radial-gradient(95% 125% at 100% 0%,color-mix(in srgb,var(--bsp-lilac) 13%,transparent),transparent 72%),var(--bsp-surface)}.bsp-mini button{border:0;background:color-mix(in srgb,var(--bsp-lilac) 10%,var(--bsp-surface));color:var(--bsp-lilac);border-radius:999px;padding:8px 10px;font-size:9px;font-weight:800;margin-top:12px}.bsp-mini-progress{height:7px;background:var(--bsp-surface-3);border-radius:999px;overflow:hidden;margin-top:13px}.bsp-mini-progress i{display:block;height:100%;width:var(--v);background:linear-gradient(90deg,var(--bsp-lilac),var(--bsp-pink));border-radius:inherit}

/* Progress navigation */
.bsp-progress-tabs{display:flex;gap:7px;overflow-x:auto;padding:3px 2px 13px;margin:0 -2px 2px;scrollbar-width:none}.bsp-progress-tabs::-webkit-scrollbar{display:none}.bsp-progress-tab{border:0;background:var(--bsp-surface);color:var(--bsp-muted);padding:10px 14px;border-radius:999px;white-space:nowrap;font-weight:700;box-shadow:var(--bsp-shadow-soft);transition:transform var(--bs-press,160ms),background var(--bs-state,200ms),color var(--bs-state,200ms)}.bsp-progress-tab:active{transform:scale(.97)}.bsp-progress-tab.active{background:var(--bs-ink,#12192e);color:var(--bs-bg,#f6f8ff)}
.bsp-progress-panel[hidden]{display:none!important}.bsp-progress-panel{animation:bspPanel var(--bs-shared,250ms) ease-out both}@keyframes bspPanel{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}

/* Summary */
.bsp-hero{padding:22px;margin-top:4px;background:radial-gradient(75% 90% at 14% 0%,color-mix(in srgb,var(--bsp-lilac) 12%,transparent),transparent 76%),var(--bsp-surface)}.bsp-hero-top{display:flex;justify-content:space-between;align-items:center;font-size:9px;letter-spacing:.13em;font-weight:800;color:var(--bsp-muted)}.bsp-hero-status{color:var(--bsp-green)}.bsp-hero-main{display:grid;grid-template-columns:180px 1fr;align-items:center;gap:24px;margin-top:17px}.bsp-ring{width:170px;aspect-ratio:1;position:relative}.bsp-ring svg{width:100%;height:100%;transform:rotate(-90deg)}.bsp-ring circle{fill:none;stroke-width:10}.bsp-ring-track{stroke:var(--bsp-surface-3)}.bsp-ring-progress{stroke:var(--bsp-cyan);stroke-linecap:round;stroke-dasharray:302;transition:stroke-dashoffset 250ms ease-out}.bsp-ring-copy{position:absolute;inset:0;display:grid;place-content:center;text-align:center}.bsp-ring-copy strong{font-size:40px;letter-spacing:-.055em;line-height:1}.bsp-ring-copy span{margin-top:7px;color:var(--bsp-muted);font-size:10px;font-weight:700}.bsp-hero-kicker{font-size:9px;letter-spacing:.14em;font-weight:800;color:var(--bsp-pink)}.bsp-hero-message h2{margin:8px 0 7px;font-size:23px;line-height:1.15;letter-spacing:-.03em}.bsp-hero-message p{margin:0;color:var(--bsp-muted);font-size:11px;line-height:1.5}.bsp-metrics{display:grid;grid-template-columns:repeat(2,1fr);gap:11px}.bsp-metric{background:var(--bsp-surface-2);border-radius:19px;padding:16px}.bsp-metric span{font-size:9px;color:var(--bsp-muted);font-weight:700}.bsp-metric strong{display:block;font-size:25px;letter-spacing:-.04em;margin:5px 0 2px}.bsp-metric small{color:var(--bsp-faint);font-size:9px}.bsp-week-spark{display:grid;gap:9px;margin-top:17px}.bsp-week-row{display:grid;grid-template-columns:28px 1fr 36px;align-items:center;gap:9px;font-size:9px;color:var(--bsp-muted)}.bsp-week-row b{text-align:right;color:var(--bsp-text)}.bsp-week-row.current span,.bsp-week-row.current b{color:var(--bsp-lilac)}.bsp-bar{height:8px;background:var(--bsp-surface-3);border-radius:999px;overflow:hidden}.bsp-bar i{display:block;height:100%;width:var(--v);background:linear-gradient(90deg,var(--bsp-lilac),var(--bsp-pink));border-radius:inherit}.bsp-insights{display:grid;gap:9px}.bsp-insight{display:flex;gap:11px;align-items:flex-start;padding:13px;background:var(--bsp-surface-2);border-radius:17px}.bsp-insight-icon{width:31px;height:31px;border-radius:10px;display:grid;place-items:center;flex:0 0 auto;color:var(--bsp-lilac);background:color-mix(in srgb,var(--bsp-lilac) 11%,var(--bsp-surface));font-weight:900}.bsp-insight.steady .bsp-insight-icon{color:var(--bsp-green);background:color-mix(in srgb,var(--bsp-green) 10%,var(--bsp-surface))}.bsp-insight strong{font-size:12px}.bsp-insight p{font-size:10px;line-height:1.45;color:var(--bsp-muted);margin:3px 0 0}.bsp-empty-copy{padding:18px;background:var(--bsp-surface-2);border-radius:18px;color:var(--bsp-muted);font-size:11px;line-height:1.55}

/* Strength */
.bsp-select{border:0;background:var(--bsp-surface-2);color:var(--bsp-muted);border-radius:999px;padding:9px 29px 9px 12px;font-size:10px;font-weight:700;max-width:180px}.bsp-strength-summary{display:grid;grid-template-columns:1fr 1fr;gap:11px;margin-bottom:13px}.bsp-strength-summary>div{padding:16px;border-radius:18px;background:var(--bsp-surface-2);position:relative}.bsp-strength-summary span{font-size:9px;color:var(--bsp-muted);font-weight:700}.bsp-strength-summary strong{display:block;font-size:21px;margin-top:4px}.bsp-strength-summary .delta{background:color-mix(in srgb,var(--bsp-lilac) 9%,var(--bsp-surface-2))}.bsp-strength-summary small{color:var(--bsp-lilac);font-weight:800;position:absolute;right:13px;top:13px;font-size:9px}.bsp-chart{background:var(--bsp-surface-2);border-radius:21px;padding:15px}.bsp-chart-head{display:flex;justify-content:space-between;align-items:center;gap:10px}.bsp-chart-head span{font-size:9px;color:var(--bsp-muted)}.bsp-chart-head strong{margin-left:4px;font-size:9px}.bsp-chart-filter{display:flex;background:var(--bsp-surface);padding:3px;border-radius:999px}.bsp-chart-filter button{border:0;background:transparent;padding:6px 8px;border-radius:999px;color:var(--bsp-muted);font-size:8px;font-weight:700}.bsp-chart-filter button.active{background:var(--bs-ink,#12192e);color:var(--bs-bg,#f6f8ff)}.bsp-line-chart{width:100%;height:auto;margin-top:8px;overflow:visible}.bsp-grid-lines line{stroke:var(--bsp-line);stroke-width:1}.bsp-chart-line{fill:none;stroke:var(--bsp-lilac);stroke-width:4;stroke-linecap:round;stroke-linejoin:round}.bsp-chart-dot{fill:var(--bsp-surface);stroke:var(--bsp-lilac);stroke-width:4}.bsp-chart-label{fill:var(--bsp-faint);font-size:8px;text-anchor:middle;font-family:'Manrope',sans-serif}.bsp-record-strip{display:grid;grid-template-columns:repeat(var(--cols,4),1fr);gap:5px;margin-top:3px}.bsp-record-strip div{text-align:center}.bsp-record-strip span{display:block;font-size:7px;color:var(--bsp-faint)}.bsp-record-strip b{font-size:8px}.bsp-strength-metrics{margin-top:11px}

/* Muscles */
.bsp-period-switch{display:grid;grid-template-columns:repeat(3,1fr);gap:5px;background:var(--bsp-surface-2);padding:4px;border-radius:16px;margin-bottom:13px}.bsp-period-switch button{border:0;background:transparent;color:var(--bsp-muted);padding:9px;border-radius:12px;font-size:9px;font-weight:700}.bsp-period-switch button.active{background:var(--bsp-surface);color:var(--bsp-text);box-shadow:var(--bsp-shadow-soft)}.bsp-body-card{background:var(--bsp-surface-2);border-radius:22px;padding:15px}.bsp-map-toolbar{display:flex;justify-content:space-between;align-items:center;color:var(--bsp-muted);font-size:9px;font-weight:700}.bsp-map-toolbar button{border:0;background:var(--bsp-surface);width:38px;height:38px;border-radius:50%;display:grid;place-items:center;color:var(--bsp-text);box-shadow:var(--bsp-shadow-soft)}.bsp-map-toolbar svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.bsp-body-wrap{height:430px;display:grid;place-items:center;position:relative;overflow:hidden}.bsp-body-map-image{height:418px;max-width:100%;width:auto;object-fit:contain;display:block;filter:saturate(.92) contrast(.98);transition:opacity var(--bs-state,200ms),transform var(--bs-state,200ms)}html[data-theme="dark"] .bsp-body-map-image{filter:saturate(.9) brightness(.94) contrast(1.02)}.bsp-muscle-list{display:grid;gap:8px;margin-top:12px}.bsp-muscle-row{display:flex;justify-content:space-between;align-items:center;gap:14px;padding:13px 14px;background:var(--bsp-surface-2);border-radius:16px}.bsp-muscle-row strong{display:block;font-size:12px}.bsp-muscle-row span{display:block;color:var(--bsp-muted);font-size:8px;margin-top:3px}.bsp-muscle-row b{color:var(--bsp-lilac);font-size:10px;white-space:nowrap}.bsp-map-note{margin:10px 3px 0;color:var(--bsp-faint);font-size:8px;line-height:1.5}

/* History */
.bsp-history{display:grid;gap:9px}.bsp-history-card{width:100%;border:0;background:var(--bsp-surface-2);color:var(--bsp-text);border-radius:17px;padding:14px 15px;display:flex;align-items:center;justify-content:space-between;text-align:left}.bsp-history-card.current{background:color-mix(in srgb,var(--bsp-lilac) 9%,var(--bsp-surface-2))}.bsp-history-card span{font-size:8px;letter-spacing:.11em;color:var(--bsp-lilac);font-weight:800}.bsp-history-card strong{display:block;font-size:13px;margin:3px 0}.bsp-history-card small{display:block;color:var(--bsp-muted);font-size:9px}.bsp-history-card>em{font-style:normal;color:var(--bsp-faint);font-size:22px}

/* More */
.bsp-profile{padding:17px;display:flex;align-items:center;gap:13px}.bsp-avatar,.bsp-coach-avatar{width:48px;height:48px;border-radius:16px;display:grid;place-items:center;background:linear-gradient(135deg,color-mix(in srgb,var(--bsp-lilac) 18%,var(--bsp-surface)),color-mix(in srgb,var(--bsp-pink) 16%,var(--bsp-surface)));color:var(--bsp-lilac);font-weight:800}.bsp-profile-copy{flex:1}.bsp-profile-copy strong,.bsp-coach-row b{display:block;font-size:15px}.bsp-profile-copy span,.bsp-coach-row small{display:block;color:var(--bsp-muted);font-size:9px;margin-top:2px}.bsp-settings{margin-top:19px}.bsp-settings-title{margin:0 0 8px 4px;font-size:9px;letter-spacing:.14em;font-weight:800;color:var(--bsp-muted)}.bsp-setting-row,.bsp-coach-row{width:100%;border:0;background:var(--bsp-surface);color:var(--bsp-text);padding:15px 16px;display:flex;align-items:center;justify-content:space-between;text-align:left;border-bottom:1px solid var(--bsp-line)}.bsp-setting-row:first-of-type{border-radius:19px 19px 0 0}.bsp-setting-row:last-child{border-radius:0 0 19px 19px;border-bottom:0}.bsp-setting-row:only-of-type{border-radius:19px}.bsp-setting-row b{display:block;font-size:11px}.bsp-setting-row small{display:block;color:var(--bsp-muted);font-size:8px;margin-top:3px}.bsp-setting-row em{font-style:normal;color:var(--bsp-faint);font-size:22px}.bsp-coach-row{border-radius:19px!important;border:1px solid var(--bsp-line);justify-content:flex-start;gap:11px;box-shadow:var(--bsp-shadow-soft)}.bsp-coach-avatar{width:42px;height:42px;border-radius:14px}

@media(max-width:620px){
  .bsp-heading h1{font-size:36px}.bsp-section,.bsp-hero{border-radius:23px}.bsp-hero-main{grid-template-columns:1fr;text-align:center;justify-items:center;gap:13px}.bsp-hero-message{max-width:340px}.bsp-ring{width:160px}.bsp-section{padding:18px}.bsp-body-wrap{height:390px}.bsp-body-map-image{height:378px}.bs-bottom-nav{height:72px}
}
@media(max-width:390px){
  .bsp-home-grid,.bsp-metrics,.bsp-strength-summary{grid-template-columns:1fr}.bsp-next-session{flex-direction:column;align-items:flex-start}.bsp-section-head{flex-direction:column}.bsp-record-strip{grid-template-columns:repeat(2,1fr)!important}.bsp-body-wrap{height:360px}.bsp-body-map-image{height:350px}
}
@media(prefers-reduced-motion:reduce){.bsp-progress-panel,.bs-bottom-nav button,.bsp-progress-tab,.bsp-ring-progress{animation:none!important;transition:none!important}}
