/* ────────────────────────────────────────────────────────────────
   Formula slots (the three dashes area: e.g., S V V)
   Usage: <div class="formula-slots"><span class="formula-slot"></span>...</div>
   Add .filled and data-letter="S|V" when user fills a slot.
   ──────────────────────────────────────────────────────────────── */
   .formula-slots {
    display: inline-flex;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(6px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25) inset, 0 6px 24px rgba(0, 0, 0, 0.15);
    align-items: center;
  }
  .formula-slot {
    position: relative;
    width: 44px;
    height: 22px;
    border-bottom: 3px dashed rgba(255, 255, 255, 0.45);
    transition: all 160ms ease;
  }
  .formula-slot:hover {
    transform: translateY(-1px);
    border-bottom-color: rgba(255, 255, 255, 0.7);
  }
  .formula-slot.filled {
    border-bottom-color: transparent;
  }
  .formula-slot.filled::after {
    content: attr(data-letter);
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-weight: 800;
    letter-spacing: 1px;
    color: #0f172a;
    background: linear-gradient(180deg, #a7f3d0, #6ee7b7);
    border-radius: 10px;
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
    animation: formulaPop 200ms ease-out both;
  }
  @keyframes formulaPop {
    0% { transform: translateY(4px) scale(0.9); opacity: 0; }
    100% { transform: translateY(-4px) scale(1.02); opacity: 1; }
  }
  
  /* ────────────────────────────────────────────────────────────────
     Word annotation tooltip (appears above a clicked word)
     Usage: absolutely-position near the word container
     Buttons: .ann-btn, with modifiers .ann-btn--S / --V / --HV
     ──────────────────────────────────────────────────────────────── */
  .annotation-tooltip {
    position: absolute;
    z-index: 50;
    top: -52px; /* adjust based on word height */
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 10px;
    background: rgba(2, 6, 23, 0.82);
    color: #e2e8f0;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
    animation: tooltipRise 140ms ease-out both;
  }
  .annotation-tooltip::after {
    content: "";
    position: absolute;
    bottom: -7px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 7px 7px 0 7px;
    border-style: solid;
    border-color: rgba(2, 6, 23, 0.82) transparent transparent transparent;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.25));
  }
  @keyframes tooltipRise {
    from { transform: translate(-50%, 6px); opacity: 0; }
    to   { transform: translate(-50%, 0); opacity: 1; }
  }
  .ann-btn {
    appearance: none;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.65);
    color: #e2e8f0;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
    text-transform: uppercase;
    letter-spacing: .4px;
  }
  .ann-btn:hover { transform: translateY(-1px); }
  .ann-btn--S { border-color: rgba(59, 130, 246, 0.6); background: rgba(59, 130, 246, 0.18); }
  .ann-btn--V { border-color: rgba(34, 197, 94, 0.6); background: rgba(34, 197, 94, 0.18); }
  .ann-btn--HV { border-color: rgba(168, 85, 247, 0.6); background: rgba(168, 85, 247, 0.18); }

  .annotator-locked .word {
    pointer-events: none;     /* blocks hover/click/drag */
    cursor: default;
  }
  
  .annotator-locked .label-tooltip {
    display: none !important; /* ensure any lingering tooltips are hidden */
  }
  
  /* ────────────────────────────────────────────────────────────────
     Word tag chips (labels above words after selection)
     Apply .word-has-tag on the word container and inject child .word-tag
     ──────────────────────────────────────────────────────────────── */
  .word-has-tag {
    position: relative; /* ensure tag positioning */
  }
  .word-tag {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translate(-50%, -6px);
    font-size: 11px;
    line-height: 1;
    font-weight: 800;
    padding: 4px 6px;
    border-radius: 6px;
    color: #0f172a;
    background: #e2e8f0;
    border: 1px solid rgba(15, 23, 42, 0.15);
    white-space: nowrap;
    box-shadow: 0 8px 18px rgba(0,0,0,0.25);
    animation: chipPop 160ms ease-out both;
  }
  .word-tag::before {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translate(-50%, -1px);
    border-width: 6px 6px 0 6px;
    border-style: solid;
    border-color: #e2e8f0 transparent transparent transparent;
  }
  .word-tag--S { background: #bfdbfe; border-color: rgba(37, 99, 235, 0.35); }
  .word-tag--V { background: #bbf7d0; border-color: rgba(22, 163, 74, 0.35); }
  .word-tag--HV { background: #e9d5ff; border-color: rgba(147, 51, 234, 0.35); }
  @keyframes chipPop {
    from { transform: translate(-50%, 0) scale(.9); opacity: 0; }
    to   { transform: translate(-50%, -6px) scale(1); opacity: 1; }
  }
  
  /* ────────────────────────────────────────────────────────────────
     Verb grouping (helping verb + main verb) – wrapper approach
     Wrap both words with <span class="verb-group"><span class="word">...</span> <span class="word">...</span><span class="verb-group-label">Verb</span></span>
     ──────────────────────────────────────────────────────────────── */
  .verb-group {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    border-radius: 12px;
    background: rgba(16, 185, 129, 0.15);
    border: 2px solid rgba(16, 185, 129, 0.55);
    box-shadow: 0 8px 28px rgba(16,185,129,0.25) inset, 0 6px 24px rgba(0,0,0,0.25);
    animation: verbMerge 220ms ease-out both;
  }
  .verb-group .word {
    padding: 0 2px;
    border-radius: 8px;
    background: rgba(16, 185, 129, 0.08);
  }
  .verb-group-label {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #bbf7d0;
    border: 1px solid rgba(16,185,129,0.6);
    color: #064e3b;
    font-size: 10px;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 999px;
    letter-spacing: .4px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
  }
  @keyframes verbMerge {
    0% { transform: scale(0.96); box-shadow: 0 0 0 rgba(16,185,129,0); }
    100% { transform: scale(1); box-shadow: 0 8px 28px rgba(16,185,129,0.25) inset, 0 6px 24px rgba(0,0,0,0.25); }
  }
  
  /* ────────────────────────────────────────────────────────────────
     Verb grouping – fallback (no wrapper): mark contiguous pair parent with .verb-pair
     Structure: <span class="verb-pair"><span class="word">was</span><span class="word">covered</span></span>
     ──────────────────────────────────────────────────────────────── */
  .verb-pair {
    display: inline-flex;
    align-items: center;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid rgba(16,185,129,0.55);
    background: rgba(16,185,129,0.12);
    animation: verbMerge 220ms ease-out both;
  }
  .verb-pair .word {
    padding: 0 4px;
    background: rgba(16,185,129,0.08);
  }
  .verb-pair .word + .word {
    border-left: 1px dashed rgba(16,185,129,0.45);
  }
  
  /* ────────────────────────────────────────────────────────────────
     Animated connector (if you inject a bridging span between words)
     Usage: <span class="verb-bridge"></span> placed between the two words
     ──────────────────────────────────────────────────────────────── */
  .verb-bridge {
    display: inline-block;
    height: 10px;
    width: 0;
    border-top: 2px dashed rgba(16,185,129,0.6);
    transform: translateY(-2px);
    animation: bridgeGrow 220ms ease-out forwards;
  }
  @keyframes bridgeGrow {
    from { width: 0; opacity: .2; }
    to   { width: 10px; opacity: 1; }
  }
  
  /* ────────────────────────────────────────────────────────────────
     Focus ring when a word is "armed" for annotation (optional)
     Add .word-armed to a word to hint it's clickable
     ──────────────────────────────────────────────────────────────── */
  .word-armed {
    outline: 2px dashed rgba(148, 163, 184, 0.55);
    outline-offset: 3px;
    border-radius: 8px;
    background: rgba(255,255,255,0.06);
    animation: armedPulse 900ms ease-in-out infinite;
  }
  @keyframes armedPulse {
    0% { box-shadow: 0 0 0 0 rgba(148,163,184,0.25); }
    70% { box-shadow: 0 0 0 6px rgba(148,163,184,0); }
    100% { box-shadow: 0 0 0 0 rgba(148,163,184,0); }
  }
  
  /* ────────────────────────────────────────────────────────────────
     Subtle success glow when a tag is placed on a word
     ──────────────────────────────────────────────────────────────── */
  .word-tag--V,
  .verb-group,
  .verb-pair {
    box-shadow: 0 0 0 0 rgba(16,185,129,0.35);
    animation: successPulse 900ms ease-out 1;
  }
  @keyframes successPulse {
    0% { box-shadow: 0 0 0 0 rgba(16,185,129,0.35); }
    100% { box-shadow: 0 0 0 12px rgba(16,185,129,0); }
  }
  
  /* ────────────────────────────────────────────────────────────────
     Compact helper: place S/V chip above a grouped verb (centered)
     Usage: <span class="group-chip">Verb</span> positioned inside .verb-group or .verb-pair
     ──────────────────────────────────────────────────────────────── */
  .group-chip {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    font-weight: 900;
    color: #064e3b;
    background: #bbf7d0;
    border: 1px solid rgba(16,185,129,0.6);
    border-radius: 999px;
    padding: 2px 6px;
    letter-spacing: .4px;
    white-space: nowrap;
  }
  
  /* ────────────────────────────────────────────────────────────────
     Micro utility: a faint underline to show "this token is labeled"
     Add to any labeled word if you want an extra cue
     ──────────────────────────────────────────────────────────────── */
  .word-labeled {
    background-image: linear-gradient(currentColor, currentColor);
    background-repeat: no-repeat;
    background-size: 100% 2px;
    background-position: 0 100%;
    text-decoration: none;
    text-underline-offset: 4px;
    color: inherit;
    opacity: .96;
  }
  
  .word, .word-anchored { position: relative; display: inline-block; vertical-align: baseline; }
  .verb-group { overflow: visible; }
  .annotation-tooltip { position: absolute; z-index: 2000; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); }
  .annotation-tooltip::after { top: 100%; left: 50%; transform: translateX(-50%); }
  
  .compose-field {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .compose-hint-line {
    position: absolute;
    right: 12px;             /* mirrors input right padding */
    bottom: 14px;            /* near the text baseline */
    height: 2px;
    background: rgba(148, 163, 184, 0.45);
    border-radius: 2px;
    pointer-events: none;
  }
  .compose-measure {
    position: absolute;
    visibility: hidden;
    pointer-events: none;
    white-space: pre;        /* keep spaces */
    font-size: 14px;         /* must match input font-size */
    padding: 10px 12px;      /* match input padding for accurate width */
  }
  /* Layout container for 4A inputs */
.l4a-shell {
  display: grid;
  gap: 18px;
}

/* Frosted cards */
.l4a-card {
  position: relative;
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(2,6,23,0.55), rgba(2,6,23,0.35));
  border: 1px solid rgba(148,163,184,0.28);
  backdrop-filter: blur(8px);
  box-shadow:
    0 8px 28px rgba(0,0,0,0.35) inset,
    0 10px 30px rgba(0,0,0,0.25);
}

/* Head labels */
.l4a-label {
  display: inline-block;
  font-weight: 900;
  letter-spacing: .4px;
  margin-bottom: 10px;
  color: #e5e7eb;
  text-transform: uppercase;
  font-size: 12px;
  opacity: 0.95;
}

/* Inputs (shared) */
.l4a-input {
  width: 100%;
  color: #e2e8f0;
  background: radial-gradient(1200px 400px at 20% -20%, rgba(30,41,59,0.45), rgba(15,23,42,0.35)) no-repeat,
              rgba(15,23,42,0.35);
  border: 1px solid rgba(148,163,184,0.35);
  outline: none;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  transition: box-shadow 160ms ease, border-color 160ms ease, transform 120ms ease;
  box-shadow: 0 6px 24px rgba(0,0,0,0.18) inset;
}

.l4a-input:focus {
  border-color: rgba(59,130,246,0.65);
  box-shadow:
    0 0 0 4px rgba(59,130,246,0.12),
    0 10px 32px rgba(0,0,0,0.28) inset;
  transform: translateY(-1px);
}

/* Topic & Sentences specific minimums */
.l4a-topic {
  min-height: 92px;
}

.l4a-sentences {
  min-height: 280px;
}

/* Subtle helper text */
.l4a-hint {
  margin-top: 10px;
  font-size: 12px;
  color: #cbd5e1;
  opacity: 0.85;
}

/* Optional: pleasant selection color for inputs */
.l4a-input::selection {
  background: rgba(59,130,246,0.35);
}

/* Header actions spacing so "Instructions" sits nicely next to Back */
.header-actions-group {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Collapsible instructions with smooth height + opacity transition */
.pretest-collapsible {
  overflow: hidden;
  transition:
    max-height 260ms ease,
    opacity 220ms ease,
    transform 220ms ease,
    margin 220ms ease;
  will-change: max-height, opacity, transform, margin;
}
.pretest-collapsible.open {
  max-height: 520px; /* adjust if your list can exceed this */
  opacity: 1;
  transform: translateY(0);
  margin: 0 0 8px 0;
  pointer-events: auto;
}
.pretest-collapsible.closed {
  max-height: 0;
  opacity: 0;
  transform: translateY(-6px);
  margin: 0;
  pointer-events: none; /* ensures it's truly gone for interaction */
}

/* Inner content gets its padding reduced to zero when closed to avoid ghost space */
.pretest-collapsible.closed .pretest-inner {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border-width: 0 !important; /* if your pretest box has borders */
}

/* Inner instructions container */
.pretest-inner {
  position: relative;
  padding-right: 44px; /* leave space for the close button on the right */
}

/* ✕ close button top-right */
.pretest-close {
  position: absolute;
  top: 8px;
  right: 10px; /* <-- moved to right */
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(148,163,184,0.35);
  background:
    radial-gradient(220px 80px at 10% 0%, rgba(59,130,246,0.18), rgba(2,6,23,0.45)) no-repeat,
    rgba(15,23,42,0.55);
  color: #e2e8f0;
  font-weight: 900;
  cursor: pointer;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
  box-shadow:
    0 10px 30px rgba(0,0,0,0.25),
    inset 0 6px 18px rgba(255,255,255,0.04);
}

.pretest-close:hover {
  transform: translateY(-1px);
  background:
    radial-gradient(220px 80px at 10% 0%, rgba(59,130,246,0.28), rgba(2,6,23,0.55)) no-repeat,
    rgba(30,41,59,0.6);
  border-color: rgba(148,163,184,0.55);
  box-shadow:
    0 12px 34px rgba(0,0,0,0.32),
    0 0 0 4px rgba(59,130,246,0.14);
}

/* Special case: unlabeled token inside HV…V group */
.word--nonverb-in-group {
  background: rgba(146, 146, 146, 0.4) !important;
  color: black;
  border-radius: 4px;
  padding: 0 25px !important;
  z-index: 1;
}

/* Special case: unlabeled token inside HV…V group */
/* .word--nonverb-in-group {
  position: relative;
  padding: 0 2px;
  border-radius: 4px;
  color: white;
} */

/* Add the strikethrough line */
/* .word--nonverb-in-group::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  background: #ef4444;
  transform: translateY(-50%);
  pointer-events: none;
} */

/* Draggable bubbles (unchanged from previous step) */
.drag-toolbar { display:flex; justify-content:flex-start; margin:6px 0 10px; }
.drag-bubbles { display:inline-flex; gap:10px; }
.drag-bubble {
  appearance:none; border:1px solid rgba(148,163,184,.35); background:rgba(15,23,42,.65);
  color:#e2e8f0; font-size:12px; font-weight:900; padding:8px 12px; border-radius:999px;
  letter-spacing:.4px; cursor:grab; user-select:none;
  transition:transform 120ms ease, background 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}
.drag-bubble:active { cursor:grabbing; transform:scale(.98); }
.drag-bubble--S { border-color:rgba(59,130,246,.6); }
.drag-bubble--S:hover { background:rgba(59,130,246,.18); box-shadow:0 0 0 4px rgba(59,130,246,.12); }
.drag-bubble--HV { border-color:rgba(168,85,247,.6); }
.drag-bubble--HV:hover { background:rgba(168,85,247,.18); box-shadow:0 0 0 4px rgba(168,85,247,.12); }
.drag-bubble--V { border-color:rgba(34,197,94,.6); }
.drag-bubble--V:hover { background:rgba(34,197,94,.18); box-shadow:0 0 0 4px rgba(34,197,94,.12); }

/* Tooltip for labeled words (Clear action) */
.label-tooltip {
  position:absolute;
  z-index:2000;
  bottom:calc(100% + 8px);
  left:50%;
  transform:translateX(-50%);
  display:inline-flex;
  gap:6px;
  padding:6px 8px;
  border-radius:10px;
  background:rgba(2,6,23,.88);
  color:#e2e8f0;
  backdrop-filter:blur(8px);
  border:1px solid rgba(148,163,184,.25);
  box-shadow:0 10px 30px rgba(0,0,0,.35);
}
.label-tooltip::after {
  content:"";
  position:absolute;
  top:100%;
  left:50%;
  transform:translateX(-50%);
  border-width:7px 7px 0 7px;
  border-style:solid;
  border-color:rgba(2,6,23,.88) transparent transparent transparent;
  filter:drop-shadow(0 2px 2px rgba(0,0,0,.25));
}

.label-tooltip__btn {
  appearance:none;
  border:1px solid rgba(148,163,184,.35);
  background:rgba(15,23,42,.65);
  color:#e2e8f0;
  font-size:12px;
  font-weight:800;
  padding:6px 8px;
  border-radius:8px;
  cursor:pointer;
  letter-spacing:.3px;
  transition:transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

.label-tooltip__btn:hover { transform:translateY(-1px); }
.label-tooltip__btn--clear { border-color:rgba(239,68,68,.6); background:rgba(239,68,68,.18); }

.topic-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.topic-bubble {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(2, 6, 23, 0.35);
  color: #e2e8f0;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.06s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.topic-bubble:hover {
  transform: translateY(-1px);
  border-color: rgba(148, 163, 184, 0.6);
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
}

.topic-bubble--active {
  border-color: #60a5fa;
  background: linear-gradient(180deg, rgba(37,99,235,0.18), rgba(2,6,23,0.45));
  box-shadow: 0 6px 18px rgba(37,99,235,0.35);
}

/* --- NEW class names only --- */

.formula-and-triplet {
  display: flex;
  align-items: center;
  gap: 10px; /* space between triplet and formula input */
}

.formula-triplet {
  display: flex;
  gap: 6px;
}

.formula-triplet__box {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid rgba(148,163,184,0.35);
  background: rgba(2,6,23,0.35);
  color: #e2e8f0;
  text-align: center;
  font-size: 16px;
  outline: none;
}

.formula-triplet__box:focus {
  border-color: rgba(226, 232, 240, 0.8);
  box-shadow: 0 0 0 2px rgba(226, 232, 240, 0.15);
}

.lesson-submit-btn {
  font-weight: 600;
}


.formula-triplet__group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.formula-triplet__label {
  font-size: 12px;
  font-weight: 600;
  color: #e2e8f0;
  text-align: center;
}

/* Disable interactions but keep the original look */
.topic-bubble.is-disabled {
  pointer-events: none;
  opacity: 0.7;
}

/* Keep textarea visuals identical even when readonly */
.l4a-input.l4a-sentences[readonly] {
  cursor: default;
}

/* ----- Formula Card panel ----- */
.formula-card {
  position: relative;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 260ms ease, opacity 200ms ease, transform 260ms ease;
  transform: translateY(-4px);
}
.formula-card.open {
  max-height: 520px; /* large enough to fit content; adjust if needed */
  opacity: 1;
  transform: translateY(0);
}
.formula-card.closed {
  pointer-events: none;
}

.formula-card__inner {
  position: relative;
  margin: 12px auto 0;
  padding: 16px;
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.6); /* deep translucent slate */
  border: 1px solid rgba(148, 163, 184, 0.25);
  max-width: 960px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.formula-card__close {
  position: absolute;
  top: 10px;
  right: 10px;
  appearance: none;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 18px;
  line-height: 1;
  background: rgba(30, 41, 59, 0.6);
  color: #e5e7eb;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease;
}
.formula-card__close:hover {
  transform: scale(1.05);
  background: rgba(30, 41, 59, 0.75);
}

.formula-card__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.formula-card__title {
  font-size: 18px;
  font-weight: 700;
  color: #e5e7eb;
  letter-spacing: 0.4px;
}
.formula-card__subtitle {
  font-size: 13px;
  color: #cbd5e1;
  opacity: 0.9;
}

/* ----- Formula rows ----- */
.formula-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 12px 10px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.2);
  margin-top: 10px;
}
.formula-row__left {
  min-width: 0;
}
.formula-row__title {
  font-size: 15px;
  font-weight: 700;
  color: #e2e8f0;
  letter-spacing: 0.3px;
}
.formula-row__subtitle {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 2px;
}

.formula-row__right {
  display: grid;
  grid-template-columns: minmax(160px, 240px) auto;
  gap: 10px;
  align-items: center;
}

/* ----- Bar that keeps tally ----- */
.formula-bar {
  position: relative;
  height: 22px;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.28);
  overflow: hidden;
}
.formula-bar__fill {
  position: absolute;
  inset: 0 0 0 0;
  width: 0%;
  background: linear-gradient(90deg, rgba(34,197,94,0.85), rgba(16,185,129,0.9));
  transition: width 180ms ease;
}
.formula-bar__count {
  position: relative;
  z-index: 1;
  font-size: 12px;
  color: #f1f5f9;
  text-align: center;
  line-height: 22px;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0,0,0,0.35);
}

/* ----- Plus / Minus buttons ----- */
.formula-actions {
  display: inline-flex;
  gap: 8px;
}
.formula-btn {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(30, 41, 59, 0.65);
  color: #e5e7eb;
  width: 38px;
  height: 32px;
  border-radius: 8px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: transform 100ms ease, background 120ms ease, border-color 120ms ease;
}
.formula-btn:hover {
  transform: translateY(-1px);
  background: rgba(30, 41, 59, 0.78);
  border-color: rgba(148, 163, 184, 0.55);
}
.formula-btn:active {
  transform: translateY(0);
}
.formula-btn--minus { }
.formula-btn--plus { }

/* Step pills */
.l4-steps {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin: 10px auto 0;
}
.l4-step-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #e5e7eb;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.2px;
  opacity: 0.8;
  transition: opacity 120ms ease, transform 120ms ease, border-color 120ms ease;
}
.l4-step-pill.active {
  opacity: 1;
  transform: translateY(-1px);
  border-color: rgba(148, 163, 184, 0.45);
}
.l4-step-pill__index {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid rgba(34, 197, 94, 0.45);
  font-size: 12px;
}
.l4-step-pill__label {
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Video container card tweak */
.video-card {
  padding: 0;
  overflow: hidden;
}

/* Watch exact hint (kept inline color; class for spacing if needed later) */
.watch-hint {
  margin-top: 6px;
}

/* (Formula card styles were already shared earlier; reuse those classes) */

