/* finder-final r4: sticky footer fix, centred setup column, AI home with 3 cards, approval lanes, turn-on lane strip, finder status page, sets page.
   Layout and surface only; every control is a DS or ai-shared component. */

/* ---- the footer always meets the bottom edge: main is a min-height flex column, the view and the shell fill it ---- */
body:has(.fnx-page) main.rs { min-height: calc(100vh - 32px); min-height: calc(100dvh - 32px); display: flex; flex-direction: column; }
@media (max-width: 782px) { body:has(.fnx-page) main.rs { min-height: calc(100vh - 46px); min-height: calc(100dvh - 46px); } }
main.rs > .view.fnx-page { flex: 1 0 auto; display: flex; flex-direction: column; }
.fnx-page > .fnx-shell { flex: 1 0 auto; min-height: 0; }

/* ---- widths: setup is one centred column; the finder page and sets page are a little wider ---- */
.fnx-shell[data-mode="flow"] { --ff-w: 960px; }
.fnx-shell[data-mode="finder"], .fnx-shell[data-mode="sets"] { --ff-w: 1100px; }
.ff-main { display: block; }
.ff-lead { margin: 0; }

/* ---- AI home: 3 cards ---- */
.hub-page .ix-grid.ix-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); justify-content: stretch; max-width: 1500px; margin-inline: auto; }
.ix-grid--3 .ix-st { flex-wrap: wrap; }
.ix-grid--3 .ix-a { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ix-sets { display: grid; gap: 8px; }
.ix-sets__h { margin: 0; font: 500 12px/16px var(--font); color: var(--type-primary); }
.ix-sets__g { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.ix-sets__c { display: grid; gap: 4px; padding: 8px; border: 1px solid var(--stroke-tertiary); border-radius: var(--radius-8); background: var(--surface-screen); }
.ix-sets__c i { display: block; height: 5px; border-radius: var(--radius-full); background: var(--neutral-100); }
.ix-sets__c i:first-child { width: 55%; background: var(--brand-100); }
.ix-sets__c i:nth-child(3) { width: 70%; }
@media (max-width: 1100px) { .hub-page .ix-grid.ix-grid--3 { grid-template-columns: minmax(0, 1fr); max-width: 560px; } }

/* ---- approval lanes (step 2 and the finder page) ---- */
.ff-appr { display: grid; gap: 16px; min-width: 0; }
.ff-lanes { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ff-lanes__h, .ff-lane { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.1fr) minmax(0, .8fr); gap: 12px 24px; min-width: 0; }
.ff-lanes__h { padding: 0 21px; font: 500 12px/16px var(--font); color: var(--type-secondary); }
.ff-lane { align-items: center; padding: 16px 20px; border: 1px solid var(--stroke-tertiary); border-radius: var(--radius-12); background: var(--surface-screen); }
.ff-lane__s { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ff-lgs { display: inline-flex; flex-wrap: wrap; gap: 4px; max-width: 80px; min-width: 56px; flex: none; align-content: center; }
.ff-lgs:empty { display: none; }
.ff-lg { width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--stroke-tertiary); border-radius: var(--radius-4); background: var(--surface-screen); overflow: hidden; color: var(--type-secondary); }
.ff-lg .aif-lg { max-width: 16px; max-height: 16px; }
.ff-lane__n { display: grid; gap: 2px; min-width: 0; }
.ff-lane__n b { font: 500 14px/20px var(--font); color: var(--type-primary); }
.ff-lane__n span { font: 400 13px/20px var(--font); color: var(--type-secondary); overflow-wrap: anywhere; }
.ff-lane__y { font: 400 14px/20px var(--font); color: var(--type-primary); min-width: 0; }
.ff-lane__e { min-width: 0; }
.ff-st--sel .ds-select { width: 100%; min-width: 0; }
@media (max-width: 700px) {
  .ff-lanes__h { display: none; }
  .ff-lane { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .ff-lane__y::before, .ff-lane__e::before { content: attr(data-l); display: block; margin-bottom: 4px; font: 500 12px/16px var(--font); color: var(--type-secondary); }
}
.ff-pgflat__h { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 16px; }
.ff-pgflat__t { display: grid; gap: 2px; min-width: 0; }
.ff-pgflat__t b { font: 500 16px/24px var(--font); color: var(--type-primary); }
.ff-pgflat__t span { font: 400 13px/20px var(--font); color: var(--type-secondary); }

/* home card footers: pill and line, then the one action, on one baseline across the cards */
.ix-grid--3 .ix-foot { display: grid; gap: 12px; align-content: end; min-height: 0; }
.ix-grid--3 .ix-foot > span:empty { display: none; }

/* ---- turn-on dialog: the "What happens next" lane strip ---- */
.ff-ws { display: grid; gap: 12px; margin: 0 0 16px; }
.ff-ws__t { margin: 0; font: 500 14px/20px var(--font); color: var(--type-primary); }
.ff-ws__l { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ff-ws__i { display: grid; justify-items: start; align-content: start; gap: 4px; padding: 12px; border: 1px solid var(--stroke-tertiary); border-radius: var(--radius-8); background: var(--neutral-25); min-width: 0; }
.ff-ws__i b { font: 500 13px/20px var(--font); color: var(--type-primary); }
.ff-ws__i .ff-lgs { width: auto; min-height: 24px; }
.ff-ws__a { color: var(--neutral-400); display: inline-flex; }
.ff-ws__v { font: 400 13px/18px var(--font); color: var(--type-primary); }
.ff-ws__n { margin: 0; font: 400 13px/20px var(--font); color: var(--type-secondary); }
@media (max-width: 520px) { .ff-ws__l { grid-template-columns: minmax(0, 1fr); } }

/* ---- finder page and sets page header ---- */
.ff-fh { align-items: flex-start; flex-wrap: wrap; margin-bottom: 20px; }
.ff-fh__a { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ff-fh__w { display: inline-flex; padding: 0; height: auto; vertical-align: baseline; margin-left: 4px; }
.ff-fh .ais-head__l { display: block; }
@media (max-width: 640px) { .ff-fh__a { width: 100%; } .ff-fh__a .ds-seg { display: flex; } .ff-fh__a .ds-seg > label { flex: 1 1 0; } .ff-fh__a .ds-seg .seg-in { justify-content: center; } }
.ff-notes { display: grid; gap: 12px; margin: 0 0 20px; }
.ff-h2 { margin: 28px 0 12px; font: 500 16px/24px var(--font); color: var(--type-primary); }
.ff-lh .ff-sumn { font: 400 13px/20px var(--font); color: var(--type-secondary); margin-left: 8px; }
#ff-setbody .ff-lh { margin-top: 20px; }
#ff-setbody .ff-lh:first-child { margin-top: 0; }

/* ---- the 4-count strip ---- */
.ff-cts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.ff-ct { position: relative; background: var(--surface-screen); border: 1px solid var(--stroke-tertiary); border-radius: var(--radius-12); min-width: 0; transition: border-color var(--m-base, .2s) ease, box-shadow var(--m-base, .2s) ease; }
.ff-ct:hover { border-color: var(--brand-100); box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.ff-ct__a { display: grid; gap: 2px; padding: 16px 20px; color: inherit; text-decoration: none; border-radius: var(--radius-12); }
.ff-ct__a b { font: 500 28px/36px var(--font); color: var(--type-primary); }
.ff-ct__a span { font: 400 13px/20px var(--font); color: var(--type-secondary); padding-right: 24px; }
.ff-ct__a > .fa { position: absolute; top: 18px; right: 18px; color: var(--neutral-400); }
.ff-ct__a:hover > .fa { color: var(--brand-300); }
.ff-ct__a:focus-visible { outline: var(--focus-ring-width) solid var(--focus-ring-color); outline-offset: 2px; }
.ff-ct__i { position: absolute; right: 16px; bottom: 16px; color: var(--neutral-500); display: inline-flex; border-radius: var(--radius-full); }
.ff-ct__i:focus-visible { outline: var(--focus-ring-width) solid var(--focus-ring-color); outline-offset: 2px; }
@media (max-width: 900px) { .ff-cts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
@media (max-width: 480px) { .ff-ct__a { padding: 12px 16px; } .ff-ct__a span { padding-right: 20px; } }
.ff-fpage .ff-cts + .ff-h2 { margin-top: 28px; }

/* the auto-approve row keeps its toggle at the far right on phones too (locked: toggles at the far right) */
@media (max-width: 640px) { .ff-appr .ais-set { flex-direction: row; align-items: center; flex-wrap: nowrap; } .ff-appr .ais-set__t { flex: 1 1 0; } .ff-appr .ais-set__c { flex: none; margin-left: 12px; } }

/* Skipped is a plain stat, not a link */
.ff-ct--static:hover { border-color: var(--stroke-tertiary); box-shadow: none; }
.ff-ct--static .ff-ct__a { cursor: default; }

/* ---- r5 ---- */
/* lane icon group: fixed width for 3 icons so every lane title starts at the same x */
.ff-lane .ff-lgs { width: 80px; min-width: 80px; max-width: 80px; }
.ff-lane .ff-lgs:empty { display: flex; }
/* home cards are not links: no hover lift or shadow */
.hub-page .ix-card:hover { box-shadow: var(--r2-card-sh); transform: none; }
/* finder page: segs sit under the title, full width and horizontal, on phones */
@media (max-width: 600px) {
  .ff-fpage .ais-seg { display: flex; flex-direction: row; width: 100%; }
  .ff-fpage .ais-seg > label { flex: 1 1 0; border-top: 0; border-inline-start: 1px solid var(--stroke-secondary); }
  .ff-fpage .ais-seg > label:first-of-type { border-inline-start: 0; }
  .ff-fpage .ais-seg .seg-in { justify-content: center; text-align: center; padding-inline: 6px; }
}
/* touch targets at phone width: 44px hit areas (an invisible pseudo-element where the visual must stay small) */
@media (max-width: 600px) {
  .rs-crumb a { display: inline-flex; align-items: center; min-height: 44px; }
  .rs-sub .lnk-wp { position: relative; }
  .rs-sub .lnk-wp::after { content: ""; position: absolute; left: -4px; right: -4px; top: 50%; height: 44px; transform: translateY(-50%); }
  .ff-pbtn.rs-hit, .btn-text.rs-hit { position: relative; }
}

/* r5b: on phones the lane icons size to their content, so titles sit right after them */
@media (max-width: 600px) { .ff-lane .ff-lgs { width: auto; min-width: 0; max-width: none; } }
