/* Features page: every module and who uses it (Nov 2026).
   Sits below the role story and changes nothing in it.

   The module explorer: the groups in a rail on the left (the active one a
   navy pill that glides, as in the story's role picker), one group at a time
   on the right, wearing its module's homepage colour, a card per module, and
   a search across all of them. Without features-list.js every group is shown
   stacked, so the whole list stays readable in the page source. */

.fm { scroll-margin-top: 110px; }
.fm .sec-intro { margin-bottom: 8px; }
.fm .sec-intro h2 { text-wrap: balance; }
.fm-p[hidden], .fm-c[hidden], .fm-empty[hidden], .fm-clear[hidden] { display: none !important; }

/* each group's chip wears its module's homepage colour */
.ch-sky { --chip: var(--skyl); --chipfg: var(--sky-ink); }
.ch-mint { --chip: var(--mint); --chipfg: var(--teal-ink); }
.ch-lav { --chip: var(--lav); --chipfg: var(--grape-d); }
.ch-cream { --chip: var(--cream); --chipfg: var(--money); }
.ch-blush { --chip: var(--blush); --chipfg: var(--blossom-ink); }
.ch-butter { --chip: var(--butter); --chipfg: var(--warn); }
.ch-peach { --chip: var(--peach); --chipfg: var(--err); }
.ch-ink { --chip: #E8EBF3; --chipfg: var(--ink); }

/* the three ways in, one colour each, here and in the roles table */
.surf.sv-portal { background: var(--ink); color: #fff; }
.surf.sv-app { background: var(--mint); color: var(--teal-ink); }
.surf.sv-driver { background: var(--peach); color: var(--err); }
.fm-ph .surf { box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .55); }
.c-navy .surf.sv-portal { background: rgba(255, 255, 255, .16); color: #fff; box-shadow: none; }

/* ---------- the explorer ---------- */
.fm-x { display: grid; gap: var(--gap); }
.fm-side { display: none; }
.fm-x.on .fm-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.fm-panels { display: grid; gap: calc(var(--gap) * 2); align-content: start; min-width: 0; }
.fm-x.on .fm-panels { gap: 0; }
.fm-res { display: none; }
@media (min-width: 1000px) {
  .fm-x.on { grid-template-columns: 300px minmax(0, 1fr); align-items: start; }
}
@media (min-width: 1000px) and (min-height: 800px) {
  .fm-x.on .fm-side { position: sticky; top: 100px; }
}

/* search */
.fm-find { position: relative; display: flex; align-items: center; height: 56px; padding: 0 8px 0 18px; border-radius: 999px; background: #fff; box-shadow: var(--sh1); transition: box-shadow .3s; }
.fm-find:focus-within { box-shadow: 0 0 0 3px rgba(59, 163, 240, .35), var(--sh1); }
.fm-find-ic { width: 20px; height: 20px; flex: none; color: var(--ink5); }
.fm-find input { flex: 1; min-width: 0; height: 100%; padding: 0 10px 0 12px; border: 0; outline: 0; background: transparent; font: 500 16px/1 var(--ft); color: var(--ink); }
.fm-find input::placeholder { color: var(--ink4); }
.fm-find input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.fm-clear { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--page); color: var(--ink); cursor: pointer; }
.fm-clear span { width: 16px; height: 16px; }
.fm-clear:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }

/* the rail of groups */
.fm-rail { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 8px; border-radius: 26px; background: #fff; box-shadow: var(--sh1); }
.fm-ind { position: absolute; left: 0; top: 0; z-index: 0; border-radius: 17px; background: var(--ink); pointer-events: none; opacity: 0; transition: transform .55s var(--ease), width .55s var(--ease), height .55s var(--ease), opacity .3s; }
.fm-tab { position: relative; z-index: 1; display: flex; align-items: center; gap: 11px; width: 100%; padding: 6px 9px 6px 6px; border: 0; border-radius: 17px; background: transparent; cursor: pointer; text-align: left; font: 700 14.5px/1.2 var(--fd); letter-spacing: -.01em; color: var(--ink7); transition: color .3s, background-color .3s, opacity .3s; }
.fm-tab:hover { background: var(--page); color: var(--ink); }
.fm-tab.on, .fm-tab.on:hover { background: transparent; color: #fff; }
.fm-rail:not(.glide) .fm-tab.on { background: var(--ink); }
.fm-tab:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
.fm-tab-ic { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: var(--chip); color: var(--chipfg); }
.fm-tab-ic svg { width: 17px; height: 17px; }
.fm-tab-n { flex: 1; min-width: 0; }
.fm-tab-c { flex: none; min-width: 26px; padding: 4px 8px; border-radius: 999px; background: var(--page); font: 700 12px/1 var(--fd); color: var(--ink5); text-align: center; transition: background-color .3s, color .3s; }
.fm-tab.on .fm-tab-c { background: rgba(255, 255, 255, .16); color: #fff; }
.fm-tab.none { opacity: .36; }

/* ---------- a group: its colour, then a card per module ---------- */
.fm-ph { position: relative; min-height: 220px; padding: clamp(24px, 2.6vw, 36px); gap: 10px; justify-content: flex-end; }
.fm-ph > :not(.fm-ghost) { position: relative; z-index: 1; }
.fm-ghost { position: absolute; right: -24px; bottom: -44px; z-index: 0; width: 240px; height: 240px; color: var(--h, var(--ink)); opacity: .14; pointer-events: none; }
.fm-ghost svg { width: 100%; height: 100%; stroke-width: 1.3; }
.fm-ph-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: auto; }
.fm-n { margin-right: 6px; font: 700 13px/1 var(--fd); color: var(--k); }
.fm-n:empty { display: none; }
.fm-where { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.fm-ph h3 { max-width: 18ch; margin-top: 22px; font-size: clamp(28px, 2.7vw, 42px); line-height: 1.02; letter-spacing: -.035em; text-wrap: balance; }
.fm-purpose { max-width: 46ch; font: 400 clamp(15.5px, 1.15vw, 17.5px)/1.5 var(--ft); color: var(--fg, var(--ink7)); }

.fm-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.fm-c { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; align-items: start; padding: 18px 20px 18px 16px; border-radius: 20px; background: #fff; box-shadow: var(--sh1); }
.fm-c-ic { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 13px; background: var(--chip); color: var(--chipfg); }
.fm-c-ic svg { width: 20px; height: 20px; }
.fm-c h4 { margin: 2px 0 4px; font: 700 16px/1.3 var(--fd); letter-spacing: -.015em; color: var(--ink); }
.fm-c p { font: 400 14.5px/1.55 var(--ft); color: var(--ink7); }
.fm-foot { margin-top: 14px; padding-inline: 6px; }
.fm-foot .pgc-link span, .fm-empty .pgc-link span { width: 18px; height: 18px; }

/* ---------- searching: each group shrinks to a label over the cards that match ---------- */
.fm-x.is-search .fm-res { display: block; padding: 2px 4px 12px; font: 700 15px/1.4 var(--fd); color: var(--ink7); }
.fm-x.is-search .fm-panels { gap: 18px; }
.fm-x.is-search .fm-ph { min-height: 0; flex-direction: row; align-items: center; justify-content: flex-start; gap: 12px; padding: 14px 18px; border-radius: 20px; }
.fm-x.is-search .fm-ghost, .fm-x.is-search .fm-purpose, .fm-x.is-search .fm-where { display: none; }
.fm-x.is-search .fm-ph-top { order: 2; margin: 0; }
.fm-x.is-search .fm-ph h3 { max-width: none; margin: 0; font-size: 19px; letter-spacing: -.02em; }
.fm-empty { display: grid; justify-items: start; gap: 8px; padding: 28px; border-radius: 24px; background: #fff; box-shadow: var(--sh1); }
.fm-empty h4 { font: 800 22px/1.2 var(--fd); letter-spacing: -.02em; color: var(--ink); }

/* before the list scrolls into view (the script removes this) */
.fm-x.pre .fm-side, .fm-x.pre .fm-panels { opacity: 0; }

/* the group's ghost icon drifts, slowly; still under reduced motion */
@media (prefers-reduced-motion: no-preference) {
  .fm-x.on .fm-ghost svg { animation: fm-drift 9s ease-in-out infinite alternate; }
}
@keyframes fm-drift {
  from { transform: translate(0, 0) rotate(-4deg); }
  to { transform: translate(-14px, -10px) rotate(5deg); }
}

/* ---------- tablet and phone: the groups become a row of capsules ---------- */
@media (max-width: 999px) {
  .fm-rail { flex-direction: row; overflow-x: auto; padding: 6px; border-radius: 22px; scrollbar-width: none; }
  .fm-rail::-webkit-scrollbar { display: none; }
  .fm-tab { flex: none; width: auto; gap: 9px; padding: 6px 13px 6px 6px; }
  .fm-tab-n { white-space: nowrap; }
  .fm-tab-ic { width: 30px; height: 30px; }
  .fm-tab-c { display: none; }
}
@media (max-width: 699px) {
  .fm-cards { grid-template-columns: 1fr; }
  .fm-ph { min-height: 190px; }
  .fm-ghost { right: -20px; bottom: -32px; width: 170px; height: 170px; }
}

/* ---------- who uses it ---------- */
.fm-roles { padding: 8px; }
.fm-t { width: 100%; border-collapse: collapse; font: 400 15px/1.5 var(--ft); color: var(--ink7); }
.fm-t th, .fm-t td { padding: 14px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.fm-t thead th { padding-block: 12px; font: 700 12.5px/1.2 var(--fd); color: var(--ink5); background: var(--page); border-bottom: 0; }
.fm-t thead th:first-child { border-radius: calc(var(--r) - 10px) 0 0 calc(var(--r) - 10px); }
.fm-t thead th:last-child { border-radius: 0 calc(var(--r) - 10px) calc(var(--r) - 10px) 0; }
.fm-t tbody th { width: 17%; font: 700 15.5px/1.35 var(--fd); color: var(--ink); letter-spacing: -.01em; white-space: nowrap; }
.fm-t tbody td:nth-child(2) { width: 24%; }
.fm-t tbody td:nth-child(2) .surf { margin: 0 4px 4px 0; }
.fm-t tbody tr:last-child th, .fm-t tbody tr:last-child td { border-bottom: 0; }
.fm-more { margin-top: 14px; padding-inline: 4px; }
.fm-more .pgc-link span { width: 18px; height: 18px; }

@media (max-width: 699px) {
  .fm-roles { padding: 6px 16px; }
  .fm-t thead { display: none; }
  .fm-t, .fm-t tbody, .fm-t tr, .fm-t th, .fm-t td { display: block; width: auto; }
  .fm-t tr { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .fm-t tbody tr:last-child { border-bottom: 0; }
  .fm-t th, .fm-t td { padding: 0; border: 0; }
  .fm-t tbody th, .fm-t tbody td, .fm-t tbody td:nth-child(2) { width: auto; }
  .fm-t tbody th { margin-bottom: 6px; white-space: normal; }
  .fm-t tbody td:nth-child(2) { margin-bottom: 4px; }
  .fm-t .surf { white-space: nowrap; }
}
