/* ==========================================================================
   Interview.ps — page layer for the redesigned hub and planner
   Loaded after flat-modern.css. Uses the same tokens: navy #012970,
   blue #1647a5, page #f5f7fb, tint #eef3fc, amber #b45309, green #236342.
   Flat surfaces, pill controls, logical properties for Arabic RTL.
   ========================================================================== */

/* ===== Shared: kicker pill ================================================= */

.fm-kicker {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  margin: 0 0 1.2rem;
  padding: .45rem 1rem .45rem .7rem;
  border: 2px solid rgba(255, 255, 255, .28);
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, .08);
  font-family: var(--fm-font-display);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  line-height: 1.2;
  text-transform: uppercase;
}

[dir="rtl"] .fm-kicker {
  padding: .45rem .7rem .45rem 1rem;
  letter-spacing: 0;
}

.fm-kicker .fm-kicker-dot {
  flex: 0 0 auto;
  width: .6rem;
  height: .6rem;
  background: var(--site-accent);
}

.fm-kicker-dark {
  border-color: var(--site-line);
  color: var(--site-blue);
  background: #fff;
}

/* ===== Resources hub ======================================================= */

/* The hero is .hb-article > .hero, so flat-modern already paints the flat navy
   panel with its circle and diamond. Here we only add the two-column layout. */

.fm-hub-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr);
  gap: clamp(1.5rem, 4vw, 3.25rem);
  align-items: center;
}

.fm-hub-hero-copy {
  min-width: 0;
}

.fm-hub .hb-hero-inner,
.fm-hub-hero-copy {
  max-width: none;
}

.fm-hub-hero h1 {
  max-width: 24ch;
}

[dir="rtl"] .fm-hub-hero h1 {
  max-width: 26ch;
}

.fm-hub-hero-sub {
  max-width: 46ch;
  margin: 0 0 1.75rem;
  color: var(--site-line);
  font-size: clamp(1rem, 1.3vw, 1.12rem);
  line-height: 1.72;
}

.fm-hub-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  margin-block-end: 2rem;
}

.fm-hub .hb-btn-primary {
  padding-inline-end: .55rem;
}

.fm-hub .hb-btn-secondary {
  border-color: #fff;
  background: transparent;
  color: #fff;
}

.fm-hub .hb-btn-secondary:hover {
  border-color: #fff;
  background: #fff;
  color: var(--site-navy);
}

.fm-hub-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, auto));
  gap: 1.5rem 2.25rem;
  margin: 0;
  justify-content: start;
}

.fm-hub-stats > div {
  display: flex;
  flex-direction: column-reverse;
  gap: .1rem;
}

.fm-hub-stats dt {
  color: var(--site-line);
  font-family: var(--fm-font-display);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

[dir="rtl"] .fm-hub-stats dt {
  letter-spacing: 0;
}

.fm-hub-stats dd {
  margin: 0;
  color: #fff;
  font-family: var(--fm-font-display);
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
  font-weight: 850;
  letter-spacing: -.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.fm-hub-stats .fm-hub-stats-text {
  font-size: clamp(1.05rem, 1.7vw, 1.35rem);
  letter-spacing: 0;
}

/* --- Route motion graphic --- */

.fm-hub-visual {
  min-width: 0;
  width: 100%;
}

.fm-route {
  margin: 0;
  padding: 1.4rem 1.25rem 1.1rem;
  border: 2px solid rgba(255, 255, 255, .2);
  border-radius: var(--fm-radius-l);
  background: rgba(255, 255, 255, .06);
}

.fm-route svg {
  display: block;
  overflow: visible;
}

.fm-route-caption {
  margin-block-start: .85rem;
  color: var(--site-line);
  font-family: var(--fm-font-display);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-align: center;
  text-transform: uppercase;
}

[dir="rtl"] .fm-route-caption {
  letter-spacing: 0;
}

.fm-route-path {
  fill: none;
  stroke: rgba(255, 255, 255, .22);
  stroke-width: 2;
  stroke-linecap: round;
}

.fm-route-progress {
  fill: none;
  stroke: var(--site-accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: fm-route-draw 1.5s var(--fm-ease) .35s both;
}

@keyframes fm-route-draw {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

.fm-route-node {
  fill: #fff;
  stroke: none;
  transform-box: fill-box;
  transform-origin: center;
  animation: fm-node-pop .5s var(--fm-ease) both;
  animation-delay: calc(var(--fm-stage) * 240ms + 220ms);
}

.fm-route-num {
  fill: var(--site-navy);
  font-family: var(--fm-font-display);
  font-size: 15px;
  font-weight: 800;
  animation: fm-fade-up .5s var(--fm-ease) both;
  animation-delay: calc(var(--fm-stage) * 240ms + 320ms);
}

.fm-route-label {
  fill: var(--site-line);
  font-family: var(--fm-font-display);
  font-size: 11px;
  font-weight: 700;
  animation: fm-fade-up .5s var(--fm-ease) both;
  animation-delay: calc(var(--fm-stage) * 240ms + 380ms);
}

.fm-hub .hero .fm-route-stage:last-child .fm-route-node {
  fill: var(--site-green);
}

.fm-hub .hero .fm-route-stage:last-child .fm-route-num {
  fill: #fff;
}

@keyframes fm-node-pop {
  from { opacity: 0; transform: scale(.4); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes fm-fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* --- Planner spotlight --- */

.fm-spotlight {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: center;
  overflow: hidden;
  border-block-start: 4px solid var(--site-accent);
}

.fm-spotlight-copy {
  min-width: 0;
}

.fm-spotlight h2 {
  margin-block: 0 .6rem;
}

.fm-spotlight-copy > p {
  max-width: 62ch;
  color: var(--site-muted);
}

.fm-spotlight-cta {
  margin-block: 1.35rem 1.15rem;
}

.fm-spotlight-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.fm-spotlight-meta li {
  padding: .3rem .8rem;
  border: 2px solid var(--site-line);
  border-radius: 999px;
  color: var(--site-navy);
  font-family: var(--fm-font-display);
  font-size: .78rem;
  font-weight: 800;
  line-height: 1.5;
}

.fm-spotlight-visual {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-width: 0;
}

.fm-bars {
  display: flex;
  align-items: flex-end;
  gap: .45rem;
  width: 100%;
  max-width: 15rem;
  height: 9.5rem;
  padding: .9rem;
  border: 2px solid var(--site-line);
  border-radius: var(--fm-radius);
  background: var(--site-tint);
}

.fm-bars > span {
  flex: 1 1 0;
  height: var(--fm-h, 40%);
  border-radius: .45rem;
  background: var(--site-blue);
  transform: scaleY(0);
  transform-origin: bottom center;
  animation: fm-bar-grow .7s var(--fm-ease) both;
  animation-delay: calc(var(--fm-bar) * 80ms);
}

.fm-bars > span:nth-child(1) { --fm-h: 32%; }
.fm-bars > span:nth-child(2) { --fm-h: 52%; --fm-bar: 1; }
.fm-bars > span:nth-child(3) { --fm-h: 44%; --fm-bar: 2; }
.fm-bars > span:nth-child(4) { --fm-h: 74%; background: var(--site-navy); --fm-bar: 3; }
.fm-bars > span:nth-child(5) { --fm-h: 60%; --fm-bar: 4; }
.fm-bars > span:nth-child(6) { --fm-h: 92%; background: var(--site-navy); --fm-bar: 5; }
.fm-bars > span:nth-child(7) { --fm-h: 100%; background: var(--site-accent); --fm-bar: 6; }

@keyframes fm-bar-grow {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}

/* --- Filter --- */

.fm-filter {
  display: grid;
  gap: .5rem;
  margin-block: 1.5rem 1.75rem;
}

.fm-filter-label {
  color: var(--site-navy);
  font-family: var(--fm-font-display);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

[dir="rtl"] .fm-filter-label {
  letter-spacing: 0;
}

.fm-filter-field {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 34rem;
}

.fm-filter-icon {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: .95rem;
  transform: translateY(-50%);
  color: var(--site-muted);
  pointer-events: none;
}

.fm-filter input[type="search"] {
  width: 100%;
  min-height: 3rem;
  padding: .7rem 1rem .7rem 2.9rem;
  border: 2px solid var(--site-line);
  border-radius: 999px;
  color: var(--site-ink);
  background: #fff;
  font-size: 1rem;
  appearance: none;
  transition: border-color .2s var(--fm-ease);
}

[dir="rtl"] .fm-filter input[type="search"] {
  padding: .7rem 2.9rem .7rem 1rem;
}

.fm-filter input[type="search"]:hover {
  border-color: var(--site-navy);
}

.fm-filter input[type="search"]::-webkit-search-cancel-button {
  cursor: pointer;
}

.fm-filter-status {
  margin: 0;
  color: var(--site-muted);
  font-size: .88rem;
}

/* --- Category cards --- */

.fm-cats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: 1rem;
  align-items: start;
}

.fm-cat {
  overflow: hidden;
  border: 2px solid var(--site-line);
  border-radius: var(--fm-radius);
  background: #fff;
  transition: border-color .25s var(--fm-ease), transform .25s var(--fm-ease);
}

.fm-cat:hover {
  border-color: var(--site-navy);
}

.fm-cat[hidden] {
  display: none;
}

.fm-cat-head {
  position: relative;
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr) auto;
  gap: .85rem;
  align-items: center;
  min-height: 3.6rem;
  padding: 1rem 1.15rem;
  color: var(--site-navy);
  background: #fff;
  cursor: pointer;
  list-style: none;
  transition: background-color .25s var(--fm-ease);
}

.fm-cat-head::-webkit-details-marker {
  display: none;
}

.fm-cat-head::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  width: 100%;
  height: .3rem;
  background: var(--site-blue);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .35s var(--fm-ease);
}

[dir="rtl"] .fm-cat-head::before {
  transform-origin: right center;
}

.fm-cat:nth-child(3n+2) .fm-cat-head::before { background: var(--site-accent); }
.fm-cat:nth-child(3n+3) .fm-cat-head::before { background: var(--site-green); }

.fm-cat[open] .fm-cat-head::before {
  transform: scaleX(1);
}

.fm-cat-head:hover {
  background: var(--site-tint);
}

.fm-cat-head:focus-visible {
  outline: 3px solid var(--site-focus);
  outline-offset: -3px;
}

.fm-cat-num {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: .8rem;
  color: var(--site-blue);
  background: var(--site-tint);
  font-family: var(--fm-font-display);
  font-size: .95rem;
  font-weight: 850;
}

.fm-cat:nth-child(2) .fm-cat-num,
.fm-cat:nth-child(4) .fm-cat-num {
  border-radius: 50%;
}

.fm-cat[open] .fm-cat-num {
  color: #fff;
  background: var(--site-blue);
}

.fm-cat-name {
  color: var(--site-navy);
  font-family: var(--fm-font-display);
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: -.015em;
  line-height: 1.25;
}

[dir="rtl"] .fm-cat-name {
  letter-spacing: 0;
}

.fm-cat-count {
  display: inline-flex;
  align-items: baseline;
  gap: .3rem;
  color: var(--site-muted);
  font-family: var(--fm-font-display);
  font-size: .82rem;
  font-weight: 700;
  white-space: nowrap;
}

.fm-cat-count-word {
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

[dir="rtl"] .fm-cat-count-word {
  letter-spacing: 0;
}

.fm-cat-list {
  display: block;
  margin: 0;
  padding: 0 1.15rem 1.1rem;
  border-block-start: 2px solid var(--site-tint);
  list-style: none;
}

.fm-cat-list > li {
  border-block-end: 1px solid var(--site-tint);
}

.fm-cat-list > li:last-child {
  border-block-end: 0;
}

.fm-cat[open] .fm-cat-list {
  animation: fm-cat-open .35s var(--fm-ease);
}

@keyframes fm-cat-open {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

.fm-cat-list a {
  display: flex;
  gap: .5rem;
  align-items: baseline;
  padding-block: .6rem;
  color: var(--site-ink);
  font-size: .95rem;
  line-height: 1.5;
  text-decoration: none;
  transition: color .2s var(--fm-ease), padding .2s var(--fm-ease);
}

.fm-cat-list a::before {
  content: "";
  flex: 0 0 .4rem;
  width: .4rem;
  height: .4rem;
  border-radius: 50%;
  background: var(--site-line);
  transform: translateY(-.15em);
  transition: background-color .2s var(--fm-ease);
}

.fm-cat-list a:hover {
  color: var(--site-blue);
  padding-inline-start: .3rem;
}

.fm-cat-list a:hover::before {
  background: var(--site-accent);
}

.fm-cat-list a:focus-visible {
  outline: 3px solid var(--site-focus);
  outline-offset: 2px;
  border-radius: .3rem;
}

/* ===== Grind 75 planner ==================================================== */

.fm-grind-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  margin-block: 0 1.75rem;
  padding: clamp(1.6rem, 3.5vw, 2.5rem);
  border-radius: var(--fm-radius-l);
  color: #fff;
  background: var(--site-navy);
}

.fm-grind-hero-copy {
  min-width: 0;
}

.fm-grind-hero .page-heading,
.fm-grind-hero h1 {
  margin: 0;
}

.fm-grind-hero h1,
/* grind75.css paints .grind-main .page-heading h1 navy; the hero is on navy. */
.grind-main .page-heading.fm-grind-hero h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(2rem, 4.2vw, 3rem);
  font-weight: 850;
  letter-spacing: -.028em;
  line-height: 1.08;
}

[dir="rtl"] .fm-grind-hero h1 {
  letter-spacing: 0;
  line-height: 1.32;
}

.fm-grind-hero-sub {
  max-width: 48ch;
  margin: .9rem 0 0;
  color: var(--site-line);
  font-size: clamp(1rem, 1.2vw, 1.08rem);
  line-height: 1.7;
}

/* grind75.css styles .page-heading p; keep the kicker pill and the lead intact. */
.page-heading .fm-kicker {
  max-width: none;
  margin: 0 0 1.2rem;
  color: #fff;
  font-size: .78rem;
}

[dir="rtl"] .page-heading .fm-kicker {
  font-size: .74rem;
}

.page-heading .fm-grind-hero-sub {
  max-width: 48ch;
  margin: .9rem 0 0;
  color: var(--site-line);
  font-size: clamp(1rem, 1.2vw, 1.08rem);
}

.fm-grind-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin: 1.4rem 0 0;
  padding: 0;
  list-style: none;
}

.fm-grind-chips li {
  padding: .3rem .8rem;
  border: 2px solid rgba(255, 255, 255, .28);
  border-radius: 999px;
  color: #fff;
  font-family: var(--fm-font-display);
  font-size: .76rem;
  font-weight: 800;
  line-height: 1.5;
}

.fm-grind-visual {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .9rem 1.25rem;
  align-items: center;
  min-width: 0;
}

.fm-ring {
  position: relative;
  flex: 0 0 auto;
}

.fm-ring svg {
  display: block;
  transform: rotate(-90deg);
}

.fm-ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, .2);
  stroke-width: 9;
}

.fm-ring-value {
  fill: none;
  stroke: var(--site-accent);
  stroke-width: 9;
  stroke-linecap: round;
  transition: stroke-dashoffset .8s var(--fm-ease);
}

.fm-ring-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: .1rem;
  text-align: center;
}

.fm-ring-count {
  color: #fff;
  direction: ltr;
  unicode-bidi: isolate;
  font-family: var(--fm-font-display);
  font-size: 1.35rem;
  font-weight: 850;
  letter-spacing: -.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.fm-ring-caption {
  color: var(--site-line);
  font-family: var(--fm-font-display);
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

[dir="rtl"] .fm-ring-caption {
  letter-spacing: 0;
}

.fm-ribbon {
  min-width: 0;
}

.fm-ribbon svg {
  display: block;
  width: 100%;
  height: auto;
}

/* Static hand-off before the scripted ribbon replaces it. */
.fm-ribbon-fallback rect {
  fill: rgba(255, 255, 255, .22);
}

.fm-ribbon-fallback rect:nth-child(4),
.fm-ribbon-fallback rect:nth-child(7) {
  fill: var(--site-blue);
}

.fm-ribbon-fallback rect:last-child {
  fill: var(--site-accent);
}

.fm-ribbon-caption {
  grid-column: 1 / -1;
  margin: .1rem 0 0;
  color: var(--site-line);
  font-family: var(--fm-font-display);
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-align: center;
  text-transform: uppercase;
}

[dir="rtl"] .fm-ribbon-caption {
  letter-spacing: 0;
}

.fm-week {
  fill: rgba(255, 255, 255, .22);
  rx: 4;
  transform-box: fill-box;
  transform-origin: center;
  animation: fm-week-in .5s var(--fm-ease) both;
  animation-delay: calc(var(--fm-week) * 34ms);
  transition: fill .4s var(--fm-ease);
}

.fm-week.is-used {
  fill: var(--site-blue);
}

.fm-week.is-current {
  fill: var(--site-accent);
}

@keyframes fm-week-in {
  from { opacity: 0; transform: scaleY(.25); }
  to { opacity: 1; transform: scaleY(1); }
}

/* Bump animation for live numbers the planner rewrites */

.fm-bump {
  animation: fm-bump .45s var(--fm-ease);
}

@keyframes fm-bump {
  0% { transform: scale(1); }
  35% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* --- Planner surfaces --- */

.grind-main .summary,
.grind-main .question-group,
.grind-main .preferences {
  border: 2px solid var(--site-line);
  border-radius: var(--fm-radius);
  overflow: hidden;
  box-shadow: none;
  background: #fff;
}

.grind-main .summary > h2 {
  padding: .9rem 1.25rem;
  border-block-end: 2px solid var(--site-line);
  color: var(--site-navy);
  font-family: var(--fm-font-display);
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

[dir="rtl"] .grind-main .summary > h2 {
  letter-spacing: 0;
}

.grind-main .summary-grid > div {
  border-inline-end: 1px solid var(--site-tint);
}

.grind-main .summary-grid h3 {
  color: var(--site-accent);
  font-family: var(--fm-font-display);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

[dir="rtl"] .grind-main .summary-grid h3 {
  letter-spacing: 0;
}

.grind-main .summary-grid strong {
  color: var(--site-navy);
  font-family: var(--fm-font-display);
  font-size: 1.45rem;
  font-weight: 850;
  letter-spacing: -.02em;
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

.grind-main .summary-grid small {
  font-weight: 600;
}

.grind-main .pill {
  border-radius: 999px;
  padding: .12rem .55rem;
  font-family: var(--fm-font-display);
  font-size: .74rem;
  font-weight: 800;
}

.grind-main .summary-pills {
  gap: .45rem .4rem;
}

.grind-main .progress-line {
  border-block-start: 2px solid var(--site-line);
  color: var(--site-navy);
  font-family: var(--fm-font-display);
  font-weight: 800;
  letter-spacing: .05em;
}

[dir="rtl"] .grind-main .progress-line {
  letter-spacing: 0;
}

.grind-main .progress-track {
  height: 10px;
  background: var(--site-tint);
}

.grind-main .progress-track > div {
  position: relative;
  background: var(--site-blue);
  transition: width .55s var(--fm-ease);
}

.grind-main .progress-track > div::after {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-end: 0;
  width: .6rem;
  border-radius: 999px;
  background: var(--site-accent);
}

/* Toolbar */

.grind-main .toolbar {
  gap: .5rem;
  margin-block: 1.6rem;
}

.grind-main .toolbar select,
.grind-main .toolbar button {
  min-height: 2.6rem;
  padding: .45rem 1rem;
  border: 2px solid var(--site-line);
  border-radius: 999px;
  color: var(--site-navy);
  background: #fff;
  font-family: var(--fm-font-display);
  font-size: .85rem;
  font-weight: 800;
  transition: border-color .2s var(--fm-ease), background-color .2s var(--fm-ease), color .2s var(--fm-ease);
}

.grind-main .toolbar select:hover,
.grind-main .toolbar button:hover {
  border-color: var(--site-navy);
  background: var(--site-tint);
  color: var(--site-navy);
}

.grind-main .toolbar #show-topics[aria-pressed="true"] {
  border-color: var(--site-navy);
  color: #fff;
  background: var(--site-navy);
}

/* Question groups */

.grind-main .question-group {
  margin-block: 1rem;
  animation: fm-group-in .5s var(--fm-ease) both;
}

@keyframes fm-group-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* Rows are rebuilt on every preference change, so the entrance is a CSS insert
   animation instead of a scripted reveal: it replays with each new plan. */
.grind-main .question-list .question-row {
  animation: fm-row-in .42s var(--fm-ease) both;
}

.grind-main .question-list .question-row:nth-child(1) { animation-delay: 30ms; }
.grind-main .question-list .question-row:nth-child(2) { animation-delay: 60ms; }
.grind-main .question-list .question-row:nth-child(3) { animation-delay: 90ms; }
.grind-main .question-list .question-row:nth-child(4) { animation-delay: 120ms; }
.grind-main .question-list .question-row:nth-child(5) { animation-delay: 150ms; }
.grind-main .question-list .question-row:nth-child(6) { animation-delay: 180ms; }
.grind-main .question-list .question-row:nth-child(7) { animation-delay: 210ms; }
.grind-main .question-list .question-row:nth-child(8) { animation-delay: 240ms; }
.grind-main .question-list .question-row:nth-child(n+9) { animation-delay: 270ms; }

@keyframes fm-row-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.grind-main .group-head {
  padding: 1rem 1.25rem;
  color: var(--site-navy);
  background: var(--site-tint);
  font-family: var(--fm-font-display);
  font-weight: 800;
  transition: background-color .25s var(--fm-ease);
}

.grind-main .group-head:hover {
  color: #fff;
  background: var(--site-navy);
}

.grind-main .group-head small {
  color: inherit;
  opacity: .75;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.grind-main .question-row {
  border-block-start: 1px solid var(--site-tint);
  transition: background-color .2s var(--fm-ease);
}

.grind-main .question-row:hover,
.grind-main .question-row:focus-within {
  background: var(--site-tint);
}

.grind-main .question-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--site-blue);
  cursor: pointer;
  transition: transform .2s var(--fm-ease);
}

.grind-main .question-row input[type="checkbox"]:active {
  transform: scale(.85);
}

.grind-main .question-row a {
  color: var(--site-ink);
  font-weight: 700;
}

.grind-main .question-row a:hover {
  color: var(--site-blue);
}

.grind-main .question-row.done a {
  color: var(--site-muted);
}

.grind-main .question-row .number {
  color: var(--site-muted);
  font-variant-numeric: tabular-nums;
}

.grind-main .notice,
.grind-main .empty {
  padding: 1rem 1.25rem;
  border: 2px solid var(--site-line);
  border-radius: var(--fm-radius);
  color: var(--site-muted);
  background: #fff;
}

/* Preferences panel */

.grind-main .preferences-lead,
.grind-main .preferences-toggle {
  padding: 1.15rem 1.35rem;
  color: #fff;
  background: var(--site-navy);
  font-family: var(--fm-font-display);
  font-size: .8rem;
  font-weight: 700;
  line-height: 1.5;
}

.grind-main .preferences-toggle {
  border: 0;
  cursor: pointer;
}

.grind-main .pref-block {
  border-block-end: 1px solid var(--site-tint);
}

.grind-main .pref-block h2,
.grind-main .pref-block legend {
  color: var(--site-accent);
  font-family: var(--fm-font-display);
  font-weight: 800;
  letter-spacing: .07em;
}

[dir="rtl"] .grind-main .pref-block h2,
[dir="rtl"] .grind-main .pref-block legend {
  letter-spacing: 0;
}

.grind-main .pref-block input[type="range"] {
  height: 1.4rem;
  accent-color: var(--site-blue);
  cursor: pointer;
}

.grind-main .pref-block input[type="checkbox"],
.grind-main .pref-block #topic-options input {
  width: 17px;
  height: 17px;
  accent-color: var(--site-blue);
}

.grind-main .pref-block button {
  border: 0;
  color: var(--site-blue);
  background: transparent;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: .18em;
  cursor: pointer;
}

.grind-main .pref-block button:hover {
  color: var(--site-navy);
}

/* Topic count + "change topics" read as one tidy row, not a wrapped sentence. */
.grind-main .pref-topics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .3rem .5rem;
}

.grind-main .pref-topics button {
  padding: .2rem .75rem;
  border: 2px solid var(--site-line);
  border-radius: 999px;
  color: var(--site-blue);
  background: #fff;
  font-family: var(--fm-font-display);
  font-size: .78rem;
  font-weight: 800;
  text-decoration: none;
  transition: border-color .2s var(--fm-ease), background-color .2s var(--fm-ease), color .2s var(--fm-ease);
}

.grind-main .pref-topics button:hover {
  border-color: var(--site-navy);
  color: #fff;
  background: var(--site-navy);
}

/* Topic dialog */

#topic-dialog {
  border: 2px solid var(--site-line);
  border-radius: var(--fm-radius);
  box-shadow: 0 18px 40px rgba(1, 41, 80, .28);
}

#topic-dialog .dialog-header h2 {
  color: var(--site-navy);
}

#topic-dialog .dialog-header button {
  min-width: 44px;
  min-height: 44px;
  border-radius: 999px;
  color: var(--site-navy);
  cursor: pointer;
}

#topic-dialog .dialog-actions button {
  min-height: 2.6rem;
  padding: .45rem 1.1rem;
  border: 2px solid var(--site-line);
  border-radius: 999px;
  color: var(--site-navy);
  background: #fff;
  font-family: var(--fm-font-display);
  font-weight: 800;
  cursor: pointer;
}

#topic-dialog .dialog-actions button:hover {
  border-color: var(--site-navy);
}

#topic-dialog .dialog-actions #topic-done {
  border-color: var(--site-blue);
  color: #fff;
  background: var(--site-blue);
}

#topic-dialog .dialog-actions #topic-done:hover {
  border-color: var(--site-navy);
  background: var(--site-navy);
}

/* ===== Motion ============================================================== */

.fm-pages-motion .fm-page-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .7s var(--fm-ease), transform .7s var(--fm-ease);
  transition-delay: var(--fm-delay, 0ms);
}

.fm-pages-motion .fm-page-reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ===== Responsive ========================================================== */

@media (max-width: 1100px) {
  .fm-hub-hero,
  .fm-spotlight {
    grid-template-columns: minmax(0, 1fr);
  }

  .fm-spotlight-visual {
    justify-content: flex-start;
  }

  .fm-bars {
    max-width: 20rem;
  }

  .fm-grind-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .fm-grind-visual {
    grid-template-columns: auto minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .fm-hub-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.5rem;
  }

  .fm-hub-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .fm-hub .hb-btn-primary,
  .fm-hub .hb-btn-secondary {
    width: 100%;
    white-space: normal;
    text-align: center;
    line-height: 1.3;
    padding-block: .5rem;
  }

  .fm-hub .hb-btn-primary {
    padding-inline-end: 1.6rem;
  }

  .fm-hub .hb-btn-primary .hb-arrow {
    display: none;
  }

  .fm-cat-head {
    grid-template-columns: 2.25rem minmax(0, 1fr);
    row-gap: .1rem;
  }

  .fm-cat-count {
    grid-column: 2;
  }

  .fm-grind-visual {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
  }

  .fm-ring-count {
    font-size: 1.15rem;
  }
}

@media (max-width: 520px) {
  .fm-route {
    padding: 1rem .75rem .85rem;
  }

  .fm-route-label {
    display: none;
  }

  .fm-route svg {
    height: 8.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fm-route-node,
  .fm-route-num,
  .fm-route-label,
  .fm-route-progress,
  .fm-bars > span,
  .fm-week,
  .fm-cat[open] .fm-cat-list,
  .grind-main .question-group,
  .grind-main .question-list .question-row,
  .fm-bump {
    animation: none !important;
  }

  .fm-route-progress {
    stroke-dashoffset: 0;
  }

  .fm-bars > span {
    transform: none;
  }

  .fm-pages-motion .fm-page-reveal {
    opacity: 1;
    transform: none;
  }

  .fm-cat-head::before {
    transition: none;
  }
}

@media print {
  .fm-route,
  .fm-bars,
  .fm-ring,
  .fm-ribbon,
  .fm-filter {
    display: none !important;
  }

  .fm-hub-hero,
  .fm-grind-hero {
    color: #000;
    background: none;
  }

  .fm-kicker {
    border-color: var(--site-line);
    color: var(--site-ink);
    background: none;
  }

  .fm-cat,
  .fm-cat[open] {
    break-inside: avoid;
  }
}
