:root {
  --ink: #15170f;
  --ink-2: #202419;
  --ink-3: #313629;
  --paper: #efede4;
  --paper-bright: #fffdf6;
  --paper-dim: #d8d5c9;
  --lime: #d8ff5c;
  --lime-soft: #edffb5;
  --orange: #ff5b2d;
  --orange-dark: #bd3514;
  --muted: #77796c;
  --line: rgba(21, 23, 15, 0.2);
  --line-strong: rgba(21, 23, 15, 0.42);
  --line-light: rgba(239, 237, 228, 0.22);
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Atkinson Hyperlegible", sans-serif;
  --mono: "DM Mono", monospace;
  --shadow: 0 28px 70px rgba(21, 23, 15, 0.17);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
}

code,
pre,
.mono-note {
  font-family: var(--mono);
}

[hidden] {
  display: none !important;
}

.grain {
  position: fixed;
  z-index: 100;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.1'/%3E%3C/svg%3E");
}

.section-label,
.eyebrow,
.mono-note,
.count-pill,
.topline-meta,
.login-footer,
.app-footer,
.app-header__edition,
.hero-index,
.editor-metrics small,
.picker-filters label > span,
.picker-search > span {
  font-family: var(--mono);
  font-size: 0.67rem;
  font-weight: 400;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.section-label,
.eyebrow {
  margin: 0;
  color: var(--orange);
}

.signal-dot {
  display: inline-block;
  width: 0.52rem;
  height: 0.52rem;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 0.23rem rgba(255, 91, 45, 0.15);
}

.signal-dot--lime {
  flex: 0 0 auto;
  background: var(--lime);
  box-shadow: 0 0 0 0.23rem rgba(216, 255, 92, 0.12);
}

.wordmark {
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
  color: var(--paper-bright);
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1;
  text-decoration: none;
}

.wordmark__slash {
  color: var(--lime);
}

.wordmark--small {
  font-size: 1.05rem;
}

/* Login */

.login-view {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  overflow: hidden;
  padding: 1.1rem clamp(1rem, 3vw, 3rem) 0;
  background:
    linear-gradient(112deg, transparent 0 61%, rgba(216, 255, 92, 0.06) 61% 61.15%, transparent 61.15%),
    radial-gradient(circle at 90% 7%, rgba(255, 91, 45, 0.16), transparent 25rem),
    linear-gradient(180deg, #11130d 0%, #1b1e15 100%);
  color: var(--paper-bright);
}

.login-view::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -22rem;
  right: -12rem;
  width: 48rem;
  aspect-ratio: 1;
  border: 1px solid rgba(216, 255, 92, 0.25);
  border-radius: 50%;
}

.login-view::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 42%;
  bottom: -24rem;
  width: 38rem;
  height: 38rem;
  background: var(--orange);
  filter: blur(9rem);
  opacity: 0.14;
}

.login-topline {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line-light);
}

.topline-meta {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  color: rgba(239, 237, 228, 0.58);
}

#demo-label {
  padding: 0.22rem 0.4rem;
  background: var(--lime);
  color: var(--ink);
  font-size: 0.6rem;
}

.login-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(22rem, 0.75fr);
  gap: clamp(2.5rem, 7vw, 8rem);
  align-items: center;
  width: min(1480px, 100%);
  min-height: calc(100vh - 6.7rem);
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 7rem) 0;
}

.login-hero {
  position: relative;
  animation: rise-in 680ms both cubic-bezier(0.18, 0.8, 0.25, 1);
}

.login-hero .eyebrow {
  margin-bottom: 1.7rem;
}

.login-hero h1 {
  max-width: 7.5ch;
  margin: 0;
  color: var(--paper-bright);
  font-family: var(--display);
  font-size: clamp(5.1rem, 10.8vw, 10.5rem);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 0.73;
  text-transform: uppercase;
}

.login-hero h1 em {
  display: inline-block;
  color: var(--orange);
  font-family: var(--display);
  font-style: italic;
  font-weight: 600;
  letter-spacing: -0.035em;
  text-transform: none;
  transform: translateX(0.05em) rotate(-1.5deg);
}

.login-lede {
  max-width: 38rem;
  margin: clamp(1.7rem, 4vw, 3rem) 0 0;
  color: rgba(239, 237, 228, 0.68);
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  line-height: 1.65;
}

.hero-index {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.75rem;
  align-items: center;
  max-width: 38rem;
  margin-top: 3rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line-light);
  color: rgba(239, 237, 228, 0.48);
}

.hero-index span:nth-child(odd) {
  color: var(--lime);
}

.auth-card {
  position: relative;
  padding: clamp(1.4rem, 3vw, 2.4rem);
  border: 1px solid rgba(239, 237, 228, 0.18);
  background: var(--paper-bright);
  color: var(--ink);
  box-shadow: 0 2rem 7rem rgba(0, 0, 0, 0.3);
  animation: rise-in 680ms 110ms both cubic-bezier(0.18, 0.8, 0.25, 1);
}

.auth-card::before {
  content: "";
  position: absolute;
  top: -0.55rem;
  right: -0.55rem;
  width: 1.1rem;
  height: 1.1rem;
  background: var(--lime);
}

.auth-card__head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
}

.auth-card__code {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
}

.auth-card h2 {
  margin: 1.5rem 0 0;
  font-family: var(--display);
  font-size: clamp(2.2rem, 4vw, 3.7rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.9;
  text-transform: uppercase;
}

.auth-card__intro {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.58;
}

.auth-card__intro strong {
  color: var(--ink);
}

.auth-card code {
  overflow-wrap: anywhere;
  color: var(--orange-dark);
  font-size: 0.78em;
}

.auth-steps {
  display: grid;
  gap: 1.1rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.auth-steps li {
  display: grid;
  grid-template-columns: 1.7rem minmax(0, 1fr);
  gap: 0.8rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}

.step-number {
  display: grid;
  width: 1.55rem;
  height: 1.55rem;
  place-items: center;
  background: var(--ink);
  color: var(--lime);
  font-family: var(--mono);
  font-size: 0.65rem;
}

.step-title {
  margin: 0 0 0.65rem;
  font-weight: 700;
  line-height: 1.2;
}

.auth-link-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1rem;
  align-items: center;
  margin-top: 0.65rem;
}

.auth-link-wrap a {
  color: var(--orange-dark);
  font-family: var(--mono);
  font-size: 0.66rem;
  text-underline-offset: 0.2rem;
}

.callback-step {
  display: grid;
}

.callback-step textarea {
  width: 100%;
  min-height: 6.3rem;
  resize: vertical;
  padding: 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  outline: none;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.7rem;
  line-height: 1.5;
}

.callback-step textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 91, 45, 0.12);
}

.button {
  display: inline-flex;
  min-height: 2.8rem;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--ink);
  border-radius: 0;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-transform: uppercase;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.button:hover:not(:disabled),
.button:focus-visible:not(:disabled) {
  transform: translateY(-1px);
  outline: none;
}

.button--primary {
  background: var(--ink);
  color: var(--paper-bright);
}

.button--primary:hover:not(:disabled),
.button--primary:focus-visible:not(:disabled) {
  border-color: var(--lime);
  background: var(--lime);
  color: var(--ink);
}

.button--accent {
  border-color: var(--orange);
  background: var(--orange);
  color: var(--ink);
}

.button--accent:hover:not(:disabled),
.button--accent:focus-visible:not(:disabled) {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--lime);
}

.button--outline {
  background: transparent;
  color: var(--ink);
}

.button--outline:hover:not(:disabled),
.button--outline:focus-visible:not(:disabled) {
  border-color: var(--orange);
  background: rgba(255, 91, 45, 0.08);
}

.button--ghost {
  border-color: var(--line);
  background: transparent;
  color: var(--ink);
}

.button--ghost:hover:not(:disabled),
.button--ghost:focus-visible:not(:disabled) {
  border-color: var(--ink);
  background: rgba(21, 23, 15, 0.05);
}

.button:disabled {
  opacity: 0.42;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.04em;
  text-decoration: underline;
  text-decoration-color: var(--orange);
  text-underline-offset: 0.22rem;
}

.text-button:hover,
.text-button:focus-visible {
  color: var(--orange-dark);
  outline: none;
}

.text-button--inline {
  justify-self: start;
  margin-top: 0.55rem;
}

.auth-status {
  min-height: 2.5rem;
  margin: 1.4rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.63rem;
  line-height: 1.55;
}

.auth-status.is-error {
  color: var(--orange-dark);
}

.auth-status.is-success {
  color: #405a00;
}

.login-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--line-light);
  color: rgba(239, 237, 228, 0.45);
}

/* App */

.app-view {
  min-height: 100vh;
  background:
    linear-gradient(90deg, transparent 0 24px, rgba(21, 23, 15, 0.045) 24px 25px, transparent 25px),
    var(--paper);
}

.app-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  justify-content: space-between;
  gap: 1.2rem;
  align-items: center;
  min-height: 4.4rem;
  padding: 0.75rem clamp(1rem, 3vw, 3rem);
  background: var(--ink);
  color: var(--paper-bright);
}

.app-header__brand,
.app-header__account,
.member-chip,
.app-header__edition {
  display: flex;
  align-items: center;
}

.app-header__brand {
  gap: 1.1rem;
}

.app-header__edition {
  padding-left: 1.1rem;
  border-left: 1px solid var(--line-light);
  color: rgba(239, 237, 228, 0.46);
}

.app-header__account {
  gap: 1.1rem;
}

.member-chip {
  gap: 0.7rem;
}

.member-chip__avatar {
  display: grid;
  width: 2.35rem;
  height: 2.35rem;
  place-items: center;
  background: var(--lime);
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 800;
  text-transform: uppercase;
}

.member-chip strong,
.member-chip small {
  display: block;
}

.member-chip strong {
  font-size: 0.84rem;
  font-weight: 700;
}

.member-chip small {
  margin-top: 0.1rem;
  color: rgba(239, 237, 228, 0.55);
  font-family: var(--mono);
  font-size: 0.57rem;
}

.icon-button {
  min-height: 2.25rem;
  padding: 0 0.7rem;
  border: 1px solid var(--line-light);
  background: transparent;
  color: rgba(239, 237, 228, 0.72);
  font-family: var(--mono);
  font-size: 0.6rem;
  text-transform: uppercase;
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: var(--orange);
  color: var(--paper-bright);
  outline: none;
}

.studio-shell {
  display: grid;
  grid-template-columns: minmax(17rem, 0.29fr) minmax(0, 1fr);
  min-height: calc(100vh - 7rem);
}

.routine-rail {
  display: flex;
  flex-direction: column;
  padding: clamp(1.4rem, 3vw, 2.8rem) clamp(1.1rem, 2.4vw, 2rem);
  background:
    linear-gradient(145deg, transparent 0 70%, rgba(216, 255, 92, 0.05) 70% 70.4%, transparent 70.4%),
    var(--ink-2);
  color: var(--paper-bright);
}

.rail-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--line-light);
}

.rail-head .section-label {
  color: var(--lime);
}

.count-pill {
  padding: 0.25rem 0.4rem;
  border: 1px solid var(--line-light);
  color: rgba(239, 237, 228, 0.6);
}

.routine-rail h1 {
  margin: 1.5rem 0 0;
  font-family: var(--display);
  font-size: clamp(3.2rem, 5.2vw, 5.2rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 0.82;
  text-transform: uppercase;
}

.rail-note {
  max-width: 20rem;
  margin: 1rem 0 0;
  color: rgba(239, 237, 228, 0.53);
  font-size: 0.82rem;
  line-height: 1.5;
}

.workout-list {
  display: grid;
  gap: 0.55rem;
  margin-top: 2rem;
}

.workout-card {
  position: relative;
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr);
  gap: 0.75rem;
  width: 100%;
  padding: 1rem 0.85rem;
  border: 1px solid var(--line-light);
  background: transparent;
  color: var(--paper-bright);
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.workout-card:hover,
.workout-card:focus-visible {
  border-color: rgba(216, 255, 92, 0.7);
  background: rgba(216, 255, 92, 0.06);
  outline: none;
  transform: translateX(3px);
}

.workout-card.is-active {
  border-color: var(--lime);
  background: var(--lime);
  color: var(--ink);
}

.workout-card--draft {
  cursor: default;
}

.workout-card--draft:hover {
  border-color: var(--lime);
  background: var(--lime);
  transform: none;
}

.workout-card__index {
  color: var(--orange);
  font-family: var(--mono);
  font-size: 0.66rem;
}

.workout-card.is-active .workout-card__index {
  color: var(--orange-dark);
}

.workout-card strong {
  display: block;
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.03;
  text-transform: uppercase;
}

.workout-card small {
  display: block;
  margin-top: 0.35rem;
  color: rgba(239, 237, 228, 0.5);
  font-family: var(--mono);
  font-size: 0.55rem;
  line-height: 1.4;
  text-transform: uppercase;
}

.workout-card.is-active small {
  color: rgba(21, 23, 15, 0.62);
}

.rail-footer {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  margin-top: auto;
  padding-top: 2rem;
}

.rail-footer p {
  margin: 0;
  color: rgba(239, 237, 228, 0.42);
  font-family: var(--mono);
  font-size: 0.58rem;
  line-height: 1.55;
  text-transform: uppercase;
}

.editor-panel {
  min-width: 0;
  padding: clamp(1.5rem, 4vw, 3.6rem);
}

.editor-empty {
  display: grid;
  min-height: 62vh;
  align-content: center;
  justify-items: start;
}

.editor-empty h2,
.editor-head h2 {
  margin: 0.7rem 0 0;
  font-family: var(--display);
  font-size: clamp(3.3rem, 7vw, 7.3rem);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 0.8;
  text-transform: uppercase;
}

.editor-empty p:not(.section-label) {
  max-width: 35rem;
  color: var(--muted);
  line-height: 1.6;
}

.editor-head {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  align-items: flex-end;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line-strong);
  animation: rise-in 400ms both ease-out;
}

.editor-head__title {
  min-width: 0;
}

.editor-head h2 {
  overflow-wrap: anywhere;
  font-size: clamp(3.2rem, 6.5vw, 6.5rem);
}

.mono-note {
  overflow: hidden;
  max-width: 44rem;
  margin: 0.8rem 0 0;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-head__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.55rem;
  flex: 0 0 auto;
}

.editor-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line-strong);
}

.editor-metrics > div {
  display: grid;
  gap: 0.2rem;
  padding: 1.1rem 1rem 1.1rem 0;
  border-right: 1px solid var(--line);
}

.editor-metrics > div:not(:first-child) {
  padding-left: 1rem;
}

.editor-metrics > div:last-child {
  border-right: 0;
}

.editor-metrics span {
  overflow: hidden;
  font-family: var(--display);
  font-size: clamp(1.6rem, 2.8vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.editor-metrics small {
  color: var(--muted);
  font-size: 0.55rem;
}

.editor-metrics #save-state {
  font-family: var(--mono);
  font-size: 0.77rem;
  letter-spacing: 0.06em;
  line-height: 1.55;
}

.editor-metrics #save-state.is-dirty {
  color: var(--orange-dark);
}

.catalog-callout {
  display: flex;
  gap: 0.9rem;
  align-items: center;
  margin: 1.3rem 0 0;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(255, 91, 45, 0.45);
  background: rgba(255, 91, 45, 0.07);
}

.catalog-callout__mark {
  display: grid;
  flex: 0 0 auto;
  width: 1.5rem;
  height: 1.5rem;
  place-items: center;
  background: var(--orange);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
}

.catalog-callout p {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.8rem;
  line-height: 1.45;
}

.catalog-callout code {
  color: var(--orange-dark);
  font-size: 0.8em;
}

.exercise-list {
  display: grid;
  gap: 1rem;
  margin-top: 1.3rem;
}

.exercise-card {
  display: grid;
  grid-template-columns: 12rem minmax(0, 1fr);
  min-height: 16rem;
  border: 1px solid var(--line);
  background: var(--paper-bright);
  box-shadow: 0 12px 28px rgba(21, 23, 15, 0.06);
  animation: card-reveal 380ms both cubic-bezier(0.2, 0.8, 0.2, 1);
}

.exercise-card__media {
  position: relative;
  min-height: 13rem;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255, 91, 45, 0.9), rgba(21, 23, 15, 0.92)),
    var(--ink);
}

.exercise-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 42%, rgba(21, 23, 15, 0.5));
}

.exercise-card__media img {
  width: 100%;
  height: 100%;
  min-height: 13rem;
  object-fit: cover;
  filter: saturate(0.78) contrast(1.06);
  transition: transform 420ms ease, filter 250ms ease;
}

.exercise-card:hover .exercise-card__media img {
  filter: saturate(1.03) contrast(1.03);
  transform: scale(1.035);
}

.exercise-card__number {
  position: absolute;
  z-index: 2;
  top: 0.75rem;
  left: 0.75rem;
  display: grid;
  min-width: 2rem;
  height: 1.55rem;
  place-items: center;
  background: var(--ink);
  color: var(--lime);
  font-family: var(--mono);
  font-size: 0.62rem;
}

.exercise-card__media-label {
  position: absolute;
  z-index: 2;
  right: 0.75rem;
  bottom: 0.75rem;
  color: var(--paper-bright);
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.exercise-card__body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 1.1rem 1.2rem 1rem;
}

.exercise-card__top {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  align-items: flex-start;
}

.exercise-card__kicker {
  margin: 0;
  color: var(--orange-dark);
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.3rem;
}

.badge {
  padding: 0.24rem 0.38rem;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.52rem;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge--hidden {
  border-color: rgba(255, 91, 45, 0.44);
  background: rgba(255, 91, 45, 0.09);
  color: var(--orange-dark);
}

.badge--lime {
  border-color: rgba(94, 120, 4, 0.35);
  background: rgba(216, 255, 92, 0.32);
  color: #3d5000;
}

.badge--custom {
  border-color: rgba(21, 23, 15, 0.38);
  color: var(--ink);
}

.exercise-card h3 {
  margin: 0.45rem 0 0;
  font-family: var(--display);
  font-size: clamp(1.8rem, 3.1vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.9;
  text-transform: uppercase;
}

.exercise-card__subtitle {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.exercise-card__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.7rem;
}

.mini-button {
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.03em;
  text-decoration: underline;
  text-decoration-color: var(--orange);
  text-underline-offset: 0.18rem;
  text-transform: uppercase;
}

.mini-button:hover,
.mini-button:focus-visible {
  color: var(--orange-dark);
  outline: none;
}

.mini-button--danger {
  color: var(--orange-dark);
  text-decoration-color: var(--orange-dark);
}

.mini-button:disabled {
  opacity: 0.35;
}

.set-table-wrap {
  margin-top: auto;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}

.set-table-head,
.set-row {
  display: grid;
  grid-template-columns: 2.2rem repeat(3, minmax(4.5rem, 1fr));
  gap: 0.55rem;
  align-items: center;
}

.set-table-head {
  padding-bottom: 0.35rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.5rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.set-table-head span:not(:first-child),
.set-row label {
  text-align: center;
}

.set-row {
  padding: 0.28rem 0;
}

.set-row__index {
  color: var(--orange-dark);
  font-family: var(--mono);
  font-size: 0.62rem;
}

.set-row label {
  display: grid;
  gap: 0.12rem;
}

.set-row input {
  width: 100%;
  min-width: 0;
  height: 1.9rem;
  padding: 0.25rem 0.35rem;
  border: 1px solid var(--line);
  border-radius: 0;
  outline: none;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.67rem;
  text-align: center;
}

.set-row input:focus {
  border-color: var(--orange);
  background: var(--paper-bright);
  box-shadow: 0 0 0 2px rgba(255, 91, 45, 0.1);
}

.set-row small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.48rem;
}

.set-count-control {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  margin-left: auto;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.58rem;
  text-transform: uppercase;
}

.set-count-control input {
  width: 3rem;
  height: 1.8rem;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.66rem;
  text-align: center;
}

.no-exercises {
  margin-top: 1.3rem;
  padding: clamp(2rem, 5vw, 4rem);
  border: 1px dashed var(--line-strong);
  background: rgba(255, 253, 246, 0.48);
}

.no-exercises h3 {
  margin: 0.5rem 0 1.2rem;
  font-family: var(--display);
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.app-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 3vw, 3rem);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.58rem;
}

/* Picker */

dialog {
  color: var(--ink);
}

.picker-dialog,
.json-dialog {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--paper-bright);
  box-shadow: 0 3rem 9rem rgba(0, 0, 0, 0.5);
}

.picker-dialog::backdrop,
.json-dialog::backdrop {
  background: rgba(13, 15, 9, 0.82);
  backdrop-filter: blur(7px);
}

.picker-dialog {
  width: min(76rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
}

.picker-dialog[open],
.json-dialog[open] {
  animation: dialog-in 260ms both cubic-bezier(0.2, 0.8, 0.2, 1);
}

.picker-shell {
  display: flex;
  max-height: calc(100vh - 2rem);
  flex-direction: column;
}

.picker-head,
.json-dialog header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.25rem 1.4rem;
  background: var(--ink);
  color: var(--paper-bright);
}

.picker-head .section-label,
.json-dialog .section-label {
  color: var(--lime);
}

.picker-head h2,
.json-dialog h2 {
  margin: 0.4rem 0 0;
  font-family: var(--display);
  font-size: clamp(2.5rem, 5vw, 4.8rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 0.82;
  text-transform: uppercase;
}

.dialog-close {
  display: grid;
  flex: 0 0 auto;
  width: 2.4rem;
  height: 2.4rem;
  place-items: center;
  border: 1px solid var(--line-light);
  background: transparent;
  color: var(--paper-bright);
  font-family: var(--display);
  font-size: 1.9rem;
  line-height: 1;
}

.dialog-close:hover,
.dialog-close:focus-visible {
  border-color: var(--orange);
  color: var(--orange);
  outline: none;
}

.picker-filters {
  display: grid;
  grid-template-columns: minmax(16rem, 2fr) minmax(10rem, 1fr) minmax(10rem, 1fr) auto;
  gap: 0.7rem;
  align-items: end;
  padding: 1rem 1.4rem;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.picker-filters label {
  display: grid;
  gap: 0.4rem;
  min-width: 0;
}

.picker-filters label > span {
  color: var(--muted);
  font-size: 0.55rem;
}

.picker-filters select {
  width: 100%;
  height: 2.7rem;
  min-width: 0;
  padding: 0 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  outline: none;
  background: var(--paper-bright);
  color: var(--ink);
  font-size: 0.77rem;
}

.picker-filters select:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 2px rgba(255, 91, 45, 0.1);
}

.picker-search > div {
  position: relative;
}

.picker-search svg {
  position: absolute;
  top: 50%;
  left: 0.75rem;
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: var(--orange);
  stroke-width: 1.7;
  transform: translateY(-50%);
}

.picker-search input {
  width: 100%;
  height: 2.7rem;
  padding: 0 0.8rem 0 2.35rem;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  outline: none;
  background: var(--paper-bright);
  color: var(--ink);
  font-size: 0.82rem;
}

.picker-search input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 2px rgba(255, 91, 45, 0.1);
}

.picker-status-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.65rem 1.4rem;
  border-bottom: 1px solid var(--line);
}

.picker-status,
.picker-alias {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.6rem;
}

.picker-alias {
  color: #4d6200;
  text-align: right;
}

.picker-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  overflow-y: auto;
  padding: 1rem 1.4rem;
  overscroll-behavior: contain;
}

.picker-card {
  display: grid;
  grid-template-columns: 7.6rem minmax(0, 1fr);
  min-height: 8.4rem;
  border: 1px solid var(--line);
  background: var(--paper);
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.picker-card:hover {
  border-color: rgba(255, 91, 45, 0.6);
  box-shadow: 0 9px 20px rgba(21, 23, 15, 0.08);
  transform: translateY(-2px);
}

.picker-card__thumb {
  position: relative;
  min-height: 8rem;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255, 91, 45, 0.85), rgba(21, 23, 15, 0.9)),
    var(--ink);
}

.picker-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.8) contrast(1.04);
}

.picker-card__thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(21, 23, 15, 0.42));
}

.picker-card__content {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 0.75rem;
}

.picker-card__content h3 {
  margin: 0.3rem 0 0;
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 0.94;
  text-transform: uppercase;
}

.picker-card__meta {
  margin: 0.35rem 0 0;
  overflow: hidden;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.53rem;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.picker-card__footer {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: end;
  margin-top: auto;
  padding-top: 0.55rem;
}

.picker-add {
  min-height: 2rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper-bright);
  font-family: var(--mono);
  font-size: 0.55rem;
  text-transform: uppercase;
}

.picker-add:hover:not(:disabled),
.picker-add:focus-visible:not(:disabled) {
  border-color: var(--orange);
  background: var(--orange);
  color: var(--ink);
  outline: none;
}

.picker-add:disabled {
  opacity: 0.5;
}

.picker-card__id {
  overflow: hidden;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.48rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.load-more {
  align-self: center;
  margin: 0 1.4rem 1.2rem;
}

.json-dialog {
  width: min(62rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
}

.json-dialog pre {
  max-height: calc(100vh - 14rem);
  overflow: auto;
  margin: 0;
  padding: 1.2rem;
  background: #10120c;
  color: #dff8a7;
  font-size: 0.67rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.toast {
  position: fixed;
  z-index: 200;
  right: 1.2rem;
  bottom: 1.2rem;
  max-width: min(28rem, calc(100vw - 2.4rem));
  padding: 0.9rem 1rem;
  border-left: 4px solid var(--lime);
  background: var(--ink);
  color: var(--paper-bright);
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.3);
  font-family: var(--mono);
  font-size: 0.66rem;
  line-height: 1.45;
}

.toast.is-error {
  border-left-color: var(--orange);
}

.empty-results {
  grid-column: 1 / -1;
  padding: 3rem 1rem;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  text-align: center;
}

.empty-results strong {
  display: block;
  color: var(--ink);
  font-family: var(--display);
  font-size: 2rem;
  text-transform: uppercase;
}

/* Motion */

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(1.2rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes card-reveal {
  from {
    opacity: 0;
    transform: translateY(0.8rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(1rem) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

@media (max-width: 1180px) {
  .login-grid {
    grid-template-columns: minmax(0, 1fr) minmax(21rem, 0.82fr);
    gap: 3rem;
  }

  .login-hero h1 {
    font-size: clamp(4.6rem, 9vw, 7.8rem);
  }

  .studio-shell {
    grid-template-columns: minmax(15rem, 0.34fr) minmax(0, 1fr);
  }

  .exercise-card {
    grid-template-columns: 9rem minmax(0, 1fr);
  }

  .editor-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .editor-head__actions {
    justify-content: flex-start;
  }

  .picker-results {
    grid-template-columns: 1fr;
  }

  .picker-filters {
    grid-template-columns: minmax(14rem, 2fr) minmax(9rem, 1fr) minmax(9rem, 1fr) auto;
  }
}

@media (max-width: 900px) {
  .login-view {
    overflow: auto;
  }

  .login-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    min-height: auto;
    padding: 4rem 0;
  }

  .login-hero h1 {
    font-size: clamp(4.6rem, 17vw, 8rem);
  }

  .auth-card {
    max-width: 38rem;
  }

  .login-footer {
    margin-top: 2rem;
  }

  .studio-shell {
    grid-template-columns: 1fr;
  }

  .routine-rail {
    min-height: auto;
  }

  .routine-rail h1 {
    font-size: 4rem;
  }

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

  .rail-footer {
    margin-top: 1.5rem;
  }

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

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

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

  .editor-metrics > div:nth-child(3) {
    padding-left: 0;
  }

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

  .picker-search {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .login-topline {
    align-items: flex-start;
  }

  .topline-meta {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .login-hero h1 {
    font-size: clamp(4.1rem, 20vw, 6.7rem);
  }

  .hero-index {
    display: none;
  }

  .login-footer,
  .app-footer {
    flex-direction: column;
  }

  .app-header {
    position: relative;
    align-items: flex-start;
    flex-direction: column;
  }

  .app-header__account {
    width: 100%;
    justify-content: space-between;
  }

  .app-header__edition {
    display: none;
  }

  .editor-panel {
    padding: 1.2rem 1rem 2rem;
  }

  .routine-rail {
    padding: 1.3rem 1rem;
  }

  .workout-list {
    grid-template-columns: 1fr;
  }

  .editor-head h2 {
    font-size: clamp(2.9rem, 16vw, 5rem);
  }

  .editor-head__actions {
    width: 100%;
  }

  .editor-head__actions .button {
    flex: 1 1 auto;
  }

  .editor-metrics span {
    font-size: 1.65rem;
  }

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

  .exercise-card__media {
    min-height: 12rem;
    max-height: 15rem;
  }

  .exercise-card__body {
    padding: 1rem;
  }

  .set-table-head,
  .set-row {
    grid-template-columns: 2rem repeat(3, minmax(3.8rem, 1fr));
    gap: 0.35rem;
  }

  .set-row input {
    height: 2.25rem;
  }

  .picker-dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    margin: 0;
  }

  .picker-shell {
    height: 100vh;
    max-height: 100vh;
  }

  .picker-head {
    padding: 1rem;
  }

  .picker-filters {
    grid-template-columns: 1fr;
    padding: 0.9rem 1rem;
  }

  .picker-search {
    grid-column: auto;
  }

  .picker-status-row {
    align-items: flex-start;
    flex-direction: column;
    padding: 0.6rem 1rem;
  }

  .picker-alias {
    text-align: left;
  }

  .picker-results {
    padding: 0.8rem 1rem;
  }

  .picker-card {
    grid-template-columns: 6.2rem minmax(0, 1fr);
  }

  .json-dialog {
    width: calc(100vw - 1rem);
  }
}

/* Create routine */

.button--rail {
  width: 100%;
  margin-top: 1.35rem;
  border-color: var(--lime);
  background: var(--lime);
  color: var(--ink);
}

.button--rail:hover:not(:disabled),
.button--rail:focus-visible:not(:disabled) {
  border-color: var(--orange);
  background: var(--orange);
  color: var(--ink);
}

.editor-empty .button {
  margin-top: 1.2rem;
}

.new-workout-dialog {
  width: min(38rem, calc(100vw - 2rem));
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--paper-bright);
  color: var(--ink);
  box-shadow: 0 3rem 9rem rgba(0, 0, 0, 0.5);
}

.new-workout-dialog::backdrop {
  background: rgba(13, 15, 9, 0.82);
  backdrop-filter: blur(7px);
}

.new-workout-dialog[open] {
  animation: dialog-in 260ms both cubic-bezier(0.2, 0.8, 0.2, 1);
}

.new-workout-form > header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.25rem 1.4rem;
  background: var(--ink);
  color: var(--paper-bright);
}

.new-workout-form > header .section-label {
  color: var(--lime);
}

.new-workout-form h2 {
  margin: 0.4rem 0 0;
  font-family: var(--display);
  font-size: clamp(2.8rem, 6vw, 4.8rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 0.82;
  text-transform: uppercase;
}

.new-workout-body {
  display: grid;
  gap: 1rem;
  padding: 1.4rem;
}

.new-workout-body label {
  display: grid;
  gap: 0.55rem;
}

.new-workout-body label > .section-label {
  color: var(--muted);
  font-size: 0.58rem;
}

.new-workout-body input {
  width: 100%;
  height: 3.2rem;
  padding: 0 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  outline: none;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.new-workout-body input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 91, 45, 0.12);
}

.new-workout-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.55;
}

.new-workout-note strong {
  color: var(--ink);
}

.new-workout-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
}

@media (max-width: 680px) {
  .new-workout-dialog {
    width: calc(100vw - 1rem);
  }

  .new-workout-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

/* Live workout estimate */

.workout-estimate {
  display: grid;
  grid-template-columns: minmax(9rem, 0.7fr) 1px minmax(9rem, 0.7fr) minmax(16rem, 1.4fr);
  gap: 1.2rem;
  align-items: center;
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(110deg, rgba(216, 255, 92, 0.18), transparent 46%),
    var(--paper-bright);
}

.workout-estimate__value {
  display: grid;
  gap: 0.25rem;
}

.workout-estimate__value span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.1em;
}

.workout-estimate__value strong {
  font-family: var(--display);
  font-size: clamp(2rem, 3.6vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.86;
  text-transform: uppercase;
}

.workout-estimate__divider {
  width: 1px;
  height: 3.2rem;
  background: var(--line-strong);
}

.workout-estimate p {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.58rem;
  line-height: 1.55;
}

.workout-estimate p strong {
  color: var(--ink);
}

@media (max-width: 900px) {
  .workout-estimate {
    grid-template-columns: 1fr 1px 1fr;
  }

  .workout-estimate p {
    grid-column: 1 / -1;
    padding-top: 0.7rem;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 680px) {
  .workout-estimate {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .workout-estimate__divider {
    width: 100%;
    height: 1px;
  }

  .workout-estimate p {
    grid-column: auto;
  }
}

.workout-estimate {
  position: relative;
}

.workout-estimate__head {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--line);
  color: var(--orange-dark);
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.1em;
}

.workout-estimate__head span:last-child {
  color: var(--muted);
}

@keyframes estimate-in {
  from {
    opacity: 0;
    transform: translateY(0.6rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.workout-estimate:not([hidden]) {
  animation: estimate-in 320ms both cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Exercise detail */

.exercise-detail-dialog {
  width: min(76rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--paper-bright);
  color: var(--ink);
  box-shadow: 0 3rem 9rem rgba(0, 0, 0, 0.55);
}

.exercise-detail-dialog::backdrop {
  background: rgba(13, 15, 9, 0.84);
  backdrop-filter: blur(7px);
}

.exercise-detail-dialog[open] {
  animation: dialog-in 260ms both cubic-bezier(0.2, 0.8, 0.2, 1);
}

.exercise-detail-shell {
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}

.exercise-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.25rem 1.4rem;
  background: var(--ink);
  color: var(--paper-bright);
}

.exercise-detail-head .section-label {
  color: var(--lime);
}

.exercise-detail-head h2 {
  margin: 0.4rem 0 0;
  font-family: var(--display);
  font-size: clamp(2.6rem, 5vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 0.82;
  text-transform: uppercase;
}

.exercise-detail-head > div > p:last-child {
  margin: 0.65rem 0 0;
  color: rgba(239, 237, 228, 0.55);
  font-family: var(--mono);
  font-size: 0.65rem;
}

.exercise-detail-grid {
  display: grid;
  grid-template-columns: minmax(18rem, 1.08fr) minmax(17rem, 0.92fr);
  gap: 1.3rem;
  padding: 1.3rem;
}

.exercise-detail-media,
.exercise-detail-copy {
  min-width: 0;
}

.exercise-detail-video {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #0d0f09;
}

.exercise-detail-video video {
  display: block;
  width: 100%;
  height: 100%;
  background: #0d0f09;
  object-fit: contain;
  cursor: pointer;
}

.exercise-detail-video video::-webkit-media-controls {
  display: none !important;
}

.exercise-detail-video__sound,
.exercise-detail-video__duration,
.exercise-detail-video__play {
  position: absolute;
  z-index: 2;
  border: 1px solid rgba(255, 253, 246, 0.45);
  background: rgba(13, 15, 9, 0.78);
  color: var(--paper-bright);
  font-family: var(--mono);
  font-size: 0.58rem;
  line-height: 1;
  letter-spacing: 0.04em;
  backdrop-filter: blur(8px);
}

.exercise-detail-video__sound {
  top: 0.75rem;
  right: 0.75rem;
  min-height: 2rem;
  padding: 0.5rem 0.65rem;
  cursor: pointer;
}

.exercise-detail-video__sound:hover,
.exercise-detail-video__sound:focus-visible,
.exercise-detail-video__play:hover,
.exercise-detail-video__play:focus-visible {
  border-color: var(--lime);
  background: var(--lime);
  color: var(--ink);
  outline: none;
}

.exercise-detail-video__duration {
  right: 0.75rem;
  bottom: 0.75rem;
  padding: 0.45rem 0.55rem;
  color: var(--lime);
}

.exercise-detail-video__play {
  top: 50%;
  left: 50%;
  display: grid;
  width: 3.6rem;
  height: 3.6rem;
  place-items: center;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  transform: translate(-50%, -50%);
}

.exercise-detail-video__status {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  padding: 2rem;
  background: rgba(13, 15, 9, 0.78);
  color: var(--paper-bright);
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.55;
  text-align: center;
}

.exercise-detail-video__status a {
  color: var(--lime);
  pointer-events: auto;
}

.exercise-detail-id {
  overflow-wrap: anywhere;
  margin: 0.8rem 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.58rem;
  line-height: 1.45;
}

.exercise-detail-copy {
  display: grid;
  align-content: start;
  gap: 1.2rem;
}

.exercise-detail-section {
  padding-top: 0.85rem;
  border-top: 1px solid var(--line-strong);
}

.exercise-detail-section .section-label {
  margin-bottom: 0.85rem;
}

.exercise-steps {
  display: grid;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: exercise-step;
}

.exercise-steps li {
  position: relative;
  min-height: 2rem;
  padding-left: 2.5rem;
  color: var(--ink-2);
  font-size: 0.9rem;
  line-height: 1.55;
  counter-increment: exercise-step;
}

.exercise-steps li::before {
  content: counter(exercise-step, decimal-leading-zero);
  position: absolute;
  top: 0.05rem;
  left: 0;
  color: var(--orange-dark);
  font-family: var(--mono);
  font-size: 0.58rem;
}

.exercise-steps:empty::after {
  content: "Sin explicación disponible para este ejercicio.";
  display: block;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.62rem;
  line-height: 1.5;
}

.exercise-detail-note {
  margin: 0;
  padding: 0.75rem 0.85rem;
  border-left: 3px solid var(--lime);
  background: rgba(216, 255, 92, 0.18);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.58rem;
  line-height: 1.55;
}

@media (max-width: 760px) {
  .exercise-detail-dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    margin: 0;
  }

  .exercise-detail-shell {
    max-height: 100vh;
  }

  .exercise-detail-grid {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .exercise-detail-head {
    padding: 1rem;
  }
}

.chip--warning {
  border-color: rgba(255, 91, 45, 0.5);
  background: rgba(255, 91, 45, 0.1);
  color: var(--orange-dark);
}

.picker-card__actions {
  display: inline-flex;
  gap: 0.55rem;
  align-items: center;
}
