:root {
  color-scheme: light;
  --ink: #202124;
  --muted: #62656b;
  --line: #d8dedb;
  --paper: #fbfaf6;
  --panel: #ffffff;
  --sage: #4d7767;
  --coral: #d96d5c;
  --gold: #bd8a36;
  --teal: #1f7a8c;
  --shadow: 0 16px 40px rgba(32, 33, 36, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app-header {
  min-height: 42vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 28px;
  align-items: end;
  padding: 48px clamp(20px, 5vw, 72px);
  background:
    linear-gradient(120deg, rgba(32, 33, 36, 0.62), rgba(31, 122, 140, 0.14)),
    url("https://images.unsplash.com/photo-1518611012118-696072aa579a?auto=format&fit=crop&w=1800&q=80");
  background-position: center 46%;
  background-size: cover;
  color: white;
}

.eyebrow {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 0.78rem;
  font-weight: 800;
}

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

h1 {
  max-width: 780px;
  margin-bottom: 0;
  font-size: clamp(2.15rem, 4.6vw, 4.8rem);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: 1.25rem;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.05rem;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: -36px auto 56px;
}

.summary-card,
.notice,
.planner,
.routine-card,
.video-card,
.notes,
.dashboard article {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.summary-card {
  border-radius: 8px;
  padding: 18px;
  color: var(--ink);
}

.summary-card span,
.section-title span,
.routine-meta,
.video-card span,
.progress-text {
  color: var(--muted);
  font-size: 0.9rem;
}

.summary-card strong {
  display: block;
  margin-top: 6px;
}

.notice {
  border-left: 5px solid var(--coral);
  border-radius: 8px;
  padding: 18px 20px;
}

.notice p,
.dashboard p,
.notes li {
  color: var(--muted);
}

.dashboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.dashboard article {
  min-height: 128px;
  border-radius: 8px;
  padding: 18px;
}

.metric {
  display: block;
  margin-bottom: 10px;
  color: var(--sage);
  font-size: 1.4rem;
  font-weight: 850;
}

.planner,
.notes {
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 18px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.text-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--sage);
  cursor: pointer;
  font-weight: 800;
  min-height: 40px;
  padding: 0 14px;
}

.progress-shell {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6ebe8;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sage), var(--teal), var(--coral));
  transition: width 180ms ease;
}

.progress-text {
  margin: 8px 0 0;
}

.routine-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.routine-card {
  border-radius: 8px;
  padding: 20px;
}

.routine-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
}

.routine-heading {
  min-width: 0;
  flex: 1 1 auto;
}

.routine-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.routine-progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6ebe8;
}

.routine-progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sage), var(--gold));
  transition: width 180ms ease;
}

.routine-progress-text {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
  white-space: nowrap;
}

.day-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #eef5f2;
  color: var(--sage);
  font-size: 0.78rem;
  font-weight: 850;
  padding: 7px 10px;
}

.block {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.block-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-weight: 850;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
}

.exercise-list {
  display: grid;
  gap: 9px;
}

.exercise {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.exercise-check {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.exercise input {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  accent-color: var(--sage);
}

.exercise strong {
  display: block;
}

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

.info-button {
  min-width: 52px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
  color: var(--teal);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 850;
}

.info-button:hover {
  border-color: var(--teal);
  background: #eef7f8;
}

.video-section {
  margin-top: 26px;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.video-card {
  display: flex;
  min-height: 168px;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 8px;
  padding: 18px;
  text-decoration: none;
  color: inherit;
}

.video-card:hover,
.text-button:hover {
  border-color: var(--sage);
}

.video-card strong {
  margin-top: 8px;
  font-size: 1rem;
}

.video-card p {
  color: var(--muted);
  margin-bottom: 12px;
}

.video-card b {
  color: var(--teal);
}

.notes {
  margin-top: 22px;
}

.notes ul {
  margin: 0;
  padding-left: 20px;
}

.notes li + li {
  margin-top: 8px;
}

.exercise-dialog {
  width: min(920px, calc(100% - 28px));
  max-height: min(860px, calc(100vh - 28px));
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
}

.exercise-dialog::backdrop {
  background: rgba(23, 28, 31, 0.58);
}

.dialog-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.1fr);
  overflow: hidden;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
}

.icon-button {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  background: rgba(32, 33, 36, 0.62);
  color: white;
  cursor: pointer;
  font-size: 1.6rem;
  line-height: 1;
}

.dialog-image {
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: cover;
  background: #dfe6e2;
}

.dialog-content {
  padding: 28px;
}

.dialog-category {
  display: inline-flex;
  margin-bottom: 10px;
  border-radius: 999px;
  background: #eef5f2;
  color: var(--sage);
  font-size: 0.78rem;
  font-weight: 850;
  padding: 7px 10px;
}

.dialog-content p {
  color: var(--muted);
}

.dialog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.dialog-grid h3 {
  margin-bottom: 8px;
}

.dialog-grid ol,
.dialog-grid ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.dialog-grid li + li {
  margin-top: 7px;
}

.video-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin-top: 22px;
  border-radius: 8px;
  background: var(--teal);
  color: white;
  font-weight: 850;
  padding: 0 16px;
  text-decoration: none;
}

@media (max-width: 880px) {
  .app-header,
  .dashboard,
  .routine-grid,
  .video-grid,
  .dialog-panel,
  .dialog-grid {
    grid-template-columns: 1fr;
  }

  .dialog-image {
    min-height: 260px;
    max-height: 340px;
  }

  .app-header {
    min-height: 56vh;
    align-items: end;
  }

  .summary-card {
    max-width: 360px;
  }
}

@media (max-width: 560px) {
  main {
    width: min(100% - 24px, 1180px);
    margin-top: -24px;
  }

  .app-header {
    padding: 32px 18px;
  }

  .section-title,
  .routine-card header {
    align-items: flex-start;
    flex-direction: column;
  }

  .routine-heading,
  .routine-progress {
    width: 100%;
  }

  .exercise {
    grid-template-columns: 1fr;
  }

  .info-button {
    width: 100%;
  }

  .dialog-content {
    padding: 22px;
  }
}
