
:root{
  --bg:#0b0c10;
  --panel:#11131a;
  --panel2:#151827;
  --text:#e8eaf2;
  --muted:#a6acc7;
  --stroke:rgba(255,255,255,.08);
  --stroke2:rgba(255,255,255,.12);
  --good:#2bd576;
  --warn:#f0c23a;
  --bad:#ff5c73;
  --btn:#2d5bff;
  --btn2:#2147cf;
  --radius:18px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--font);
  background: radial-gradient(1200px 600px at 10% 0%, rgba(45,91,255,.20), transparent 60%),
              radial-gradient(900px 500px at 90% 10%, rgba(43,213,118,.12), transparent 55%),
              var(--bg);
  color:var(--text);
}

.app{max-width:1100px;margin:0 auto; padding:18px 14px 28px;}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 14px;
  border:1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(17,19,26,.9), rgba(17,19,26,.6));
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.brand{display:flex;gap:12px;align-items:center}
.brandMark{
  width:44px;height:44px;border-radius:14px;
  background: linear-gradient(135deg, rgba(45,91,255,1), rgba(33,71,207,1));
  display:flex;align-items:center;justify-content:center;
  font-weight:800; letter-spacing:.5px;
}
.brandName{font-weight:800; font-size:14px; line-height:1.1}
.brandSub{font-size:12px; color:var(--muted); margin-top:2px}

.dayNav{display:flex;align-items:center;gap:10px}
.navBtn{
  width:40px;height:40px;border-radius:14px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.04);
  color:var(--text);
  font-size:18px;
  cursor:pointer;
}
.navBtn:disabled{opacity:.35; cursor:not-allowed}
.daySelect{
  height:40px;
  padding:0 12px;
  border-radius:14px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.04);
  color:var(--text);
  outline:none;
}

.hero{
  margin-top:14px;
  border-radius: calc(var(--radius) + 6px);
  overflow:hidden;
  border:1px solid var(--stroke);
  background-size:cover;
  background-position:center;
  min-height:180px;
  box-shadow: var(--shadow);
}
.hero.is-hidden{display:none}
.heroOverlay{
  min-height:180px;
  padding:18px 18px;
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
  background: linear-gradient(180deg, rgba(0,0,0,.10), rgba(0,0,0,.70));
}
.heroKicker{font-size:12px;color:rgba(255,255,255,.80); margin-bottom:6px}
.heroTitle{margin:0;font-size:26px; letter-spacing:-.3px}

.content{margin-top:14px; display:flex; flex-direction:column; gap:14px}

.summary{
  display:flex; gap:12px; flex-wrap:wrap;
}
.summaryCard{
  flex: 0 0 180px;
  background: rgba(255,255,255,.04);
  border:1px solid var(--stroke);
  border-radius: var(--radius);
  padding:12px 14px;
}
.summaryWide{flex: 1 1 420px}
.summaryLabel{font-size:12px; color:var(--muted)}
.summaryValue{font-size:16px; font-weight:800; margin-top:6px}
.summaryText{font-weight:600;color:rgba(255,255,255,.90)}

.status{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
  background: rgba(255,255,255,.04);
  border:1px solid var(--stroke);
  border-radius: var(--radius);
}
.statusLine{font-size:13px;color:rgba(255,255,255,.88);line-height:1.25}

.primaryBtn{
  border:none;
  background: linear-gradient(135deg, var(--btn), var(--btn2));
  color:white;
  height:44px;
  padding:0 16px;
  border-radius:16px;
  font-weight:800;
  cursor:pointer;
  box-shadow: 0 10px 24px rgba(45,91,255,.25);
}
.primaryBtn:disabled{opacity:.4; cursor:not-allowed}

.blocks{display:flex; flex-direction:column; gap:12px}

.blockCard{
  background: rgba(255,255,255,.04);
  border:1px solid var(--stroke);
  border-radius: calc(var(--radius) + 4px);
  overflow:hidden;
}
.blockHead{
  display:flex; align-items:flex-start; justify-content:space-between;
  padding:12px 14px;
  border-bottom:1px solid var(--stroke);
  gap:10px;
}
.blockTitle{font-weight:900; font-size:14px}
.blockMeta{font-size:12px;color:var(--muted); margin-top:4px}
.blockBadge{
  font-size:11px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--stroke2);
  background: rgba(255,255,255,.04);
  color:rgba(255,255,255,.85);
  text-transform:uppercase;
  letter-spacing:.6px;
  white-space:nowrap;
}

.blockCard.completed .blockBadge{border-color: rgba(43,213,118,.35); background: rgba(43,213,118,.10)}
.blockCard.in-progress .blockBadge{border-color: rgba(45,91,255,.40); background: rgba(45,91,255,.10)}
.blockCard.pending .blockBadge{opacity:.7}

.exerciseGrid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:10px;
  padding:12px 12px 14px;
}
@media (max-width:900px){
  .exerciseGrid{grid-template-columns: repeat(2, minmax(0, 1fr));}
}
@media (max-width:520px){
  .exerciseGrid{grid-template-columns: 1fr;}
  .status{flex-direction:column; align-items:stretch}
  .primaryBtn{width:100%}
}

.exerciseCardBtn{
  display:flex;
  gap:10px;
  align-items:center;
  padding:10px 10px;
  border-radius:16px;
  border:1px solid var(--stroke);
  background: rgba(0,0,0,.18);
  color:var(--text);
  cursor:pointer;
  text-align:left;
  width:100%;
}
.exerciseCardBtn:hover{border-color: rgba(255,255,255,.16)}
.exerciseThumb{
  width:56px;height:56px;
  border-radius:14px;
  border:1px solid var(--stroke);
  display:flex; align-items:center; justify-content:center;
  color:rgba(255,255,255,.85);
  background: rgba(255,255,255,.03);
  background-size:cover;
  background-position:center;
  font-weight:800;
}
.exerciseThumb.has-img{color:transparent}
.exerciseLabel{display:flex;flex-direction:column; gap:3px; min-width:0}
.exerciseId{font-size:12px; color:var(--muted); font-weight:700}
.exerciseName{font-size:13px; font-weight:800; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}

.emptyHint{
  grid-column: 1 / -1;
  padding:12px 14px;
  border:1px dashed var(--stroke2);
  border-radius:16px;
  color:var(--muted);
  font-size:13px;
  background: rgba(0,0,0,.12);
}

/* Modal */
.modal{
  position:fixed; inset:0;
  display:none;
}
.modal.is-open{display:block}
.modalBackdrop{
  position:absolute; inset:0;
  background: rgba(0,0,0,.70);
}
.modalCard{
  position:relative;
  width:min(560px, calc(100% - 24px));
  margin: 7vh auto 0;
  border-radius: 22px;
  border:1px solid var(--stroke);
  background: rgba(17,19,26,.92);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.modalHead{
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 14px;
  border-bottom:1px solid var(--stroke);
}
.modalTitle{font-weight:900; font-size:14px}
.iconBtn{
  width:38px;height:38px;border-radius:14px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.04);
  color:var(--text);
  cursor:pointer;
}
.modalImg{
  width:100%;
  max-height: 56vh;
  object-fit: contain;
  background: rgba(0,0,0,.25);
}
.modalImg.is-hidden{display:none}
.modalActions{padding:12px 14px}
.linkBtn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:42px;
  padding:0 14px;
  border-radius:16px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.05);
  color:var(--text);
  text-decoration:none;
  font-weight:800;
}
.linkBtn.is-disabled{opacity:.45; pointer-events:none}
