
:root {
  --bg: #f5f6fa;
  --card: #ffffff;
  --text: #202a44;
  --muted: #a4a9b4;
  --line: #edf0f5;
  --red: #ff3b3f;
  --red2: #ff6b6f;
  --pink: #ffe2e5;
  --soft: #f1f3f7;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  width: min(980px, calc(100vw - 28px));
  margin: 22px auto 44px;
}

.hidden {
  display: none !important;
}

.card {
  background: var(--card);
  border-radius: 30px;
  padding: 24px;
  margin-bottom: 18px;
  box-shadow: 0 18px 40px rgba(20, 28, 48, 0.06);
}

.login-card {
  max-width: 420px;
  margin: 16vh auto 0;
}

h1, h2, h3, p {
  margin-top: 0;
}

h1 {
  font-size: 34px;
  letter-spacing: -0.04em;
}

h2 {
  font-size: 22px;
}

h3 {
  font-size: 17px;
  margin-bottom: 0;
}

.muted {
  color: var(--muted);
}

.error {
  color: #dc2626;
  min-height: 1.4em;
}

.topbar,
.section-head,
.month-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-head.compact {
  margin-bottom: 12px;
}

.controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  font-weight: 700;
}

input, select, button {
  font: inherit;
  border-radius: 15px;
}

input, select {
  border: 1px solid #e1e5ec;
  background: #fff;
  padding: 12px 13px;
}

button {
  border: 0;
  background: var(--text);
  color: white;
  padding: 13px 16px;
  font-weight: 800;
  cursor: pointer;
}

button.ghost {
  background: var(--soft);
  color: var(--text);
}

button.small {
  padding: 9px 12px;
  font-size: 14px;
}

button.danger {
  background: #ffe4e6;
  color: #b91c1c;
}

.chart-wrap {
  height: 280px;
}

.fitness-card {
  text-align: center;
  padding-top: 30px;
}

.month-title {
  color: #d9dde5;
  font-size: 24px;
  font-weight: 900;
  text-align: left;
}

.hero-time {
  margin-top: 28px;
  font-size: clamp(54px, 13vw, 110px);
  line-height: 1;
  font-weight: 950;
  letter-spacing: -0.07em;
}

.trained-days {
  margin-top: 10px;
  margin-bottom: 28px;
  font-size: 22px;
  font-weight: 800;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
  margin: 0 auto;
}

.day-dot {
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  border: 2px dashed transparent;
  background: transparent;
  color: #b8bec8;
  display: grid;
  place-items: center;
  font-size: clamp(17px, 4vw, 28px);
  font-weight: 900;
  cursor: pointer;
  position: relative;
}

.day-dot.empty {
  visibility: hidden;
}

.day-dot.no-record {
  border-color: #e5e8ef;
  color: #bdc2cc;
}

.day-dot.has-weight {
  background: var(--pink);
  color: var(--red);
}

.day-dot.has-workout {
  background: linear-gradient(180deg, var(--red), var(--red2));
  color: white;
  box-shadow: 0 10px 20px rgba(255, 59, 63, 0.22);
}

.day-dot.today {
  outline: 3px solid #202a44;
  outline-offset: 3px;
}

.day-dot.selected {
  box-shadow: 0 0 0 5px rgba(32, 42, 68, 0.14), 0 10px 22px rgba(32, 42, 68, 0.14);
}

.week-labels {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
  margin-top: 24px;
  color: var(--muted);
  font-weight: 700;
}

.day-detail {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.detail-line {
  background: #f8f9fc;
  border-radius: 18px;
  padding: 12px 14px;
}

.workout-rows {
  display: grid;
  gap: 10px;
}

.workout-row {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr auto;
  gap: 8px;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 20px 0;
}

@media (max-width: 680px) {
  .card {
    border-radius: 26px;
    padding: 20px;
  }

  .topbar,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .month-title {
    font-size: 21px;
  }

  .calendar {
    gap: 8px;
  }

  .week-labels {
    gap: 8px;
  }

  .workout-row {
    grid-template-columns: 1fr;
  }
}
