

:root{
  --bg:#f6f8fb;
  --card:#ffffff;
  --primary:#2563eb;
  --muted:#6b7280;
  --success:#059669;
  --glass: rgba(37,99,235,0.08);
  --radius:12px;
  --max-width:900px;
}

*{box-sizing:border-box}

body{
  margin:0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background: linear-gradient(180deg,var(--bg), #ffffff 40%);
  color:#0f172a;
  display:flex;
  justify-content:center;
  padding:28px;
}

.app {
  width:100%;
  max-width: var(--max-width);
  display:grid;
  grid-template-columns: 360px 1fr;
  gap:20px;
  align-items:start;
}

header {
  grid-column: 1 / -1;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  margin-bottom:6px;
}

header h1{
  font-size:20px;
  margin:0;
  color:var(--primary);
  display:flex;
  gap:10px;
  align-items:center;
}

.subtitle { margin:0; color:var(--muted); font-size:14px; }
.meta-right { text-align:right; }

.muted { color:var(--muted); }
.small { font-size:12px; color:var(--muted); }

.card {
  background:var(--card);
  border-radius:var(--radius);
  padding:16px;
  box-shadow: 0 6px 18px rgba(2,6,23,0.06);
}

/* Progress */
.challenge-progress-bar {
  width:100%;
  height:14px;
  background:#eef2ff;
  border-radius:999px;
  overflow:hidden;
}

.challenge-progress-fill {
  height:100%;
  width:0%;
  background:linear-gradient(90deg,var(--primary), #60a5fa);
  transition: width 360ms ease;
}

.challenge-stats { display:flex; justify-content:space-between; margin-top:8px; font-size:13px; color:var(--muted); }

/* Controls */
.controls { display:flex; gap:8px; flex-wrap:wrap; margin-top:8px; }

.btn {
  display:inline-flex;
  align-items:center;
  gap:8px;
  background:var(--primary);
  color:white;
  border:none;
  padding:8px 12px;
  border-radius:10px;
  cursor:pointer;
  font-weight:600;
}
.btn.ghost {
  background:transparent;
  color:var(--primary);
  border:1px solid rgba(37,99,235,0.12);
}
.btn.warn {
  background:#ef4444;
}

/* Tracker */
.challenge-tracker {
  display:flex;
  flex-direction:column;
  gap:12px;
  max-height:75vh;
  overflow:auto;
  padding-right:6px;
}

.challenge-day {
  display:flex;
  flex-direction:column;
  gap:8px;
  border-radius:10px;
  padding:12px;
  border:1px solid #eef2f5;
  background:linear-gradient(180deg, rgba(255,255,255,0.6), rgba(255,255,255,0.85));
}

.challenge-day-header {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
}

.day-left {
  display:flex;
  gap:12px;
  align-items:center;
}

.challenge-badge {
  background:var(--glass);
  color:var(--primary);
  padding:6px 9px;
  border-radius:999px;
  font-weight:700;
}

.challenge-date {
  font-size:13px;
  color:var(--muted);
}

textarea {
  width:100%;
  min-height:64px;
  resize:vertical;
  padding:10px;
  border-radius:8px;
  border:1px solid #e6eef8;
  font-size:14px;
  font-family:inherit;
}

.challenge-saved {
  font-size:12px;
  color:var(--success);
  font-weight:600;
  text-align:right;
}

/* Footer */
.smallprint {
  grid-column: 1 / -1;
  margin-top:8px;
  color:var(--muted);
  font-size:13px;
  text-align:center;
}

/* Responsive */
@media (max-width:880px){
  .app { grid-template-columns: 1fr; }
}
