/* Loops · loop quests and loop bosses (wave 4, loops-quests): the loop maker in challenge mode on a quest's make stage
   (quests/stage_make.html) and in a loop boss (quests/_boss_box.html), the Loops page's challenge list, and the skill
   rack's "Warm-up first" note. Registered through the registry (app.features.loops), so every rule is scoped under
   its own classes. Tokens only: no hex here.

   Workshop: the challenge's ask is plain text above the instrument; the check bar sits on the plate's own steel under
   the grid, with "Check my loop" (or "Lock it in") as the one blue press. A row the challenge keeps is drawn read-only
   with a quiet "set by the challenge" note, never a padlock. Studio ([data-world="studio"], at the end): the same
   pieces on card stock with kraft and ink, same layout. Nothing here moves with the beat; under reduced motion
   nothing animates at all. Every control is 44px on a touch screen. */

/* ------------------------------------------------------------------ the make stage */
.q-make { min-width: 0; }
.q-loop { min-width: 0; gap: 10px; }
.q-loop-title { margin: 0; font-size: 1.15rem; line-height: 1.3; }
.q-loop-ask { max-width: 65ch; }
.q-loop-mount { min-width: 0; }
.q-loop-fb:empty { display: none; }
.q-loop-way { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); max-width: 760px; }
.q-loop-way-head { margin: 0; color: var(--ink); }
.q-loop-load { justify-self: start; }
.q-loop-next { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.q-loop-note, .q-comeback, .q-loop-boss-note, .q-warm-first {
  display: flex; gap: 8px; align-items: flex-start; margin: 0; color: var(--ink-2); font-size: .92rem; max-width: 65ch;
}
.q-loop-note .icon, .q-comeback .icon, .q-loop-boss-note .icon, .q-warm-first .icon { flex: none; margin-top: 2px; color: var(--ink-3); }
.q-comeback { color: var(--ink); font-weight: 700; }
.q-loop-boss-row { align-items: center; }

/* ------------------------------------------------------------------ the loop maker in challenge mode */
.lp-fixed-note { display: flex; gap: 8px; align-items: flex-start; margin: 0; color: var(--ink-2); font-size: .9rem; max-width: 65ch; }
.lp-fixed-note .icon { flex: none; margin-top: 2px; color: var(--ink-3); }
.lp-fixed-row { color: var(--ink-3); font-size: .85rem; font-weight: 700; }
.lp-check-bar {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; padding-top: 14px; border-top: 1px solid var(--line); min-width: 0;
}
.lp-typed { flex: 0 1 260px; min-width: min(100%, 180px); }
.lp-typed-input {
  width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--field-line); border-radius: var(--r);
  background: var(--surface); color: var(--ink); font: 500 1rem/1.3 var(--font-mono);
}
.lp-typed-input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.lp-check { min-width: 168px; }
.lp-check[aria-busy="true"] { cursor: progress; }
.lp-check-msg { flex: 1 1 100%; margin: 0; color: var(--ink-2); font-size: .9rem; }
.lp-check-msg:empty { display: none; }
@media (max-width: 420px) { .lp-check { flex: 1 1 100%; } }
@media (pointer: coarse) { .lp-check, .lp-typed-input { min-height: 48px; } }

/* ------------------------------------------------------------------ the Loops page's challenge list */
.lp-challenges { display: grid; gap: 10px; min-width: 0; }
.lp-challenges-intro { margin: 0; color: var(--ink-2); max-width: 65ch; }
.lp-ch-rows { display: grid; margin: 0; padding: 0; list-style: none; }
.lp-ch-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 16px; padding: 10px 0; border-top: 1px solid var(--line); }
.lp-ch-row:last-child { border-bottom: 1px solid var(--line); }
.lp-ch-main { display: grid; gap: 4px; min-width: 0; }
.lp-ch-title { font-weight: 700; color: var(--ink); }
.lp-ch-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--ink-2); font-size: .88rem; }
.lp-ch-meta .num { font-family: var(--font-mono); }
@media (max-width: 520px) { .lp-ch-row { grid-template-columns: minmax(0, 1fr); } }
@media (pointer: coarse) { .lp-ch-row .btn { min-height: 44px; } }

/* ------------------------------------------------------------------ reduced motion: nothing here animates */
@media (prefers-reduced-motion: reduce) {
  .lp-check, .q-loop-load { transition: none; }
}

/* ------------------------------------------------------------------ studio: card stock, kraft and ink */
[data-world="studio"] .q-loop-way { background: var(--card); border-color: var(--card-edge); border-radius: var(--r-sm); box-shadow: var(--shadow-hung); }
[data-world="studio"] .lp-check-bar { border-color: var(--line); }
[data-world="studio"] .lp-typed-input { background: var(--card); border-color: var(--field-line); border-radius: var(--r-sm); }
[data-world="studio"] .lp-fixed-row { color: var(--ink-2); }
[data-world="studio"] .lp-ch-row { border-color: var(--line); }
[data-world="studio"] .lp-ch-title { font-family: var(--font-body); }
