/* Progress: cumulative milestones with no calendar resets.
   Shared settings and mock-readiness styles are retained below.

   The page reads the same at every width: a page title over a summary panel
   and a list of rows, built from the theme tokens, so it follows day and night
   without a palette of its own. desktop-study.css only widens the scale. */
#home {
  border-top-color: var(--paper);
  padding: 0 0 calc(100px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
  background: var(--paper);
  color: var(--ink);
}
#home .hinner {
  max-width: 540px;
}
#home.show .hinner > * {
  animation: none;
}
/* Row one: the shared header controls, above the title and level with the rest
   of the page's content, as on every other study tab. The row's shape is the
   shared rule below; only the page's own gutter lives here. */
.progress-actions {
  margin: 0 16px;
}
.progress-hero {
  padding: 0 16px;
}
/* The page-title tier every study page's heading wears: Topics, Preferences
   and the topic notes are the same size, weight and tracking. */
#home .progress-hero h1 {
  margin: 0;
  color: var(--ink);
  font:
    900 30px/1.2 Nunito,
    sans-serif;
  letter-spacing: -0.4px;
  text-wrap: initial;
}
.progress-subtitle {
  margin: 10px 0 0;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.5;
  font-weight: 600;
}
.progress-summary-card {
  margin: 20px 0 0;
  padding: 17px 16px 19px;
  border: 2px solid var(--brand-soft-2);
  border-radius: 16px;
  background: var(--brand-soft);
}
#home .progress-summary-card h2 {
  margin: 0 0 13px;
  color: var(--ink);
  font:
    900 17px/1.3 Nunito,
    sans-serif;
}
.progress-summary-meter {
  display: flex;
  align-items: center;
  min-height: 34px;
  gap: 12px;
}
/* The meters keep a pale track and a dark label in both themes. Every fill is
   a bright colour that needs dark text on it, and no one label colour reads on
   both a bright fill and a dark track, so the track stays pale at night. */
.quest-track {
  position: relative;
  flex: 1;
  height: 20px;
  border-radius: 10px;
  background: #e8e8e8;
  overflow: hidden;
  isolation: isolate;
}
.quest-track-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--progress, 0%);
  border-radius: inherit;
  background: #ffc800;
}
.quest-track-fill::after {
  content: "";
  position: absolute;
  inset: 3px 5px auto;
  height: 5px;
  border-radius: 6px;
  background: rgb(255 255 255 / 25%);
}
.quest-track-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #6f6f6f;
  font-size: 12px;
  line-height: 1;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.quest-track.is-summary {
  height: 24px;
  border-radius: 12px;
}
.quest-track.is-summary .quest-track-fill {
  background: var(--brand);
}
.quest-track.is-facts .quest-track-fill {
  background: #20bdeb;
}
.quest-track.is-correct .quest-track-fill,
.quest-track.is-complete .quest-track-fill {
  background: #8bd437;
}
.quest-icon {
  display: block;
  width: 52px;
  height: 52px;
  flex: none;
  object-fit: contain;
}
.milestones {
  padding: 0 16px;
}
/* A section heading over its list: spacing, not a fixed row height. */
.milestones-header {
  display: flex;
  align-items: center;
  padding: 20px 0 12px;
  border-bottom: 2px solid var(--line-2);
}
#home .milestones-header h2 {
  margin: 0;
  font:
    900 19px/1.3 Nunito,
    sans-serif;
  letter-spacing: -0.2px;
}
.milestones-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.milestone {
  display: flex;
  align-items: center;
  gap: 19px;
  width: 100%;
  min-height: 106px;
  padding: 19px 4px 19px 9px;
  border: 0;
  border-bottom: 2px solid var(--line-2);
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.milestone:hover {
  background: var(--panel);
}
.milestone:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: -3px;
  border-radius: 8px;
}
.milestones-list li:last-child .milestone {
  border-bottom: 0;
}
.milestone-content {
  flex: 1;
  min-width: 0;
}
.milestone-title {
  display: block;
  margin: 0 0 13px;
  font:
    850 17px/1.35 Nunito,
    sans-serif;
  color: var(--ink);
}
.milestone-meter {
  display: flex;
  align-items: center;
  gap: 10px;
}
.milestone-marker {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border: 2px solid var(--marker-line);
  border-radius: 11px;
  background: var(--marker-bg);
  color: var(--marker-ink);
}
.milestone-marker svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.milestone-marker.is-complete {
  --marker-line: #68b83c;
  --marker-bg: #79c94d;
  --marker-ink: #fff;
}
.milestone-marker.is-complete svg {
  stroke-width: 3;
}
.milestone-reached {
  display: block;
  margin-top: 8px;
  color: var(--green-ink);
  font-size: 12px;
  font-weight: 900;
}
.is-readiness .milestone-title {
  margin-bottom: 5px;
}
.milestone-description {
  display: block;
  margin-bottom: 13px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.45;
}

/* The settings button is one component, used on Progress and Learn. */
.settings-button {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 13px;
  background: var(--paper);
  color: var(--icon-quiet);
  box-shadow: none;
}
.settings-button svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}
.settings-button:hover {
  background: var(--panel);
}
/* The test-day countdown, study streak and review count sit beside Preferences
   in the same 44px row, borderless like it. */
.streak-button,
.test-day-button,
.review-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: none;
  height: 44px;
  min-width: 44px;
  margin: 0;
  padding: 0 8px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 17px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  box-shadow: none;
}
.streak-button svg,
.test-day-button svg,
.review-button svg {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
}
.streak-button:hover,
.test-day-button:hover,
.review-button:hover {
  background: var(--panel);
}
/* No streak, test date or due facts: the value steps back, but the button
   still opens its sheet. The icon uses .is-unlit (sheets.css). */
.streak-button:not(.is-lit) b,
.test-day-button:not(.is-set) b,
.review-button:not(.is-due) b {
  color: var(--ink-3);
}
/* Row one, on every study tab: the same four controls, the same 44px height,
   the same space above and below, right-aligned on a wide screen and spread
   across their own row on a phone. Declared once, here with the controls it
   lays out and after each tab's own stylesheet, so no page can drift from it.
   Learn adds sticky on top of this (today.css); nothing else differs. */
.today-top,
.mock-library-heading,
.topics-heading,
.progress-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 15px 0 12px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}
/* On phones the buttons spread across the row, as on every tab; wider screens
   pull them to the right. */
@media (max-width: 520px) {
  .header-actions {
    order: -1;
    width: 100%;
    justify-content: space-between;
  }
}

/* Readiness */
.readiness-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.readiness-line b {
  font-size: 34px;
  font-weight: 950;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.readiness-line span {
  margin-left: auto;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}
.readiness-track {
  position: relative;
  height: 14px;
  border-radius: 10px;
  background: var(--panel-2);
  overflow: visible;
}
.readiness-fill {
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: #ff8a1f;
  transition: width 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.readiness-fill.is-near {
  background: #f5b400;
}
.readiness-fill.is-pass {
  background: #2f9e5b;
}
.readiness-pass {
  position: absolute;
  left: var(--progress, 0%);
  top: -5px;
  bottom: -5px;
  width: 3px;
  margin-left: -1px;
  border-radius: 2px;
  background: var(--ink);
}
.readiness-verdict {
  margin: 14px 0 16px;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 750;
  color: var(--ink-2);
}
.readiness-verdict.is-pass {
  color: var(--green-ink);
}
.readiness-verdict.is-near {
  color: var(--amber-ink);
}

@media (max-width: 359px) {
  .progress-hero {
    padding-left: 12px;
    padding-right: 12px;
  }
  .progress-actions {
    margin-inline: 12px;
  }
  .milestones {
    padding: 0 12px;
  }
  .milestone {
    gap: 12px;
    padding-left: 0;
  }
  .milestone-title {
    font-size: 16px;
  }
}

/* Desktop: the page owns the gutter, so the controls row keeps the same edges
   as the hero and the list. */
@media (min-width: 960px) {
  #home .progress-actions {
    margin-inline: 0;
  }
  #home .milestones-header {
    min-height: 0;
    padding: 26px 0 14px;
  }
}
