body > header,
.wrap {
  --weights-bg: #0b1220;
  --weights-surface: rgba(18, 25, 37, 0.94);
  --weights-raised: #192231;
  --weights-hover: #202b3b;
  --weights-border: rgba(148, 163, 184, 0.14);
  --weights-border-hover: rgba(148, 163, 184, 0.28);
  --weights-text: #e5eaf1;
  --weights-secondary: #a0acbc;
  --weights-muted: #778498;
  --weights-accent: #6ee7b7;
  --weights-accent-hover: #8af0c8;
  --weights-accent-subtle: rgba(110, 231, 183, 0.09);
}

body > header,
.wrap,
.wrap *,
.wrap *::before,
.wrap *::after {
  box-sizing: border-box;
}

body > header {
  width: 100%;
  max-width: 1100px;
  margin: calc(var(--navbar-height, 68px) + 20px) auto 0;
  padding: 0 22px 20px;
  color: var(--weights-text);
  font-family: var(--main-font-family, inherit);
}

body > header h1 {
  position: relative;
  margin: 0 0 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--weights-border);
  color: var(--weights-text);
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: -0.045em;
}

body > header h1::after {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 46px;
  height: 3px;
  border-radius: 999px;
  background: var(--weights-accent);
  content: "";
}

body > header .sub {
  max-width: 760px;
  color: var(--weights-secondary);
  font-size: 0.92rem;
  line-height: 1.75;
}

.wrap {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto 3rem;
  padding: 12px 22px 48px;
  color: var(--weights-text);
  font-family: var(--main-font-family, inherit);
  font-size: var(--main-font-size, 14px);
  line-height: 1.6;
}

.grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1.4fr);
  align-items: start;
  gap: 20px;
}

.card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--weights-border);
  border-radius: 20px;
  background: var(--weights-surface);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.025);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.card h2 {
  margin: 0;
  padding: 18px 22px;
  border-bottom: 1px solid var(--weights-border);
  background:
    linear-gradient(135deg, var(--weights-accent-subtle), transparent 75%),
    rgba(255, 255, 255, 0.01);
  color: var(--weights-text);
  font-size: 0.95rem;
  font-weight: 750;
  letter-spacing: 0.025em;
}

.card .content {
  min-width: 0;
  padding: 22px;
}

.row {
  display: flex;
  min-width: 0;
  align-items: flex-end;
  gap: 12px;
}

.row > div {
  min-width: 0;
  flex: 1 1 0;
}

.row > .exercise-weight-pill {
  flex: none;
  width: 20rem;
  justify-content: center;
}

.exercise-weight-pill-row {
  flex-direction: column;
  align-items: center;
}

.wrap label,
.wrap legend {
  color: var(--weights-secondary);
  font-size: 0.82rem;
  font-weight: 600;
}

.wrap label {
  display: block;
  margin-bottom: 7px;
}

.wrap input[type="number"],
#currentStateStringInput,
.assistanceline select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--weights-border);
  border-radius: 10px;
  outline: none;
  background-color: rgba(11, 18, 32, 0.72);
  color: var(--weights-text);
  font: inherit;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.wrap input:not([type="radio"]):hover,
.assistanceline select:hover {
  border-color: var(--weights-border-hover);
}

.wrap input:not([type="radio"]):focus,
.assistanceline select:focus {
  border-color: rgba(110, 231, 183, 0.7);
  background-color: #0e1725;
  box-shadow: 0 0 0 3px rgba(110, 231, 183, 0.1);
}

.wrap input:focus-visible,
.wrap select:focus-visible,
.wrap button:focus-visible,
.week-pill:focus-visible,
.day .head:focus-visible {
  outline: 2px solid var(--weights-accent);
  outline-offset: 3px;
}

.row_radio {
  min-width: 0;
}

.row_radio > div {
  min-width: 0;
}

.wrap fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--weights-border);
  border-radius: 12px;
  background: rgba(11, 18, 32, 0.36);
}

.wrap legend {
  width: auto;
  margin: 0;
  padding: 0 7px;
  font-weight: 700;
}

.wrap fieldset > div {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  transition:
    background 160ms ease,
    border-color 160ms ease;
}

.wrap fieldset input[type="radio"] {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--weights-accent);
}

.wrap fieldset label {
  margin: 0;
  color: var(--weights-text);
  font-size: 0.82rem;
  cursor: pointer;
}

.wrap fieldset input[type="radio"]:checked + label {
  color: var(--weights-accent);
}

.divider {
  height: 1px;
  margin: 20px 0;
  background: var(--weights-border);
}

.pill {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 11px;
  border: 1px solid var(--weights-border);
  border-radius: 999px;
  background: rgba(11, 18, 32, 0.55);
  color: var(--weights-secondary);
  font-size: 0.78rem;
  line-height: 1.4;
  user-select: none;
}

.pill b,
.mono,
.setline .rhs,
.assistanceline .rhs {
  font-family: "Fira Code", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
}

.pill b {
  color: var(--weights-accent);
  font-weight: 700;
}

.help,
.note {
  margin-top: 14px;
  color: var(--weights-secondary);
  font-size: 0.8rem;
  line-height: 1.7;
}

.help ul {
  padding-left: 20px !important;
}

.help li + li,
.note li + li {
  margin-top: 5px;
}

.btnrow {
  display: flex;
  gap: 9px;
  margin: 2rem 0;
}

.wrap button {
  min-height: 42px;
  padding: 9px 13px;
  border: 1px solid var(--weights-border);
  border-radius: 10px;
  background: var(--weights-raised);
  color: var(--weights-text);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 650;
  line-height: 1.35;
  cursor: pointer;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.wrap button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--weights-border-hover);
  background: var(--weights-hover);
}

.wrap button:active:not(:disabled) {
  transform: translateY(0);
}

.wrap button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#btnResetDefaults {
  border-color: rgba(110, 231, 183, 0.24);
  background: var(--weights-accent-subtle);
  color: var(--weights-accent);
}

#btnResetDefaults:hover:not(:disabled) {
  border-color: rgba(110, 231, 183, 0.42);
  background: rgba(110, 231, 183, 0.14);
  color: var(--weights-accent-hover);
}

#loadStateInput {
  display: flex;
  gap: 10px;
}

#currentStateStringInput {
  flex: 1 1 auto;
}

#btnLoadState {
  flex: 0 0 auto;
}

.warnbox {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 12px;
  background: rgba(251, 191, 36, 0.07);
  color: #f5d98b;
  font-size: 0.8rem;
  line-height: 1.65;
}

.wrap a {
  color: var(--weights-accent);
  text-decoration: none;
  text-underline-offset: 3px;
}

.wrap a:hover {
  color: var(--weights-accent-hover);
  text-decoration: underline;
}

#program > .small {
  color: var(--weights-muted);
  font-size: 0.8rem;
}

#program .week {
  margin-top: 14px;
}

#program .week-pill {
  position: relative;
  min-height: 42px;
  margin-top: 10px;
  padding: 9px 38px 9px 14px;
  border-radius: 11px;
  background: var(--weights-raised);
  color: var(--weights-text);
  font-size: 0.84rem;
  font-weight: 650;
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

#program .week-pill::after {
  position: absolute;
  top: 50%;
  right: 14px;
  color: var(--weights-muted);
  content: "▸";
  transform: translateY(-50%);
}

#program .week-pill.is-open {
  border-color: rgba(110, 231, 183, 0.35);
  background: var(--weights-accent-subtle);
  color: var(--weights-accent);
}

#program .week-pill.is-open::after {
  color: var(--weights-accent);
  content: "▾";
}

#program .week-pill b {
  color: inherit;
}

#program .week-days {
  display: none;
  margin-top: 8px;
}

#program .day {
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid var(--weights-border);
  border-radius: 13px;
  background: rgba(11, 18, 32, 0.42);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

#program .day.is-current {
  border-color: rgba(110, 231, 183, 0.48);
  box-shadow: 0 0 0 3px rgba(110, 231, 183, 0.08);
}

#program .day .head {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid transparent;
  background: rgba(255, 255, 255, 0.015);
  cursor: pointer;
  transition: background 160ms ease;
}

#program .day .head:hover {
  background: var(--weights-hover);
}

#program .day.is-current .head {
  border-bottom-color: var(--weights-border);
  background: var(--weights-accent-subtle);
}

#program .day .title {
  color: var(--weights-text);
  font-size: 0.9rem;
  font-weight: 700;
}

#program .badge {
  padding: 5px 9px;
  border: 1px solid var(--weights-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--weights-secondary);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.4;
  text-align: right;
  white-space: nowrap;
}

#program .day.is-current .badge {
  border-color: rgba(110, 231, 183, 0.25);
  color: var(--weights-accent);
}

#program .day .body {
  display: none;
  padding: 14px;
  color: var(--weights-text);
}

#program .k,
#program .muted {
  color: var(--weights-secondary);
}

#program .small {
  font-size: 0.76rem;
}

#program .setline,
#program .assistanceline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 9px 0;
  border-bottom: 1px solid var(--weights-border);
  font-size: 0.8rem;
}

#program .setline:last-child,
#program .assistanceline:last-child {
  border-bottom: 0;
}

#program .setline .lhs,
#program .assistanceline .lhs {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

#program .setline .tag,
#program .assistanceline label.tag {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 4px 8px;
  border: 1px solid var(--weights-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--weights-secondary);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.4;
}

#program .setline .rhs,
#program .assistanceline .rhs {
  flex: 0 0 auto;
  color: var(--weights-accent);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: right;
}

#program .assist-title {
  margin: 14px 0 8px;
  color: var(--weights-text);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

#program .assistanceline .lhs {
  flex-wrap: nowrap;
}

#program .assistanceline select {
  width: auto;
  min-width: 150px;
  min-height: 36px;
  padding: 7px 30px 7px 10px;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--weights-secondary) 50%),
    linear-gradient(135deg, var(--weights-secondary) 50%, transparent 50%);
  background-position:
    calc(100% - 15px) 50%,
    calc(100% - 10px) 50%;
  background-size:
    5px 5px,
    5px 5px;
  background-repeat: no-repeat;
  font-size: 0.75rem;
}

#program .assistanceline select option {
  background: var(--weights-bg);
  color: var(--weights-text);
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 600px) {
  body > header {
    margin-top: calc(var(--navbar-height, 68px) + 16px);
    padding: 0 16px 16px;
  }

  .wrap {
    margin-bottom: 2rem;
    padding: 10px 16px 36px;
  }

  .card {
    border-radius: 16px;
  }

  .card h2 {
    padding: 15px 17px;
  }

  .card .content {
    padding: 17px;
  }

  .row {
    gap: 10px;
  }

  .wrap fieldset {
    gap: 5px;
    padding: 11px;
  }

  .wrap fieldset > div {
    padding: 6px 7px;
  }

  .btnrow > button {
    flex: 1 1 140px;
  }

  #loadStateInput {
    gap: 8px;
  }

  #btnLoadState {
    padding-inline: 10px;
  }

  #program .day .head {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  #program .badge {
    white-space: normal;
    text-align: left;
  }

  #program .assistanceline {
    align-items: stretch;
    flex-direction: column;
    gap: 5px;
  }

  #program .assistanceline .rhs {
    padding-top: 2px;
  }

  #program .assistanceline .lhs {
    flex-wrap: wrap;
  }

  #program .assistanceline select {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 380px) {
  .row {
    align-items: stretch;
    flex-direction: column;
  }

  .row_radio {
    flex-direction: row;
  }

  #loadStateInput {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wrap *,
  .wrap *::before,
  .wrap *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
