/* Family Math home. Calm, mobile-first; tokens come from fm2.css. One primary button (.fm2-btn-primary) at a time,
   quiet outlined buttons for everything else, muted text only for supporting detail. @fm2 FM-001 FM-002 FM-036 */
.home-page {
  overflow-x: clip;
}
.hm-region {
  margin-top: 28px;
}
.hm-head {
  margin-bottom: 12px;
}
.hm-noprint {
  align-self: flex-start;
}
.hm-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Welcome and practice setup: one compact card */
.hm-hero {
  display: grid;
  gap: 18px;
  margin-top: 0;
  padding: clamp(16px, 3vw, 24px);
  border: 1px solid var(--fm-line);
  border-radius: 20px;
  background: #fff;
}
.hm-hero-copy {
  min-width: 0;
  align-self: start;
}
.hm-hero h1 {
  margin: 0 0 8px;
  font:
    700 clamp(1.6rem, 4.6vw, 2.2rem) / 1.12 Georgia,
    serif;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
.hm-hero-lead {
  margin: 0;
  max-width: 34em;
  font-size: 1.05rem;
}
.hm-privacy {
  margin: 10px 0 0;
  color: var(--fm-muted);
  font-size: 0.92rem;
}
.hm-setup {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  border-radius: 16px;
  background: var(--fm-paper);
  color: var(--fm-ink);
}
.hm-controls {
  display: grid;
  gap: 12px;
}
.hm-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.hm-field legend,
.hm-field-label {
  display: block;
  padding: 0;
  margin-bottom: 6px;
  font-size: 0.92rem;
  font-weight: 800;
}
.hm-grade-select {
  width: 100%;
  min-height: 48px;
  padding: 8px 12px;
  border: 2px solid var(--fm-line);
  border-radius: 12px;
  background: #fff;
  color: var(--fm-ink);
  font-family: var(--fm-font);
  font-size: 1rem;
  touch-action: manipulation;
}
.hm-seg {
  display: flex;
  gap: 6px;
}
.hm-pill {
  position: relative;
  display: inline-flex;
  flex: 1 1 0;
  min-width: 0;
}
.hm-pill input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.hm-pill span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-height: 48px;
  padding: 6px 8px;
  border: 2px solid var(--fm-line);
  border-radius: 999px;
  background: #fff;
  font-size: 0.95rem;
  font-weight: 800;
  text-align: center;
  line-height: 1.15;
  pointer-events: none;
}
.hm-pill input:checked + span {
  border-color: var(--fm-navy);
  background: var(--fm-navy);
  color: #fff;
}
.hm-pill input:checked + span::before {
  content: "✓";
}
.hm-pill input:focus-visible + span {
  box-shadow: var(--fm-focus);
}
.hm-hint,
.hm-note {
  margin: 0;
  color: var(--fm-muted);
  font-size: 0.92rem;
}
.hm-note {
  text-align: center;
}
.hm-note-start {
  text-align: start;
  margin-bottom: 12px;
}
.hm-start {
  width: 100%;
  min-height: 56px;
  font-size: 1.15rem;
}
.hm-loading {
  margin: 0;
  color: var(--fm-muted);
}
.hm-guided-box {
  display: grid;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--fm-line);
}
.hm-guided {
  width: 100%;
  min-height: 48px;
  text-align: center;
}
.hm-else {
  margin: 0;
  text-align: center;
  font-size: 0.95rem;
}
.hm-else a,
.hm-skill-link,
.hm-act-link {
  color: var(--fm-navy);
  text-underline-offset: 3px;
}

/* Saved activity */
.hm-resume {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 14px;
  padding: 14px 18px;
  border: 2px solid var(--fm-mint);
  border-radius: 16px;
  background: var(--fm-mint-soft);
}
.hm-resume > div {
  flex: 1 1 260px;
  min-width: 0;
}
.hm-resume h2 {
  margin: 0;
  font-size: 1.1rem;
}
.hm-resume p {
  margin: 2px 0 0;
}

/* Mission */
.hm-acts {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.hm-act {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 8px 12px;
  padding: 14px;
  border: 1px solid var(--fm-line);
  border-radius: 16px;
  background: #fff;
}
.hm-act-main {
  min-width: 0;
}
.hm-act-main p,
.hm-act-main h3 {
  margin: 0;
}
.hm-act-meta {
  color: var(--fm-muted);
  font-size: 0.85rem;
}
.hm-act-title {
  font-size: 1.1rem;
  line-height: 1.25;
}
.hm-act-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.hm-act-game {
  color: var(--fm-muted);
  font-size: 0.9rem;
}
.hm-act-note {
  margin-top: 4px;
}
.hm-why {
  margin-top: 4px;
  color: var(--fm-muted);
  font-size: 0.88rem;
}
.hm-act-go {
  grid-column: 1 / -1;
}
.hm-total {
  margin: 10px 2px 0;
  color: var(--fm-muted);
  font-size: 0.95rem;
}

/* Progress */
.hm-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}
.hm-stat {
  padding: 12px;
  border: 1px solid var(--fm-line);
  border-radius: 14px;
  background: #fff;
}
.hm-stat b {
  display: block;
  font:
    700 clamp(1.4rem, 5vw, 1.9rem) / 1.1 Georgia,
    serif;
}
.hm-stat span {
  color: var(--fm-muted);
  font-size: 0.88rem;
}
.hm-week {
  margin-bottom: 12px;
  border: 1px solid var(--fm-line);
  border-radius: 14px;
  background: #fff;
}
.hm-week summary,
.hm-skill-more summary,
.hm-more-ideas summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 14px;
  font-weight: 800;
  cursor: pointer;
}
.hm-week > :not(summary) {
  padding: 0 14px 14px;
}

/* Collapsible browsing sections: games and math at home */
.hm-fold {
  border: 1px solid var(--fm-line);
  border-radius: 16px;
  background: #fff;
}
.hm-fold > summary {
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: 8px 18px;
  cursor: pointer;
}
.hm-fold > summary h2 {
  display: inline;
}
.hm-fold > :not(summary) {
  margin-inline: 18px;
}
.hm-fold > :last-child {
  margin-bottom: 18px;
}

/* Games shelf */
.hm-games {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 10px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}
.hm-game {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 12px;
  border: 1px solid var(--fm-line);
  border-radius: 14px;
  background: #fff;
}
.hm-game-main {
  flex: 1 1 140px;
  min-width: 0;
}
.hm-game-main strong {
  display: block;
  overflow-wrap: anywhere;
}
.hm-game-main span {
  display: block;
  color: var(--fm-muted);
  font-size: 0.9rem;
}
.hm-game-main small {
  display: block;
  margin-top: 2px;
  color: var(--fm-muted);
  font-weight: 700;
}
.hm-game-off {
  background: #eef0f6;
  border-style: dashed;
}

/* Skill browser: search, topic groups, details on demand */
.hm-browser {
  display: grid;
  gap: 10px;
}
.hm-search label,
.hm-share label {
  display: block;
  margin-bottom: 6px;
  font-weight: 800;
}
.hm-search input,
.hm-share input,
.hm-share textarea,
.hm-share select {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 2px solid var(--fm-line);
  border-radius: 12px;
  color: var(--fm-ink);
  background: #fff;
  font: inherit;
}
.hm-share textarea {
  min-height: 84px;
  resize: vertical;
}
.hm-search-status {
  margin: 0;
  min-height: 1.3em;
  color: var(--fm-muted);
  font-size: 0.92rem;
}
.hm-share {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 2px solid var(--fm-mint);
  border-radius: 16px;
  background: var(--fm-mint-soft);
}
.hm-share p {
  margin: 0;
}
.hm-share button {
  justify-self: start;
}
.hm-strand {
  border: 1px solid var(--fm-line);
  border-radius: 16px;
  background: #fff;
}
.hm-strand > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 52px;
  padding: 8px 16px;
  font-weight: 800;
  cursor: pointer;
  border-radius: 16px;
}
.hm-strand > summary small {
  color: var(--fm-muted);
  font-weight: 700;
  white-space: nowrap;
}
.hm-skills {
  display: grid;
  margin: 0;
  padding: 0 12px 8px;
  list-style: none;
}
.hm-skill {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 12px;
  padding: 8px 4px;
  border-top: 1px solid var(--fm-mist);
}
.hm-skill-main {
  min-width: 0;
}
.hm-skill-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.hm-skill-main span {
  display: block;
  color: var(--fm-muted);
  font-size: 0.88rem;
}
.hm-skill-main .pk-stars {
  display: block;
  margin-top: 2px;
}
.hm-practice {
  min-height: 44px;
  padding: 6px 16px;
}
.hm-skill-more {
  grid-column: 1 / -1;
}
.hm-skill-more summary {
  min-height: 44px;
  padding-inline: 0;
  color: var(--fm-navy);
  font-size: 0.92rem;
}
.hm-skill-more p {
  margin: 4px 0;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

/* Coaching card and real-world activities */
.hm-coach {
  padding: 18px;
  border: 1px solid #bfe3d3;
  border-radius: 20px;
  background: var(--fm-mint-soft);
}
.hm-quote {
  margin: 0 0 12px;
  padding: 8px 0 8px 14px;
  border-left: 4px solid var(--fm-mint);
  font:
    700 1.2rem / 1.35 Georgia,
    serif;
}
.hm-coach-row {
  margin: 8px 0;
  max-width: 44em;
}
.hm-more-ideas summary {
  padding-inline: 0;
}
.hm-rw {
  margin-top: 10px;
  border: 1px solid var(--fm-line);
  border-radius: 14px;
  background: #fff;
}
.hm-rw summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 2px 12px;
  min-height: 52px;
  padding: 8px 16px;
  font-weight: 800;
  cursor: pointer;
}
.hm-rw summary small {
  color: var(--fm-muted);
  font-weight: 700;
}
.hm-rw-body {
  padding: 0 16px 14px;
}
.hm-rw-body ol {
  margin: 8px 0;
  padding-left: 1.3rem;
}
.hm-rw-body li {
  margin: 4px 0;
}
.hm-more-btn {
  margin-top: 10px;
}

/* More ways + footer */
.hm-more {
  display: grid;
  gap: 12px;
}
.hm-more-card {
  display: block;
  padding: 16px 18px;
  border: 1px solid var(--fm-line);
  border-radius: 16px;
  background: #fff;
  color: var(--fm-ink);
  text-decoration: none;
}
.hm-more-card:hover {
  background: var(--fm-paper);
}
.hm-more-card strong {
  display: block;
  font-size: 1.05rem;
}
.hm-more-card span {
  color: var(--fm-muted);
  font-size: 0.92rem;
}
.hm-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 16px;
  width: min(1120px, 100% - 32px);
  margin: 0 auto;
  padding: 16px 0 36px;
  border-top: 1px solid var(--fm-line);
  color: var(--fm-muted);
  font-size: 0.88rem;
}
.hm-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #17324d;
  font-weight: 700;
}

@media (min-width: 700px) {
  .hm-controls {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1.5fr);
    align-items: start;
  }
  .hm-more {
    grid-template-columns: 1fr 1fr;
  }
  .hm-act {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
  }
  .hm-act-go {
    grid-column: 3;
  }
}
@media (min-width: 1000px) {
  .hm-hero {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr);
    gap: 32px;
  }
  .hm-controls {
    grid-template-columns: 1fr;
  }
  .hm-seg {
    max-width: 22rem;
  }
}
@media (max-width: 520px) {
  .hm-region {
    margin-top: 22px;
  }
  .hm-setup {
    padding: 12px;
  }
  .hm-pill span {
    padding: 6px 4px;
    font-size: 0.9rem;
  }
  .hm-skill .pk-ico {
    display: none;
  }
  .hm-skill {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .hm-stat {
    padding: 10px;
  }
  .hm-fold > summary {
    padding-inline: 14px;
  }
  .hm-fold > :not(summary) {
    margin-inline: 14px;
  }
}

/* Printing: the coaching card or one real-world activity prints alone, with plain styling. */
@media print {
  .home-page {
    background: #fff;
  }
  .hm-footer,
  .hm-noprint,
  .hm-resume,
  .hm-more-btn {
    display: none !important;
  }
  body[data-print] .hm-region,
  body[data-print] .hm-hero {
    display: none;
  }
  body[data-print="coach"] #coach-region,
  body[data-print="realworld"] #rw-region {
    display: block;
    margin: 0;
  }
  body[data-print="realworld"] .hm-rw:not([data-printing]) {
    display: none;
  }
  body[data-print="realworld"] #rw-region > summary,
  body[data-print="realworld"] #rw-region .pk-lead,
  body[data-print="coach"] .hm-more-ideas summary {
    display: none;
  }
  .hm-coach {
    border: 1px solid #999;
    background: #fff;
  }
  .hm-rw {
    border: 1px solid #999;
    break-inside: avoid;
  }
  .hm-rw summary::marker {
    content: "";
  }
}
