/* =====================================================================
   MY LEARNING (/my-learning): the parts the old dashboard did not have.
   The tabs that follow the reader down the page, the section headings,
   My Path's goals, the progress board and the saved list; and the page a
   visitor sees before signing in (.ml-out). The dashboard's own parts are
   styled by dashboard.css. Logical properties throughout (RTL); tokens
   come from layout.css and dashboard.css, redefined for the dark theme.
   ===================================================================== */
.ml {
  --ml-tabs-top: calc(var(--ip-header-h, 76px) + 10px);
  --ml-emerald: var(--ip-area-fill, #1f7a63);
  --ml-gold: #b7791f;
  --ml-sky: #0284c7;
  --ml-violet: #7c3aed;
  --ml-rose: #db2777;
}
body.dark .ml,
[data-theme="dark"] .ml {
  --ml-emerald: var(--ip-area, #2eb872);
  --ml-gold: #e6b85c;
  --ml-sky: #38bdf8;
  --ml-violet: #a78bfa;
  --ml-rose: #f472b6;
}

/* ---------- Hero: the greeting above the page's name ---------- */
.ml-hello {
  margin: 0 0 .15rem;
  font-size: 1.02rem;
  font-weight: 650;
  color: #ffdca0;
}
.ml-title {
  display: flex;
  align-items: center;
  gap: .6rem;
}
.ml-title .bi {
  font-size: .7em;
  color: #e6b85c;
}

/* ---------- Tabs: one pill bar, kept in view below the header ---------- */
.ml-tabs {
  position: sticky;
  top: var(--ml-tabs-top);
  z-index: 20;
  margin-block-end: 18px;
}
.ml-tabs__list {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 5px;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
  border-radius: 999px;
  background: color-mix(in srgb, var(--dmd-card, #fff) 88%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  backdrop-filter: blur(18px) saturate(1.6);
  border: 1px solid var(--dmd-line, rgba(20, 26, 51, .09));
  box-shadow: var(--dmd-shadow);
}
.ml-tabs__list::-webkit-scrollbar {
  display: none;
}
.ml-tabs__list li {
  flex: 1 0 auto;
}
.ml-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 44px;
  padding: .4rem 1rem;
  border-radius: 999px;
  color: var(--dmd-ink);
  font-size: .92rem;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color .2s ease, color .2s ease;
}
.ml-tab .bi {
  color: var(--dmd-gold);
}
.ml-tab:hover {
  background: var(--dmd-mint);
  color: var(--dmd-ink);
}
.ml-tab:focus-visible {
  outline: 3px solid #e6b85c;
  outline-offset: 1px;
}
.ml-tab.is-on {
  background: linear-gradient(135deg, var(--ml-emerald), color-mix(in srgb, var(--ml-emerald) 70%, #0b3324));
  color: #fff;
  box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--ml-emerald) 80%, transparent);
}
.ml-tab.is-on .bi {
  color: #ffdca0;
}

/* ---------- Sections ---------- */
.ml-section {
  scroll-margin-top: calc(var(--ml-tabs-top) + 70px);
  margin-block-end: 30px;
}
.ml-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .25rem 1rem;
  margin-block-end: 14px;
}
.ml-h2 {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin: 0 0 12px;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--dmd-ink);
}
.ml-section__head .ml-h2 {
  margin: 0;
}
.ml-h2 .bi {
  display: grid;
  place-items: center;
  inline-size: 34px;
  block-size: 34px;
  border-radius: 11px;
  font-size: 1rem;
  color: #fff;
  background: linear-gradient(135deg, var(--ml-emerald), color-mix(in srgb, var(--ml-emerald) 65%, #0b3324));
}
.ml-lead {
  flex: 1 1 280px;
  margin: 0;
  color: var(--dmd-muted);
  font-size: .92rem;
}
.ml-head-action {
  margin-inline-start: auto;
}
.ml-grid-today {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.ml-grid-1 {
  grid-template-columns: minmax(0, 1fr);
  margin-block-start: 18px;
}
.ml-grid-saved {
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
}
.ml-empty {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1rem;
  padding: 20px;
  border: 1px dashed color-mix(in srgb, var(--dmd-gold) 45%, transparent);
  border-radius: 22px;
  background: var(--dmd-card);
}
.ml-empty > .bi {
  font-size: 1.8rem;
  color: var(--dmd-gold);
}
.ml-empty p {
  flex: 1 1 260px;
  margin: 0;
  color: var(--dmd-ink);
}

/* ---------- Rings (My Path and the progress board) ---------- */
.ml-ring {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  inline-size: 52px;
  block-size: 52px;
}
.ml-ring svg {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  transform: rotate(-90deg);
}
[dir="rtl"] .ml-ring svg {
  transform: rotate(-90deg) scaleY(-1);
}
.ml-ring__track {
  fill: none;
  stroke: var(--dmd-line);
  stroke-width: 5;
}
.ml-ring__fill {
  fill: none;
  stroke: var(--ml-tone, var(--ml-emerald));
  stroke-width: 5;
  stroke-linecap: round;
  transition: stroke-dashoffset .8s ease;
}
.ml-ring > .bi {
  font-size: 1.1rem;
  color: var(--ml-tone, var(--ml-emerald));
}
.ml-ring > b {
  font-size: .82rem;
  font-weight: 800;
  color: var(--dmd-ink);
}
.ml-ring > b small {
  font-size: .7em;
  font-weight: 700;
}

/* ---------- My Path: one card per goal, the next step under it ---------- */
.ml-goals {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ml-goal {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--dmd-line);
  border-radius: 20px;
  background: var(--dmd-card);
  box-shadow: var(--dmd-shadow);
  overflow: hidden;
}
.ml-goal__main {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  color: var(--dmd-ink);
  text-decoration: none;
}
.ml-goal__main:hover {
  color: var(--dmd-ink);
  background: var(--dmd-mint);
}
.ml-goal__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ml-goal__text strong {
  font-size: 1rem;
  line-height: 1.25;
}
.ml-goal__text small {
  color: var(--dmd-muted);
}
.ml-goal__next {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  margin-block-start: auto;
  padding: 10px 16px 12px;
  border-block-start: 1px dashed var(--dmd-line);
  background: linear-gradient(135deg, var(--dmd-gold-soft), transparent);
  color: var(--dmd-ink);
  text-decoration: none;
}
.ml-goal__next:hover {
  color: var(--dmd-ink);
  background: var(--dmd-gold-soft);
}
.ml-goal__label {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dmd-gold);
}
.ml-goal__step {
  font-weight: 650;
  font-size: .92rem;
  line-height: 1.3;
}
.ml-goal__main:focus-visible,
.ml-goal__next:focus-visible {
  outline: 3px solid #e6b85c;
  outline-offset: -3px;
}

/* ---------- Progress board ---------- */
.ml-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ml-journey {
  --ml-tone: var(--ml-emerald);
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "visual text" "visual go";
  align-items: center;
  gap: 2px 12px;
  block-size: 100%;
  padding: 12px 14px;
  border: 1px solid var(--dmd-line);
  border-radius: 18px;
  background: var(--dmd-card);
  color: var(--dmd-ink);
  text-decoration: none;
  box-shadow: var(--dmd-shadow);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.ml-journey::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  inline-size: 4px;
  background: var(--ml-tone);
  opacity: .25;
}
.ml-journey.is-started::before {
  opacity: 1;
}
.ml-journey--gold { --ml-tone: var(--ml-gold); }
.ml-journey--sky { --ml-tone: var(--ml-sky); }
.ml-journey--violet { --ml-tone: var(--ml-violet); }
.ml-journey--rose { --ml-tone: var(--ml-rose); }
.ml-journey:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--ml-tone) 45%, transparent);
  box-shadow: var(--dmd-shadow-lift);
  color: var(--dmd-ink);
}
.ml-journey:focus-visible {
  outline: 3px solid #e6b85c;
  outline-offset: 2px;
}
.ml-journey > .ml-ring,
.ml-journey__icon {
  grid-area: visual;
}
.ml-journey__icon {
  display: grid;
  place-items: center;
  inline-size: 52px;
  block-size: 52px;
  border-radius: 16px;
  font-size: 1.3rem;
  color: var(--ml-tone);
  background: color-mix(in srgb, var(--ml-tone) 12%, transparent);
}
.ml-journey__text {
  grid-area: text;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ml-journey__text strong {
  font-size: .95rem;
  line-height: 1.25;
}
.ml-journey__text small {
  color: var(--dmd-muted);
  font-size: .8rem;
}
.ml-journey__go {
  grid-area: go;
  display: inline-flex;
  align-items: center;
  gap: .1rem;
  font-size: .78rem;
  font-weight: 750;
  color: var(--ml-tone);
}

/* ---------- Saved list ---------- */
.ml-saved {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ml-saved a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 2px 10px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 14px;
  background: var(--dmd-sand);
  color: var(--dmd-ink);
  text-decoration: none;
  font-weight: 600;
  font-size: .9rem;
}
.ml-saved a:hover {
  background: var(--dmd-mint);
  color: var(--dmd-ink);
}
.ml-saved a > .bi {
  grid-row: span 2;
  color: var(--dmd-gold);
}
.ml-saved small {
  color: var(--dmd-muted);
  font-weight: 500;
}

@media (max-width: 991.98px) {
  .ml-grid-today,
  .ml-grid-saved {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 575.98px) {
  .ml-tabs {
    margin-inline: -4px;
  }
  .ml-tab {
    padding-inline: .8rem;
    font-size: .86rem;
  }
  .ml-h2 {
    font-size: 1.15rem;
  }
  .ml-head-action {
    margin-inline-start: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ml-journey,
  .ml-ring__fill,
  .ml-tab {
    transition: none;
  }
  .ml-journey:hover {
    transform: none;
  }
}

/* =====================================================================
   Signed out: what My Learning offers, and the ways in.
   ===================================================================== */
.ml-out {
  --ml-out-card: var(--ip-surface, #fff);
  --ml-out-line: var(--ip-line, rgba(20, 26, 51, .09));
  --ml-out-ink: var(--ip-ink, #1c1c1c);
  --ml-out-muted: var(--ip-muted, #5b6b66);
  --ml-out-canvas: var(--ip-surface-2, #f7f9f8);
  background: var(--ml-out-canvas);
}
.ml-out__hero {
  position: relative;
  overflow: hidden;
  padding: 48px 0 64px;
  color: #fff;
  background: var(--ip-jewel);
}
.ml-out__sky {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 85% 20%, rgba(230, 184, 92, .22) 0, transparent 40%),
    radial-gradient(circle at 10% 90%, rgba(46, 184, 114, .22) 0, transparent 45%);
}
.ml-out__grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: 32px;
  align-items: center;
}
.ml-out__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin: 0 0 .6rem;
  padding: .3rem .8rem;
  border-radius: 999px;
  background: rgba(230, 184, 92, .16);
  color: #ffdca0;
  font-size: .82rem;
  font-weight: 700;
}
.ml-out__title {
  margin: 0 0 .6rem;
  font-size: clamp(2.1rem, 5vw, 3.3rem);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.05;
  color: #fff;
}
.ml-out__lead {
  max-width: 38rem;
  margin: 0 0 1.4rem;
  color: rgba(255, 255, 255, .86);
  font-size: 1.05rem;
  line-height: 1.6;
}
.ml-out__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.ml-out__btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 48px;
  padding: .7rem 1.4rem;
  border-radius: 999px;
  font-weight: 750;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.ml-out__btn--primary {
  background: linear-gradient(135deg, #f3d38a, #e6b85c);
  color: #2a1d04;
  box-shadow: 0 14px 30px -12px rgba(230, 184, 92, .8);
}
.ml-out__btn--primary:hover {
  color: #2a1d04;
  transform: translateY(-2px);
}
.ml-out__btn--ghost {
  border: 1px solid rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .08);
  color: #fff;
}
.ml-out__btn--ghost:hover {
  background: rgba(255, 255, 255, .16);
  color: #fff;
}
.ml-out__btn:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}
.ml-out__private {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin: 1rem 0 0;
  color: rgba(255, 255, 255, .72);
  font-size: .86rem;
}
.ml-out__preview {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.ml-out__card {
  border-radius: 22px;
  padding: 16px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .05));
  border: 1px solid rgba(230, 184, 92, .32);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 24px 50px rgba(0, 0, 0, .22);
}
.ml-out__card--ring {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ml-out__card--ring svg {
  inline-size: 72px;
  block-size: 72px;
  flex: 0 0 auto;
  transform: rotate(-90deg);
}
.ml-out__track {
  fill: none;
  stroke: rgba(255, 255, 255, .16);
  stroke-width: 10;
}
.ml-out__fill {
  fill: none;
  stroke: #e6b85c;
  stroke-width: 10;
  stroke-linecap: round;
}
.ml-out__lines {
  display: grid;
  gap: 8px;
  flex: 1;
}
.ml-out__lines i {
  display: block;
  block-size: 9px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .28);
}
.ml-out__lines i + i {
  inline-size: 60%;
  background: rgba(255, 255, 255, .16);
}
.ml-out__card--path {
  grid-row: span 2;
  display: grid;
  place-items: center;
}
.ml-out__card--path svg {
  inline-size: 100%;
  block-size: auto;
}
.ml-out__route {
  fill: none;
  stroke: rgba(255, 255, 255, .45);
  stroke-width: 2.5;
  stroke-dasharray: 5 6;
}
.ml-out__stars path {
  fill: #fff;
}
.ml-out__stars .is-next {
  fill: #e6b85c;
}
.ml-out__card--bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  block-size: 92px;
}
.ml-out__card--bars span {
  flex: 1;
  block-size: var(--h);
  border-radius: 6px;
  background: linear-gradient(180deg, #7fe0b0, #2eb872);
  opacity: .85;
}
.ml-out__body {
  padding-block: 36px 56px;
}
.ml-out__h2 {
  margin: 0 0 14px;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--ml-out-ink);
}
.ml-out__offers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 32px;
  padding: 0;
  list-style: none;
}
.ml-offer {
  --ml-tone: #1f7a63;
  display: flex;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--ml-out-line);
  border-radius: 20px;
  background: var(--ml-out-card);
}
.ml-offer--gold { --ml-tone: #b7791f; }
.ml-offer--sky { --ml-tone: #0284c7; }
.ml-offer--violet { --ml-tone: #7c3aed; }
.ml-offer--rose { --ml-tone: #db2777; }
body.dark .ml-offer--emerald, [data-theme="dark"] .ml-offer--emerald { --ml-tone: #2eb872; }
body.dark .ml-offer--gold, [data-theme="dark"] .ml-offer--gold { --ml-tone: #e6b85c; }
body.dark .ml-offer--sky, [data-theme="dark"] .ml-offer--sky { --ml-tone: #38bdf8; }
body.dark .ml-offer--violet, [data-theme="dark"] .ml-offer--violet { --ml-tone: #a78bfa; }
body.dark .ml-offer--rose, [data-theme="dark"] .ml-offer--rose { --ml-tone: #f472b6; }
.ml-offer__icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  inline-size: 44px;
  block-size: 44px;
  border-radius: 14px;
  font-size: 1.2rem;
  color: #fff;
  background: linear-gradient(135deg, var(--ml-tone), color-mix(in srgb, var(--ml-tone) 60%, #0b1220));
}
.ml-offer__text {
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.ml-offer__text strong {
  color: var(--ml-out-ink);
  font-size: 1rem;
}
.ml-offer__text span {
  color: var(--ml-out-muted);
  font-size: .88rem;
  line-height: 1.45;
}
.ml-out__links {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ml-out__links a {
  display: flex;
  align-items: center;
  gap: .6rem;
  min-height: 52px;
  padding: .6rem .9rem;
  border: 1px solid var(--ml-out-line);
  border-radius: 16px;
  background: var(--ml-out-card);
  color: var(--ml-out-ink);
  font-weight: 650;
  text-decoration: none;
}
.ml-out__links a > .bi:first-child {
  color: #b7791f;
  font-size: 1.15rem;
}
.ml-out__links a span {
  flex: 1;
}
.ml-out__links a:hover {
  border-color: #1f7a63;
  color: var(--ml-out-ink);
}
.ml-out__links a:focus-visible {
  outline: 3px solid #e6b85c;
  outline-offset: 2px;
}
@media (max-width: 991.98px) {
  .ml-out__grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .ml-out__offers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ml-out__links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 575.98px) {
  .ml-out__hero {
    padding: 32px 0 40px;
  }
  .ml-out__preview {
    display: none;
  }
  .ml-out__offers,
  .ml-out__links {
    grid-template-columns: minmax(0, 1fr);
  }
  .ml-out__btn {
    flex: 1 1 auto;
    justify-content: center;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ml-out__btn {
    transition: none;
  }
  .ml-out__btn--primary:hover {
    transform: none;
  }
}
