:root {
  --bg: #f4f6f3;
  --surface: #fff;
  --surface-soft: #f6f8f5;
  --line: #d9ded8;
  --text: #202722;
  --muted: #65716a;
  --green: #176b49;
  --green-soft: #e8f2ec;
  --blue: #285f8d;
  --blue-soft: #e8f0f7;
  --amber: #8f5d0b;
  --amber-soft: #fff1d8;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  background: var(--bg);
  font: 14px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  color: inherit;
  font: inherit;
}

button {
  cursor: pointer;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.masthead {
  position: relative;
  height: 190px;
  overflow: hidden;
  color: #fff;
  background: #1e332a;
}

.masthead--compact {
  height: 230px;
}

.masthead img,
.masthead__shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.masthead img {
  object-fit: cover;
  object-position: center 48%;
}

.masthead__shade {
  background: linear-gradient(90deg, rgba(18, 35, 28, 0.92), rgba(18, 35, 28, 0.5) 48%, rgba(18, 35, 28, 0.08));
}

.masthead__content {
  position: relative;
  width: min(1320px, calc(100% - 48px));
  margin: 0 auto;
  padding-top: 35px;
}

.masthead__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.masthead__nav a {
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 5px;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
}

.masthead__nav a:hover,
.masthead__nav a:focus-visible,
.masthead__nav a[aria-current="page"] {
  outline: none;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}

.eyebrow {
  margin: 0 0 7px;
  color: #d7ebdf;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 36px;
  line-height: 1.1;
}

.masthead__content > p:last-child {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.88);
}

.shell {
  position: relative;
  width: min(1320px, calc(100% - 48px));
  margin: 24px auto 0;
}

.page-shell {
  width: min(900px, calc(100% - 48px));
  margin: 24px auto 52px;
}

.page-section {
  padding: 24px 27px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.page-section + .page-section {
  margin-top: 12px;
}

.page-section--highlight {
  background: var(--green-soft);
}

.page-section h2 {
  margin: 0 0 10px;
  font-size: 21px;
  line-height: 1.25;
}

.page-section p {
  margin: 0;
  white-space: normal;
}

.page-section p + p,
.page-section p + .text-link,
.page-section p + .code-sample {
  margin-top: 12px;
}

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

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

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  color: var(--green);
  font-weight: 700;
}

.doc-table {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
}

.doc-table > div {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
}

.doc-table > div + div {
  border-top: 1px solid var(--line);
}

.doc-table strong,
.doc-table span {
  padding: 10px 12px;
}

.doc-table strong {
  background: var(--surface-soft);
}

.code-sample {
  margin: 0;
  padding: 14px;
  border: 1px solid #dbe3dc;
  border-radius: 5px;
  color: #183125;
  background: var(--green-soft);
  overflow-x: auto;
}

.code-sample code {
  font: 13px/1.65 "SFMono-Regular", Consolas, monospace;
  white-space: pre;
}

.toolbar {
  display: flex;
  align-items: end;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(25, 36, 30, 0.08);
}

.toolbar > label:not(.search, .check) {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  height: 41px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-soft);
}

.search svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}

select {
  min-width: 180px;
  height: 41px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
}

.check {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 41px;
  padding: 0 10px;
  white-space: nowrap;
}

.check input {
  width: 17px;
  height: 17px;
  accent-color: var(--green);
}

.layout {
  display: grid;
  grid-template-columns: 390px minmax(0, 1fr);
  grid-template-areas: "catalog detail";
  gap: 12px;
  height: calc(100vh - 255px);
  min-height: 540px;
  margin-top: 12px;
}

.catalog,
.detail {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.catalog {
  display: flex;
  flex-direction: column;
  grid-area: catalog;
}

.catalog__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 15px;
  border-bottom: 1px solid var(--line);
}

.catalog__heading h2 {
  margin: 0;
  font-size: 15px;
}

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

#workout-list,
.detail {
  overflow-y: auto;
}

.workout {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid #ebeeea;
  background: transparent;
  text-align: left;
}

.workout:hover,
.workout:focus-visible {
  outline: none;
  background: var(--surface-soft);
}

.workout.is-selected {
  background: #edf4ef;
  box-shadow: inset 3px 0 var(--green);
}

.workout__title {
  display: block;
  font-weight: 680;
}

.workout__bucket {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.workout__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.tag {
  padding: 2px 7px;
  border-radius: 4px;
  color: #405047;
  background: #edf1ed;
  font-size: 11px;
}

.detail {
  grid-area: detail;
  padding: 24px 27px 32px;
}

.detail__bucket {
  margin: 0 0 5px;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.detail h2 {
  margin: 0;
  font-size: 27px;
  line-height: 1.2;
}

.timer-card {
  position: relative;
  margin: 20px 0;
  border: 1px solid #dbe3dc;
  border-radius: 5px;
  background: var(--green-soft);
}

.timer {
  display: block;
  min-height: 55px;
  padding: 14px 112px 14px 14px;
  color: #183125;
  font: 13px/1.65 "SFMono-Regular", Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.copy-timer {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #b9c8bd;
  border-radius: 5px;
  color: #183125;
  background: var(--surface);
}

.copy-timer svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.copy-timer:hover,
.copy-timer:focus-visible {
  outline: none;
  border-color: var(--green);
  background: var(--green-soft);
}

.copy-timer:disabled {
  cursor: default;
  color: var(--muted);
}

.copy-timer.is-copied {
  color: var(--green);
  border-color: var(--green);
  background: var(--surface);
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -8px 0 20px;
}

.export-workout,
.download-workout {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid #b9c8bd;
  border-radius: 5px;
  color: #183125;
  background: var(--surface);
  font-weight: 650;
  text-decoration: none;
}

.download-workout {
  color: var(--muted);
  background: transparent;
}

.export-workout:hover,
.export-workout:focus-visible,
.download-workout:hover,
.download-workout:focus-visible {
  outline: none;
  border-color: var(--green);
  background: var(--green-soft);
}

.export-workout svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.clipboard-fallback {
  position: fixed;
  left: -9999px;
  top: 0;
}

.properties {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 22px;
}

.property {
  padding: 5px 9px;
  border-radius: 4px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 12px;
  font-weight: 600;
}

.property--accent {
  color: var(--amber);
  background: var(--amber-soft);
}

.detail section {
  margin-top: 22px;
}

.detail h3 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.detail p {
  margin: 0;
  white-space: pre-wrap;
}

.empty {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--muted);
}

@media (max-width: 850px) {
  .masthead__content,
  .shell,
  .page-shell {
    width: min(100% - 28px, 680px);
  }

  .toolbar {
    flex-wrap: wrap;
  }

  .search {
    flex-basis: 100%;
  }

  .toolbar > label:not(.search, .check) {
    flex: 1;
  }

  select {
    width: 100%;
    min-width: 0;
  }

  .layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "detail"
      "catalog";
    height: auto;
    min-height: 0;
  }

  .catalog {
    min-height: 0;
  }

  .detail {
    overflow: visible;
    min-height: 480px;
  }

  #workout-list {
    overflow: visible;
  }
}

@media (max-width: 520px) {
  .masthead {
    height: 168px;
  }

  .masthead--compact {
    height: 226px;
  }

  .masthead__content {
    padding-top: 26px;
  }

  .masthead__nav {
    margin-bottom: 18px;
  }

  h1 {
    font-size: 31px;
  }

  .detail,
  .page-section {
    padding: 19px 16px 25px;
  }

  .timer {
    padding: 54px 12px 12px;
  }
}
