.ad-stage {
  --ad-surface: var(--ad-card, #fff);
  --ad-inset: var(--ad-card-2, #f5f7f8);
  --ad-border: var(--ad-rule, #dfe5e8);
  --ad-heading: var(--ad-title, #171e25);
  --ad-text: var(--ad-body, #3d4853);
  --ad-secondary: var(--ad-note, #65717c);
  --ad-highlight: var(--ad-accent, #c2f826);
  --ad-dark: var(--ad-ink, #192821);
  --ad-shadow: 0 3px 10px rgb(9 21 16 / 12%);
  position: relative;
  isolation: isolate;
  container-type: inline-size;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  overflow: clip;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
  text-align: start;
  letter-spacing: normal;
  overflow-wrap: anywhere;
  color: var(--ad-text);
  background: transparent;
}

.ad-number {
  font-family: "Barlow Condensed", "MiSans", sans-serif;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.ad-svg {
  display: block;
  flex: none;
  width: 18px;
  height: 18px;
}

.ad-piece {
  position: absolute;
  top: 0;
  left: 0;
  box-sizing: border-box;
  transform-origin: 0 0;
  transform: var(--ad-pose);
  opacity: var(--ad-opacity, 1);
  transition: var(--ad-motion,
    transform 420ms cubic-bezier(.22,.7,.2,1) var(--ad-delay, 0ms),
    opacity 260ms ease var(--ad-delay, 0ms));
}

.ad-paper,
.ad-athlete,
.ad-memory,
.ad-action {
  border: 1px solid var(--ad-border);
  border-radius: 20px;
  background-color: var(--ad-surface);
  box-shadow: var(--ad-shadow);
}

.ad-lesson {
  width: min(84%, 490px);
}

.ad-paper {
  position: absolute;
  inset: 0;
  clip-path: var(--ad-clip);
  transition: var(--ad-motion, clip-path 420ms cubic-bezier(.22,.7,.2,1));
}

.ad-lesson-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 66px;
  box-sizing: border-box;
  padding: 13px 18px;
}

.ad-symbol {
  display: grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  color: var(--ad-surface);
  background-color: var(--ad-dark);
}

.ad-lesson-title,
.ad-name,
.ad-memory-title,
.ad-action-title {
  min-width: 0;
  color: var(--ad-heading);
  font-weight: 600;
}

.ad-lesson-title {
  font-size: 21px;
}

.ad-meta,
.ad-shared,
.ad-rows {
  transition: var(--ad-motion, opacity 220ms ease);
}

.ad-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  align-items: center;
  gap: 2px 8px;
  margin-inline-start: auto;
  color: var(--ad-secondary);
  font-size: 12px;
}

.ad-duration {
  padding-inline-start: 8px;
  border-inline-start: 1px solid var(--ad-border);
}

.ad-shared {
  position: absolute;
  inset-inline-end: 18px;
  padding: 4px 9px;
  border-radius: 12px;
  color: var(--ad-text);
  background-color: var(--ad-inset);
  font-size: 12px;
  opacity: 0;
}

.ad-rows {
  position: relative;
  padding: 0 18px 10px;
}

.ad-lesson-row {
  display: grid;
  grid-template-columns: minmax(0, .76fr) minmax(0, 1.55fr) minmax(0, .68fr);
  align-items: baseline;
  gap: 8px;
  padding-block: 10px;
  border-top: 1px solid var(--ad-border);
}

.ad-part {
  font-size: 12px;
  color: var(--ad-secondary);
}

.ad-exercise {
  color: var(--ad-heading);
  font-weight: 600;
}

.ad-dose {
  color: var(--ad-text);
  text-align: end;
}

.ad-dose .ad-number {
  font-size: 17px;
  line-height: 1;
}

.ad-lesson[data-compact="true"] .ad-rows,
.ad-lesson[data-compact="true"] .ad-meta {
  opacity: 0;
}

.ad-lesson[data-compact="true"] .ad-shared {
  opacity: 1;
}

.ad-athlete {
  width: calc((100% - 36px) / 2);
  padding: 11px 14px 12px;
  min-height: var(--ad-card-height, 0);
}

.ad-person,
.ad-rest,
.ad-memory-head,
.ad-action-context {
  display: flex;
  align-items: center;
}

.ad-person {
  justify-content: space-between;
  gap: 8px;
  min-height: 22px;
}

.ad-name {
  font-size: 16px;
  line-height: 1.3;
}

.ad-stamp {
  display: grid;
  flex: none;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: var(--ad-surface);
  background-color: var(--ad-dark);
  opacity: 0;
  transition: var(--ad-motion,
    opacity 90ms ease var(--ad-check-delay, 0ms),
    transform 90ms ease var(--ad-check-delay, 0ms));
}

.ad-stamp .ad-svg {
  width: 13px;
  height: 13px;
}

.ad-situation {
  margin-block: 2px 7px;
  color: var(--ad-secondary);
  font-size: 13px;
}

.ad-change-group + .ad-change-group {
  margin-block-start: 7px;
}

.ad-change {
  padding: 5px 9px;
  border-inline-start: 3px solid var(--ad-highlight);
  border-radius: 0 10px 10px 0;
  background-color: var(--ad-inset);
}

.ad-before {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  color: var(--ad-secondary);
  font-size: 12px;
}

.ad-old {
  text-decoration: line-through;
}

.ad-change-part {
  flex-shrink: 0;
  max-width: 40%;
}

.ad-new {
  margin-top: 1px;
  color: var(--ad-heading);
  font-size: 15px;
  font-weight: 600;
}

.ad-reason {
  margin-block-start: 5px;
  color: var(--ad-text);
  font-size: 12px;
}

.ad-rest {
  gap: 5px;
  margin-block-start: 6px;
  color: var(--ad-secondary);
  font-size: 12px;
}

.ad-rest .ad-svg {
  width: 13px;
  height: 13px;
}

.ad-memory,
.ad-action {
  width: calc(100% - 24px);
}

.ad-memory {
  padding: 12px 15px 7px;
}

.ad-memory-head,
.ad-action-context {
  gap: 7px;
  color: var(--ad-text);
}

.ad-memory-title,
.ad-action-title {
  font-size: 15px;
}

.ad-memory-list {
  margin-top: 8px;
}

.ad-memory-row {
  display: grid;
  grid-template-columns: 4.2em minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 9px;
  padding: 6px 0;
  border-top: 1px solid var(--ad-border);
  font-size: 13px;
}

.ad-layer {
  color: var(--ad-secondary);
  font-size: 12px;
}

.ad-memory-text {
  min-width: 0;
  color: var(--ad-heading);
  font-weight: 600;
}

.ad-source,
.ad-used {
  box-sizing: border-box;
  justify-self: end;
  padding: 2px 7px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.4;
}

.ad-source {
  color: var(--ad-secondary);
  background-color: var(--ad-inset);
}

.ad-learned {
  grid-template-columns: 4.2em minmax(0, 1fr) auto auto;
}

.ad-used {
  background-color: var(--ad-dark);
  color: var(--ad-surface);
  font-weight: 600;
}

.ad-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px 9px 15px;
}

.ad-action-context {
  min-width: 0;
}

.ad-save {
  display: inline-flex;
  box-sizing: border-box;
  flex: 0 1 auto;
  justify-content: center;
  align-items: center;
  gap: 5px;
  min-width: min(11em, 58%);
  padding: 9px 14px;
  border-radius: 12px;
  background-color: var(--ad-highlight);
  color: var(--ad-dark);
  font-size: 13px;
  font-weight: 600;
}

.ad-save .ad-svg {
  width: 15px;
  height: 15px;
}

.ad-press {
  animation: var(--ad-motion, ad-press-down 140ms ease-in-out);
}

@keyframes ad-press-down {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(.97); }
}

.ad-picker[hidden] {
  display: none;
}

.ad-picker {
  display: flex;
  gap: 6px;
}

.ad-picker-button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  box-sizing: border-box;
  padding: 6px 2px;
  border: 1px solid #8d9c96;
  border-radius: 12px;
  color: var(--ad-surface);
  background: var(--ad-dark);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.ad-picker-button[aria-pressed="true"] {
  color: var(--ad-dark);
  background: var(--ad-surface);
  border-color: var(--ad-surface);
}

.ad-picker-button:focus-visible {
  outline: 3px solid var(--ad-highlight);
  outline-offset: 2px;
}

.ad-narrow {
  transition: var(--ad-motion, height 280ms cubic-bezier(.22,.7,.2,1));
}

.ad-narrow .ad-layout {
  display: grid;
  gap: 12px;
  padding: 8px 12px;
}

.ad-narrow .ad-piece {
  position: relative;
  width: 100%;
  min-height: 0;
  transform: none;
  opacity: 1;
}

.ad-narrow .ad-piece[aria-hidden="true"],
.ad-narrow .ad-rows[aria-hidden="true"],
.ad-narrow .ad-meta[aria-hidden="true"],
.ad-narrow .ad-shared[aria-hidden="true"] {
  display: none;
}

.ad-narrow .ad-paper {
  clip-path: none;
}

.ad-narrow .ad-lesson[data-compact="true"] .ad-shared {
  position: static;
  flex: none;
  margin-inline-start: auto;
}

.ad-narrow .ad-lesson-head {
  gap: 7px;
  padding-inline: 13px;
}

.ad-narrow .ad-shared {
  inset-inline-end: 13px;
}

.ad-narrow .ad-rows {
  padding-inline: 13px;
}

.ad-narrow .ad-lesson-row {
  grid-template-columns: minmax(0, .78fr) minmax(0, 1.45fr) minmax(0, .7fr);
  gap: 5px;
}

.ad-narrow .ad-memory-row {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "layer source" "text text";
  gap: 2px 8px;
  padding-block: 5px;
}

.ad-narrow .ad-learned {
  grid-template-areas: "layer source" "text used";
}

.ad-narrow .ad-layer { grid-area: layer; }
.ad-narrow .ad-memory-text { grid-area: text; }
.ad-narrow .ad-source { grid-area: source; }
.ad-narrow .ad-used { grid-area: used; }

.ad-static,
.ad-still,
.ad-reduced {
  --ad-motion: none;
}

@media (prefers-reduced-motion: reduce) {
  .ad-stage {
    --ad-motion: none;
  }
}

/* Rows without their optional labels: name on the left, value on the right. */
.ad-stage .ad-lesson-row,
.ad-stage .ad-memory-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ad-stage .ad-memory-row {
  padding-block: 9px;
  font-size: 14px;
}
