/* ============================================================
   HALF-YEARLY HQ — half-yearly-learn.css
   Styles for the LEARN half of the app: lesson journeys and the
   interactive apparatus. Loaded after half-yearly.css and scoped
   under the same .hy root, so it inherits every token.
   ============================================================ */

/* ============================================================
   LESSONS — the learning journey
   ============================================================ */
.hy-lesson {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-xl); padding: 26px; box-shadow: var(--sh); position: relative;
}
.hy-lesson__bar { height: 6px; background: var(--bg2); border-radius: 999px; overflow: hidden; margin-bottom: 14px; }
.hy-lesson__fill { height: 100%; background: linear-gradient(90deg, var(--teal), var(--accent)); transition: width .45s ease; }
.hy-lesson__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; }
.hy-lesson__title { font-family: var(--f-display); font-weight: 700; font-size: 1rem; }
.hy-lesson__step { font-size: .8rem; color: var(--ink-mute); font-weight: 700; font-variant-numeric: tabular-nums; }
.hy-lesson__skip {
  display: block; margin: 12px auto 0; background: none; border: 0;
  color: var(--ink-mute); font-size: .84rem; text-decoration: underline; cursor: pointer;
}
.hy-lesson__skip:hover { color: var(--ink-soft); }

.hy-lstage__h { font-size: clamp(1.35rem, 3.4vw, 1.9rem); margin-bottom: 12px; }
.hy-lstage__body p { margin: 0 0 12px; font-size: 1.04rem; }
.hy-lstage__body ul, .hy-lstage__body ol { padding-left: 22px; margin: 0 0 12px; }
.hy-lstage__body li { margin-bottom: 6px; }
.hy-lstage__body strong { color: var(--accent); }
.hy-lstage__why { color: var(--ink-soft); margin-bottom: 16px; }
.hy-lstage--intro { text-align: center; padding: 20px 0; }
.hy-lstage__emoji { font-size: 3.4rem; line-height: 1; margin-bottom: 8px; }
.hy-lstage--intro .hy-lstage__body { max-width: 46ch; margin: 0 auto; color: var(--ink-soft); }
.hy-cannow { background: var(--green-soft); border-radius: var(--r); padding: 16px 20px; margin-top: 18px; text-align: left; }
.hy-cannow__t { font-weight: 800; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--green); margin-bottom: 6px; }
.hy-cannow ul { margin: 0; padding-left: 20px; }

.hy-lessongrid { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.hy-lessoncard {
  display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit;
  background: var(--surface2); border: 1px solid var(--line);
  border-left: 4px solid var(--teal); border-radius: var(--r-sm); padding: 14px 16px; min-height: 62px;
}
.hy-lessoncard:hover { border-color: var(--accent); }
.hy-lessoncard.is-done { border-left-color: var(--green); }
.hy-lessoncard__emoji { font-size: 1.6rem; }
.hy-lessoncard__main { flex: 1; min-width: 0; }
.hy-lessoncard__t { display: block; font-weight: 700; }
.hy-lessoncard__m { display: block; font-size: .8rem; color: var(--ink-mute); }
.hy-lessoncard__go { font-weight: 700; font-size: .88rem; color: var(--accent); }
.hy-lessoncard.is-done .hy-lessoncard__go { color: var(--green); }
.hy-skilllist__h { margin-top: 26px; }
.hy-block--lesson { border-left-color: var(--teal); }

/* ============================================================
   WIDGETS — shared chrome
   ============================================================ */
.hy-widget { margin-top: 8px; }
.hw-intro { color: var(--ink-soft); margin: 0 0 16px; font-size: 1.02rem; }
.hw-intro strong { color: var(--ink); }
.hw-row { display: flex; align-items: center; gap: 10px; margin: 14px 0; }
.hw-row--wrap { flex-wrap: wrap; }
.hw-label { font-weight: 700; font-size: .88rem; color: var(--ink-soft); }
.hw-label--a { color: var(--accent); }
.hw-label--b { color: var(--teal); }
.hw-step {
  width: 46px; height: 46px; border-radius: 999px; border: 2px solid var(--line-2);
  background: var(--surface2); color: var(--ink); font-size: 1.3rem; font-weight: 700; cursor: pointer;
}
.hw-step:hover { border-color: var(--accent); color: var(--accent); }
.hw-val { font-family: var(--f-display); font-size: 1.5rem; font-weight: 700; min-width: 40px; text-align: center; }
.hw-select {
  min-height: 46px; padding: 8px 14px; border-radius: var(--r-sm);
  border: 2px solid var(--line-2); background: var(--surface2); color: var(--ink);
  font-family: var(--f-body); font-size: 1rem; font-weight: 600;
}
.hw-slider { flex: 1; accent-color: var(--accent); height: 34px; }
.hw-status {
  background: var(--surface2); border-radius: var(--r-sm); padding: 12px 16px;
  margin: 14px 0; font-size: .96rem; color: var(--ink-soft); min-height: 52px;
}
.hw-status.is-good { background: var(--green-soft); color: var(--ink); }
.hw-status.is-bad { background: var(--red-soft); color: var(--ink); }
.hw-status strong { color: var(--ink); }
.hw-muted { color: var(--ink-mute); font-size: .9rem; }
.hw-go { width: 100%; }
.hw-win { background: var(--green-soft); border-radius: var(--r-sm); padding: 14px 16px; margin-top: 12px; font-weight: 600; }
.hw-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hw-chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 8px 14px; border-radius: var(--r-sm);
  border: 2px solid var(--line); background: var(--surface2); color: var(--ink);
  font-weight: 700; font-size: .95rem; font-family: var(--f-body);
}
.hw-chip.is-btn { cursor: pointer; }
.hw-chip.is-btn:hover { border-color: var(--accent); }
.hw-chip.is-on { background: var(--green-soft); border-color: var(--green); color: var(--green); }
.hw-chip.is-sel { border-color: var(--accent); background: var(--accent-soft); }
.hw-chip.is-right { border-color: var(--green); background: var(--green-soft); }
.hw-chip.is-wrong { border-color: var(--red); background: var(--red-soft); }
.hw-bank { min-height: 52px; padding: 8px; border: 2px dashed var(--line-2); border-radius: var(--r-sm); }

/* factor rectangles */
.hw-board { display: flex; justify-content: center; padding: 16px 0; }
.hw-dots { display: grid; gap: 6px; }
.hw-dot { width: 22px; height: 22px; border-radius: 6px; background: var(--line-2); transition: background .2s; }
.hw-dot.is-ok { background: var(--accent); }
.hw-dot.is-left { background: var(--red); }
.hw-found__title { font-weight: 700; font-size: .9rem; margin: 12px 0 8px; color: var(--ink-soft); }

/* multiple grid */
.hw-numgrid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.hw-cell {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border-radius: 7px; background: var(--surface2); font-size: .78rem; font-weight: 600; color: var(--ink-mute);
}
.hw-cell.is-a { background: var(--accent); color: #fff; }
.hw-cell.is-b { background: var(--teal); color: #fff; }
.hw-cell.is-both { background: var(--amber); color: #fff; box-shadow: 0 0 0 3px var(--amber-soft); }
.hw-ink-a { color: var(--accent); }
.hw-ink-b { color: var(--teal); }

/* prime sieve */
.hw-sieve { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; }
.hw-scell {
  aspect-ratio: 1; border: 0; border-radius: 6px; background: var(--surface2);
  color: var(--ink); font-size: .72rem; font-weight: 700; cursor: pointer; font-family: var(--f-body);
}
.hw-scell.is-out { background: var(--bg2); color: var(--ink-mute); text-decoration: line-through; opacity: .5; }
.hw-scell.is-prime { background: var(--green); color: #fff; }

/* factor tree */
.hw-tree { display: flex; justify-content: center; padding: 10px 0 4px; overflow-x: auto; }
.hw-tnode { display: flex; flex-direction: column; align-items: center; }
.hw-tval {
  min-width: 54px; height: 46px; padding: 0 12px; border-radius: var(--r-sm);
  border: 2px solid var(--line-2); background: var(--surface2); color: var(--ink);
  font-family: var(--f-display); font-size: 1.15rem; font-weight: 700; cursor: default;
}
.hw-tval.is-open { border-color: var(--accent); color: var(--accent); cursor: pointer; animation: hy-pulse 2s infinite; }
.hw-tval.is-prime { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.hw-tval.is-done { opacity: .6; }
.hw-tstem { width: 2px; height: 14px; background: var(--line-2); }
.hw-tkids { display: flex; gap: 14px; border-top: 2px solid var(--line-2); padding-top: 10px; }
.hw-picker__t { font-weight: 700; margin-bottom: 8px; font-size: .92rem; }

/* HCF / LCM venn */
.hw-venn { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin: 12px 0; }
.hw-venn__cap { text-align: center; font-size: .78rem; font-weight: 800; color: var(--ink-mute); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em; }
.hw-venn__zone {
  min-height: 92px; border: 2px dashed var(--line-2); border-radius: var(--r);
  padding: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; justify-content: center;
  background: var(--surface2); cursor: pointer;
}
.hw-venn__mid .hw-venn__zone { border-color: var(--amber); background: var(--amber-soft); }
.hw-venn__mid .hw-venn__cap { color: var(--amber); }

/* protractor + circle + lines */
.hw-proto, .hw-circle, .hw-linelab { display: flex; justify-content: center; touch-action: none; user-select: none; }
.hw-proto__svg, .hw-circle__svg, .hw-linelab__svg { width: 100%; max-width: 420px; height: auto; cursor: grab; }
.hw-key { display: inline-block; margin-right: 12px; font-weight: 700; font-size: .9rem; }
.hw-key--p { color: var(--accent); }
.hw-key--a { color: var(--amber); }
.hw-key--t { color: var(--teal); }

/* tense timeline */
.hy .hw-tense { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.hw-tcell {
  min-height: 62px; border-radius: var(--r-sm); border: 2px solid var(--line);
  background: var(--surface2); color: var(--ink); font-weight: 700; font-size: .88rem;
  cursor: pointer; font-family: var(--f-body); padding: 8px;
}
.hw-tcell.is-cont { border-style: dashed; }
.hw-tcell:hover { border-color: var(--accent); }
.hw-tcell.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.hw-sentence { margin-top: 14px; text-align: center; min-height: 48px; }
.hw-sentence__t { font-size: 1.3rem; font-weight: 600; }

/* -ing machine */
.hw-machine { text-align: center; }
.hw-machine__word { font-family: var(--f-display); font-size: 2.2rem; font-weight: 700; color: var(--accent); }
.hw-machine__arrow { color: var(--ink-mute); font-size: .9rem; margin: 6px 0 12px; }
.hw-machine__out { font-family: var(--f-display); font-size: 2.2rem; font-weight: 700; color: var(--green); }
.hw-machine__opts { display: grid; gap: 8px; margin-top: 8px; }
.hw-rulebtn {
  padding: 12px 16px; border-radius: var(--r-sm); border: 2px solid var(--line);
  background: var(--surface2); color: var(--ink); cursor: pointer; text-align: left; font-family: var(--f-body);
}
.hw-rulebtn span { display: block; font-size: .82rem; color: var(--ink-mute); font-weight: 500; }
.hw-rulebtn:hover { border-color: var(--accent); }
.hw-rulebtn.is-wrong { border-color: var(--red); background: var(--red-soft); }

/* word hunt */
.hw-hunt { font-size: 1.15rem; line-height: 2.4; }
.hw-hunt__line { margin-bottom: 10px; }
.hw-htok {
  display: inline-block; padding: 4px 8px; margin: 0 2px; border-radius: 8px;
  border: 2px solid transparent; background: transparent; color: var(--ink);
  font-size: inherit; font-family: inherit; cursor: pointer;
}
.hw-htok:hover { background: var(--bg2); }
.hw-htok.is-found { background: var(--green-soft); border-color: var(--green); font-weight: 700; }
.hw-htok.is-miss { background: var(--red-soft); border-color: var(--red); }
.hw-htok__k { display: block; font-size: .62rem; color: var(--green); font-weight: 800; text-transform: uppercase; line-height: 1.2; }

/* poem reader */
.hw-poem { display: flex; flex-direction: column; gap: 6px; }
.hw-poem__row {
  display: grid; grid-template-columns: 44px 1fr; gap: 8px; align-items: center;
  padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer;
}
.hw-poem__row:hover { background: var(--surface2); }
.hw-poem__spk {
  width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface2); cursor: pointer; font-size: .95rem;
}
.hw-poem__t { font-size: 1.2rem; }
.hw-poem__t.is-hidden { letter-spacing: .18em; color: var(--ink-mute); }
.hw-poem__m { grid-column: 2; font-size: .88rem; color: var(--teal); }
.hw-poem__m.is-off { display: none; }

/* word lab cards */
.hw-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.hw-card {
  min-height: 104px; border-radius: var(--r); border: 2px solid var(--line);
  background: var(--surface2); cursor: pointer; padding: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-family: var(--f-body); color: var(--ink); text-align: center;
}
.hw-card:hover { border-color: var(--accent); }
.hw-card.is-flipped { background: var(--teal-soft); border-color: var(--teal); }
.hw-card__w { font-size: 1.3rem; font-weight: 700; }
.hw-card__r { font-size: .78rem; color: var(--ink-mute); }
.hw-card__m { font-size: 1rem; font-weight: 600; }
.hw-card__eg { font-size: .8rem; color: var(--ink-soft); }

/* degree ladder */
.hw-ladder { display: flex; flex-direction: column; gap: 8px; }
.hw-lstep {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; border-radius: var(--r-sm); background: var(--surface2);
  border-left: 5px solid var(--line-2);
}
.hw-lstep--1 { border-left-color: var(--teal); }
.hw-lstep--2 { border-left-color: var(--amber); margin-left: 18px; }
.hw-lstep--3 { border-left-color: var(--accent); margin-left: 36px; }
.hw-lstep__lbl { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-mute); }
.hw-lstep__w { font-family: var(--f-display); font-size: 1.35rem; font-weight: 700; }

@media (max-width: 720px) {
  .hy-lesson { padding: 18px 14px; border-radius: var(--r-lg); }
  .hw-numgrid, .hw-sieve { gap: 2px; }
  .hw-scell, .hw-cell { font-size: .62rem; border-radius: 4px; }
  .hy .hw-tense { grid-template-columns: repeat(2, 1fr); }
  .hw-venn { grid-template-columns: 1fr; }
  .hw-dot { width: 18px; height: 18px; }
  .hw-lstep--2 { margin-left: 10px; }
  .hw-lstep--3 { margin-left: 20px; }
}

/* session divider on the Today screen */
.hy-sessionhead {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin: 18px 0 2px; padding-top: 12px; border-top: 1px dashed var(--line-2);
}
.hy-sessionhead:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.hy-sessionhead__n {
  font-family: var(--f-display); font-weight: 700; font-size: 1.05rem; color: var(--accent);
}
.hy-sessionhead__m { font-size: .84rem; color: var(--ink-mute); font-weight: 600; }
