.primary-nav {
  margin-top: 72px;
  display: grid;
  gap: 9px;
}

.nav-link {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.nav-link:focus-visible,
.mobile-nav button:focus-visible,
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.topbar-actions,
.mission-actions,
.card-actions,
.workout-footer-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.network,
.save-status {
  font: 10px "DM Mono", monospace;
}

.network {
  color: var(--green);
  border: 1px solid var(--line);
  padding: 8px 10px;
  white-space: nowrap;
}

.network.is-offline {
  color: #ffd28a;
}

.save-status {
  min-height: 34px;
  margin: -18px 0 16px;
  color: #a1aeca;
}

.save-status.is-offline,
.save-status.is-warning {
  color: #ffd28a;
}

.save-status.is-error {
  color: #ff9eaa;
}

.mission {
  padding: 38px clamp(22px, 4vw, 46px);
}

.mission h2 {
  margin: 0 0 8px;
  font-size: clamp(30px, 4vw, 42px);
  letter-spacing: -2px;
}

.mission-exercises {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 38px;
  margin: 25px 0 18px;
  padding: 0;
  list-style: none;
}

.mission-exercises li,
.exercise-library li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  font-size: 13px;
}

.mission-exercises li span,
.exercise-library li > span {
  color: var(--cyan);
  font: 10px "DM Mono", monospace;
  white-space: nowrap;
}

.mission-actions {
  margin-top: 18px;
}

.plan-picker {
  display: grid;
  gap: 6px;
  margin-top: 24px;
  max-width: 300px;
  color: var(--muted);
  font: 9px "DM Mono", monospace;
  letter-spacing: 1px;
}

.plan-picker select,
.builder input,
.builder select,
.builder textarea,
.set-row input {
  width: 100%;
  min-width: 0;
  border: 1px solid #2a394d;
  border-radius: 0;
  background: #0b1019;
  color: var(--text);
  padding: 12px;
  font: 14px Manrope, sans-serif;
}

.metric-date {
  font-size: 21px !important;
}

.resume-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
}

.resume-banner strong,
.resume-banner small {
  display: block;
}

.resume-banner small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.empty-inline {
  padding: 18px 0;
  color: var(--muted);
  font-size: 12px;
}

.empty-inline p {
  margin: 0;
}

.session-progress {
  height: 3px;
  margin: -18px 0 14px;
  background: #273143;
}

.session-progress span {
  display: block;
  height: 100%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  transition: width 180ms ease;
}

.logger {
  padding: 28px;
}

.logger-head,
.builder-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
}

.logger-head .muted,
.builder-head .muted {
  margin-bottom: 0;
}

.timer {
  text-align: right;
  color: var(--muted);
  font: 10px "DM Mono", monospace;
  white-space: nowrap;
}

.timer strong {
  display: block;
  margin-top: 5px;
  color: var(--cyan);
  font-size: 25px;
}

.previous-hint {
  display: flex;
  align-items: center;
  gap: 10px 16px;
  flex-wrap: wrap;
  margin-top: 22px;
  padding: 13px 15px;
  border-left: 2px solid var(--cyan);
  background: rgba(84, 200, 255, .05);
}

.previous-hint > span {
  color: var(--muted);
  font: 9px "DM Mono", monospace;
  letter-spacing: .6px;
}

.previous-hint strong {
  color: var(--text);
  font-size: 12px;
}

.previous-hint .text-button {
  margin-left: auto;
  padding: 0;
}

.set-labels,
.set-row {
  display: grid;
  grid-template-columns: 62px minmax(90px, 1fr) minmax(90px, 1fr) 48px;
  gap: 12px;
  align-items: center;
}

.set-labels {
  padding: 25px 8px 9px;
  color: var(--muted);
  font: 9px "DM Mono", monospace;
}

.set-row {
  padding: 12px 8px;
  border-top: 1px solid var(--line);
  font: 13px "DM Mono", monospace;
}

.set-row:last-child {
  border-bottom: 1px solid var(--line);
}

.set-row input {
  min-height: 48px;
  font: 16px "DM Mono", monospace;
}

.set-row input::placeholder {
  color: #65738a;
}

.set-index {
  color: var(--cyan);
}

.set-done {
  background: rgba(100, 230, 181, .055);
}

.set-done input {
  border-color: rgba(100, 230, 181, .35);
}

.set-done .set-index {
  color: var(--green);
}

.check {
  width: 42px;
  height: 42px;
  border: 1px solid #425067;
  background: transparent;
  color: #73829a;
  cursor: pointer;
  font-size: 18px;
  transition: .18s;
}

.check:hover,
.check.done {
  border-color: var(--green);
  background: rgba(131, 240, 195, .13);
  color: var(--green);
}

.logger-actions,
.workout-footer {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.workout-footer {
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.secondary-button,
.icon-button {
  border: 1px solid #34445a;
  background: transparent;
  color: #c9d6eb;
  padding: 11px 14px;
  font: 10px "DM Mono", monospace;
  cursor: pointer;
}

.secondary-button:hover,
.icon-button:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.secondary-button:disabled,
.icon-button:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.abandon-button {
  color: #ff9eaa;
}

.summary {
  padding: clamp(24px, 5vw, 48px);
}

.summary h1 {
  font-size: clamp(32px, 5vw, 42px);
}

.summary-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 34px 0;
  border: 1px solid var(--line);
}

.summary-stats > div {
  min-width: 0;
  padding: 18px;
  border-right: 1px solid var(--line);
}

.summary-stats > div:last-child {
  border-right: 0;
}

.summary-stats small {
  display: block;
  color: var(--muted);
  font: 9px "DM Mono", monospace;
}

.summary-stats strong {
  display: block;
  margin-top: 9px;
  font-size: 24px;
  overflow-wrap: anywhere;
}

.summary-stats em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.progression {
  margin: 24px 0;
  padding: 12px 18px;
  border-left: 2px solid var(--cyan);
  background: rgba(84, 200, 255, .05);
}

.progression p {
  margin-bottom: 8px;
}

.progression strong {
  font-size: 13px;
}

.summary-detail {
  margin: 24px 0;
}

.summary-detail ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.summary-detail li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.summary-detail li strong {
  color: var(--cyan);
  font: 12px "DM Mono", monospace;
  text-align: right;
}

.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 275px), 1fr));
  gap: 14px;
}

.plan-card,
.library,
.builder,
.history {
  padding: 26px;
}

.plan-card h3,
.history h3,
.library h3 {
  margin-bottom: 0;
  font-size: 19px;
}

.plan-card ol {
  padding-left: 18px;
  color: #aebcd1;
  font-size: 12px;
}

.plan-card li {
  padding: 8px 0;
}

.plan-card li span {
  float: right;
  color: var(--cyan);
  font-family: "DM Mono", monospace;
}

.card-actions {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--cyan);
  padding: 12px 0;
  font: 10px "DM Mono", monospace;
  text-transform: uppercase;
  letter-spacing: .5px;
  cursor: pointer;
}

.danger-text {
  color: #ff9eaa;
}

.compact {
  margin-top: 0;
}

.library {
  margin-top: 14px;
}

.exercise-library {
  margin: 14px 0 20px;
  padding: 0;
  list-style: none;
}

.exercise-library li {
  align-items: flex-start;
}

.exercise-library li > div {
  display: grid;
  gap: 5px;
}

.exercise-library small,
.exercise-library a {
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.exercise-library a:hover {
  color: var(--cyan);
}

.exercise-create {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.exercise-create summary {
  color: var(--cyan);
  cursor: pointer;
  font: 10px "DM Mono", monospace;
  text-transform: uppercase;
}

.builder {
  display: grid;
  gap: 20px;
}

.builder > label {
  display: grid;
  gap: 8px;
  color: #aebcd1;
  font: 11px "DM Mono", monospace;
}

.builder textarea {
  min-height: 85px;
  resize: vertical;
}

.builder input:focus,
.builder select:focus,
.builder textarea:focus,
.set-row input:focus {
  border-color: var(--cyan);
}

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

.plan-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 100px 100px auto;
  gap: 10px;
  align-items: end;
  margin: 10px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.plan-row label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font: 9px "DM Mono", monospace;
}

.plan-row input,
.plan-row select {
  margin-top: 5px;
  font-family: Manrope, sans-serif;
}

.row-actions {
  display: flex;
  gap: 4px;
}

.icon-button {
  min-width: 34px;
  min-height: 38px;
  padding: 5px;
  font-size: 15px;
}

.history article {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 70px 120px auto;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
}

.history article:last-child {
  border: 0;
}

.history article h3 {
  font-size: 15px;
}

.history article strong {
  display: block;
  font: 18px "DM Mono", monospace;
}

.history article span:not(.tag) {
  color: var(--muted);
  font-size: 10px;
}

.history .eyebrow {
  overflow-wrap: anywhere;
}

.empty {
  padding: 34px 18px;
  text-align: center;
}

.empty h2 {
  font-size: 25px;
}

.empty .muted {
  margin: 0 auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mobile-nav {
  display: none;
}

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

.exercise-library-actions .text-button {
  padding: 4px 0;
}

@media (max-width: 900px) {
  .sidebar {
    width: 190px;
  }

  .content {
    padding-right: 28px;
    padding-left: 28px;
  }

  .summary-stats > div {
    padding: 14px 10px;
  }

  .summary-stats strong {
    font-size: 20px;
  }
}

@media (max-width: 680px) {
  .mission {
    padding: 27px 20px;
  }

  .mission-exercises {
    grid-template-columns: 1fr;
  }

  .logger {
    padding: 20px 12px;
  }

  .set-labels,
  .set-row {
    grid-template-columns: 34px minmax(0, 1fr) minmax(0, 1fr) 42px;
    gap: 7px;
  }

  .set-row input {
    min-height: 46px;
    padding: 8px;
  }

  .check {
    width: 40px;
    height: 40px;
  }

  .summary-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-stats > div:nth-child(2) {
    border-right: 0;
  }

  .summary-stats > div:nth-child(-n+2) {
    border-bottom: 1px solid var(--line);
  }

  .plan-row {
    grid-template-columns: minmax(0, 1fr) 65px 65px;
    gap: 8px;
  }

  .plan-row > label:first-child {
    grid-column: 1 / -1;
  }

  .row-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .history article {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }

  .history article > :nth-child(3) {
    grid-column: 2;
    grid-row: 2;
  }

  .history article > button {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .sidebar {
    display: none;
  }

  .content {
    padding: 28px 17px 96px;
  }

  .topbar {
    gap: 10px;
    margin-bottom: 24px;
  }

  .topbar-actions {
    justify-content: flex-end;
  }

  .network {
    padding: 7px;
    font-size: 8px;
  }

  .save-status {
    margin-top: -10px;
    font-size: 9px;
  }

  .mobile-nav {
    display: flex;
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 4;
    justify-content: space-around;
    border-top: 1px solid var(--line);
    background: rgba(16, 22, 33, .97);
    padding-bottom: env(safe-area-inset-bottom);
    margin: 0;
    gap: 0;
  }

  .mobile-nav button {
    flex: 1;
    border: 0;
    background: transparent;
    color: #aab7cc;
    padding: 15px 8px;
    font: 10px "DM Mono", monospace;
    cursor: pointer;
  }

  .mobile-nav button.active {
    color: var(--cyan);
  }
}

@media (max-width: 390px) {
  .workout-footer {
    align-items: stretch;
  }

  .workout-footer,
  .workout-footer-left {
    flex-direction: column;
  }

  .workout-footer > button,
  .workout-footer-left button {
    width: 100%;
  }

  .previous-hint .text-button {
    margin-left: 0;
  }
}
