:root {
  color-scheme: light;
  --bg: #f5f3ef;
  --panel: #ffffff;
  --ink: #202426;
  --muted: #6d7377;
  --line: #dedbd3;
  --accent: #1f7a68;
  --accent-soft: #dff1ed;
  --warn: #a8462d;
  --shadow: 0 18px 45px rgba(37, 41, 44, 0.1);
}

* {
  box-sizing: border-box;
}

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

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 10px;
  font-size: 2.1rem;
}

h2 {
  margin-bottom: 0;
  font-size: 1.1rem;
}

.brand-wordmark {
  color: var(--accent);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h3 {
  margin-bottom: 4px;
  font-size: 1.25rem;
}

.muted,
.asset-name,
.instruction {
  color: var(--muted);
}

.panel-header,
.exercise-title-row,
.topbar,
.modal-header,
.sets-head,
.set-row {
  display: flex;
  align-items: center;
}

.panel-header,
.exercise-title-row,
.topbar,
.modal-header {
  justify-content: space-between;
  gap: 16px;
}

.icon-button,
.edit-exercise,
.remove-set {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.remove-set {
  color: var(--warn);
}

.edit-exercise {
  color: var(--accent);
}

.search-wrap input {
  width: 100%;
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.search-mode {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 16px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f5f0;
}

.search-mode-button {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.search-mode-button.active {
  background: var(--panel);
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(20, 24, 26, 0.08);
}

.modal-results {
  display: grid;
  gap: 8px;
  max-height: min(54vh, 520px);
  margin-top: 12px;
  overflow: auto;
}

.search-result {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

.search-result strong,
.search-result span {
  display: block;
}

.search-result span {
  color: var(--muted);
  font-size: 0.8rem;
}

main {
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  min-width: 0;
  padding: 28px;
}

.back-button,
.primary-button,
.open-routine,
.add-exercise-bottom {
  border-radius: 8px;
  font-weight: 800;
}

.back-button {
  padding: 9px 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.nav-sign-in {
  width: auto;
  min-width: 0;
  padding: 9px 14px;
  border: 1px solid rgba(31, 122, 104, 0.28);
  border-radius: 999px;
  background: #fff;
  color: var(--accent);
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(37, 41, 44, 0.08);
}

.primary-button,
.open-routine,
.add-exercise-bottom {
  padding: 11px 14px;
  border: 0;
  background: var(--accent);
  color: #fff;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: -28px -28px 24px;
  padding: 22px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 243, 239, 0.92);
  backdrop-filter: blur(14px);
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.auth-page {
  display: grid;
  gap: 22px;
  min-height: 62vh;
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: 28px;
  min-height: min(620px, calc(100vh - 120px));
  align-items: center;
}

.hero-copy {
  display: grid;
  gap: 18px;
  align-content: center;
}

.hero-copy h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.5rem, 7vw, 5.8rem);
  line-height: 0.95;
}

.hero-copy p:not(.eyebrow) {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.hero-actions a {
  text-decoration: none;
}

.hero-actions span {
  color: var(--muted);
  font-size: 0.92rem;
}

.hero-visual {
  position: relative;
  min-height: 430px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #dff5f7;
  box-shadow: var(--shadow);
}

.hero-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.hero-data-card {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px solid rgba(222, 219, 211, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
}

.hero-data-card.secondary {
  top: 16px;
  right: 16px;
  bottom: auto;
  left: auto;
  width: min(250px, calc(100% - 32px));
}

.hero-data-card strong,
.hero-data-card span {
  display: block;
}

.hero-data-card span {
  color: var(--muted);
  font-size: 0.84rem;
}

.auth-card {
  display: grid;
  gap: 18px;
  width: min(480px, 100%);
  margin: 0 auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.sign-in-page {
  align-self: start;
  margin-top: min(12vh, 110px);
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form label,
.auth-form label span {
  display: grid;
  gap: 6px;
}

.auth-form label span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.auth-form input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.auth-form input[readonly] {
  background: #f5f3ef;
  color: var(--muted);
}

.auth-message {
  margin: 0;
  color: var(--accent);
  font-weight: 750;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(86px, 1fr));
  gap: 10px;
}

.summary-grid div {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.summary-grid span {
  display: block;
  font-size: 1.1rem;
  font-weight: 800;
}

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

.routine-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.workout-timer {
  min-width: 64px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-weight: 850;
  text-align: center;
}

.routine-summary-panel {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.routine-list {
  display: grid;
  gap: 18px;
}

.add-exercise-bottom {
  width: 100%;
  min-height: 56px;
  margin-top: 4px;
  font-size: 1rem;
}

.app-credit {
  padding: 24px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.app-credit a {
  color: inherit;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  align-items: end;
  padding: 18px;
  background: rgba(32, 36, 38, 0.36);
}

.modal-overlay[hidden] {
  display: none;
}

.exercise-modal,
.edit-modal {
  width: min(720px, 100%);
  max-height: min(82vh, 760px);
  margin: 0 auto;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(20, 24, 26, 0.28);
}

.edit-modal {
  width: min(460px, 100%);
}

.edit-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.edit-action {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.edit-action strong,
.edit-action span {
  display: block;
}

.edit-action span {
  color: var(--muted);
  font-size: 0.86rem;
}

.edit-action.danger strong {
  color: var(--warn);
}

.workouts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.calendar-panel {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 2fr) minmax(190px, 1fr);
  gap: 16px;
  align-items: stretch;
  height: min(42vh, 360px);
  min-height: 300px;
}

.calendar-card,
.streak-counter {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.calendar-card {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 8px;
  min-width: 0;
  min-height: 0;
  padding: 14px;
  overflow: hidden;
}

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

.view-history-button {
  padding: 8px 10px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 850;
}

.streak-counter {
  position: relative;
  display: grid;
  gap: 7px;
  place-items: center;
  border: 1px solid var(--line);
  min-height: 0;
  padding: 14px;
  border: 1px solid rgba(31, 122, 104, 0.22);
  background: linear-gradient(180deg, #ffffff 0%, #eef8f5 100%);
  color: #145f50;
  text-align: center;
}

.streak-counter strong {
  font-size: 2.1rem;
  line-height: 1;
}

.streak-counter span {
  font-size: 0.9rem;
  font-weight: 800;
}

.streak-flame {
  position: relative;
  width: 46px;
  height: 56px;
  animation: flame-float 1.8s ease-in-out infinite;
}

.streak-flame::before,
.streak-flame::after,
.streak-flame span {
  position: absolute;
  content: "";
  left: 50%;
  bottom: 2px;
  transform: translateX(-50%) rotate(45deg);
  border-radius: 68% 18% 64% 34%;
}

.streak-flame::before {
  width: 36px;
  height: 44px;
  background: linear-gradient(135deg, #ff4d2d 0%, #ff9a31 62%, #ffd36a 100%);
  box-shadow: 0 10px 28px rgba(255, 114, 43, 0.34);
  animation: flame-pulse 1.25s ease-in-out infinite;
}

.streak-flame::after {
  bottom: 8px;
  width: 24px;
  height: 29px;
  background: linear-gradient(135deg, #ffd967 0%, #fff1b2 100%);
  animation: flame-pulse 1.25s ease-in-out -0.15s infinite;
}

.streak-flame span {
  bottom: 15px;
  width: 12px;
  height: 18px;
  background: #fff8cf;
  opacity: 0.85;
}

.calendar-weekdays,
.calendar-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.calendar-weekdays {
  display: grid;
}

.calendar-weekdays span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-align: center;
}

.calendar-grid {
  display: grid;
}

.calendar-day {
  position: relative;
  display: grid;
  height: clamp(44px, 6.2vh, 62px);
  min-height: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 850;
  text-decoration: none;
}

.calendar-day.trained {
  border-color: rgba(31, 122, 104, 0.3);
  background: var(--accent-soft);
  color: #145f50;
}

.calendar-day.today {
  box-shadow: inset 0 0 0 2px rgba(31, 122, 104, 0.42);
}

.calendar-day.selected {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.calendar-day i {
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 12px;
  height: 14px;
}

.calendar-day i::before,
.calendar-day i::after,
.calendar-day i span {
  position: absolute;
  content: "";
  left: 50%;
  bottom: 0;
  transform: translateX(-50%) rotate(45deg);
  border-radius: 68% 18% 64% 34%;
}

.calendar-day i::before {
  width: 10px;
  height: 13px;
  background: #ff7a2f;
}

.calendar-day i::after {
  bottom: 2px;
  width: 7px;
  height: 9px;
  background: #ffd766;
}

.calendar-day i span {
  bottom: 4px;
  width: 3px;
  height: 5px;
  background: #fff4b7;
}

.day-detail-page {
  display: grid;
  gap: 16px;
}

.day-detail-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.day-detail-card h3 {
  margin-bottom: 0;
}

.day-detail-list {
  display: grid;
  gap: 12px;
}

.day-detail-list article {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
}

.day-detail-workout-header,
.day-edit-exercise-header,
.day-edit-set {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.day-detail-workout-header > div {
  display: grid;
  gap: 2px;
}

.day-detail-list small {
  color: var(--muted);
}

.save-workout-edit,
.add-logged-set {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.save-workout-edit {
  padding: 8px 10px;
}

.save-workout-edit:disabled {
  opacity: 0.62;
}

.day-edit-exercises,
.day-edit-exercise,
.day-edit-sets {
  display: grid;
  gap: 10px;
}

.day-edit-exercise {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.day-edit-head,
.day-edit-set {
  display: grid;
  grid-template-columns: 36px minmax(82px, 1fr) minmax(82px, 1fr) 32px;
  gap: 8px;
  align-items: center;
}

.day-edit-head {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.day-edit-set > span {
  font-weight: 850;
}

.day-edit-set input {
  min-width: 0;
  width: 100%;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.remove-logged-set {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--warn);
  font-weight: 900;
}

.add-logged-set {
  width: max-content;
  padding: 8px 10px;
}

@keyframes flame-float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

@keyframes flame-pulse {
  0%, 100% {
    transform: translateX(-50%) rotate(45deg) scale(1);
  }
  50% {
    transform: translateX(-50%) rotate(45deg) scale(1.07, 0.96);
  }
}

.workout-card {
  display: grid;
  gap: 16px;
  min-height: 260px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.workout-card h3 {
  font-size: 1.35rem;
}

.workout-preview {
  display: flex;
  min-height: 86px;
  align-items: center;
}

.workout-preview img {
  width: 64px;
  height: 64px;
  margin-right: -10px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #f8f8f5;
  object-fit: contain;
}

.exercise-card {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.exercise-media {
  display: grid;
  min-height: 180px;
  max-height: 210px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f8f5;
}

.exercise-media img {
  width: 100%;
  height: auto;
  max-height: 190px;
  object-fit: contain;
}

.asset-name {
  margin-bottom: 0;
  font-size: 0.86rem;
}

.muscle-dropdown {
  margin: 12px 0;
}

.muscle-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
}

.muscle-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 0 12px;
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}

.muscle-details summary::-webkit-details-marker {
  display: none;
}

.muscle-details summary::after {
  content: "⌄";
  color: var(--muted);
  font-size: 1.05rem;
}

.muscle-details[open] summary::after {
  transform: rotate(180deg);
}

.muscle-details summary strong {
  display: inline-grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #145f50;
  font-size: 0.78rem;
}

.muscle-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  padding: 0 10px 10px;
}

.muscle-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid #ebe7df;
  border-radius: 8px;
  background: #fff;
}

.muscle-thumb {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid #d9e3e0;
  background: #f1f6f5;
}

.muscle-thumb img {
  width: 92%;
  height: 92%;
  object-fit: contain;
}

.muscle-row strong,
.muscle-row small {
  display: block;
}

.muscle-row strong {
  overflow: hidden;
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.muscle-row code {
  color: var(--muted);
  font-family: inherit;
  font-size: 0.76em;
  font-weight: 700;
}

.muscle-row small {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: capitalize;
}

.instruction {
  margin-bottom: 16px;
  line-height: 1.45;
}

.sets {
  min-width: 0;
  overflow-x: auto;
}

.sets-head,
.set-row {
  display: grid;
  grid-template-columns: 42px 52px 92px minmax(82px, 1fr) minmax(82px, 1fr) 38px;
  gap: 10px;
  min-width: 590px;
  align-items: center;
}

.sets-head > *,
.set-row > * {
  min-width: 0;
}

.sets-head {
  padding: 0 0 8px;
  color: var(--muted);
  font-size: 0.77rem;
  font-weight: 800;
  text-transform: uppercase;
}

.set-row {
  padding: 7px 0;
  border-top: 1px solid #ece9e2;
}

.set-index {
  font-weight: 800;
}

.prev-button {
  padding: 8px 10px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent-soft);
  color: #145f50;
  font-weight: 800;
  white-space: nowrap;
}

.set-done {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #fff;
  font-weight: 900;
}

.set-done.checked {
  border-color: var(--accent);
  background: var(--accent);
}

.set-done:disabled {
  cursor: default;
  opacity: 0.45;
}

.set-row input {
  min-width: 0;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.add-set {
  margin-top: 12px;
  padding: 10px 13px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.status {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .calendar-panel {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
    max-height: none;
  }

  .streak-counter {
    grid-template-columns: auto 1fr;
    min-height: 86px;
    justify-items: start;
  }

  .streak-flame {
    grid-row: span 2;
  }

  .topbar-actions {
    width: 100%;
  }

  .topbar-actions button {
    flex: 1;
  }

  .auth-mode .topbar-actions {
    width: auto;
    margin-left: auto;
  }

  .auth-mode .topbar-actions button {
    flex: none;
  }

  .auth-page {
    min-height: 68vh;
  }

  .auth-card {
    padding: 16px;
  }

  .landing-hero {
    grid-template-columns: 1fr;
    gap: 16px;
    min-height: auto;
  }

  .hero-copy {
    gap: 12px;
  }

  .hero-copy h1 {
    font-size: 2.8rem;
  }

  .hero-copy p:not(.eyebrow) {
    font-size: 0.98rem;
  }

  .hero-visual {
    min-height: 290px;
  }

  .hero-data-card {
    left: 10px;
    right: 10px;
    bottom: 10px;
  }

  .hero-data-card.secondary {
    top: 10px;
    right: 10px;
  }

  .exercise-card {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .exercise-media {
    aspect-ratio: 16 / 10;
    min-height: 0;
    max-height: 260px;
  }

  .exercise-media img {
    max-height: 240px;
  }
}

@media (max-width: 560px) {
  main {
    padding: 12px;
  }

  .topbar {
    margin: -12px -12px 12px;
    padding: 14px 12px;
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .auth-mode .topbar {
    align-items: center;
    flex-direction: row;
  }

  .auth-mode .topbar-actions {
    width: auto;
    margin-left: auto;
  }

  .auth-mode .topbar-actions button {
    flex: none;
    white-space: nowrap;
  }

  .summary-grid {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .summary-grid div {
    padding: 8px;
  }

  .summary-grid span {
    font-size: 0.98rem;
  }

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

  .calendar-panel {
    gap: 10px;
  }

  .calendar-card {
    overflow: visible;
  }

  .calendar-card {
    gap: 9px;
    padding: 14px;
    background: #1c1625;
    color: #f9f7ff;
  }

  .calendar-card .eyebrow {
    color: #86dfd1;
  }

  .calendar-card h3 {
    color: #fff;
  }

  .view-history-button {
    color: #5fc8ff;
  }

  .calendar-weekdays,
  .calendar-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
  }

  .calendar-weekdays span {
    color: #7f768f;
  }

  .calendar-day {
    height: clamp(42px, 11vw, 48px);
    min-height: 0;
    border-color: #3a3147;
    background: #2a2335;
    color: #e9e3f3;
  }

  .calendar-day.trained {
    border-color: #6b6180;
    background: #30283c;
  }

  .calendar-day.today {
    box-shadow: inset 0 0 0 2px #54c7f6;
  }

  .calendar-day.selected {
    border-color: #54c7f6;
    background: #2b2438;
    color: #fff;
  }

  .streak-counter {
    grid-template-columns: auto 1fr;
    min-height: 88px;
    justify-items: start;
    padding: 14px;
  }

  .streak-flame {
    grid-row: span 2;
    width: 42px;
    height: 52px;
  }

  .streak-counter strong {
    font-size: 1.75rem;
  }

  .routine-list {
    gap: 12px;
  }

  .exercise-card {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 10px 12px;
    padding: 10px;
  }

  .exercise-media {
    width: 88px;
    min-height: 88px;
    max-height: 88px;
    aspect-ratio: 1;
  }

  .exercise-media img {
    max-height: 86px;
  }

  .exercise-body {
    display: contents;
  }

  .exercise-title-row {
    align-self: center;
    gap: 8px;
  }

  .exercise-title-row h3 {
    font-size: 1.08rem;
    line-height: 1.15;
  }

  .asset-name {
    display: none;
  }

  .edit-exercise {
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
  }

  .muscle-dropdown,
  .instruction,
  .sets,
  .add-set {
    grid-column: 1 / -1;
  }

  .muscle-dropdown {
    margin: 0;
  }

  .muscle-details summary {
    min-height: 36px;
    padding: 0 10px;
    font-size: 0.86rem;
  }

  .muscle-list {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 0 8px 8px;
  }

  .muscle-row {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 7px;
    padding: 6px;
  }

  .muscle-thumb {
    width: 34px;
    height: 34px;
  }

  .muscle-row strong {
    font-size: 0.76rem;
  }

  .muscle-row code {
    display: block;
    margin-top: 1px;
  }

  .muscle-row small {
    font-size: 0.64rem;
  }

  .instruction {
    display: none;
  }

  .sets {
    overflow-x: visible;
  }

  .sets-head,
  .set-row {
    grid-template-columns: 22px 30px 58px minmax(42px, 1fr) minmax(42px, 1fr) 26px;
    gap: 6px;
    min-width: 0;
  }

  .sets-head {
    font-size: 0.62rem;
  }

  .set-row {
    padding: 5px 0;
  }

  .prev-button {
    padding: 6px 4px;
    font-size: 0.72rem;
  }

  .set-row input {
    padding: 7px 6px;
    font-size: 0.84rem;
  }

  .remove-set {
    width: 26px;
    height: 26px;
  }

  .set-done {
    width: 26px;
    height: 26px;
  }

  .add-set {
    width: max-content;
    margin-top: 2px;
    padding: 8px 10px;
    font-size: 0.86rem;
  }

  .day-detail-card {
    padding: 14px;
  }

  .day-detail-workout-header {
    align-items: flex-start;
  }

  .save-workout-edit {
    padding: 7px 9px;
    font-size: 0.78rem;
    white-space: nowrap;
  }

  .day-edit-exercise {
    padding: 10px;
  }

  .day-edit-head,
  .day-edit-set {
    grid-template-columns: 24px minmax(58px, 1fr) minmax(58px, 1fr) 28px;
    gap: 6px;
  }

  .day-edit-head {
    font-size: 0.64rem;
  }

  .day-edit-set input {
    padding: 7px 6px;
    font-size: 0.84rem;
  }

  .remove-logged-set {
    width: 26px;
    height: 26px;
  }

  .add-logged-set {
    padding: 7px 9px;
    font-size: 0.82rem;
  }
}
