/* "File it with me" (app/m1-fwm.js): where the kit's k-fwm pieces sit in the app. The pieces themselves are the kit's
   (docs/ux/m1-system/kit-extra.css); this file only places them, kit tokens only, all under html.b-m1. */
/* the stage owns the work panel (desk) / the sheet (phone) while it is open; the page under it stays as it was */
html.b-m1 #m1Fwm{display:none}
html.b-m1.m1-fwm-on #m1Fwm{display:block;flex:1 0 auto}
html.b-m1.m1-fwm-on .app>:not(#m1Fwm):not(#m1Grab){display:none!important}
html.b-m1.m1-fwm-canvas #m1Fwm .k-fwm{padding-top:var(--k-s10)}
/* the chat-led variant's canvas: the copy rows only on a desk, its one action stays on the chat card (a phone has the sheet over the chat: the action stays here) */
@media (min-width:861px){html.b-m1.m1-fwm-canvas #m1Fwm .k-fwm-go{display:none}}
/* the stage's back / later line sits right under the card, starting where the card's action starts (not pushed to the far
   right), and flows after the card: it never covers the card's bottom */
html.b-m1 #m1Fwm,html.b-m1 #m1Fwm .k-fwm{background:inherit}
html.b-m1 #m1Fwm .k-fwm-foot{justify-content:flex-start;padding:0 24px;margin-top:calc(-1 * var(--k-s3));box-sizing:border-box}
html.b-m1 #m1Fwm .k-fwm-foot .k-fwm-later{margin-left:0}
/* the box copy on a desk: tighter rows, so the 11 boxes, the action and the foot fit the panel at 900 px */
@media (min-width:861px){html.b-m1 #m1Fwm .k-fwm-card[data-kind="copy-boxes"]{gap:var(--k-s5);padding-top:24px;padding-bottom:22px}
  html.b-m1 #m1Fwm .k-fwm-card[data-kind="copy-boxes"] .k-fwm-box li{min-height:38px}
  html.b-m1 #m1Fwm .k-fwm-card[data-kind="copy-boxes"] .k-fwm-box li+li{margin-top:1px}
  html.b-m1 #m1Fwm .k-fwm-card[data-kind="copy-boxes"] .k-fwm-copy{height:32px}
  html.b-m1 #m1Fwm .k-fwm-card[data-kind="copy-boxes"] .k-fwm-go{margin-top:var(--k-s2)}}
/* a chat card's kicker keeps its whole count ("IVA 3T 2026 · 4/7"); the test pill and the switch wrap under it when the column is narrow */
html.b-m1 .k-fwm-step header{flex-wrap:wrap;row-gap:var(--k-s2)}
html.b-m1 .k-fwm-step header .k-fwm-k{flex:1 0 auto;overflow:visible}
/* the Home starters beside an open stage (a narrow chat column): one per row, the line beside the title, wrapping to at most 2 lines */
@media (min-width:861px){html.b-m1.m1-fwm-on .m1-hero :is(.k-starters,.m1k-starters){grid-template-columns:1fr;gap:8px}
  html.b-m1.m1-fwm-on .m1-hero :is(.k-stc,.m1k-stc){flex-direction:row;align-items:center;gap:12px;padding:10px 14px}
  html.b-m1.m1-fwm-on .m1-hero :is(.k-stc,.m1k-stc) :is(.k-vis,.m1k-vis){display:none}
  html.b-m1.m1-fwm-on .m1-hero :is(.k-stc,.m1k-stc)>b{margin:0;flex:none;font-size:var(--k-t-sm);white-space:nowrap}
  html.b-m1.m1-fwm-on .m1-hero :is(.k-stc,.m1k-stc) small{min-width:0}}
/* while a flow runs, the chat's suggestion rows step aside so the step's card keeps its bottom in view */
html.b-m1.m1-fwm-active #agChips,html.b-m1.m1-fwm-active #m1Sug{display:none!important}
/* the Home reminder: under the greeting, above the starters, as wide as the starters */
html.b-m1 #m1FwmRem{width:100%;max-width:560px;margin:var(--k-s2) auto var(--k-s6)}
/* the VAT board: the filing's row first on the Return tab */
html.b-m1 #m1FwmRow{margin:0 0 var(--k-s8)}
html.b-m1 #m1FwmRow .k-fwm-rem{box-shadow:none;border-radius:var(--k-r-card)}
/* chat cards: the slot is a plain block in the agent's bubble */
html.b-m1 #agThread .m1-fwm-slot{display:block;min-width:0}
html.b-m1 #agThread .m1-fwm-slot .k-fwm-rem{margin-top:var(--k-s4);box-shadow:none;border:1px solid var(--ka-soft)}
@media (max-width:860px){html.b-m1 #m1FwmRem{margin:0 auto var(--k-s4)}
  /* a long step (the box copy) keeps its one action in view at the bottom of the sheet */
  html.b-m1 #m1Fwm .k-fwm-card[data-kind="copy-boxes"] .k-fwm-go{position:sticky;bottom:0;background:inherit;padding:10px 0 4px;margin-top:0}
  /* the box copy in the phone's sheet: the rows touch (each still a 44 px tap) and the canvas starts at the top, so the whole card fits above the composer */
  html.b-m1 #m1Fwm .k-fwm-card[data-kind="copy-boxes"]{gap:var(--k-s4);padding-top:16px;padding-bottom:12px}
  html.b-m1 #m1Fwm .k-fwm-card[data-kind="copy-boxes"] .k-fwm-box li+li{margin-top:0}
  html.b-m1.m1-fwm-canvas #m1Fwm .k-fwm{padding-top:0}
  html.b-m1 #m1Fwm .k-fwm-foot{padding:0 12px}}

/* ---- round 4 (HQ 21) ---- */
/* while a stage / the canvas is open, Home's fanned waiting cards and their icon rail step aside (they were cut by the composer) */
html.b-m1.m1-fwm-on .m1-hero .m1-result{display:none}
/* the primary pill keeps its colour: focus is a ring only, the hover shade only where there is a pointer that hovers */
html.b-m1 .k-fwm-pri:focus{outline:none}
html.b-m1 .k-fwm-pri:focus-visible{outline:2px solid var(--k-text);outline-offset:3px}
@media (hover:none){html.b-m1 .k-fwm-pri:hover{opacity:1}
  html.b-m1 .k-fwm-q:hover,html.b-m1 .k-fwm-foot button:hover{color:var(--k-text-2)}
  html.b-m1 .k-fwm-q.k-fwm-alt:hover,html.b-m1 .k-fwm-foot .k-fwm-alt:hover{color:var(--k-text)}}
/* a past chat card stays readable (no whole-card fade): its kicker in --k-text-3, its title in --k-text-2 */
html.b-m1 .k-fwm-step.is-past{opacity:1}
html.b-m1 .k-fwm-step.is-past h3{color:var(--k-text-2)}
html.b-m1 .k-fwm-step.is-past .k-fwm-k,html.b-m1 .k-fwm-step.is-past :is(.k-more,.m1k-more) summary{color:var(--k-text-3)}
/* while a flow runs, its card holds the thread's one primary: the earlier brief's rows go quiet (outline "Revisar"), and their
   model chips step aside (each row's title already says "(modelo 303)") */
html.b-m1.m1-fwm-active #agThread .m1c-card :is(.k-btn,.m1k-btn):is(.k-pri,.m1c-pri){background:none;color:var(--k-text);box-shadow:inset 0 0 0 1px var(--k-line-strong)}
html.b-m1.m1-fwm-active #agThread .m1c-card .m1c-code{display:none}
/* the chosen pay option: a soft fill and the same hairline, not a heavy black border */
html.b-m1 .k-fwm-opts label:has(input:checked){border-color:var(--ka-soft);background:var(--ka-canvas)}
/* the receipt step: one way in (the button); the sample link sits quietly under it, left, like the other quiet links */
html.b-m1 [data-kind="receipt"] [data-fwm="sample"]{order:1;align-self:flex-start;margin:calc(-1 * var(--k-s3)) 0 0 -6px}
html.b-m1 .k-fwm-step[data-kind="receipt"]>.k-fwm-row{order:2}
html.b-m1 #m1Fwm [data-fwm-drop].is-over{box-shadow:0 0 0 2px var(--k-text)}
/* the done card: the status as a quiet line (the disc already says done) */
html.b-m1 .k-fwm-done .m1-fwm-st{background:none;border:0;padding:0;color:var(--k-text-2);font-size:var(--k-t-md)}
/* a chat card's header is one line (kicker + switch); the test label sits quietly at the end of the card's foot row */
html.b-m1 #agThread .k-fwm-step .k-fwm-row .m1-fwm-demo{margin-left:auto}
/* the canvas beside the chat (box copy) narrows the column: the switch waits (the canvas carries the test label) */
html.b-m1.m1-fwm-canvas #agThread .k-fwm-step:not(.is-past) header .k-fwm-sw{display:none}
@media (max-width:860px){
  /* the half-height sheet: the step scrolls inside it and its one action sticks to the sheet's bottom */
  html.b-m1 #m1Fwm .k-fwm-card .k-fwm-go{position:sticky;bottom:44px;z-index:1;background:inherit;padding:10px 0 6px;margin-top:0}
  html.b-m1:not(.m1-fwm-canvas) #m1Fwm .k-fwm-card[data-kind="copy-boxes"] .k-fwm-go{bottom:44px}
  html.b-m1.m1-fwm-canvas #m1Fwm .k-fwm-card .k-fwm-go{bottom:0}
  /* the back / later line sticks to the sheet's bottom too: no half-cut sliver of it above the composer */
  html.b-m1 #m1Fwm .k-fwm-foot{position:sticky;bottom:0;z-index:2;background:inherit;margin-top:0;padding:0;gap:0;justify-content:space-between;flex-wrap:nowrap;overflow:hidden}
  html.b-m1 #m1Fwm .k-fwm-foot button{white-space:nowrap}
  /* "‹ Atrás" is the arrow alone on a phone (its name stays for screen readers), so the line fits one row */
  html.b-m1 #m1Fwm .k-fwm-foot [data-fwm="back"]{min-width:var(--k-tap)}
  html.b-m1 #m1Fwm .m1-fwm-bk{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
  html.b-m1 #m1Fwm .k-fwm{padding-bottom:0}
  html.b-m1 .k-fwm-done .k-fwm-go{align-self:stretch;background:var(--ka-card)}
  /* the receipt read back and the done card: their rows and the file chip are the point, so the action does not stick over them */
  html.b-m1 #m1Fwm .k-fwm-card[data-kind="receipt"] .k-fwm-go,html.b-m1 #m1Fwm .k-fwm-done .k-fwm-go{position:static;padding-top:4px}
  html.b-m1 #m1Fwm:has(.k-fwm-card[data-kind="receipt"],.k-fwm-done) .k-fwm-foot{position:static}
  html.b-m1 #m1Fwm .k-fwm-card[data-kind="receipt"] dl{row-gap:2px}
  html.b-m1 .k-fwm-done .k-fwm-pri{width:100%}}

/* ---- the usability test panel (?fwm-test=1, app/m1-fwm-test.js): facilitator only, bottom left, kit tokens ---- */
html.b-m1 .m1-fwm-tp{position:fixed;left:16px;bottom:16px;z-index:80;width:min(340px,calc(100vw - 32px));max-height:min(78vh,640px);overflow:auto;box-sizing:border-box;
  background:var(--ka-card);color:var(--k-text);border-radius:var(--k-r-card);box-shadow:var(--k-sh-3);padding:14px 16px 16px;font-size:var(--k-t-md);display:flex;flex-direction:column;gap:10px}
html.b-m1 .m1-fwm-tp[data-min="1"]{width:auto;padding:6px}
html.b-m1 .m1-fwm-tp header{display:flex;align-items:center;gap:8px}
html.b-m1 .m1-fwm-tp header b{flex:1;font-weight:var(--k-w-med)}
html.b-m1 .m1-fwm-tp .tp-k{font-family:var(--k-mono);font-size:var(--k-t-xs);color:var(--k-text-3)}
html.b-m1 .m1-fwm-tp .tp-task{font-size:var(--k-t-lg);line-height:1.35;font-weight:var(--k-w-reg)}
html.b-m1 .m1-fwm-tp .tp-time{font-family:var(--k-mono);font-size:28px;font-weight:300;font-variant-numeric:tabular-nums}
html.b-m1 .m1-fwm-tp .tp-row{display:flex;flex-wrap:wrap;gap:6px}
html.b-m1 .m1-fwm-tp .tp-chip{border:1px solid var(--ka-soft);background:none;border-radius:var(--k-r-pill);padding:4px 11px;min-height:32px;font:inherit;font-size:var(--k-t-sm);color:var(--k-text);cursor:pointer}
html.b-m1 .m1-fwm-tp .tp-chip[aria-pressed="true"]{background:var(--k-text);color:var(--ka-card);border-color:var(--k-text)}
html.b-m1 .m1-fwm-tp textarea,html.b-m1 .m1-fwm-tp input[type=text]{width:100%;box-sizing:border-box;border:1px solid var(--ka-soft);border-radius:var(--k-r-md);background:var(--ka-card);color:var(--k-text);font:inherit;padding:8px 10px}
html.b-m1 .m1-fwm-tp textarea{min-height:56px;resize:vertical}
html.b-m1 .m1-fwm-tp small{color:var(--k-text-3);font-size:var(--k-t-xs)}
html.b-m1 .m1-fwm-tp table{border-collapse:collapse;font-size:var(--k-t-xs);width:100%}
html.b-m1 .m1-fwm-tp td,html.b-m1 .m1-fwm-tp th{padding:3px 4px;text-align:left;border-top:1px solid var(--ka-soft);font-weight:var(--k-w-reg)}
@media (max-width:860px){html.b-m1 .m1-fwm-tp{left:8px;right:8px;bottom:8px;width:auto}html.b-m1 .m1-fwm-tp .tp-chip{min-height:var(--k-tap)}}
.k-fwm-unv{align-self:flex-start;margin:2px 0 6px}
/* a long value (an IBAN) goes under its label on a phone, so the copy button stays in the row */
@media (max-width:520px){.k-fwm-box li.is-long{grid-template-columns:34px minmax(0,1fr) var(--k-tap);row-gap:0}.k-fwm-box li.is-long>b{grid-column:2;grid-row:2;white-space:normal;overflow-wrap:anywhere}.k-fwm-box li.is-long>button{grid-column:3;grid-row:1/span 2}}
/* the half sheet's end mark (m1-fwm.js stepCore): as tall as the sticky action + footer, no room in the flow; desk: none */
.k-fwm-end{display:none}
@media (max-width:860px){html.b-m1 #m1Fwm .k-fwm-end{display:block;height:124px;margin:0 0 -124px;pointer-events:none;visibility:hidden}}
