:root {
  --bg: #f7f4ed;
  --panel: #ffffff;
  --ink: #11181c;
  --muted: #637178;
  --line: #d9dedf;
  --red: #df3442;
  --teal: #1f9d96;
  --gold: #d69a22;
  --navy: #15242c;
  --soft-teal: #e8f4f3;
  --soft-gold: #fff4d9;
  --shadow: 0 18px 50px rgba(17, 24, 28, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

a {
  color: inherit;
}

.site-header {
  padding: 38px clamp(18px, 4vw, 64px) 24px;
  background:
    linear-gradient(130deg, rgba(21, 36, 44, 0.98), rgba(21, 36, 44, 0.9)),
    var(--navy);
  color: #ffffff;
}

.header-copy {
  max-width: 850px;
}

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

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

h1 {
  max-width: 780px;
  margin-bottom: 18px;
  font-size: clamp(2.2rem, 5vw, 4.7rem);
  line-height: 0.96;
  letter-spacing: 0;
}

main {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 22px clamp(14px, 3vw, 40px) 42px;
}

.controls {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(280px, 1fr);
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(247, 244, 237, 0.94);
  backdrop-filter: blur(16px);
}

label {
  display: grid;
  gap: 6px;
}

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

input,
select,
button {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

input,
select {
  padding: 0 12px;
}

button {
  cursor: pointer;
  font-weight: 800;
}

button:hover,
a.workout-link:hover {
  border-color: var(--teal);
}

.layout {
  margin-top: 20px;
}

.results-bar h2 {
  margin-bottom: 12px;
  font-size: 1rem;
}

.results-bar {
  margin-bottom: 14px;
}

.schedule-card {
  scroll-margin-top: 96px;
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 26px rgba(17, 24, 28, 0.06);
}

.schedule-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, #ffffff, #f4faf9);
}

.schedule-head h3 {
  margin-bottom: 0;
  font-size: 1.35rem;
  line-height: 1.15;
}

.group {
  padding: 16px 18px 20px;
}

.group + .group {
  border-top: 1px solid var(--line);
}

.group-title {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
  text-transform: uppercase;
}

.week-block {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.week-label {
  display: inline-flex;
  width: fit-content;
  padding: 5px 9px;
  border-radius: 6px;
  background: var(--navy);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 900;
}

.workout-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.workout-row.has-day-tag {
  grid-template-columns: minmax(82px, 120px) minmax(0, 1fr) auto;
}

.day-tag {
  display: inline-flex;
  justify-content: center;
  min-height: 34px;
  padding: 7px 9px;
  border-radius: 6px;
  background: #f1f4f4;
  color: #334148;
  font-size: 0.82rem;
  font-weight: 850;
}

.workout-title {
  font-weight: 850;
  overflow-wrap: anywhere;
}

.workout-link,
.missing-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 98px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 900;
}

.workout-link {
  background: var(--ink);
  color: #ffffff;
}

.missing-link {
  background: #f4f1ea;
  color: var(--muted);
}

.empty-state {
  padding: 30px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  text-align: center;
}

footer {
  padding: 0 clamp(18px, 4vw, 64px) 38px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 980px) {
  .controls {
    top: 0;
    grid-template-columns: 1fr;
    box-shadow: 0 10px 26px rgba(17, 24, 28, 0.12);
  }

  .search-field,
  .jump-field {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .site-header {
    padding-top: 26px;
  }

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

  .workout-row,
  .workout-row.has-day-tag {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 10px;
    padding: 10px;
  }

  .workout-row.has-day-tag .day-tag {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .schedule-head {
    grid-template-columns: 1fr;
  }

  .workout-link,
  .missing-link {
    min-width: 66px;
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.8rem;
  }

  .schedule-card {
    scroll-margin-top: 180px;
  }
}
