.home { max-width: 960px; margin: 0 auto; padding: 0 24px; }
.hero { padding: 56px 0 28px; }
.wordmark {
  font-family: var(--font-read); font-weight: 600;
  font-size: clamp(3rem, 9vw, 5.6rem); line-height: 0.95; letter-spacing: -0.03em;
  margin: 0; color: var(--navy);
}
.tagline { font-family: var(--font-read); font-style: italic; font-size: 1.35rem; margin: 14px 0 0; color: #7A5A1C; }
.tagline .ar { font-style: normal; margin-left: 12px; font-size: 1.3rem; }
.lede { max-width: 36rem; font-size: 1.05rem; color: var(--ink-soft); margin: 14px 0 0; }

.picker { padding: 8px 0 12px; }
.grades { display: flex; flex-wrap: wrap; gap: 8px; }
.grade {
  min-height: 42px; padding: 0 18px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--navy); background: transparent; font-weight: 600;
}
.grade[aria-pressed="true"] { background: var(--navy); color: var(--ivory); }
.picker-note { margin: 8px 0 0; font-size: 0.85rem; color: var(--ink-soft); }

.unit { padding: 26px 0 10px; }
.unit-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.unit-head h2 { font-family: var(--font-read); font-size: 1.6rem; margin: 0; }
.unit-progress { margin: 0; color: var(--ink-soft); font-size: 0.9rem; }

/* The unit's string of pearls */
.string { position: relative; display: flex; gap: 18px; padding: 18px 6px; margin: 6px 0 4px; }
.string::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px;
  background: linear-gradient(90deg, rgba(195,149,59,0), var(--gold) 6%, var(--gold) 94%, rgba(195,149,59,0));
}
.string .pearl { position: relative; width: 30px; height: 30px; background-color: var(--ivory); }

.texts { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--mist); }
.texts li { border-bottom: 1px solid var(--mist); }
.text-row {
  display: grid; grid-template-columns: 5.5rem 1fr 8rem; gap: 16px; align-items: center;
  padding: 16px 8px; text-decoration: none; color: inherit;
}
.text-row:hover { background: var(--pearl); }
.tr-week { font-size: 0.85rem; color: var(--ink-soft); }
.tr-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tr-lesson { font-size: 0.85rem; color: #7A5A1C; }
.tr-title { font-family: var(--font-read); font-size: 1.25rem; font-weight: 600; line-height: 1.25; }
.tr-meta { font-size: 0.85rem; color: var(--ink-soft); }
.tr-status { display: flex; align-items: center; justify-content: flex-end; gap: 8px; font-size: 0.85rem; color: var(--ink-soft); }
.tr-status .pearl { width: 22px; height: 22px; }

@media (max-width: 640px) {
  .hero { padding: 36px 0 20px; }
  .text-row { grid-template-columns: 1fr auto; }
  .tr-week { grid-column: 1 / -1; }
  .string { gap: 10px; }
  .string .pearl { width: 24px; height: 24px; }
}

.bar-links { display: flex; gap: 8px; }
.icon-btn.text { padding: 0 14px; text-decoration: none; font-size: 0.9rem; }
.icon-btn.subtle { border-color: transparent; }
.me-chip { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.me-avatar { font-size: 1.4rem; }
.welcome { font-family: var(--font-read); font-size: 1.2rem; margin: 0 0 8px; }
.empty-note { padding: 24px 0; color: var(--ink-soft); }
@media (max-width: 640px) {
  .bar-links .subtle { display: none; }
  .me-chip #me-nick { display: none; }
}

/* P4: collection, badges, notes */
.string .danah.mini, .tr-status .danah.mini { width: 30px; height: 30px; }
.tr-status .danah.mini { width: 26px; height: 26px; }
.string .danah.mini { position: relative; }
.me-panel { margin: 6px 0 12px; padding: 18px 20px; border-radius: 14px; background: var(--navy); color: var(--ivory); border-bottom: 3px solid var(--gold); }
.treasure { display: flex; flex-wrap: wrap; gap: 14px 30px; align-items: center; }
.t-pearls, .t-stat { display: flex; align-items: center; gap: 10px; }
.t-pearls .danah.big { width: 54px; height: 54px; }
.treasure strong { display: block; font-family: var(--font-read); font-size: 1.8rem; line-height: 1; color: #F4E4BC; }
.treasure small { font-size: 0.85rem; opacity: 0.85; }
.t-stat { flex-direction: column; align-items: flex-start; gap: 2px; }
.badges { margin-top: 14px; }
.badges summary { cursor: pointer; font-weight: 600; color: #F4E4BC; }
.badge-grid { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.badge { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px; border-radius: 10px; text-align: center; font-size: 0.88rem; }
.badge.on { background: rgba(195, 149, 59, 0.22); border: 1px solid var(--gold); }
.badge.off { background: rgba(255, 255, 255, 0.05); border: 1px dashed rgba(245, 241, 230, 0.3); opacity: 0.75; }
.badge small { font-size: 0.75rem; opacity: 0.8; }
.b-icon { font-size: 1.6rem; }
.certs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.notes { margin: 8px 0 12px; padding: 16px 20px; border-radius: 14px; background: #fff; border: 1px solid var(--mist); }
.notes h2 { font-family: var(--font-read); font-size: 1.3rem; margin: 0 0 10px; display: flex; align-items: center; gap: 10px; }
.unread-badge { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-ui); font-size: 0.8rem; padding: 2px 10px 2px 4px; border-radius: 999px; background: var(--navy); color: #F4E4BC; }
.danah.tiny { width: 18px; height: 18px; }
.note-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.note-item { padding: 12px 14px; border-radius: 10px; background: var(--pearl); border-left: 4px solid var(--mist); }
.note-item.unread { border-left-color: var(--gold); background: #FBF4E4; }
.note-kind { margin: 0 0 4px; font-size: 0.82rem; color: var(--ink-soft); }
.note-preset, .note-text { margin: 2px 0; font-family: var(--font-read); }
.note-text { font-style: italic; }
.note-ar p { margin: 2px 0; font-family: var(--font-ar); font-size: 1.1rem; }
.note-actions { display: flex; gap: 12px; align-items: center; margin-top: 6px; }
.link-btn { background: none; border: 0; color: #7A5A1C; text-decoration: underline; cursor: pointer; padding: 2px; }
/* Levels */
.texts li { display: block; }
.text-row { color: inherit; }
.tr-main { text-decoration: none; color: inherit; }
.tr-main:hover .tr-title { text-decoration: underline; }
.levels { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 8px 14px 6.4rem; }
.lvl { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 6px; border-radius: 999px; border: 1.5px solid var(--mist); background: #fff; text-decoration: none; color: var(--navy); font-size: 0.88rem; }
.lvl:hover { border-color: var(--gold); }
.lvl .pearl, .lvl .danah.mini { width: 20px; height: 20px; }
.lvl small { color: var(--ink-soft); }
@media (max-width: 640px) { .levels { padding-left: 8px; } }

/* ===== Gulf Gold redesign ===== */
.home { max-width: 1200px; padding: 0 32px; }
.hero-band {
  position: relative; overflow: hidden; background: var(--navy); color: var(--ivory);
}
.hero-band::before {
  content: ""; position: absolute; right: 4%; top: -12%; width: 720px; height: 620px; border-radius: 50%;
  background: radial-gradient(circle, rgba(231, 200, 120, 0.18) 0%, rgba(231, 200, 120, 0) 62%);
}
.hero-band::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--hairline); }
.hero-inner {
  position: relative; max-width: 1200px; margin: 0 auto; padding: 64px 32px 72px;
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 32px; align-items: center;
}
.hero-copy { display: flex; flex-direction: column; gap: 16px; }
.eyebrow { margin: 0; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.28em; text-transform: uppercase; color: #D9BD78; }
.hero-band .wordmark {
  font-family: var(--font-display); font-weight: 600; color: var(--ivory);
  font-size: clamp(3.4rem, 7vw, 5.6rem); line-height: 0.95; letter-spacing: -0.01em; margin: 0;
}
.hero-band .wordmark em { font-style: italic; color: var(--champagne); }
.hero-band .welcome { display: none; }
.hero-band .tagline { margin: 0; font-family: var(--font-display); font-style: italic; font-size: 1.6rem; color: var(--champagne); }
.hero-band .tagline .ar { font-style: normal; font-size: 1.25rem; margin-left: 12px; color: #D9BD78; }
.hero-band .lede { margin: 0; max-width: 34rem; font-size: 1.08rem; line-height: 1.65; color: #C9D2E0; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
.btn-outline-light {
  display: inline-flex; align-items: center; min-height: 56px; padding: 0 28px; border-radius: 999px;
  color: var(--ivory); text-decoration: none; font-weight: 600; border: 1px solid rgba(231, 200, 120, 0.55);
  background: rgba(246, 241, 230, 0.04); transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.btn-outline-light:hover { background: rgba(246, 241, 230, 0.1); border-color: var(--champagne); transform: translateY(-2px); }
.btn-outline-light:active { transform: translateY(1px); }
.hero-stats { display: flex; margin-top: 6px; }
.hero-stats > div { display: flex; flex-direction: column; gap: 4px; padding: 0 28px; border-left: 1px solid rgba(231, 200, 120, 0.3); }
.hero-stats > div:first-child { padding-left: 0; border-left: 0; }
.hero-stats strong { font-family: var(--font-display); font-size: 3rem; font-weight: 600; line-height: 1; color: var(--ivory); }
.hero-stats .gold strong { color: var(--champagne); }
.hero-stats small { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: #9FAAC0; }

.hero-oyster { position: relative; margin: 0; height: 400px; display: flex; align-items: center; justify-content: center; }
.oyster-img { width: min(420px, 100%); height: auto; filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.45)); animation: oyster-float 7s ease-in-out infinite; }
.oyster-pearls { position: absolute; left: 50%; top: 58%; transform: translateX(-50%); display: flex; align-items: flex-end; gap: 4px; }
.oyster-pearls .danah { width: 52px; height: 52px; }
.oyster-pearls .danah.centre { width: 70px; height: 70px; }
.oyster-pearls .danah.golden::before {
  content: ""; position: absolute; inset: -40%; border-radius: 50%;
  background: radial-gradient(circle, rgba(241, 213, 138, 0.55) 0%, rgba(241, 213, 138, 0) 65%);
}
@keyframes oyster-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* Grade selector: one elegant pill */
.picker { padding: 40px 0 8px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.grades { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 5px; background: #fff; border: 1px solid #E4DCCB; border-radius: 999px; box-shadow: 0 4px 14px rgba(11, 31, 58, 0.06); }
.grade { min-height: 44px; padding: 0 22px; border: 0; background: transparent; color: var(--navy); font-weight: 600; transition: background 0.2s, color 0.2s, box-shadow 0.2s; }
.grade:hover { background: #F7F0E0; }
.grade[aria-pressed="true"] { background: var(--navy); color: var(--gold-hi); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 4px 10px rgba(11, 31, 58, 0.25); }
.picker-note { margin: 0; }

/* Unit as a jewellery case */
.unit {
  margin: 32px 0; padding: 40px 44px 36px; background: #FFFDF9; border: 1px solid var(--line);
  border-radius: 28px; box-shadow: 0 30px 60px rgba(11, 31, 58, 0.08);
}
.unit-head { align-items: flex-end; }
.unit-head h2 { font-family: var(--font-display); font-size: clamp(2rem, 4vw, 3rem); font-weight: 600; line-height: 1.05; }
.unit-kicker { display: block; font-family: var(--font-ui); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.24em; text-transform: uppercase; color: var(--gold-deep); margin-bottom: 8px; }
.unit-progress { font-size: 0.95rem; }
.unit-progress b { font-family: var(--font-display); font-size: 1.9rem; font-weight: 600; color: var(--navy); }
.unit-progress b.g { color: #B18A3C; }

/* The necklace */
.string { position: relative; display: block; height: 150px; margin: 18px 0 20px; padding: 0; gap: 0; }
.string::before { content: none; }
.string .thread { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.string .bead { position: absolute; transform: translate(-50%, -50%); }
.string .danah.mini { width: 56px; height: 56px; }
.string .danah.golden::before {
  content: ""; position: absolute; inset: -35%; border-radius: 50%;
  background: radial-gradient(circle, rgba(241, 213, 138, 0.5) 0%, rgba(241, 213, 138, 0) 65%);
}
.string .ghost-pearl { width: 40px; height: 40px; }
.string .bead.new .danah { animation: bead-drop 0.9s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes bead-drop { from { transform: translateY(-60px) scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }

/* Lessons as cards */
.texts { border-top: 0; display: flex; flex-direction: column; gap: 16px; }
.texts li { border-bottom: 0; background: #fff; border: 1px solid #EDE4D1; border-radius: 18px; box-shadow: var(--shadow-card); transition: box-shadow 0.25s, transform 0.25s; }
.texts li:hover { box-shadow: 0 1px 0 rgba(255,255,255,0.9) inset, 0 20px 44px rgba(11, 31, 58, 0.11); transform: translateY(-2px); }
.text-row { grid-template-columns: 96px minmax(0, 1fr) 140px; gap: 24px; padding: 24px 30px 10px; }
.text-row:hover { background: transparent; }
.tr-week { display: flex; flex-direction: column; gap: 2px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-soft); }
.tr-week b { font-family: var(--font-display); font-size: 2.8rem; font-weight: 600; letter-spacing: 0; color: #B18A3C; line-height: 1; }
.tr-lesson { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-deep); }
.tr-title { font-family: var(--font-display); font-size: 1.9rem; font-weight: 600; line-height: 1.1; color: var(--navy); }
.tr-status { flex-direction: column; align-items: flex-end; gap: 6px; font-weight: 600; }
.tr-status .danah.mini { width: 36px; height: 36px; }
.tr-status .ghost-pearl { width: 30px; height: 30px; }
.levels { padding: 0 30px 24px calc(96px + 24px + 30px); gap: 10px; }
.lvl { height: 42px; padding: 0 16px 0 8px; gap: 8px; border: 1px solid #E4DCCB; font-weight: 600; box-shadow: 0 1px 2px rgba(11, 31, 58, 0.06); transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s; }
.lvl.done { background: #FFFDF8; border-color: #D9BD78; }
.lvl:hover { border-color: var(--gold); box-shadow: 0 6px 14px rgba(11, 31, 58, 0.1); transform: translateY(-1px); }
.lvl .danah.mini { width: 22px; height: 22px; }
.lvl .ghost-pearl { width: 18px; height: 18px; }
.lvl small { font-weight: 500; }

/* Signed-in collection panel */
.me-panel { margin: 32px 0 8px; padding: 26px 30px; border-radius: 22px; border-bottom: 0; box-shadow: 0 20px 44px rgba(11, 31, 58, 0.2); position: relative; overflow: hidden; }
.me-panel::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--hairline); }
.treasure strong { font-family: var(--font-display); font-size: 2.3rem; color: var(--ivory); }
.notes { border-radius: 22px; border-color: var(--line); box-shadow: var(--shadow-card); padding: 22px 26px; }

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; padding: 44px 22px 28px; }
  .hero-oyster { height: 260px; order: -1; }
  .oyster-img { width: 280px; }
  .home { padding: 0 18px; }
  .unit { padding: 26px 18px 22px; border-radius: 22px; }
  .string { height: 110px; }
  .string .danah.mini { width: 34px; height: 34px; }
  .string .ghost-pearl { width: 24px; height: 24px; }
  .text-row { grid-template-columns: 1fr auto; padding: 18px 18px 8px; gap: 12px; }
  .tr-week { grid-column: 1 / -1; flex-direction: row; align-items: baseline; gap: 8px; }
  .tr-week b { font-size: 1.6rem; }
  .tr-title { font-size: 1.5rem; }
  .levels { padding: 0 18px 18px; }
  .hero-stats strong { font-size: 2.2rem; }
  .hero-stats > div { padding: 0 16px; }
}
@media (max-width: 640px) {
  .hero-oyster { height: 210px; }
  .oyster-img { width: 220px; }
  .oyster-pearls .danah { width: 34px; height: 34px; }
  .oyster-pearls .danah.centre { width: 46px; height: 46px; }
  .eyebrow { letter-spacing: 0.2em; font-size: 0.68rem; }
  .hero-band .wordmark { font-size: 3.2rem; }
  .hero-band .tagline { font-size: 1.35rem; }
}

/* ===== P18: the grade menu ===== */
.picker { display: block; padding: 56px 0 8px; }
.pick-head { text-align: center; max-width: 46rem; margin: 0 auto 22px; }
.pick-head .eyebrow { color: #6B4E12; margin: 0 0 10px; }
.pick-head h2 { font-family: var(--font-display); font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 600; margin: 0; line-height: 1.05; }
.pick-head h2::after { content: ""; display: block; width: 110px; height: 2px; margin: 16px auto 0; background: linear-gradient(90deg, rgba(201,161,74,0), #C9A14A, rgba(201,161,74,0)); }
.pick-lede { margin: 14px 0 0; color: var(--ink-soft); }

.terms { display: flex; justify-content: center; gap: 6px; margin: 0 auto 10px; padding: 5px; width: fit-content;
  background: #fff; border: 1px solid #E4DCCB; border-radius: 999px; box-shadow: 0 4px 14px rgba(11, 31, 58, 0.06); }
.term { display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 0 20px; border: 0; border-radius: 999px;
  background: transparent; color: var(--navy); font-weight: 600; cursor: pointer; transition: background 0.2s, color 0.2s; }
.term.is-open[aria-pressed="true"] { background: var(--gold-leaf); color: var(--navy); box-shadow: inset 0 1px 0 rgba(255,255,255,0.6), 0 3px 10px rgba(185, 139, 47, 0.3); }
.term.is-locked { color: #9AA4B4; cursor: not-allowed; }
.term.is-locked:hover { background: #F5F1E6; color: #7C869A; }
.term .lock { width: 15px; height: 15px; }
.term-note { min-height: 1.2em; margin: 0 0 22px; text-align: center; font-size: 0.88rem; color: var(--gold-deep); }

.grades { display: block; padding: 0; background: none; border: 0; box-shadow: none; }
.g-group + .g-group { margin-top: 34px; }
.g-group-h { display: flex; align-items: baseline; gap: 12px; margin: 0 0 14px; font-family: var(--font-ui);
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.24em; text-transform: uppercase; color: #6B4E12; }
.g-group-h::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, #E8DCC2, rgba(232,220,194,0)); }
.g-group-sub { letter-spacing: 0.06em; text-transform: none; font-weight: 500; color: var(--ink-soft); font-size: 0.8rem; }
.g-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 16px; }
.grade {
  position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  min-height: 178px; padding: 20px 22px 18px; text-align: left; cursor: pointer;
  border-radius: 20px; border: 1px solid #E7DCC4;
  background: linear-gradient(165deg, #FFFDF9 0%, #F7F1E3 100%);
  box-shadow: var(--shadow-card);
  transition: transform 0.22s ease, box-shadow 0.25s ease, border-color 0.2s ease;
}
.grade::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--gold-leaf); opacity: 0.9; }
.grade::after {
  content: ""; position: absolute; right: -28px; bottom: -34px; width: 118px; height: 118px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #FFFDF4 0 14%, #EFE6D2 45%, #DCCFB2 100%);
  opacity: 0.55; transition: transform 0.35s ease, opacity 0.25s ease;
}
.grade:hover { transform: translateY(-4px); border-color: #D9BD78; box-shadow: 0 1px 0 rgba(255,255,255,0.9) inset, 0 24px 46px rgba(11, 31, 58, 0.14); }
.grade:hover::after { transform: scale(1.08); opacity: 0.8; }
.grade:active { transform: translateY(-1px); }
.grade[aria-pressed="true"] { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(231, 200, 120, 0.35), var(--shadow-card); }
.g-num { position: relative; display: flex; align-items: baseline; gap: 8px; margin-top: 2px; }
.g-num small { font-family: var(--font-ui); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); }
.g-num b { font-family: var(--font-display); font-size: 3.6rem; font-weight: 600; line-height: 0.9; color: var(--navy); }
.g-stream { position: relative; font-family: var(--font-display); font-style: italic; font-size: 1.5rem; color: #7A5A1C; line-height: 1.1; }
.g-count { position: relative; margin-top: auto; font-size: 0.8rem; color: var(--ink-soft); }
.g-go { position: relative; margin-top: 10px; width: 30px; height: 30px; border-radius: 50%; border: 1px solid #D9BD78; }
.g-go::after { content: ""; position: absolute; left: 10px; top: 10px; width: 8px; height: 8px; border-top: 2px solid var(--gold-deep); border-right: 2px solid var(--gold-deep); transform: rotate(45deg); }
.grade:hover .g-go { background: var(--gold-leaf); border-color: #A87E2A; }

.chosen { display: flex; align-items: center; gap: 16px; padding: 28px 0 0; }
.chosen-label { margin: 0; font-family: var(--font-display); font-size: 1.5rem; color: var(--navy); }
.btn.small { min-height: 40px; padding: 0 18px; font-size: 0.9rem; }

@media (max-width: 640px) {
  .picker { padding: 34px 0 4px; }
  .g-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .grade { min-height: 150px; padding: 16px 16px 14px; }
  .g-num b { font-size: 2.8rem; }
  .g-stream { font-size: 1.2rem; }
  .terms { width: 100%; }
  .term { flex: 1; padding: 0 10px; justify-content: center; }
}

/* ===== M4: My Reading Plan ===== */
.plan { margin: 32px 0 12px; padding: 22px 26px; border-radius: 22px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-card); scroll-margin-top: calc(var(--header-h) + 12px); }
.plan h2 { font-family: var(--font-read); font-size: 1.4rem; margin: 0 0 14px; }
.plan h3 { font-family: var(--font-read); font-size: 1.1rem; margin: 0 0 6px; }
.plan-current { padding: 18px 20px; border-radius: 14px; background: var(--navy); color: var(--ivory); margin-bottom: 14px; }
.plan-current h3 { font-size: 1.45rem; color: #fff; }
.plan-kicker { margin: 0 0 4px; font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-hi); }
.plan-instr { margin: 0 0 8px; font-family: var(--font-read); font-style: italic; }
.plan-meta, .plan-next { margin: 0 0 10px; }
.plan-choose { margin: 0 0 6px; }
.plan-levels { display: flex; flex-wrap: wrap; gap: 8px; }
.lvl-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid rgba(231, 200, 120, 0.6); color: var(--ivory); text-decoration: none; font-weight: 600; }
.lvl-link.core { background: var(--gold-leaf); color: var(--navy); border-color: var(--gold); }
.lvl-link:hover { border-color: var(--champagne); }
.plan-late { font-style: italic; }
.plan-block { padding: 12px 0; border-top: 1px solid var(--line); }
.plan-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.plan-sub { color: var(--ink-soft); font-size: 0.92rem; }
.plan-done { margin: 0 0 8px; color: #1E5A40; }
.plan-tip { margin: 4px 0 0; }
.plan-tip.ar { color: var(--ink-soft); }
@media (max-width: 640px) { .plan { padding: 18px; border-radius: 16px; } }
/* M8: weekly goal and My Words */
.goal-track { height: 12px; border-radius: 999px; background: var(--pearl); border: 1px solid var(--line); overflow: hidden; margin: 6px 0 8px; }
.goal-track span { display: block; height: 100%; background: var(--gold-leaf); }
.lvl-link.light { color: var(--navy); border-color: var(--line); background: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.lvl-link.light.core { background: var(--gold-leaf); border-color: var(--gold); }
.plan-words { margin: 0; padding: 12px 0; border-top: 1px solid var(--line); }

/* the wordmark in the hero */
.hero-band .wordmark .wordmark-img { display: block; width: min(560px, 100%); height: auto; margin: 8px 0 18px -4px;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.4)) drop-shadow(0 0 26px rgba(241, 213, 138, 0.14)); }
.hero-band .wordmark:has(.wordmark-img) { line-height: 0; }

/* =====================================================================
   P21: the gilded home page
   The hero's navy runs on as a lacquer room; the grade menu, each unit and
   the student's own panels are pearl folios edged in gold, as in the reader
   and projector mode. Labels move from spaced capitals to gold italics.
   ===================================================================== */
.home-page {
  --lacquer: #07152A;
  --folio: #FFFDF8; --folio-2: #FBF6EA;
  --gilt: rgba(201, 161, 74, 0.55); --gilt-soft: rgba(201, 161, 74, 0.28);
  --folio-frame: 0 0 0 1px var(--gilt), inset 0 0 0 9px var(--folio), inset 0 0 0 10px var(--gilt-soft);
  background: linear-gradient(180deg, #0B1F3A 0, #0A1C36 900px, var(--lacquer) 100%);
}
.home-page .home { position: relative; z-index: 1; padding-bottom: 20px; }

/* labels: gold italics instead of spaced capitals */
.home-page .eyebrow {
  font-family: var(--font-display); font-style: italic; font-weight: 600; font-size: 1.15rem;
  letter-spacing: 0.01em; text-transform: none; color: var(--champagne);
}
.home-page .hero-band { background: transparent; }
.home-page .hero-band::after { opacity: 0.8; }
.home-page .hero-inner { padding-bottom: 110px; }
.hero-stats small { font-family: var(--font-display); font-style: italic; font-size: 0.98rem; font-weight: 500; letter-spacing: 0.01em; text-transform: none; color: #C9D2E0; }

/* ---------- the grade menu: a folio rising out of the hero ---------- */
.home-page .picker {
  position: relative; margin: -72px 0 0; padding: 54px clamp(22px, 4vw, 56px) 44px; border-radius: 26px;
  background: radial-gradient(ellipse 70% 30% at 50% 0%, #FFFFFF 0%, rgba(255, 255, 255, 0) 70%), linear-gradient(180deg, var(--folio) 0%, var(--folio-2) 100%);
  box-shadow: var(--folio-frame), inset 0 0 0 14px var(--folio), inset 0 0 0 15px rgba(201, 161, 74, 0.16), 0 40px 90px rgba(0, 0, 0, 0.45);
}
.home-page .picker[hidden] { display: none; }
.pick-head .eyebrow { color: var(--gold-deep); }
.pick-head h2::after {
  width: 220px; height: 12px;
  background:
    radial-gradient(circle at 50% 50%, #FFFFFF 0, #F1E8D4 2.5px, #C9B891 5px, rgba(201, 161, 74, 0.7) 5.6px, rgba(0, 0, 0, 0) 6.2px) no-repeat,
    linear-gradient(90deg, rgba(201, 161, 74, 0), #C9A14A 40%, #C9A14A 60%, rgba(201, 161, 74, 0)) 0 50% / 100% 1px no-repeat;
}
.terms { background: #F5EDDA; border: 0; box-shadow: inset 0 0 0 1px var(--gilt-soft); }
.term-note { font-family: var(--font-display); font-style: italic; font-size: 1.05rem; }

.g-group-h {
  font-family: var(--font-display); font-style: italic; font-weight: 600; font-size: 1.45rem;
  letter-spacing: 0.01em; text-transform: none; color: var(--navy);
}
.g-group-h::after { background: linear-gradient(90deg, #C9A14A, rgba(201, 161, 74, 0)); opacity: 0.6; }
.g-group-sub { font-family: var(--font-ui); font-style: normal; font-size: 0.85rem; letter-spacing: 0.01em; color: var(--ink-soft); }

.grade {
  border: 0; border-radius: 18px;
  background: radial-gradient(ellipse 90% 60% at 20% 0%, #FFFFFF 0%, rgba(255, 255, 255, 0) 70%), linear-gradient(165deg, #FFFDF8 0%, #F6EEDC 100%);
  box-shadow: 0 0 0 1px var(--gilt-soft), inset 0 0 0 6px rgba(255, 253, 248, 0.9), inset 0 0 0 7px rgba(201, 161, 74, 0.18), 0 10px 26px rgba(11, 31, 58, 0.07);
}
.grade::before { inset: 0 18px auto 18px; height: 2px; border-radius: 0 0 2px 2px; }
.grade:hover { border: 0; box-shadow: 0 0 0 1px var(--gold), inset 0 0 0 6px rgba(255, 253, 248, 0.9), inset 0 0 0 7px rgba(201, 161, 74, 0.35), 0 24px 46px rgba(11, 31, 58, 0.16); }
.grade[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--gold), 0 0 0 6px rgba(231, 200, 120, 0.3), 0 10px 26px rgba(11, 31, 58, 0.1); }
.g-num small { font-family: var(--font-display); font-style: italic; font-weight: 600; font-size: 1.05rem; letter-spacing: 0.01em; text-transform: none; color: var(--gold-deep); }
.g-num b { font-size: 4rem; }
.g-go { width: 34px; height: 34px; border: 0; background: radial-gradient(circle at 35% 28%, #FFFFFF 0%, #F6ECD4 60%, #E9D9B4 100%); box-shadow: 0 0 0 1px var(--gold); }
.g-go::after { left: 11px; top: 12px; }
.grade:hover .g-go { background: var(--gold-leaf); box-shadow: 0 0 0 1px #A87E2A, 0 0 0 4px rgba(231, 200, 120, 0.25); }
.picker-note { margin-top: 26px; text-align: center; font-family: var(--font-display); font-style: italic; font-size: 1.05rem; color: var(--ink-soft); }

/* ---------- a chosen grade: its heading sits on the navy ---------- */
.home-page .chosen { flex-wrap: wrap; padding: 34px 0 0; }
.home-page .chosen-label { font-size: 2rem; font-weight: 600; color: var(--ivory); }
.home-page .chosen .btn.ghost { background: transparent; color: var(--ivory); border: 1px solid var(--gilt); }
.home-page .chosen .btn.ghost:hover { border-color: var(--champagne); background: rgba(231, 200, 120, 0.1); }
.home-page .chosen .btn.ghost .ico { color: var(--champagne); }
.home-page .offline-card { border: 0; border-radius: 16px; background: linear-gradient(180deg, #FFFFFF, var(--folio)); box-shadow: 0 0 0 1px var(--gilt), 0 14px 30px rgba(0, 0, 0, 0.25); }
.home-page .offline-card h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; }
.home-page .units > .empty-note, .home-page .units > .load-error { color: #C9D2E0; font-family: var(--font-display); font-style: italic; font-size: 1.3rem; text-align: center; padding: 40px 0; }

/* ---------- each unit: a jewellery case on the navy ---------- */
.home-page .unit {
  position: relative; border: 0; border-radius: 26px; padding: 46px 50px 40px;
  background: radial-gradient(ellipse 70% 25% at 50% 0%, #FFFFFF 0%, rgba(255, 255, 255, 0) 70%), linear-gradient(180deg, var(--folio) 0%, var(--folio-2) 100%);
  box-shadow: var(--folio-frame), inset 0 0 0 14px var(--folio), inset 0 0 0 15px rgba(201, 161, 74, 0.16), 0 36px 80px rgba(0, 0, 0, 0.42);
}
.unit-kicker { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-family: var(--font-display); font-style: italic; font-weight: 600; font-size: 1.2rem; letter-spacing: 0.01em; text-transform: none; }
.unit-kicker .official, .home-page .official {
  position: relative; font-family: var(--font-ui); font-style: normal; font-size: 0.66rem; font-weight: 600; letter-spacing: 0.02em; text-transform: none;
  padding: 2px 10px 2px 20px; border-radius: 999px; border: 0; color: var(--gold-deep); background: #FBF4E4; box-shadow: inset 0 0 0 1px var(--gilt-soft);
}
.home-page .official::before {
  content: ""; position: absolute; left: 8px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff 0%, #EFE4CC 55%, #C9B891 100%); box-shadow: 0 0 0 1px rgba(201, 161, 74, 0.55);
}
.unit-progress { font-family: var(--font-display); font-style: italic; font-size: 1.1rem; }
.unit-progress b { font-style: normal; font-size: 2.2rem; }

.texts li {
  border: 0; border-radius: 18px; background: linear-gradient(180deg, #FFFFFF 0%, #FFFDF8 100%);
  box-shadow: 0 0 0 1px var(--gilt-soft), 0 10px 26px rgba(11, 31, 58, 0.06);
}
.texts li:hover { box-shadow: 0 0 0 1px var(--gold), 0 22px 44px rgba(11, 31, 58, 0.12); }
.tr-week { font-family: var(--font-display); font-style: italic; font-weight: 600; font-size: 1.02rem; letter-spacing: 0.01em; text-transform: none; color: var(--gold-deep); }
.tr-week b { font-style: normal; font-size: 3rem; color: var(--gold); }
.tr-lesson { font-family: var(--font-display); font-style: italic; font-weight: 600; font-size: 1.05rem; letter-spacing: 0.01em; text-transform: none; }
.tr-title { font-size: 2rem; }
.tr-meta { font-family: var(--font-display); font-style: italic; font-size: 1.02rem; }
.tr-status { font-family: var(--font-display); font-style: italic; font-weight: 600; font-size: 1rem; color: var(--gold-deep); }
.lvl { border: 0; background: #fff; box-shadow: 0 0 0 1px var(--gilt-soft), 0 2px 6px rgba(11, 31, 58, 0.05); }
.lvl.done { background: #FFFBF1; box-shadow: 0 0 0 1px var(--gold), 0 2px 6px rgba(11, 31, 58, 0.05); }
.lvl:hover { border: 0; box-shadow: 0 0 0 1px var(--gold), 0 8px 16px rgba(11, 31, 58, 0.1); }

/* ---------- the student's own panels ---------- */
.home-page .me-panel {
  background: radial-gradient(ellipse 70% 60% at 15% 0%, #1A3C6B 0%, rgba(26, 60, 107, 0) 70%), linear-gradient(180deg, #12305A, var(--navy));
  box-shadow: 0 0 0 1px var(--gilt), inset 0 0 0 8px rgba(11, 31, 58, 0.0), 0 30px 60px rgba(0, 0, 0, 0.4);
}
.home-page .plan, .home-page .notes {
  border: 0; border-radius: 24px; padding: 30px 34px;
  background: linear-gradient(180deg, var(--folio) 0%, var(--folio-2) 100%);
  box-shadow: var(--folio-frame), 0 30px 60px rgba(0, 0, 0, 0.38);
}
.home-page .plan h2, .home-page .notes h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.9rem; }
.plan-kicker { font-family: var(--font-display); font-style: italic; font-weight: 600; font-size: 1.05rem; letter-spacing: 0.01em; text-transform: none; }
.home-page .plan-current { border-radius: 16px; background: radial-gradient(ellipse 70% 60% at 15% 0%, #1A3C6B 0%, rgba(26, 60, 107, 0) 70%), var(--navy); box-shadow: 0 0 0 1px var(--gilt); }
.home-page .note-item { border-left: 0; border-radius: 12px; box-shadow: inset 3px 0 0 var(--line); }
.home-page .note-item.unread { box-shadow: inset 3px 0 0 var(--gold); }

/* ---------- the teacher behind it ---------- */
.home-page .creator-card { box-shadow: 0 0 0 1px var(--gilt), inset 0 0 0 9px rgba(0, 0, 0, 0), 0 30px 70px rgba(0, 0, 0, 0.45); }
.home-page .creator-card::before { content: ""; position: absolute; inset: 10px; border-radius: inherit; border: 1px solid rgba(231, 200, 120, 0.2); pointer-events: none; }
.home-page .creator .eyebrow { font-size: 1.15rem; color: var(--champagne); }
.home-page .footer { background: transparent; }

@media (max-width: 860px) {
  .home-page .hero-inner { padding-bottom: 90px; }
  .home-page .picker { margin-top: -56px; padding: 40px 20px 32px; border-radius: 22px; }
  .home-page .unit { padding: 32px 20px 26px; border-radius: 22px; }
  .home-page .plan, .home-page .notes { padding: 24px 20px; }
  .tr-title { font-size: 1.55rem; }
  .tr-week b { font-size: 1.8rem; }
  .home-page .chosen-label { font-size: 1.5rem; }
}
@media (max-width: 640px) {
  .home-page .picker, .home-page .unit { box-shadow: 0 0 0 1px var(--gilt), inset 0 0 0 6px var(--folio), inset 0 0 0 7px var(--gilt-soft), 0 24px 50px rgba(0, 0, 0, 0.4); }
  .g-num b { font-size: 3rem; }
  .home-page .eyebrow { font-size: 1.02rem; }
}
.home-page .hero-band::after { content: none; }
.home-page:has(#picker[hidden]) .hero-inner { padding-bottom: 64px; }
.home-page .chosen .offline-card { margin: 0 0 0 auto; }
@media (max-width: 860px) { .home-page .chosen .offline-card { margin: 0; width: 100%; } }

/* =====================================================================
   P24: the unit index
   Each unit lists its texts like the contents page of a fine edition:
   grouped by week, a gold numeral for the lessons, the title, a dotted
   gold leader to the levels, and a seal that says whether it is done.
   ===================================================================== */
.idx { margin-top: 6px; }
.idx-week + .idx-week { margin-top: 30px; }
.idx-wk {
  display: flex; align-items: baseline; gap: 10px; margin: 0 0 6px;
  font-family: var(--font-display); font-weight: 600; font-size: 1rem; color: var(--navy);
}
.idx-wk span { font-style: italic; font-size: 1.15rem; color: var(--gold-deep); }
.idx-wk b { font-size: 2rem; line-height: 1; color: var(--gold); }
.idx-wk::after { content: ""; flex: 1; height: 1px; margin-left: 8px; align-self: center; background: linear-gradient(90deg, #C9A14A, rgba(201, 161, 74, 0)); opacity: 0.7; }

.idx-list { list-style: none; margin: 0; padding: 0; }
.idx-row {
  position: relative; display: grid; align-items: center; gap: 4px 18px;
  grid-template-columns: 4.4rem minmax(0, max-content) minmax(28px, 1fr) auto 8.6rem;
  padding: 16px 14px 16px 6px; border-radius: 14px;
  transition: background 0.25s;
}
.idx-row + .idx-row { box-shadow: 0 -1px 0 rgba(201, 161, 74, 0.2); }
.idx-row:hover { background: linear-gradient(90deg, rgba(251, 243, 223, 0.9), rgba(251, 243, 223, 0.35)); }
/* a finished text is washed in pale emerald and carries a gold rule on its edge */
.idx-row.done { background: linear-gradient(90deg, rgba(228, 241, 234, 0.75) 0%, rgba(228, 241, 234, 0) 55%); }
.idx-row.done::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 2px; border-radius: 2px; background: linear-gradient(180deg, #F1D58A, #C9A14A); }
.idx-row.done:hover { background: linear-gradient(90deg, rgba(228, 241, 234, 0.95) 0%, rgba(251, 243, 223, 0.5) 60%); }

.idx-no { font-family: var(--font-display); font-style: italic; font-weight: 600; font-size: 1.35rem; color: var(--gold); text-align: center; white-space: nowrap; }
.idx-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; text-decoration: none; color: var(--navy); }
.idx-title {
  font-family: var(--font-display); font-weight: 600; font-size: 1.42rem; line-height: 1.18; letter-spacing: 0.002em;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size 0.35s ease;
}
.idx-main:hover .idx-title, .idx-main:focus-visible .idx-title { background-size: 100% 1px; }
.idx-sub { display: flex; flex-wrap: wrap; align-items: center; font-family: var(--font-display); font-style: italic; font-size: 1rem; color: var(--gold-deep); }
.idx-sub span + span { color: var(--ink-soft); }
.idx-sub span + span::before {
  content: ""; display: inline-block; width: 5px; height: 5px; margin: 0 9px 0.2em; vertical-align: middle; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff 0%, #EFE4CC 55%, #C9B891 100%); box-shadow: 0 0 0 1px rgba(201, 161, 74, 0.5);
}
/* the dotted gold leader, as in a printed contents page */
.idx-leader { align-self: center; height: 4px; opacity: 0.55; transition: opacity 0.25s;
  background: radial-gradient(circle, #C9A14A 1.1px, rgba(201, 161, 74, 0) 1.5px) 0 50% / 9px 4px repeat-x; }
.idx-row:hover .idx-leader { opacity: 1; }

/* the three levels, each with a small state pearl */
.idx-lv { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: #F5EDDA; box-shadow: inset 0 0 0 1px rgba(201, 161, 74, 0.22); }
.idx-l {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 8px; border-radius: 999px;
  font-size: 0.8rem; font-weight: 600; color: var(--navy); text-decoration: none; transition: background 0.2s, box-shadow 0.2s;
}
.idx-l:hover { background: #fff; box-shadow: 0 0 0 1px var(--gold), 0 4px 10px rgba(11, 31, 58, 0.08); }
.idx-l i { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(201, 161, 74, 0.55); background: #FFFDF8; }
.idx-l.st-tried i { background: linear-gradient(90deg, #E9DFC8 50%, #FFFDF8 50%); }
.idx-l.st-pearl i { background: radial-gradient(circle at 35% 30%, #fff 0%, #F1E8D4 50%, #C9B891 100%); box-shadow: 0 0 0 1px rgba(201, 161, 74, 0.7), 0 0 5px rgba(241, 213, 138, 0.5); }
.idx-l.st-golden i { background: radial-gradient(circle at 35% 30%, #FFF8E6 0 16%, #E8C77A 42%, #B8862E 100%); box-shadow: 0 0 0 1px #A87A28, 0 0 7px rgba(241, 213, 138, 0.8); }

/* the seal: done, started or not yet */
.idx-seal { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.idx-seal .danah.mini { width: 30px; height: 30px; }
.idx-seal .ghost-pearl { width: 24px; height: 24px; }
.idx-seal-t { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; min-width: 4.6rem; }
.idx-seal-t b { font-family: var(--font-display); font-style: italic; font-weight: 600; font-size: 1.08rem; }
.idx-seal-t small { font-size: 0.78rem; font-weight: 600; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.idx-seal.done b { color: #1D6A4E; }
.idx-seal.golden b { color: #9C7427; }
.idx-seal.tried b { color: var(--gold-deep); }
.idx-seal.none b { color: #8A94A6; font-weight: 500; }

@media (max-width: 980px) {
  .idx-row { grid-template-columns: 3.4rem minmax(0, 1fr) auto; grid-template-areas: "no main seal" "no lv lv"; row-gap: 10px; }
  .idx-no { grid-area: no; align-self: start; padding-top: 2px; }
  .idx-main { grid-area: main; }
  .idx-leader { display: none; }
  .idx-lv { grid-area: lv; justify-self: start; }
  .idx-seal { grid-area: seal; align-self: start; }
}
@media (max-width: 560px) {
  .idx-row { grid-template-columns: 2.6rem minmax(0, 1fr); grid-template-areas: "no main" "no lv" "no seal"; padding: 14px 6px 14px 0; }
  .idx-seal { justify-content: flex-start; }
  .idx-title { font-size: 1.25rem; }
  .idx-no { font-size: 1.1rem; }
}
