/* Workflows + onboarding (flows.js, 27 Oct 2026). Same cards, type and tokens as the CRM; phone first; no :has() and no
   runtime custom properties (see the 22 Oct perf rules in app.css). */
.fx { display: flex; flex-direction: column; gap: 12px; }
.fx-i { width: 15px; height: 15px; flex: none; vertical-align: -2px; fill: currentColor; }
.fx .note a, .fx p a, .fx-run a { color: var(--accent); }
.fx .btn.sm, .fx-run .btn.sm { min-height: 40px; padding: 0 12px; font-size: 13.5px; }
.fx .btn.ghost.danger, .fx-run .btn.ghost.danger { color: #c2410c; }
.fx-run .btn.danger-fill { background: #c2410c; color: #fff; }
.fx .fx-lead, .fx-run .fx-lead { margin: -2px 0 12px; font-size: 14.5px; color: var(--muted); }
.fx .fx-sub, .fx-run .fx-sub { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 14px 0 6px; }
.fx .fx-sub:first-child { margin-top: 0; }
.fx .fx-pill, .fx-run .fx-pill { display: inline-flex; align-items: center; gap: 4px; flex: none; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; vertical-align: 1px; }
.fx .fx-pill.ok, .fx-run .fx-pill.ok { background: #dcf3e8; color: #13744a; }
.fx .fx-pill.warn, .fx-run .fx-pill.warn { background: #fdecd6; color: #a14b00; }
.fx .fx-pill.bad, .fx-run .fx-pill.bad { background: #fde3dc; color: #b42318; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fx .fx-pill.ok, :root:not([data-theme="light"]) .fx-run .fx-pill.ok { background: #12352a; color: #6fd3a5; }
  :root:not([data-theme="light"]) .fx .fx-pill.warn, :root:not([data-theme="light"]) .fx-run .fx-pill.warn { background: #3a2a14; color: #f2b366; }
  :root:not([data-theme="light"]) .fx .fx-pill.bad, :root:not([data-theme="light"]) .fx-run .fx-pill.bad { background: #3d1a16; color: #ff9b8a; } }
.fx-lock { color: var(--accent); margin-right: 5px; display: inline-flex; }
.fx .fx-lockt { color: var(--accent); white-space: nowrap; }
.fx .fx-x { flex: none; width: 44px; height: 44px; border-radius: 50%; color: var(--muted); font-size: 20px; line-height: 1; }
.fx .fx-x:hover { background: var(--notice); }
.fx .fx-backlink { color: var(--accent); font-weight: 600; font-size: 15px; min-height: 44px; padding: 0 12px 0 0; display: inline-flex; align-items: center; }
.fx .fx-tip { background: var(--accent-soft); border: 0; border-radius: 14px; padding: 12px 14px; font-size: 14px; margin-top: 12px; }
.fx .card.fx-tip { margin-top: 0; }
.fx .fx-tip p { margin: 4px 0 0; } .fx .fx-tip ol { margin: 6px 0 0; padding-left: 20px; } .fx .fx-tip li { margin: 4px 0; }
.fx .fx-bar, .fx-run .fx-bar { height: 8px; border-radius: 99px; background: var(--notice); overflow: hidden; margin: 10px 0 2px; }
.fx .fx-bar i, .fx-run .fx-bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s ease; }

/* forms */
.fx .fld, .fx-run .fld { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); min-width: 0; }
.fx input:not([type=checkbox]):not([type=radio]):not([type=file]), .fx select, .fx textarea, .fx-run select, .fx-run textarea { width: 100%; min-height: 42px; border: 1px solid var(--rule); border-radius: 10px; background: var(--surface); color: var(--ink); padding: 8px 10px; font: inherit; font-size: 16px; }
.fx textarea, .fx-run textarea { min-height: 0; resize: vertical; }
.fx input:focus, .fx select:focus, .fx textarea:focus, .fx-run textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.fx input[disabled], .fx select[disabled], .fx textarea[disabled] { opacity: .65; }
.fx .fx-form { display: flex; flex-direction: column; gap: 10px; }
.fx .fx-row { display: grid; gap: 8px; align-items: center; margin-bottom: 8px; }
.fx .fx-row.lic { grid-template-columns: 84px 1fr 44px; } .fx .fx-row.lic [data-l=kind] { grid-column: 1 / 3; }
/* phone: name on its own line (it's what you scan for), then role + mobile, then the email at full width so it isn't cut off */
.fx .fx-row.team { grid-template-columns: 1fr 1fr 44px; padding: 10px; border: 1px solid var(--rule); border-radius: 12px; }
.fx .fx-row.team [data-t=name] { grid-column: 1 / 3; grid-row: 1; } .fx .fx-row.team .fx-x { grid-column: 3; grid-row: 1; }
.fx .fx-row.team [data-t=role] { grid-column: 1 / 2; grid-row: 2; } .fx .fx-row.team [data-t=mobile] { grid-column: 2 / 4; grid-row: 2; }
.fx .fx-row.team [data-t=email] { grid-column: 1 / 4; grid-row: 3; } .fx .fx-row.team [data-t=licence] { grid-column: 1 / 4; grid-row: 4; }
@media (min-width: 640px) { .fx .fx-row.lic { grid-template-columns: 90px 1fr 1fr 44px; } .fx .fx-row.lic [data-l=kind] { grid-column: auto; }
  .fx .fx-row.team { grid-template-columns: 1.2fr 1fr 1.3fr 1fr 1fr 44px; border: 0; padding: 0; } .fx .fx-row.team > * { grid-column: auto !important; grid-row: auto !important; } }
.fx .fx-cards { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 560px) { .fx .fx-cards { grid-template-columns: 1fr 1fr; } }
.fx .fx-choice, .fx .fx-radio { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--rule); border-radius: 12px; cursor: pointer; background: var(--surface); }
.fx .fx-choice input, .fx .fx-radio input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--accent); }
.fx .fx-choice span, .fx .fx-radio span { display: flex; flex-direction: column; gap: 2px; font-size: 15px; }
.fx .fx-choice small, .fx .fx-radio small, .fx .fx-tog small, .fx-run .fx-tog small { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.fx .fx-choice.big { padding: 16px; }
.fx .fx-tog, .fx-run .fx-tog { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--rule); cursor: pointer; }
.fx .fx-tog > span, .fx-run .fx-tog > span { display: flex; flex-direction: column; gap: 1px; font-size: 14.5px; min-width: 0; }
.fx .fx-tog.sm, .fx-run .fx-tog.sm { border-top: 0; padding: 6px 0; }
.fx .fx-toggles .fx-tog:first-child { border-top: 0; }
/* a real iOS-style switch on a checkbox */
.fx-sw { appearance: none; -webkit-appearance: none; flex: none; width: 46px; height: 28px; border-radius: 99px; background: var(--rule); position: relative; cursor: pointer; transition: background .2s; margin: 0; }
.fx-sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.fx-sw:checked { background: var(--accent); } .fx-sw:checked::after { transform: translateX(18px); }
.fx-sw:disabled { opacity: .5; }
.fx .fx-file { display: inline-block; position: relative; }
.fx .fx-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }

/* setup wizard */
.fx .fx-hero h3 { font-size: 26px; margin-bottom: 4px; }
.fx .fx-kicker { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.fx .fx-steps { display: flex; gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding: 2px 0; }
.fx .fx-steps::-webkit-scrollbar { display: none; }
.fx .fx-steps button { flex: none; min-height: 40px; display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 6px; border-radius: 999px; border: 1px solid var(--rule); background: var(--surface); font-size: 13px; color: var(--muted); white-space: nowrap; }
.fx .fx-steps button span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--notice); font-size: 11.5px; font-weight: 600; }
.fx .fx-steps button.done span { background: #22a06b; color: #fff; }
.fx .fx-steps button.on { border-color: var(--accent); color: var(--ink); font-weight: 600; }
.fx .fx-steps button.on span { background: var(--accent); color: var(--accent-ink); }
.fx .fx-pane h3 { font-size: 24px; }
.fx .fx-nav { display: flex; justify-content: space-between; gap: 10px; position: sticky; bottom: 0; padding: 10px 0 calc(6px + env(safe-area-inset-bottom)); background: var(--bg); z-index: 2; }
.fx .fx-nav[hidden] { display: none; }
.fx .fx-nav .btn { min-height: 46px; padding: 0 20px; font-size: 15px; }
.fx .fx-nav .btn:last-child { flex: 1; max-width: 320px; margin-left: auto; }
.fx .fx-tpls { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .fx .fx-tpls { grid-template-columns: 1fr 1fr; } }
.fx .fx-tpl { border: 1px solid var(--rule); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; background: var(--surface); }
.fx .fx-tpl.off { opacity: .6; }
.fx .fx-tpl-h { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.fx .fx-tpl .btn { align-self: flex-start; margin-top: 6px; }
.fx .fx-outline { margin: 6px 0 0; padding-left: 20px; font-size: 13.5px; } .fx .fx-outline li { margin: 2px 0; } .fx .fx-outline small { color: var(--muted); }
.fx .fx-wlist { list-style: none; margin: 0; padding: 0; }
.fx .fx-wlist li { display: flex; gap: 10px; align-items: center; justify-content: space-between; border-top: 1px solid var(--rule); padding: 10px 0; }
.fx .fx-wlist li:first-child { border-top: 0; }
.fx .fx-wlist li > div { min-width: 0; }
.fx .fx-wlist .fx-wl { flex: 1; min-width: 0; text-align: left; display: flex; flex-direction: column; gap: 2px; padding: 4px 0; }
.fx .fx-wlist .fx-wl b { font-size: 16px; }
.fx .cs { font-size: 12.5px; color: var(--muted); }
.fx .fx-acc { list-style: none; margin: 0; padding: 0; }
.fx .fx-acc li { display: grid; grid-template-columns: 1fr; gap: 6px; border-top: 1px solid var(--rule); padding: 10px 0; }
.fx .fx-acc li:first-child { border-top: 0; }
@media (min-width: 560px) { .fx .fx-acc li { grid-template-columns: 1fr 210px; align-items: center; } }
.fx .fx-acc li.fx-acc-ai > a.btn { justify-self: start; text-decoration: none; }
@media (min-width: 560px) { .fx .fx-acc li.fx-acc-ai > a.btn { justify-self: end; } }
.fx .fx-remind { border-left: 3px solid var(--accent); }
.fx .fx-remind h3 { margin-bottom: 4px; }
.fx .fx-remind a.btn { display: inline-flex; margin-top: 8px; text-decoration: none; }
.fx .fx-map { display: grid; grid-template-columns: 1fr; gap: 6px; }
@media (min-width: 560px) { .fx .fx-map { grid-template-columns: 1fr 1fr; } }
.fx .fx-maprow { display: grid; grid-template-columns: minmax(90px, 40%) 1fr; gap: 8px; align-items: center; font-size: 13.5px; }
.fx .fx-maprow span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.fx .fx-kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 12px 0; }
@media (min-width: 560px) { .fx .fx-kpis { grid-template-columns: repeat(4, 1fr); } }
.fx .fx-kpis div { background: var(--bg); border: 1px solid var(--rule); border-radius: 12px; padding: 8px 10px; display: flex; flex-direction: column; }
.fx .fx-kpis b { font-family: "Instrument Serif", Georgia, serif; font-weight: 400; font-size: 28px; line-height: 1.05; }
.fx .fx-kpis span { font-size: 12px; color: var(--muted); }
.fx .fx-tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--rule); border-radius: 12px; margin-bottom: 12px; }
.fx .fx-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.fx .fx-table th, .fx .fx-table td { text-align: left; padding: 7px 9px; border-top: 1px solid var(--rule); white-space: nowrap; }
.fx .fx-table th { border-top: 0; color: var(--muted); font-weight: 600; font-size: 12px; background: var(--bg); }
.fx .fx-done { background: #dcf3e8; color: #0f5136; border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-top: 12px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fx .fx-done { background: #12352a; color: #b5ecd2; } }
.fx .fx-sum { list-style: none; margin: 0; padding: 0; }
.fx .fx-sum li { display: grid; grid-template-columns: 22px 120px 1fr; gap: 8px; padding: 9px 0; border-top: 1px solid var(--rule); font-size: 14px; align-items: start; }
.fx .fx-sum li:first-child { border-top: 0; }
.fx .fx-sum li span { color: var(--muted); } .fx .fx-sum li.ok span { color: #22a06b; }
.fx .fx-sum em { font-style: normal; color: var(--muted); overflow-wrap: anywhere; }
.fx-det summary, .fx .fx-det summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 14px; padding: 6px 0; list-style: none; }
.fx-det summary::-webkit-details-marker { display: none; }
.fx-det summary::before { content: "›"; display: inline-block; margin-right: 6px; transition: transform .15s; }
.fx-det[open] > summary::before { transform: rotate(90deg); }

/* builder */
.fx .fx-bhead .fx-title h3, .fx .fx-bhead .fx-title input { font-family: "Instrument Serif", Georgia, serif; font-size: 26px; font-weight: 400; margin: 0; }
.fx .fx-bhead .fx-title input { border-color: transparent; padding: 2px 6px; margin-left: -6px; background: transparent; }
.fx .fx-bhead .fx-title input:hover { border-color: var(--rule); }
.fx .fx-draftbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--rule); }
.fx .fx-draftbar .sp { flex: 1; }
.fx .fx-draftbar .note { margin: 0; }
.fx .fx-pub { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.fx .fx-pub .note { margin: 0; }
.fx .fx-pubb { display: flex; gap: 8px; justify-content: flex-end; }
.fx .fx-pubb .btn:last-child { flex: 0 1 200px; }
.fx .fx-legend { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; }
.fx .fx-legend .fx-i { color: var(--accent); }
.fx .fx-law { margin-top: 10px; background: #fdecd6; color: #6b3200; border-radius: 12px; padding: 10px 12px; font-size: 13.5px; }
.fx .fx-law .btn { margin-top: 8px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fx .fx-law { background: #3a2a14; color: #f6d3a8; } }
.fx .fx-stage { padding: 12px 10px 8px; }
.fx .fx-sh { display: flex; align-items: center; gap: 10px; margin: 0 4px 6px; }
.fx .fx-sh h3 { margin: 0; flex: 1; min-width: 0; }
.fx .fx-sh .fx-stname { flex: 1; min-width: 0; font-family: "Instrument Serif", Georgia, serif; font-size: 21px; border-color: transparent; background: transparent; padding: 2px 6px; min-height: 36px; }
.fx .fx-sh .fx-stname:hover { border-color: var(--rule); }
.fx .fx-sh small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.fx .fx-sn { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-size: 13px; font-weight: 600; }
.fx .fx-stepl { list-style: none; margin: 0; padding: 0; }
.fx .fx-step { border: 1px solid var(--rule); border-radius: 12px; margin: 6px 0; background: var(--surface); transition: box-shadow .15s; }
.fx .fx-step.law { border-left: 3px solid var(--accent); }
.fx .fx-step.open { box-shadow: 0 4px 18px rgba(20, 22, 28, .08); }
.fx .fx-step.dragging { box-shadow: 0 10px 30px rgba(20, 22, 28, .22); position: relative; z-index: 3; opacity: .96; }
.fx .fx-srow { display: flex; align-items: center; gap: 2px; min-height: 52px; padding-right: 4px; }
.fx .fx-grip { flex: none; width: 34px; align-self: stretch; display: grid; place-items: center; color: var(--muted); cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.fx .fx-grip .fx-i { width: 16px; height: 16px; }
.fx .fx-smain { flex: 1; min-width: 0; text-align: left; padding: 8px 6px 8px 10px; display: flex; flex-direction: column; gap: 1px; }
.fx .fx-grip + .fx-smain { padding-left: 0; }
.fx .fx-sname { font-size: 15px; font-weight: 500; display: flex; align-items: flex-start; }
.fx .fx-smain .cs { line-height: 1.35; }
.fx .fx-ud { display: flex; flex-direction: column; flex: none; }
.fx .fx-ud button { width: 40px; height: 26px; display: grid; place-items: center; color: var(--muted); border-radius: 6px; }
.fx .fx-ud button:hover:not([disabled]) { background: var(--notice); color: var(--ink); }
.fx .fx-ud button[disabled] { opacity: .25; }
.fx .fx-sed { padding: 4px 12px 12px; border-top: 1px dashed var(--rule); }
.fx .fx-rule { background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; margin: 10px 0; font-size: 14px; }
.fx .fx-rule b { display: flex; align-items: center; gap: 6px; color: var(--accent); }
.fx .fx-rule p { margin: 6px 0 0; }
.fx .fx-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 10px; }
@media (min-width: 560px) { .fx .fx-grid { grid-template-columns: 1fr 1fr; } .fx .fx-grid .wide, .fx .fx-grid .fx-tog { grid-column: 1 / -1; } }
.fx .fx-due { display: grid; grid-template-columns: 74px 1fr; gap: 6px; }
.fx .fx-add { width: 100%; text-align: left; color: var(--accent); font-weight: 600; font-size: 14px; padding: 10px 12px; border: 1px dashed var(--rule); border-radius: 12px; margin: 6px 0 4px; }
.fx .fx-add:hover { background: var(--accent-soft); }
.fx .fx-addstage { text-align: center; margin: 0; }
.fx .fx-gate { display: flex; gap: 10px; align-items: flex-start; margin: -2px 6px; padding: 10px 12px; border-radius: 12px; border: 1.5px dashed var(--accent); color: var(--ink); font-size: 13px; background: var(--surface); }
.fx .fx-gate > .fx-i { width: 20px; height: 20px; color: var(--accent); margin-top: 1px; }
.fx .fx-gate div { display: flex; flex-direction: column; gap: 2px; } .fx .fx-gate b { color: var(--accent); font-size: 14px; } .fx .fx-gate span { color: var(--muted); }
.fx .fx-gate span .fx-i { width: 12px; height: 12px; }
.fx .fx-hist { list-style: none; margin: 0; padding: 0; }
.fx .fx-hist li { display: flex; justify-content: space-between; gap: 10px; align-items: center; border-top: 1px solid var(--rule); padding: 9px 0; font-size: 14px; }
.fx .fx-hist li:first-child { border-top: 0; }

/* compliance */
.fx .fx-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.fx .fx-chips::-webkit-scrollbar { display: none; }
.fx .fx-chips button { flex: none; min-height: 40px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--rule); background: var(--surface); font-size: 13.5px; font-weight: 600; color: var(--muted); }
.fx .fx-chips button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.fx .fx-chips button.off { opacity: .5; }
.fx .fx-coolf { display: grid; grid-template-columns: 1fr; gap: 10px; align-items: end; }
@media (min-width: 560px) { .fx .fx-coolf { grid-template-columns: 1fr auto; } .fx .fx-coolf .fld:first-child:not(:last-of-type) { grid-column: 1 / -1; } }
.fx .fx-coolf .btn { min-height: 42px; }
.fx .fx-coolr { margin-top: 14px; padding: 14px; border-radius: 14px; background: var(--accent-soft); }
.fx .fx-big { font-family: "Instrument Serif", Georgia, serif; font-size: 28px; line-height: 1.1; color: var(--accent); }
.fx .fx-days { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.fx .fx-days li { display: flex; flex-direction: column; padding: 6px 9px; border-radius: 10px; background: var(--surface); font-size: 12.5px; border: 1px solid var(--rule); }
.fx .fx-days li em { font-style: normal; color: var(--muted); font-size: 11.5px; }
.fx .fx-days li.c { border-color: var(--accent); } .fx .fx-days li.c em { color: var(--accent); }
.fx .fx-days li.s { opacity: .75; }
.fx .fx-law-l { list-style: none; margin: 0; padding: 0; }
.fx .fx-law-l li { border-top: 1px solid var(--rule); padding: 9px 0; font-size: 14px; }
.fx .fx-law-l li:first-child { border-top: 0; }
.fx .fx-law-l li p { margin: 4px 0 0 21px; }
.fx .fx-law-l li .note { margin-top: 3px; }
.fx .fx-lh { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fx .fx-lh .fx-i { color: var(--accent); }
.fx .fx-dot { width: 15px; display: inline-flex; justify-content: center; } .fx .fx-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--rule); }
.fx .fx-notes { margin: 0; padding-left: 18px; font-size: 14px; } .fx .fx-notes li { margin: 5px 0; }
.fx .fx-hol { list-style: none; margin: 8px 0 0; padding: 0; columns: 2; column-gap: 16px; font-size: 13px; }
.fx .fx-hol li { break-inside: avoid; padding: 3px 0; } .fx .fx-hol span { display: inline-block; min-width: 96px; color: var(--muted); }
@media (max-width: 480px) { .fx .fx-hol { columns: 1; } }

/* record panel (in the CRM's record sheet) */
.fx-run .fx-runc { border-top: 1px solid var(--rule); padding-top: 10px; margin-top: 6px; }
.fx-run h3 + .fx-runc { border-top: 0; padding-top: 0; margin-top: 0; }
.fx-run .fx-rh { display: flex; flex-direction: column; gap: 1px; }
.fx-run .fx-rh b { font-size: 15px; }
.fx-run .cs { font-size: 12.5px; color: var(--muted); }
.fx-run .fx-rstat { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.fx-run .fx-rstat b { color: var(--ink); }
.fx-run .fx-held { background: #fdecd6; color: #6b3200; border-radius: 10px; padding: 8px 10px; font-size: 13px; margin-bottom: 8px; display: flex; flex-direction: column; gap: 4px; }
.fx-run .fx-held .fx-i { color: #a14b00; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fx-run .fx-held { background: #3a2a14; color: #f6d3a8; } }
.fx-run .fx-next { list-style: none; margin: 0; padding: 0; }
.fx-run .fx-rs { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--rule); min-height: 50px; padding: 6px 0; }
.fx-run .fx-rs:first-child { border-top: 0; }
.fx-run .fx-rs .tick { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--rule); color: #fff; font-size: 14px; }
.fx-run .fx-rs .tick.on { background: #22a06b; border-color: #22a06b; }
.fx-run .fx-rs.late .ct { color: #c2410c; }
.fx-run .fx-rs.done .ct { color: var(--muted); }
.fx-run .fx-rsm { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fx-run .fx-rsm .ct { font-size: 14.5px; font-weight: 500; display: block; }
.fx-run .fx-lock .fx-i { width: 13px; height: 13px; }
.fx-run .fx-skip { flex: none; font-size: 12.5px; color: var(--muted); padding: 8px 6px; min-height: 40px; }
.fx-run .fx-moves { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin: 10px 0 4px; }
.fx-run .fx-block { border: 1.5px solid #e8a33d; border-radius: 12px; padding: 10px 12px; margin: 8px 0; font-size: 14px; }
.fx-run .fx-block b { display: flex; gap: 6px; align-items: center; color: #a14b00; }
.fx-run .fx-block ul { margin: 6px 0; padding-left: 20px; }
.fx-run .fx-block small { color: var(--muted); }
.fx-run .fx-sub.done { color: #22a06b; } .fx-run .fx-sub.current { color: var(--accent); }
.fx-run .fx-det { margin-top: 4px; }
.fx-run .fx-audl { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.fx-run .fx-audl li { border-top: 1px solid var(--rule); padding: 6px 0; display: flex; flex-direction: column; }
.fx-run .fx-audl span, .fx-run .fx-audl em { color: var(--muted); font-size: 11.5px; font-style: normal; }
.fx-run .fx-rfoot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; border-top: 1px solid var(--rule); padding-top: 6px; }
.fx-run .fx-start .btn { margin-top: 8px; }
.fx-run .fx-start .fld { margin-bottom: 6px; }
.fx-toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 90; max-width: min(92vw, 460px);
  background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 12px; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.fx-toast.bad { background: #b42318; color: #fff; }

/* rules detail, facts, compliance extras (27 Oct 2026, real packs) */
.fx-rule .fx-why, .fx-run .fx-why { font-weight: 500; }
.fx .fx-check, .fx-run .fx-check { margin: 4px 0 0; padding-left: 20px; font-size: 13px; } .fx .fx-check li, .fx-run .fx-check li { margin: 3px 0; }
.fx-run .fx-rule { background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; margin: 4px 0 8px; font-size: 13.5px; }
.fx-run .fx-rule b { display: flex; align-items: center; gap: 6px; color: var(--accent); }
.fx-run .fx-rule p { margin: 6px 0 0; }
.fx-run .fx-rs { flex-wrap: wrap; }
.fx-run .fx-rs .fx-rsm { text-align: left; padding: 0; }
.fx-run .fx-rs .fx-rd { flex-basis: 100%; padding-left: 38px; }
.fx-run .fx-rs.na .ct { text-decoration: line-through; text-decoration-color: var(--rule); }
.fx-run .fx-rs.na .tick.on { background: var(--muted); border-color: var(--muted); }
.fx-run .fx-facts { border: 1px solid var(--rule); border-radius: 12px; padding: 8px 10px; margin-bottom: 8px; }
.fx-run .fx-fh { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; display: flex; gap: 8px; align-items: center; }
.fx-run .fx-fact { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 5px 0; font-size: 14px; border-top: 1px solid var(--rule); }
.fx-run .fx-fh + .fx-fact { border-top: 0; }
.fx-run .fx-fact small { color: var(--muted); font-size: 11.5px; }
.fx-run .fx-fact.unk > span:first-child { font-weight: 600; }
.fx-run .fx-yn { display: inline-flex; border: 1px solid var(--rule); border-radius: 999px; overflow: hidden; flex: none; }
.fx-run .fx-yn button { padding: 6px 14px; font-size: 13.5px; min-width: 56px; min-height: 40px; color: var(--muted); }
.fx-run .fx-yn button + button { border-left: 1px solid var(--rule); }
.fx-run .fx-yn button.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.fx-run .fx-facts .note { margin-top: 4px; }
.fx .fx-seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 999px; overflow: hidden; margin-bottom: 10px; max-width: 100%; }
.fx .fx-seg button { min-height: 40px; padding: 7px 13px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.fx .fx-seg button + button { border-left: 1px solid var(--rule); }
.fx .fx-seg button.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.fx .fx-stg { border-top: 1px solid var(--rule); }
.fx .fx-stg:first-of-type { border-top: 0; }
.fx .fx-stg > summary { cursor: pointer; list-style: none; padding: 10px 0; font-weight: 600; font-size: 15px; display: flex; justify-content: space-between; gap: 10px; }
.fx .fx-stg > summary::-webkit-details-marker { display: none; }
.fx .fx-stg > summary small { color: var(--muted); font-weight: 400; font-size: 12.5px; }
.fx .fx-stg > summary::after { content: "+"; color: var(--accent); font-weight: 400; font-size: 18px; line-height: 1; }
.fx .fx-stg[open] > summary::after { content: "–"; }
.fx .fx-chg { list-style: none; margin: 0; padding: 0; }
.fx .fx-chg li { border-top: 1px solid var(--rule); padding: 8px 0; font-size: 14px; display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: baseline; }
.fx .fx-chg li:first-child { border-top: 0; }
.fx .fx-chg li .note { flex-basis: 100%; margin: 0; }
.fx .fx-acsum { font-size: 14px; margin-bottom: 4px; } .fx .fx-acsum .fx-bar { margin-top: 6px; }
.fx .fx-acl { list-style: none; margin: 0; padding: 0; }
.fx .fx-acl li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; border-top: 1px solid var(--rule); padding: 7px 0; }
.fx .fx-acl li:first-child { border-top: 0; }
.fx .fx-acl .tick { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--rule); color: #fff; font-size: 14px; }
.fx .fx-acl .tick.on { background: #22a06b; border-color: #22a06b; }
.fx .fx-acm { flex: 1; min-width: 0; text-align: left; display: flex; flex-direction: column; }
.fx .fx-acm .ct { font-size: 14.5px; font-weight: 500; }
.fx .fx-acl li.done .ct { color: var(--muted); }
.fx .fx-acl .fx-rd { flex-basis: 100%; padding-left: 38px; }
.fx-run .fx-known summary { font-weight: 400; font-size: 13px; color: var(--muted); }
.fx-run .fx-known summary::before { color: var(--accent); }
.fx-run .fx-known .fx-chg-l { color: var(--accent); margin-left: 4px; }
.fx-run .fx-rsm .ct, .fx .fx-acm .ct { white-space: normal; overflow: visible; }
.fx .fx-seg { overflow-x: auto; scrollbar-width: none; } .fx .fx-seg::-webkit-scrollbar { display: none; }

/* ───── import (Setup > Bring your data; engine/import/). One decision per screen, phone first. ───── */
.fx .imp { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.fx .imp-drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; padding: 28px 16px;
  border: 2px dashed var(--rule); border-radius: 16px; background: var(--surface); cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.fx .imp-drop:hover, .fx .imp-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.fx .imp-drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.fx .imp-drop b { font-size: 18px; } .fx .imp-drop > span:not(.imp-drop-i) { color: var(--accent); font-weight: 600; font-size: 14.5px; }
.fx .imp-drop small { color: var(--muted); font-size: 12.5px; max-width: 420px; line-height: 1.4; margin-top: 4px; }
.fx .imp-drop-i { width: 44px; height: 44px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 4px; }
.fx .imp-drop-i svg { width: 24px; height: 24px; }
.fx .imp-conn { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 560px) { .fx .imp-conn { grid-template-columns: repeat(3, 1fr); } }
.fx .imp-c { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 12px 14px; min-height: 64px; border: 1px solid var(--rule); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.fx .imp-c:hover:not([disabled]) { border-color: var(--accent); }
.fx .imp-c b { font-size: 15px; } .fx .imp-c span { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.fx .imp-c[disabled] { opacity: .6; cursor: default; }
.fx .imp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fx .imp-chip { min-height: 40px; padding: 0 12px; border-radius: 18px; border: 1px solid var(--rule); background: var(--surface); color: var(--ink); font: inherit; font-size: 13.5px; cursor: pointer; }
.fx .imp-chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.fx .imp-guide .btn { margin-top: 8px; }
.fx .imp-card { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--rule); border-radius: 14px; background: var(--surface); }
.fx .imp-card > b { font-size: 16px; }
.fx .imp-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-top: 4px; }
.fx .imp-row .btn { flex: 1 1 140px; }
.fx .imp-go { font-size: 16px; }
.fx .imp-link { align-self: flex-start; background: none; border: 0; padding: 4px 0; color: var(--accent); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; text-align: left; }
.fx .imp-pre { white-space: pre-line; }
.fx .imp-busy i { animation: imp-slide 1.4s ease-in-out infinite alternate; }
@keyframes imp-slide { from { margin-left: 0; } to { margin-left: 65%; } }
@media (prefers-reduced-motion: reduce) { .fx .imp-busy i { animation: none; } }
.fx .imp-dots { display: flex; gap: 6px; } .fx .imp-dots i { flex: 1; height: 4px; border-radius: 4px; background: var(--notice); } .fx .imp-dots i.on { background: var(--accent); }
.fx .imp-h { font-family: "Instrument Serif", Georgia, serif; font-weight: 400; font-size: 26px; line-height: 1.15; margin: 4px 0 2px; overflow-wrap: anywhere; }
.fx .imp-src { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.fx .imp-src select { width: auto; flex: 1; max-width: 260px; min-height: 36px; font-size: 14px; }
.fx .imp-sample, .fx .imp-hist, .fx .imp-unsure, .fx .imp-facts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.fx .imp-sample li { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 12px; background: var(--surface); min-width: 0; }
.fx .imp-sample b { font-size: 14.5px; } .fx .imp-sample span { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.fx .imp-tags { display: flex; flex-wrap: wrap; gap: 4px; } .fx .imp-tags:empty { display: none; }
.fx .imp-tags em { font-style: normal; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); }
.fx .imp-tags em.warn { background: #fdecd6; color: #a14b00; } .fx .imp-tags em.ok { background: #dcf3e8; color: #13744a; }
.fx .imp-unsure li { display: grid; grid-template-columns: 1fr; gap: 6px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 12px; background: var(--surface); }
@media (min-width: 560px) { .fx .imp-unsure li { grid-template-columns: 1fr 1fr; align-items: center; } }
.fx .imp-unsure li > div { display: flex; flex-direction: column; min-width: 0; } .fx .imp-unsure .cs { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.fx .imp-facts li { position: relative; padding: 8px 12px 8px 30px; border-radius: 12px; background: var(--bg); font-size: 14px; line-height: 1.4; }
.fx .imp-facts li::before { content: ""; position: absolute; left: 12px; top: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.fx .imp-hist li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 12px; background: var(--surface); }
.fx .imp-hist li > div { display: flex; flex-direction: column; min-width: 0; } .fx .imp-hist b { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; } .fx .imp-hist .cs { font-size: 12px; color: var(--muted); }
.fx .imp-q { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: #fdecd6; color: #a14b00; font-style: normal; font-size: 11px; font-weight: 700; margin-left: 4px; }
.fx .imp-cols summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 14px; padding: 6px 0; }
.fx .imp-done { font-size: 15px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fx .imp-tags em.warn, :root:not([data-theme="light"]) .fx .imp-q { background: #3a2a14; color: #f2b366; }
  :root:not([data-theme="light"]) .fx .imp-tags em.ok { background: #12352a; color: #6fd3a5; } }
:root[data-theme="dark"] .fx .imp-tags em.warn, :root[data-theme="dark"] .fx .imp-q { background: #3a2a14; color: #f2b366; }
:root[data-theme="dark"] .fx .imp-tags em.ok { background: #12352a; color: #6fd3a5; }

/* 28 Oct 2026 UX pass: bigger hit areas for the round ticks (the circle stays 28px), the inline reason box, busy rows */
.fx-run .fx-rs .tick, .fx .fx-acl .tick { position: relative; }
.fx-run .fx-rs .tick::after, .fx .fx-acl .tick::after { content: ""; position: absolute; inset: -8px; }
.fx-run .fx-ask { list-style: none; padding: 0 0 6px; }
.fx-run .fx-ask .fx-block, .fx-run li.fx-ask { border: 1.5px solid var(--rule); border-radius: 12px; padding: 10px 12px; margin: 4px 0 8px; font-size: 14px; }
.fx-run .fx-block .fld, .fx-run .fx-ask .fld { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.fx .fx-wl.busy { opacity: .55; }
.fx-run .fx-rfoot .btn { min-height: 40px; }
/* Setup > Connect accounts: live status from Connections (28 Oct 2026) */
.fx .fx-pill.mute { background: var(--notice); color: var(--muted); font-weight: 500; }
.fx .fx-cx li, .fx .fx-cx li:first-child { grid-template-columns: 1fr auto; align-items: center; gap: 10px; }
.fx .fx-cx + .fx-sub { margin-top: 14px; }

/* ───── Desktop (28 Oct 2026): use the width. Setup: the steps down the left, the step beside them. Workflows: the list
   beside how it works; in a workflow each stage's name sits beside its steps. Compliance: the rules beside the cooling-off
   calculator. Keyed off fx-t-<tab> / fx-l-<screen> classes that carry no styles below 1024px. ───── */
@media (min-width: 1024px) {
  .fx { gap: 16px; }
  /* Setup */
  .fx.fx-t-setup { display: grid; grid-template-columns: 210px minmax(0, 1fr); grid-auto-flow: row dense; column-gap: 22px; row-gap: 14px; align-items: start; }
  .fx.fx-t-setup > * { grid-column: 2; min-width: 0; }
  .fx.fx-t-setup > .fx-hero, .fx.fx-t-setup > .hv-next { grid-column: 1 / -1; }
  .fx.fx-t-setup > .fx-steps { grid-column: 1; grid-row: span 2; position: sticky; top: 12px; flex-direction: column; gap: 2px; overflow: visible; padding: 6px; background: var(--surface); border: 1px solid var(--rule); border-radius: 16px; }
  .fx .fx-steps button { width: 100%; min-height: 38px; border: 0; border-radius: 10px; padding: 5px 10px 5px 6px; background: none; color: var(--ink); text-align: left; white-space: normal; line-height: 1.25; }
  .fx .fx-steps button:hover { background: var(--notice); }
  .fx .fx-steps button.on { background: var(--accent-soft); color: var(--accent); }
  .fx .fx-steps button span { flex: none; }
  .fx.fx-t-setup > .fx-nav { position: static; padding: 2px 0 0; background: none; }
  .fx .fx-nav .btn { min-height: 42px; }
  /* Workflows: the list beside "How workflows work" */
  .fx.fx-l-list { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; gap: 16px; }
  .fx.fx-l-list > * { min-width: 0; }
  .fx .fx-wlist .fx-wl { cursor: pointer; }
  .fx .fx-wlist li:hover .fx-wl b { color: var(--accent); }
  .fx.fx-l-new .fx-tpls { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
  /* a workflow: in each stage the name and count on the left, its steps on the right */
  .fx.fx-l-builder .fx-stage { display: grid; grid-template-columns: 170px minmax(0, 1fr); column-gap: 18px; align-items: start; padding: 16px 16px 12px; }
  .fx.fx-l-builder .fx-stage > * { grid-column: 2; min-width: 0; }
  .fx.fx-l-builder .fx-stage > .fx-sh { grid-column: 1; grid-row: 1 / span 2; position: sticky; top: 12px; flex-wrap: wrap; align-items: flex-start; margin: 6px 0 0; row-gap: 4px; }
  .fx.fx-l-builder .fx-stage > .fx-sh h3, .fx.fx-l-builder .fx-stage > .fx-sh .fx-stname { flex: 1 1 140px; }
  .fx.fx-l-builder .fx-stage > .fx-sh small { flex-basis: 100%; padding-left: 36px; }
  .fx.fx-l-builder .fx-stepl > .fx-step:first-child { margin-top: 0; }
  .fx.fx-l-builder .fx-gate { margin: -4px 0 -4px 204px; }
  .fx .fx-srow { min-height: 46px; }
  .fx .fx-smain { cursor: pointer; }
  .fx .fx-step:not(.open):hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--rule)); }
  .fx .fx-step.law:not(.open):hover { border-left-color: var(--accent); }
  /* Compliance (side by side from 1280px, below) */
  .fx.fx-t-compliance > .fx-chips { flex-wrap: wrap; overflow: visible; }
  .fx .fx-stg > summary:hover { color: var(--accent); }
  /* mouse: smaller targets, hover and focus */
  .fx .btn.sm, .fx-run .btn.sm { min-height: 34px; }
  .fx .fx-chips button, .fx .fx-seg button { min-height: 36px; }
  .fx .fx-chips button:not(.on):hover { color: var(--ink); border-color: var(--muted); }
  .fx .fx-x { width: 34px; height: 34px; }
  .fx .fx-backlink { min-height: 36px; }
  .fx .fx-backlink:hover { text-decoration: underline; }
  .fx .btn:hover:not([disabled]), .fx-run .btn:hover:not([disabled]) { filter: brightness(1.08); }
  .fx .btn.ghost:hover:not([disabled]), .fx-run .btn.ghost:hover:not([disabled]) { filter: none; border-color: var(--accent); }
  .fx button:focus-visible, .fx summary:focus-visible, .fx-run button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .fx-toast { bottom: 32px; left: calc(50% + var(--side-w, 240px) / 2); }
}
@media (min-width: 1280px) {
  body:not(.chat-docked) .fx.fx-t-setup { grid-template-columns: 240px minmax(0, 1fr); }
  body:not(.chat-docked) .fx.fx-l-builder .fx-stage { grid-template-columns: 210px minmax(0, 1fr); column-gap: 20px; }
  body:not(.chat-docked) .fx.fx-l-builder .fx-gate { margin-left: 246px; }
  /* Compliance: the rules on the left, the cooling-off calculator beside them */
  body:not(.chat-docked) .fx.fx-t-compliance { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); grid-auto-flow: row dense; align-items: start; gap: 16px; }
  body:not(.chat-docked) .fx.fx-t-compliance > * { grid-column: 1; min-width: 0; }
  body:not(.chat-docked) .fx.fx-t-compliance > .fx-chips { grid-column: 1 / -1; }
  body:not(.chat-docked) .fx.fx-t-compliance > .fx-cool { grid-column: 2; grid-row: 2 / span 3; position: sticky; top: 12px; }
}
@media (min-width: 1440px) {
  body:not(.chat-docked) .fx.fx-t-setup { grid-template-columns: 270px minmax(0, 1fr); }
  body:not(.chat-docked) .fx.fx-l-builder .fx-stage { grid-template-columns: 240px minmax(0, 1fr); }
  body:not(.chat-docked) .fx.fx-l-builder .fx-gate { margin-left: 276px; }
}
