/* Forms: the list, and the editor as a guided setup: a rail of six sections, one section on
   screen with Back and Next under it, and the live preview beside it (a sheet on a phone).
   portal.css tokens only, so light and dark both work; the one colour here that is not a token
   is whatever the contractor picks for their own form, and that lives inside the preview. */

/* Back: the chevron and its words, a quiet 28px text button (measurement-detail.css draws the
   bare md-back as an icon; these pages keep the word). */
.md-back.lf-back { display: inline-flex; align-items: center; align-self: flex-start; justify-self: start; gap: 2px; width: auto; height: 28px;
  margin: 0 0 -4px -6px; padding: 0 8px 0 4px; border: 0; border-radius: var(--radius-control); background: transparent;
  color: var(--ink-2); font-size: 13px; font-weight: 500; cursor: pointer; transition: background var(--motion-fast), color var(--motion-fast) }
.md-back.lf-back svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round }
.md-back.lf-back:hover { background: var(--surface-3); color: var(--ink) }
.md-back.lf-back:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px }
@media (pointer: coarse) { .md-back.lf-back { width: auto; height: 44px } }

.lf-list { overflow: hidden }
.lf-list > .empty { text-align: center }
/* A row: the link (diagram, name, numbers) and, outside it, the form's on/off switch. */
.lf-row { display: flex; align-items: center; gap: 4px; padding-right: 16px; border-bottom: 1px solid var(--line);
  transition: background var(--motion-fast) }
.lf-row:last-child { border-bottom: 0 }
.lf-row:hover { background: var(--surface-2) }
.lf-row-link { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 16px; align-items: center; flex: 1 1 auto; min-width: 0;
  min-height: 56px; padding: 8px 16px; color: var(--ink); text-decoration: none }
.lf-row.has-stats .lf-row-link { grid-template-columns: 48px minmax(0, 1fr) auto auto; gap: 24px }
.lf-row-link:hover { text-decoration: none }
.lf-row-link:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; border-radius: var(--radius-control) }
.lf-row .lf-row-switch { flex: none; gap: 0; min-height: 32px; margin: 0; padding: 0 0 0 12px }
.lf-row-switch .switch-text { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0 }
.lf-row.off .lf-row-name { color: var(--ink-3) }
.lf-row .lf-diagram { width: 48px; height: 32px }
.lf-row-main { display: grid; gap: 2px; min-width: 0 }
.lf-row-name { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.lf-row-meta { font-size: 12px; color: var(--ink-3) }
.lf-row-brief { display: none; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums }
.lf-row-count { display: grid; justify-items: end; font-variant-numeric: tabular-nums; min-width: 56px }
.lf-row-count strong { font-size: 15px; font-weight: 600; letter-spacing: -.01em; line-height: 1.3 }
.lf-row-count span { font-size: 12px; color: var(--ink-3) }
.lf-row-stats { display: flex; gap: 20px }
.lf-row-stat { display: grid; justify-items: end; min-width: 52px; font-variant-numeric: tabular-nums }
.lf-row-stat strong { font-size: 13px; font-weight: 500; color: var(--ink-2); line-height: 1.4 }
.lf-row-stat span { font-size: 12px; color: var(--ink-3) }
/* Insights: a quiet button on the row, and under the row while open, the form's last 30 days. */
.lf-row .lf-row-insights { flex: none; gap: 6px; min-height: 32px; height: 32px; padding: 0 10px; font-size: 12px; font-weight: 500;
  color: var(--ink-2) }
.lf-row .lf-row-insights svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round }
.lf-row .lf-row-insights[aria-expanded="true"] { color: var(--brand-ink); background: var(--brand-soft) }
.lf-row.lf-row-open { background: var(--surface-2) }
.lf-insights { padding: 16px 16px 18px 80px; border-bottom: 1px solid var(--line); background: var(--surface) }
.lf-insights:last-child { border-bottom: 0 }
.lf-insights-body { display: grid; gap: 14px; min-width: 0 }
.lf-insights-when { margin: 0; font-size: 12px; font-weight: 500; color: var(--ink-3) }
.lf-insights-figures { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 0 }
.lf-insights-figure { display: flex; flex-direction: column; gap: 1px }
.lf-insights-figure dt { order: 2; font-size: 12px; color: var(--ink-3) }
.lf-insights-figure dd { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; color: var(--ink);
  font-variant-numeric: tabular-nums }
.lf-insights-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 32px }
.lf-insights-block { display: grid; gap: 8px; align-content: start; min-width: 0 }
h3.lf-insights-title { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: 0; color: var(--ink-2) }
.lf-bars, .lf-top { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none }
.lf-bar-row { display: grid; grid-template-columns: minmax(64px, 104px) minmax(0, 1fr) 44px 48px; gap: 10px; align-items: center;
  font-size: 12px; line-height: 16px }
.lf-bar-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink) }
.lf-bar { display: block; height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden }
.lf-bar-fill { display: block; height: 100%; min-width: 2px; border-radius: 4px; background: var(--brand) }
.lf-bar-count, .lf-bar-share, .lf-top-count { text-align: right; font-variant-numeric: tabular-nums }
.lf-bar-count { color: var(--ink) }
.lf-bar-share { color: var(--ink-3) }
.lf-top-row { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; line-height: 16px; min-width: 0 }
.lf-top-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink) }
.lf-top-count { flex: none; color: var(--ink-2) }
.lf-insights-none, .lf-insights-note { margin: 0; font-size: 12px; color: var(--ink-3) }
/* Outside your service area: how many asked from where the business does not work yet, and from
   which ZIP codes and towns. Counts and place names only. */
.lf-insights-outside { padding-top: 14px; border-top: 1px solid var(--line) }
.lf-outside-lead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; margin: 0; font-size: 13px; line-height: 18px;
  color: var(--ink-2) }
.lf-outside-count { font-size: 18px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; color: var(--ink);
  font-variant-numeric: tabular-nums }
.lf-outside-parts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 32px; min-width: 0 }
.lf-outside-part { display: grid; gap: 6px; align-content: start; min-width: 0 }
h4.lf-outside-title { margin: 0; font-size: 12px; font-weight: 500; letter-spacing: 0; color: var(--ink-3) }

.lf-diagram { display: block }
.lf-d-page { fill: var(--surface); stroke: var(--line-2); stroke-width: 1.25 }
.lf-d-block, .lf-d-text { fill: var(--surface-3) }
.lf-d-form { fill: var(--brand-soft); stroke: var(--brand); stroke-width: 1.25 }

/* The page header: the name typed right in the title, and the form's own numbers under it. */
.lf-head { display: block }
.lf-head-text { display: grid; gap: 12px; min-width: 0 }
/* The name, and the on/off switch at the top right of the page. */
.lf-head-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-width: 0 }
.lf-head-top .lf-title { flex: 1 1 auto }
.lf-head .lf-head-switch { flex: none; gap: 8px; min-height: 32px; margin: 0; font-size: 13px; font-weight: 500; color: var(--ink-2); white-space: nowrap }
.lf-title { margin: 0; min-width: 0 }
.lf-head input.lf-title-input { display: block; width: 100%; max-width: 680px; min-height: 36px; height: auto; margin: 0 0 0 -8px; padding: 2px 8px;
  border: 1px solid transparent; border-radius: var(--radius-control); background: transparent; color: var(--ink);
  font: inherit; font-size: inherit; font-weight: inherit; letter-spacing: inherit; line-height: 1.2; text-overflow: ellipsis;
  transition: border-color var(--motion-fast), background var(--motion-fast) }
/* ios.css keeps every input at 16px with !important so iOS does not zoom; the title is larger
   than that, so it may keep the heading's own size. */
.lf-head h1.lf-title input.lf-title-input { font-size: inherit !important }
.lf-head input.lf-title-input:hover { border-color: var(--line-2) }
.lf-head input.lf-title-input:focus { outline: none; border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 3px var(--focus-ring) }
.lf-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; padding: 12px 16px; border: 1px solid var(--line);
  border-radius: var(--radius-card); background: var(--surface) }
.lf-stats-when { margin: 0; font-size: 12px; font-weight: 500; color: var(--ink-3) }
.lf-stat-figures { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0 }
.lf-stat dt { font-size: 12px; color: var(--ink-3); order: 2 }
.lf-stat dd { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; color: var(--ink);
  font-variant-numeric: tabular-nums; order: 1 }
.lf-stat { display: flex; flex-direction: column; gap: 1px }
.lf-stat-lists { display: grid; gap: 4px; margin: 0; min-width: 0; flex: 1 1 260px }
.lf-stat-list { display: flex; gap: 8px; min-width: 0; font-size: 12px; line-height: 1.5 }
.lf-stat-list dt { flex: none; color: var(--ink-3) }
.lf-stat-list dd { margin: 0; min-width: 0; color: var(--ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere }

.lf-layouts, .lf-services { margin: 0; padding: 0; border: 0; min-width: 0 }
.lf-layouts legend, .lf-services legend { padding: 0; margin-bottom: 8px }
.lf-layout-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px }
.lf-layout { position: relative; display: grid; gap: 8px; padding: 8px; border: 1px solid var(--line-2);
  border-radius: var(--radius-card); background: var(--surface); cursor: pointer;
  transition: border-color var(--motion-fast), background var(--motion-fast) }
.lf-layout:hover { border-color: var(--brand-line) }
.lf-layout.selected { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand) }
.lf-layout-input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0 }
.lf-layout:focus-within { outline: 2px solid var(--focus); outline-offset: 2px }
.lf-layout .lf-diagram { width: 100%; height: auto; max-height: 64px }
.lf-layout-words { display: grid; gap: 1px; font-weight: 400 }
.lf-layout-words strong { font-size: 13px; font-weight: 500; color: var(--ink) }
.lf-layout-words span { font-size: 12px; color: var(--ink-3) }

/* The Look group: colour tiles, sliders, Glass, the font and the corners. */
.lf-look { display: grid; gap: 12px; min-width: 0; padding-top: 20px; border-top: 1px solid var(--line) }
.lf-look-head { display: flex; align-items: center; justify-content: space-between; gap: 12px }
.lf-look-title { font-size: 13px; font-weight: 600 }
.lf-look-reset:disabled { opacity: .45; cursor: default; text-decoration: none }
.lf-look-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px }
.lf-look-tile { display: grid; align-content: start; gap: 10px; min-width: 0; padding: 12px;
  border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface) }
.lf-look-tile .switch-row { min-height: 44px; margin: 0 }
.lf-color { display: flex; align-items: center; gap: 8px; min-width: 0 }
.lf-color input[type=color] { width: 44px; height: 44px; min-height: 44px; padding: 3px; border: 1px solid var(--line-2);
  border-radius: var(--radius-control); background: var(--surface); cursor: pointer; flex: none }
.lf-color input[type=color]:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px }
.lf-main .lf-color input.lf-hex { flex: 1 1 auto; width: auto; min-width: 0; max-width: 140px; font-variant-numeric: tabular-nums; text-transform: uppercase }
.lf-hex[aria-invalid=true], .lf-field textarea[aria-invalid=true] { border-color: var(--rust) }
.lf-range { display: grid; gap: 2px; min-width: 0; margin: 0; font-weight: 400; cursor: pointer }
.lf-range-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px }
.lf-range-value { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums }
.lf-main input.lf-range-input { display: block; width: 100%; min-height: 36px; height: 36px; margin: 0; padding: 0; border: 0;
  background: transparent; accent-color: var(--brand); cursor: pointer }
.lf-main input.lf-range-input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-control) }
/* A quiet track in the theme's own greys and a brand-ringed thumb, instead of the browser's
   heavy dark track. */
.lf-main input.lf-range-input { -webkit-appearance: none; appearance: none }
.lf-main input.lf-range-input::-webkit-slider-runnable-track { height: 4px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-2) }
.lf-main input.lf-range-input::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 16px; height: 16px; margin-top: -7px;
  border: 1.5px solid var(--brand); border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-thumb); transition: transform var(--motion-fast) }
.lf-main input.lf-range-input:active::-webkit-slider-thumb { transform: scale(1.12) }
.lf-main input.lf-range-input::-moz-range-track { height: 4px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-2) }
.lf-main input.lf-range-input::-moz-range-progress { height: 4px; border-radius: 999px; background: var(--brand) }
.lf-main input.lf-range-input::-moz-range-thumb { width: 14px; height: 14px; border: 1.5px solid var(--brand); border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-thumb) }
@media (prefers-reduced-motion: reduce) { .lf-main input.lf-range-input::-webkit-slider-thumb { transition: none } }
@media (pointer: coarse) { .lf-main input.lf-range-input { min-height: 44px; height: 44px } }
@media (pointer: coarse) {
  .lf-row .lf-row-switch, .lf-head .lf-head-switch { min-height: 44px }
  .lf-q-note-line .cs-trigger, .lf-q-note-line select { min-height: 44px; height: auto }
}
.lf-font .cs { max-width: 260px }

/* Built-in questions: a row per question, one compact dropdown on the right. */
.lf-field-table { display: grid; min-width: 0 }
.lf-field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(148px, 180px); align-items: center; gap: 16px;
  min-height: 44px; padding: 6px 0; border-bottom: 1px solid var(--line) }
.lf-field-row:last-child { border-bottom: 0 }
.lf-field-name { min-width: 0; font-size: 13px; font-weight: 500; color: var(--ink); overflow-wrap: anywhere }
.lf-field-row.locked { grid-template-columns: minmax(0, 1fr) auto }
.lf-always { justify-self: end; text-align: right; font-size: 13px; color: var(--ink-3) }
.lf-field-row .lf-q-select, .lf-field-row .lf-q-select .cs { width: 100% }
.lf-field-row select { width: 100% }
.lf-field-group { margin: 16px 0 2px; font-size: 12px; font-weight: 500; color: var(--ink-3) }

/* A switch drawn on a button (role=switch): the workspace's one switch (portal.css .switch-track).
   A finger gets the 46x28 track and 24px knob in a 44px target; a desktop pointer (below) the
   compact 28x16 track and 12px knob. The knob sits 2px inside at both ends. */
.lf-switch { position: relative; flex: none; width: 46px; height: 44px; padding: 0; border: 0; border-radius: var(--radius-control);
  background: transparent; cursor: pointer }
.lf-switch::before { content: ''; position: absolute; left: 0; right: 0; top: 8px; height: 28px; border-radius: 999px;
  background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line-strong); transition: background-color 150ms ease, box-shadow 150ms ease }
.lf-switch[aria-checked=true]::before { background: var(--brand); box-shadow: inset 0 0 0 1px var(--brand) }
.lf-switch-thumb { position: absolute; top: 10px; left: 2px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface); box-shadow: var(--shadow-thumb); transition: transform 150ms ease }
.lf-switch[aria-checked=true] .lf-switch-thumb { transform: translateX(18px) }
:root[data-theme="dark"] .lf-switch-thumb { background: var(--ink) }
.lf-switch:focus-visible { outline: 2px solid var(--focus); outline-offset: 0 }
@media (prefers-reduced-motion: reduce) { .lf-switch::before, .lf-switch-thumb { transition: none } }

/* Consent */
.lf-fixed-note { margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface-2);
  font-size: 12px; color: var(--ink-2); line-height: 1.5 }
.lf-field input[aria-invalid=true] { border-color: var(--rust) }

/* Services: the Services panel, or custom checkboxes with the description under the name. */
.lf-services[hidden] { display: none }
.lf-services-panel { display: block }
.lf-service-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; margin-top: 4px }
.lf-svc { position: relative; display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 10px; align-items: start;
  min-height: 44px; padding: 10px 12px; border-radius: var(--radius-card); background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line-2); cursor: pointer; font-weight: 400;
  transition: background var(--motion-fast), box-shadow var(--motion-fast) }
.lf-svc:hover { background: var(--surface-2) }
.lf-svc.checked { background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand) }
/* Specific enough to beat the workspace's own checkbox styling: the native box is only the
   source of truth here, and takes no grid cell. */
.lf-services .lf-svc > input.lf-svc-input, .lf-notify .lf-svc > input.lf-svc-input { position: absolute; top: 0; left: 0; display: block; width: 1px; height: 1px;
  margin: 0; padding: 0; border: 0; opacity: 0; appearance: none; -webkit-appearance: none; pointer-events: none }
.lf-svc:focus-within { outline: 2px solid var(--focus); outline-offset: 2px }
.lf-svc-box { position: relative; width: 16px; height: 16px; margin-top: 1px; border: 1.5px solid var(--line-strong);
  border-radius: 4px; background: var(--surface) }
.lf-svc.checked .lf-svc-box { background: var(--brand); border-color: var(--brand) }
.lf-svc.checked .lf-svc-box::after { content: ''; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px;
  border: solid var(--action-ink); border-width: 0 1.75px 1.75px 0; transform: rotate(45deg) }
.lf-svc-words { display: grid; gap: 2px; min-width: 0 }
.lf-svc-name { font-size: 13px; font-weight: 500; color: var(--ink); overflow-wrap: anywhere }
.lf-svc-desc { font-size: 12px; color: var(--ink-2); line-height: 1.45; overflow-wrap: anywhere }
.lf-services-empty a { font-weight: 550 }

/* "Send new requests to": team members as tick boxes, outside addresses as rows with their state. */
.lf-notify { display: grid; gap: 10px; min-width: 0; padding: 0; border: 0 }
.lf-notify > legend { padding: 0; margin-bottom: 4px }
.lf-notify-members { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px }
.lf-notify .lf-svc.disabled { cursor: not-allowed; opacity: .6 }
.lf-notify .lf-svc.disabled:hover { background: var(--surface) }
.lf-notify.locked .lf-svc.checked.disabled { opacity: 1 }
.lf-notify-outside { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none }
.lf-notify-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px;
  min-height: 44px; padding: 6px 12px; border-radius: var(--radius-card); background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line-2) }
.lf-notify-words { display: grid; gap: 2px; min-width: 0; flex: 1 1 220px }
.lf-notify-email { font-size: 13px; font-weight: 500; color: var(--ink); overflow-wrap: anywhere }
.lf-notify-state { font-size: 12px; color: var(--ink-2); line-height: 1.45 }
.lf-notify-row[data-status=active] .lf-notify-state { color: var(--positive) }
.lf-notify-actions { display: flex; gap: 16px; align-items: center }
.lf-notify-add { display: grid; gap: 8px }
.lf-notify-add-open { justify-self: start; min-height: 44px }
.lf-notify-add-form { display: grid; gap: 8px; max-width: 420px }
.lf-notify-add-form[hidden] { display: none }
.lf-notify-add-field input[aria-invalid=true] { border-color: var(--rust) }
.lf-notify-add-buttons { display: flex; gap: 8px }
.lf-notify-add-buttons .button { min-height: 44px }

/* Boxes inside a section */
.lf-field { display: grid; gap: 6px; max-width: none; margin: 0 }
.lf-field + .lf-field { margin: 0 }
.lf-field input:not([type=checkbox]):not([type=color]):not([type=radio]):not([type=range]), .lf-field textarea, .lf-field select { width: 100%; min-width: 0 }
.lf-field textarea { resize: vertical; min-height: 64px; font: inherit; font-size: 13px }
.lf-label { font-size: 13px; font-weight: 500; color: var(--ink) }
.lf-hint { font-size: 12px; font-weight: 400; color: var(--ink-3); line-height: 1.5; margin: 0 }
.lf-hint:empty { display: none }
.lf-error, .lf-main .lf-field .lf-error, .lf-area-card .lf-error { color: var(--rust) }
.lf-main .switch-row { min-height: 44px }
.lf-stack { display: grid; gap: 18px; min-width: 0 }

/* The setup: rail, section, preview. Three columns on a wide screen, the preview under the
   section on a tablet, and one column on a phone with the preview in a sheet. */
.lf-wizard { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start }
.lf-wizard > .panel { margin: 0; min-width: 0; border-radius: var(--radius-card); box-shadow: none }
@media (min-width: 768px) {
  .lf-wizard { grid-template-columns: 188px minmax(0, 1fr) }
  .lf-preview { grid-column: 2 }
  .lf-rail { position: sticky; top: 16px }
}
@media (min-width: 1180px) {
  .lf-wizard { grid-template-columns: 188px minmax(0, 1fr) minmax(360px, 440px) }
  .lf-preview { grid-column: auto; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto;
    overscroll-behavior: contain }
  /* Desktop preview: the rail keeps only its numbers and the preview takes the room. */
  .lf-wizard.lf-wide { grid-template-columns: 56px minmax(0, 1fr) clamp(520px, 44vw, 900px) }
  .lf-wide .lf-rail-item { justify-content: center; padding: 0 }
  .lf-wide .lf-rail-item .lf-step-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap }
}
/* An ultrawide screen: the section keeps a readable measure instead of stretching. */
@media (min-width: 1900px) {
  .lf-wizard { grid-template-columns: 200px minmax(0, 860px) minmax(420px, 560px); justify-content: center }
  .lf-wizard.lf-wide { grid-template-columns: 56px minmax(0, 860px) minmax(720px, 1100px) }
}

/* The rail: a numbered circle per section, a tick once it is done, the current one filled. */
.lf-rail-list, .lf-steps-menu { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px }
.lf-rail-item, .lf-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 8px;
  border: 0; border-radius: var(--radius-control); background: transparent; color: var(--ink-2); font-size: 13px;
  font-weight: 500; text-align: left; transition: background var(--motion-fast), color var(--motion-fast) }
.lf-rail-item:hover, .lf-menu-item:hover { background: var(--surface-3); color: var(--ink) }
.lf-rail-item[aria-current=step], .lf-menu-item[aria-current=step] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line), var(--shadow-card) }
.lf-rail-item:focus-visible, .lf-menu-item:focus-visible { outline: 2px solid var(--focus); outline-offset: 0 }
.lf-step-name { min-width: 0; line-height: 1.3 }
.lf-mark { display: grid; place-items: center; flex: none; width: 18px; height: 18px; border: 1px solid var(--line-strong);
  border-radius: 50%; background: var(--surface); color: var(--ink-3); font-size: 11px; font-weight: 500;
  font-variant-numeric: tabular-nums }
[aria-current=step] > .lf-mark { border-color: var(--brand); color: var(--brand-ink); box-shadow: 0 0 0 2px var(--brand-soft) }
.done > .lf-mark { border-color: var(--brand); background: var(--brand); color: var(--action-ink) }
.lf-tick, .lf-steps-button svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round }

/* The section on screen */
.lf-main { padding: 0; overflow: visible }
.lf-step { display: grid; gap: 20px; padding: 20px 24px 24px; min-width: 0 }
.lf-step-head { display: grid; gap: 4px }
.lf-step-title { font-size: 16px; font-weight: 600; letter-spacing: -.01em }
.lf-step-title:focus { outline: none }
.lf-step-title:focus-visible { outline: 3px solid var(--azure); outline-offset: 4px; border-radius: 2px }
.lf-step-title.lf-quiet-focus:focus-visible { outline: none }
.lf-step-lead { font-size: 13px; line-height: 1.5; color: var(--ink-2) }
.lf-main input, .lf-main textarea, .lf-main .lf-layout, .lf-main .lf-mode {
  scroll-margin-bottom: calc(96px + var(--mobile-clearance, 0px)) }

/* Back, the quiet save line (only when something went wrong), Next */
.lf-stepbar { display: flex; align-items: center; gap: 12px; padding: 12px 24px; border-top: 1px solid var(--line) }
.lf-stepbar .button { min-height: 44px }
.lf-next { min-width: 88px; margin-left: auto }
.lf-autosave { display: flex; flex: 1; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px 8px; margin: 0;
  font-size: 12px; color: var(--ink-3); line-height: 1.4; text-align: right }
.lf-autosave[hidden] { display: none }
.lf-autosave + .lf-next { margin-left: 0 }
.lf-autosave[hidden] + .lf-next { margin-left: auto }
.lf-autosave[data-state=error], .lf-autosave[data-state=invalid] { color: var(--rust) }
.lf-retry { min-height: 44px }

/* Phone: the rail folds into one row with dots and a menu */
.lf-steprow { position: relative; display: none; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line) }
.lf-steprow-where { display: grid; flex: 1; gap: 8px; min-width: 0 }
.lf-steprow-text { font-size: 13px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums }
.lf-dots { display: flex; gap: 6px }
.lf-dot { width: 8px; height: 8px; border: 1.5px solid var(--line-2); border-radius: 50% }
.lf-dot.done { border-color: var(--brand); background: var(--brand) }
.lf-dot.current { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft) }
.lf-steps-button { display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0;
  border: 1px solid var(--line-2); border-radius: var(--radius-control); background: var(--surface); color: var(--ink) }
.lf-steps-button svg { width: 20px; height: 20px; stroke-width: 2 }
.lf-steps-button[aria-expanded=true] { border-color: var(--brand) }
.lf-steps-button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px }
.lf-steps-menu { position: absolute; top: calc(100% - 4px); right: 12px; left: 12px; z-index: 20; padding: 6px;
  border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); box-shadow: var(--shadow-pop) }
.lf-preview-open { flex: none }

/* Section 5: what happens outside the area, as four radio rows with a sentence each. */
.lf-modes { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0 }
.lf-modes legend { padding: 0; margin-bottom: 8px }
.lf-mode { position: relative; display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 10px; align-items: start;
  min-height: 44px; padding: 10px 12px; border-radius: var(--radius-card); background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line-2); cursor: pointer; font-weight: 400;
  transition: background var(--motion-fast), box-shadow var(--motion-fast) }
.lf-mode:hover { background: var(--surface-2) }
.lf-mode.selected { background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand) }
.lf-modes .lf-mode > input.lf-mode-input { position: absolute; top: 0; left: 0; width: 1px; height: 1px; margin: 0; padding: 0;
  border: 0; opacity: 0; appearance: none; -webkit-appearance: none; pointer-events: none }
.lf-mode:focus-within { outline: 2px solid var(--focus); outline-offset: 2px }
.lf-mode-dot { width: 16px; height: 16px; margin-top: 1px; border: 1.5px solid var(--line-strong); border-radius: 50%; background: var(--surface) }
.lf-mode.selected .lf-mode-dot { border-color: var(--brand); background: var(--brand); box-shadow: inset 0 0 0 3px var(--surface) }
.lf-mode-words { display: grid; gap: 2px; min-width: 0 }
.lf-mode-words strong { font-size: 13px; font-weight: 500; color: var(--ink) }
.lf-mode-words span { font-size: 12px; color: var(--ink-2); line-height: 1.45 }

/* "Don't accept": the note people outside the area see, drawn the way the form draws it, with
   Edit beside it (double-click the note does the same), and the Red / Yellow choice under it. */
.lf-outside { display: grid; gap: 8px; min-width: 0; padding: 12px; border-radius: var(--radius-card);
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line) }
.lf-outside[hidden] { display: none }
.lf-outside-row { display: flex; align-items: flex-start; gap: 8px; min-width: 0 }
.lf-outside-note { flex: 1; min-width: 0; padding: 10px 12px; border-radius: var(--radius-control);
  font-size: 13px; font-weight: 500; line-height: 1.45; color: var(--ink); cursor: text; overflow-wrap: anywhere }
.lf-outside-red { background: var(--rust-soft); box-shadow: inset 0 0 0 1px var(--rust-line) }
.lf-outside-yellow { background: var(--amber-soft); box-shadow: inset 0 0 0 1px var(--amber-line) }
.lf-outside-note[data-custom=false] .lf-outside-text { color: var(--ink-2) }
.lf-outside-note .lf-hint { display: block; margin-top: 6px }
.lf-main .lf-outside-note textarea.lf-outside-input { display: block; width: 100%; min-height: 64px; margin: 0;
  font-size: 13px; background: var(--surface) }
.lf-outside-edit { flex: none; min-height: 40px }
.lf-tones { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0 }
.lf-tones legend { padding: 0; margin-bottom: 6px }
.lf-tone { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
  border-radius: var(--radius-control); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2);
  font-size: 13px; font-weight: 500; color: var(--ink); cursor: pointer; transition: box-shadow var(--motion-fast) }
.lf-tone.selected { box-shadow: inset 0 0 0 1.5px var(--brand) }
.lf-tones .lf-tone > input.lf-mode-input { position: absolute; top: 0; left: 0; width: 1px; height: 1px; margin: 0; padding: 0;
  border: 0; opacity: 0; appearance: none; -webkit-appearance: none; pointer-events: none }
.lf-tone:focus-within { outline: 2px solid var(--focus); outline-offset: 2px }
.lf-tone-swatch { width: 16px; height: 16px; border-radius: 50% }
.lf-tone-swatch.lf-outside-red { background: var(--rust); box-shadow: none }
.lf-tone-swatch.lf-outside-yellow { background: var(--amber); box-shadow: none }
@media (prefers-reduced-motion: reduce) { .lf-tone { transition: none } }

/* Sections 3 and 4 */
.lf-manage { display: inline-flex; align-items: center; justify-self: start; min-height: 44px; font-size: 13px; font-weight: 500 }
.lf-why { font-size: 13px; color: var(--ink-2); line-height: 1.5 }

/* Section 6: three ways to reach the form, each a card: paste, share, their own address. */
.lf-ways { display: grid; gap: 12px; min-width: 0 }
.lf-way { display: grid; gap: 12px; min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-card);
  background: var(--surface) }
.lf-way-head { display: flex; align-items: center; gap: 12px }
.lf-way-icon { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: var(--radius-control);
  background: var(--brand-soft); color: var(--brand-ink) }
.lf-way-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round }
.lf-way-title { font-size: 13px; font-weight: 600 }
.lf-embed { display: grid; gap: 10px; min-width: 0 }
.lf-snippet { display: grid; gap: 8px; min-width: 0 }
.lf-snippet-actions { display: flex; justify-content: flex-end }
.lf-copy { display: inline-flex; align-items: center; gap: 8px; flex: none }
.lf-copy .button { min-height: 44px }
.lf-copied { color: var(--positive); font-size: 12px }
.lf-copied:empty { display: none }
.lf-code { margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-control);
  background: var(--surface-2); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px;
  line-height: 1.6; white-space: pre-wrap; word-break: break-all; user-select: all; -webkit-user-select: all }
.lf-other-code { display: grid; gap: 8px; min-width: 0 }
.lf-other-code summary { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; color: var(--ink-2);
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px; width: fit-content }
.lf-other-code summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px }
.lf-linkrow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
  padding: 10px 10px 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface-2) }
.lf-link { min-width: 0; font-size: 13px; overflow-wrap: anywhere }
.lf-linkrow .lf-copy { margin-left: auto }
.lf-domain { display: grid; gap: 12px; min-width: 0 }
.lf-domain-add { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px }
.lf-domain-add[hidden] { display: none }
.lf-domain-go.button { min-height: 44px }
.lf-domain-soon { margin: 0; font-size: 13px; color: var(--ink-2) }
.lf-domain-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none }
.lf-domain-list[hidden] { display: none }
.lf-domain-row { display: grid; gap: 12px; min-width: 0; padding: 14px; border-radius: var(--radius-control); background: var(--surface-2) }
.lf-domain-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px }
.lf-domain-host { font-size: 13px; font-weight: 600; overflow-wrap: anywhere }
.lf-domain-pill { display: inline-flex; align-items: center; gap: 5px; min-height: 20px; padding: 0 8px 0 7px; border-radius: 999px; font-size: 12px; font-weight: 500;
  background: var(--amber-soft); color: var(--amber-ink) }
.lf-domain-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none }
.lf-domain-pill[data-status=active] { background: var(--positive-soft); color: var(--positive-ink) }
.lf-domain-pill[data-status=failed] { background: var(--rust-soft); color: var(--rust) }
.lf-domain-step, .lf-domain-failed { margin: 0; font-size: 13px; color: var(--ink-2); line-height: 1.5 }
.lf-domain-failed { color: var(--rust) }
.lf-records { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none }
.lf-record-step { display: grid; gap: 8px; min-width: 0 }
.lf-record-head { display: flex; align-items: center; gap: 10px }
.lf-record-n { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--brand-soft);
  color: var(--brand-ink); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums }
.lf-record-type { font-size: 13px; font-weight: 600; color: var(--ink) }
.lf-record { display: grid; gap: 6px; margin: 0 }
.lf-record-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 44px;
  padding: 2px 4px 2px 12px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface) }
.lf-record-row dt { font-size: 12px; color: var(--ink-3) }
.lf-record-value { margin: 0; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px;
  overflow-wrap: anywhere; user-select: all; -webkit-user-select: all }
.lf-domain-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px }
.lf-domain-actions .button { min-height: 44px }
.lf-domain .inline-status:empty { display: none }

/* Preview: Phone or Desktop, the real form drawn at that width and scaled to fit. */
.lf-preview { padding: 12px }
.lf-preview-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px }
.lf-preview-head h2 { flex: 1; font-size: 13px; font-weight: 600; letter-spacing: 0 }
.lf-device { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface) }
.lf-device-button { min-height: 44px; min-width: 72px; padding: 0 10px; border: 0; border-radius: 4px;
  background: transparent; color: var(--ink-2); font-size: 13px; font-weight: 500; transition: background var(--motion-fast), color var(--motion-fast) }
.lf-device-button:hover { color: var(--ink) }
.lf-device-button[aria-pressed=true] { background: var(--surface-3); color: var(--ink) }
.lf-device-button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px }
.lf-sheet-close { display: none }
/* The form sits on the workspace canvas, the way it will sit on their page: no backdrop of its own. */
.lf-stage { display: grid; justify-items: center; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-control);
  background: var(--canvas); overflow: hidden }
.lf-scaler { position: relative; max-width: 100%; overflow: hidden; background: transparent }
/* 760px until the form reports its own height (form.js cm:ready / cm:resize), then that height. */
/* max-width: none, or the workspace's iframe rule squeezes the frame to the box and the page
   lays itself out narrower than the device it stands for. The frame is see-through, so a form
   whose page background is see-through shows the stage behind it, as it would on their site. */
.lf-scaler .lf-frame { display: block; width: 390px; max-width: none; height: 760px; border: 0; background: transparent;
  transform-origin: top left }
/* The drawing round the form: one element whose look follows data-device on the scaler, so the
   frame inside never moves and keeps its step and its typed text. A phone is 390 wide, a browser
   window 1280 wide; the scaler shrinks it to the pane. */
.lf-drawing { transform-origin: top left }
.lf-scaler[data-device=phone] .lf-drawing { padding: 12px; border: 1px solid var(--line-strong); border-radius: 48px;
  background: var(--surface); box-shadow: var(--shadow-card) }
.lf-scaler[data-device=phone] .lf-browser-bar, .lf-scaler[data-device=phone] .lf-mock-copy { display: none }
.lf-scaler[data-device=phone] .lf-mock-page { display: block; min-height: 0; padding: 0 }
.lf-scaler[data-device=phone] .lf-mock-slot { display: block; height: 844px; border-radius: 36px; overflow: hidden;
  background: var(--surface-2) }
/* A phone-wide editor: the plain card, no outline, as tall as the form. */
.lf-scaler[data-plain=true] .lf-drawing { padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none }
.lf-scaler[data-plain=true] .lf-mock-slot { height: auto; border-radius: var(--radius-control); background: transparent }
.lf-scaler[data-device=desktop] .lf-drawing { border: 1px solid var(--line-strong); border-radius: 12px; overflow: hidden;
  background: var(--surface); box-shadow: var(--shadow-card) }
.lf-browser-bar { display: grid; grid-template-columns: 96px minmax(0, 1fr) 96px; align-items: center; height: 44px; padding: 0 16px;
  background: var(--surface-2); border-bottom: 1px solid var(--line) }
.lf-dots { display: flex; gap: 8px }
.lf-dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--line-strong) }
.lf-address { display: flex; align-items: center; justify-content: center; gap: 8px; grid-column: 2; max-width: 560px; width: 100%;
  height: 28px; margin: 0 auto; padding: 0 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
  color: var(--ink-2); font-size: 13px; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.lf-address::before { content: ''; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--azure) }
/* The contractor's page: grey blocks stand for their headline, and the form sits where the
   chosen placement puts it. */
.lf-mock-page { display: grid; align-items: center; min-height: 520px; padding: 56px 80px }
.lf-mock-copy { display: grid; gap: 16px; align-content: center; min-width: 0 }
.lf-mock-bar { display: block; height: 14px; border-radius: 7px; background: var(--line-2) }
.lf-mock-bar-1 { width: 82%; height: 30px; border-radius: 10px }
.lf-mock-bar-2 { width: 58%; height: 30px; border-radius: 10px; margin-bottom: 8px }
.lf-mock-bar-3 { width: 72% }
.lf-mock-bar-4 { width: 50% }
.lf-mock-slot { min-width: 0; display: grid; justify-items: center }
.lf-mock-slot .lf-frame { display: block }
.lf-mock-page[data-layout=hero] { grid-template-columns: minmax(0, 1fr) auto; gap: 64px }
.lf-mock-page[data-layout=hero] .lf-mock-slot { justify-items: end }
.lf-mock-page[data-layout=section] { gap: 40px }
.lf-mock-page[data-layout=section] .lf-mock-copy { width: min(560px, 100%); justify-self: center }
.lf-mock-page[data-layout=page] { padding: 32px 80px }
.lf-mock-page[data-layout=page] .lf-mock-copy { display: none }
.lf-preview-off { margin: 0; padding: 48px 24px; text-align: center; font-size: 14px; color: var(--ink-2); background: var(--surface) }

/* Section 5: the map card. The map is always the light liberty map; what sits on it (the hint,
   the drawing tools, the edit bar) is frosted glass in the workspace's own theme. */
.lf-area-card { display: grid; gap: 12px; min-width: 0 }
.lf-area-head h3 { font-size: 13px; font-weight: 600 }
.lf-area-head p { margin-top: 2px; font-size: 12px }
/* Specific enough to beat ios.css, which makes every .free-map 4:3 on a phone: drawing needs the room. */
.lf-area-card .lf-area-map { height: 400px; aspect-ratio: auto; scroll-margin: 80px 0 calc(96px + var(--mobile-clearance, 0px)) }
.lf-area-map:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px }
.lf-area-card .lf-area-map.lf-area-nomap { display: grid; place-items: center; height: auto; min-height: 120px; padding: 24px }
.lfa-nomap { margin: 0; max-width: 420px; text-align: center; font-size: 13px; color: var(--ink-2); line-height: 1.5 }
.lfa-tools { position: absolute; top: 12px; left: 12px; z-index: 3; display: flex; gap: 6px }
.lfa-tools[hidden], .lfa-editbar[hidden], .lfa-hint[hidden] { display: none }
.lf-icon { display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; border: 0;
  border-radius: var(--radius-control); background: transparent; color: var(--ink-2); cursor: pointer;
  transition: background var(--motion-fast), color var(--motion-fast) }
.lf-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round }
.lf-icon:hover:not(:disabled) { background: var(--surface-3); color: var(--ink) }
.lf-icon:disabled { opacity: .4; cursor: default }
.lf-icon:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px }
.lfa-tools .lf-icon { width: 40px; height: 40px; border: 1px solid var(--glass-line); background: var(--glass-bg); color: var(--ink);
  box-shadow: var(--shadow-float); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px) }
.lfa-tools .lf-icon:hover:not(:disabled) { background: var(--surface) }
/* The hint sits in a band that stops short of the right-hand column (the zoom buttons) and above
   the map credit's row (its words open leftward along the bottom), centred in it, so it never
   covers a control. */
.lfa-hint { position: absolute; left: 12px; right: 60px; bottom: 60px; z-index: 2; width: fit-content; max-width: calc(100% - 72px);
  margin: 0 auto; padding: 9px 16px; border: 1px solid var(--glass-line); border-radius: 999px; background: var(--glass-bg); color: var(--ink);
  box-shadow: var(--shadow-float); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); font-size: 13px; font-weight: 550;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none }
[data-mode=edit] .lfa-hint { top: 12px; bottom: auto }
.lfa-editbar { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 3; display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 8px; padding: 8px 8px 8px 14px; border: 1px solid var(--glass-line); border-radius: var(--radius-card);
  background: var(--glass-bg); box-shadow: var(--shadow-float); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px) }
.lfa-editname { min-width: 0; font-size: 14px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.lfa-editbuttons { display: flex; gap: 6px; margin-left: auto }
.lfa-editbar .button { min-height: 44px }
.lfa-editbar .lfa-delete-corner:not(:disabled) { color: var(--rust) }
/* The corner handles: a white dot ringed in azure inside a larger invisible target. */
.lfa-corner, .lfa-mid { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; cursor: grab; touch-action: none }
.lfa-corner:active, .lfa-mid:active { cursor: grabbing }
.lfa-corner .lfa-dot { width: 16px; height: 16px; border: 3px solid var(--brand); border-radius: 50%; background: var(--on-image);
  box-shadow: var(--shadow-thumb); transition: transform var(--motion-fast), background var(--motion-fast) }
.lfa-corner:hover .lfa-dot { transform: scale(1.15) }
.lfa-corner.selected .lfa-dot { background: var(--brand); border-color: var(--on-image); transform: scale(1.25) }
.lfa-mid .lfa-dot { width: 11px; height: 11px; border: 2px solid var(--brand); border-radius: 50%; background: var(--on-image); opacity: .8;
  transition: opacity var(--motion-fast), transform var(--motion-fast) }
.lfa-mid:hover .lfa-dot, .lfa-mid.active .lfa-dot { opacity: 1; transform: scale(1.2) }
.lfa-corner:focus-visible, .lfa-mid:focus-visible { outline: 2px solid var(--focus); outline-offset: 0 }
@media (pointer: coarse) { .lfa-corner, .lfa-mid { width: 44px; height: 44px } .lfa-tools .lf-icon { width: 44px; height: 44px } }
.lf-area-status { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px }
.lf-area-status .inline-status:empty { display: none }
.lf-area-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none }
.lf-area-list[hidden] { display: none }
.lf-area-row { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto 44px 44px; gap: 10px; align-items: center;
  padding: 6px 6px 6px 14px; border-radius: var(--radius-control); border: 1px solid var(--line); background: var(--surface);
  transition: background var(--motion-fast), border-color var(--motion-fast) }
.lf-area-row.selected { border-color: var(--brand-line); background: var(--brand-soft) }
.lf-area-swatch { width: 12px; height: 12px; border: 2px solid var(--brand); border-radius: 3px; background: var(--brand-soft) }
.lf-area-row input.lf-area-name { min-width: 0; width: 100%; min-height: 44px }
.lf-area-meta { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap }
.lf-area-delete:hover:not(:disabled) { color: var(--rust) }
.lf-area-card .inline-status:empty { display: none }

/* Section 2, part two: their own questions (Ask 11). A card per question: the grip on the left,
   the question and its help, the type and Required side by side, the choices, the page, then
   the rule as a sentence. Every control is a 44px target. */
.lf-qs { display: grid; gap: 12px; min-width: 0; padding-top: 20px; border-top: 1px solid var(--line) }
.lf-qs-head { display: grid; gap: 4px }
.lf-qs-title { font-size: 13px; font-weight: 600 }
.lf-q-list { position: relative; display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; min-width: 0 }
.lf-q-list[hidden] { display: none }
.lf-q { position: relative; display: grid; gap: 14px; min-width: 0; padding: 10px 16px 16px 8px; border: 1px solid var(--line);
  border-radius: var(--radius-card); background: var(--surface) }
.lf-q > :not(.lf-q-head) { margin-left: 44px }
.lf-q-head { display: flex; align-items: center; gap: 4px; min-height: 44px }
.lf-q-number { flex: 1; font-size: 12px; font-weight: 500; color: var(--ink-3); font-variant-numeric: tabular-nums }
.lf-q-delete:hover:not(:disabled) { color: var(--rust) }
.lf-q-settings { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 16px; align-items: end }
.lf-q-type .cs { max-width: 260px }
.lf-q-switch { display: flex; align-items: center; gap: 8px; min-height: 44px }
.lf-q-switch-text { font-size: 13px; font-weight: 500; color: var(--ink) }

/* The grip: six dots in a 44px target, the hand while it moves. */
.lf-grip { display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; border: 0;
  border-radius: var(--radius-control); background: transparent; color: var(--ink-3); cursor: grab; touch-action: none; user-select: none;
  transition: background var(--motion-fast), color var(--motion-fast) }
.lf-grip svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round }
.lf-grip:hover { background: var(--surface-3); color: var(--ink) }
.lf-grip:active { cursor: grabbing }
.lf-grip:focus-visible { outline: 2px solid var(--focus); outline-offset: 0 }
/* While a card is dragged: it rides the pointer, lifted; the others slide aside; a dashed slot
   shows where it lands. */
.lf-sorting > li:not(.lf-dragging):not(.lf-drop-slot) { transition: transform 160ms cubic-bezier(.2, .7, .2, 1) }
.lf-dragging { position: relative; z-index: 4; box-shadow: var(--shadow-pop); cursor: grabbing; will-change: transform }
.lf-dragging .lf-grip { cursor: grabbing; background: var(--surface-2); color: var(--ink) }
.lf-drop-slot { position: absolute; top: 0; left: 0; right: 0; z-index: 0; border: 2px dashed var(--brand); border-radius: var(--radius-card);
  background: var(--brand-soft); opacity: .7; pointer-events: none }
.lf-sorting { user-select: none; -webkit-user-select: none }
@media (prefers-reduced-motion: reduce) { .lf-sorting > li:not(.lf-dragging):not(.lf-drop-slot) { transition: none } }

/* Choices: the grip, the words, then remove. */
.lf-q-choices { display: grid; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0 }
.lf-q-choices legend { padding: 0; margin-bottom: 8px }
.lf-q-choice-list { position: relative; display: grid; gap: 6px; margin: 0; padding: 0; list-style: none }
.lf-q-choice { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 4px; align-items: center; border-radius: var(--radius-control);
  background: var(--surface) }
.lf-q-choice input { width: 100%; min-width: 0 }
.lf-q-choice .lf-grip svg { width: 18px; height: 18px }
.lf-q-choice-list .lf-drop-slot { border-radius: var(--radius-control) }
.lf-qs .button:disabled { opacity: .4; cursor: default }
.lf-q-page:focus-visible, .lf-q-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px }
.lf-q-choices > .button { justify-self: start }

/* Show on page: three small buttons, 3 marked as the review page. */
.lf-q-pages-wrap { display: grid; gap: 6px }
.lf-q-pages { display: inline-flex; justify-self: start; gap: 2px; padding: 2px; border: 1px solid var(--line);
  border-radius: var(--radius-control); background: var(--surface) }
.lf-q-page { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 48px; min-height: 44px;
  padding: 0 10px; border: 0; border-radius: 4px; background: transparent; color: var(--ink-2);
  font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; cursor: pointer }
.lf-q-page[aria-pressed=true] { background: var(--surface-3); color: var(--ink) }
.lf-q-page-words { font-size: 12px; font-weight: 500; color: var(--ink-3) }
.lf-q-page[aria-pressed=true] .lf-q-page-words { color: var(--ink-2) }

/* "Only ask when [question] [is] [answer]": one sentence that wraps. */
.lf-q-rule, .lf-q-notebox { display: grid; gap: 8px; min-width: 0 }
/* "Show a note when they pick [Yes]": one quiet line, the words and a compact dropdown, no box. */
.lf-q-sentence.lf-q-note-line { flex-wrap: nowrap; gap: 8px; padding: 0; border: 0; border-radius: 0; background: transparent }
.lf-q-note-line .lf-q-words { flex: none; font-size: 13px; color: var(--ink-2) }
.lf-q-note-line .lf-q-select, .lf-q-note-line .lf-q-select .cs { width: auto; min-width: 88px }
.lf-q-note-line .cs-trigger, .lf-q-note-line select { min-height: 32px; height: 32px; padding-top: 0; padding-bottom: 0; font-size: 13px }
.lf-q-rule > .button, .lf-q-notebox > .button { justify-self: start }
.lf-q-sentence { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface-2) }
.lf-q-words { font-size: 13px; color: var(--ink) }
.lf-q-select { display: inline-block; min-width: 0; max-width: 100% }
.lf-q-sentence .lf-q-select .cs { width: auto; min-width: 120px; max-width: 100% }
.lf-q-rule-target .cs { min-width: 180px }
.lf-q-chips { display: flex; flex-wrap: wrap; gap: 6px }
.lf-q-chip { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 999px;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); font-size: 12px; font-weight: 500; cursor: pointer }
.lf-q-chip.checked { background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand-line); color: var(--ink) }
.lf-qs .lf-q-chip > input.lf-q-chip-input { position: absolute; inset: 0; width: 1px; height: 1px; margin: 0; padding: 0; border: 0;
  opacity: 0; appearance: none; -webkit-appearance: none; pointer-events: none }
.lf-q-chip:focus-within { outline: 2px solid var(--focus); outline-offset: 2px }
.lf-q-link { justify-self: start; min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--ink-2);
  font-size: 13px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer }
.lf-q-link:hover { color: var(--ink) }
.lf-q-note { margin: 0; font-size: 13px; line-height: 1.5; color: var(--ink-2) }
.lf-q-note:empty { display: none }
.lf-q-add { justify-self: start; min-height: 44px }

/* Undo after a delete: a small bar at the bottom of the screen, above the phone's step bar. */
.lf-toast { position: fixed; left: 50%; bottom: calc(24px + var(--mobile-clearance, 0px)); z-index: 60; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 32px); padding: 6px 6px 6px 14px;
  border-radius: var(--radius-card); background: var(--ink); color: var(--surface); box-shadow: var(--shadow-pop); font-size: 13px }
.lf-toast[hidden] { display: none }
.lf-toast-text { min-width: 0 }
.lf-toast .lf-toast-undo { flex: none; min-height: 44px; border-color: transparent; background: transparent; color: var(--surface);
  font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px }
.lf-toast .lf-toast-undo:hover { background: transparent; color: var(--surface) }
.lf-toast .lf-toast-undo[hidden] { display: none }

@media (max-width: 767px) {
  .lf-q { padding: 10px 12px 14px 6px }
  .lf-q > :not(.lf-q-head) { margin-left: 38px }
  .lf-q-settings { grid-template-columns: minmax(0, 1fr) }
  .lf-q-type .cs { max-width: none }
  .lf-q-choice { gap: 2px }
  .lf-q-sentence .lf-q-select, .lf-q-sentence .lf-q-select .cs { width: 100% }
  .lf-toast { bottom: calc(96px + var(--mobile-clearance, 0px)) }
}

@media (prefers-reduced-motion: reduce) {
  .lf-rail-item, .lf-menu-item, .lf-mode, .lf-layout, .lf-svc, .lf-grip, .lf-icon, .lf-area-row,
  .lfa-corner .lfa-dot, .lfa-mid .lfa-dot, .lf-head input.lf-title-input { transition: none }
}

@media (max-width: 767px) {
  .lf-row { padding-right: 12px }
  .lf-row .lf-row-switch { padding-left: 4px }
  /* A form row on a phone: a small diagram, the name on one line, one quiet line under it, the
     lead count, then the switch. Nothing wraps into a third line. */
  .lf-row-link, .lf-row.has-stats .lf-row-link { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; min-height: 64px; padding: 10px 4px 10px 16px }
  .lf-row .lf-diagram { width: 36px; height: 24px }
  .lf-row-name { font-size: 15px; line-height: 1.3 }
  .lf-row-meta, .lf-row-brief { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; line-height: 1.4 }
  .lf-row-count { min-width: 40px }
  /* The editor's title shares its line with the on/off switch, so it steps down to 20px. */
  .lf-head .lf-head-top { gap: 10px }
  .lf-head h1.lf-title { font-size: 20px; letter-spacing: -.02em }
  .lf-head .lf-head-switch { gap: 8px; font-size: 13px }
  .lf-row-stats { display: none }
  .lf-row.has-stats .lf-row-brief { display: block }
  /* On a phone the Insights button is its icon (44px, named for a screen reader), and the
     section under the row takes the full width in one column. */
  .lf-row .lf-row-insights { width: 44px; min-height: 44px; height: 44px; padding: 0; justify-content: center }
  .lf-row-insights-text { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0 }
  .lf-insights { padding: 14px 16px 16px }
  /* Five figures in three columns: the funnel (Views, Started, Sent) on one line, Left partway and
     Conversion under it, never a lone figure on a row of its own. */
  .lf-insights-figures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 16px }
  .lf-insights-grid { grid-template-columns: minmax(0, 1fr); gap: 16px }
  .lf-outside-parts { grid-template-columns: minmax(0, 1fr); gap: 12px }
  .lf-bar-row { grid-template-columns: minmax(64px, 96px) minmax(0, 1fr) 36px 44px; gap: 8px }
  .lf-stats { padding: 12px 14px; gap: 10px 20px }
  .lf-stat-figures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; width: 100% }
  .lf-rail { display: none }
  .lf-steprow { display: flex }
  /* Steps: a hollow dot is still to do, a check is done, the filled azure pill is where you are. */
  .lf-steprow .lf-dots { align-items: center; gap: 6px }
  .lf-steprow .lf-dot { box-sizing: border-box; width: 10px; height: 10px; border: 1.5px solid var(--line-strong); background: transparent; box-shadow: none; transition: width 160ms cubic-bezier(.2,0,0,1) }
  .lf-steprow .lf-dot.done { position: relative; width: 14px; height: 14px; border-color: var(--brand); background: var(--brand) }
  .lf-steprow .lf-dot.done::after { content: ""; position: absolute; left: 4px; top: 1.5px; width: 3px; height: 6px; border: solid var(--on-brand); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg) }
  .lf-steprow .lf-dot.current, .lf-steprow .lf-dot.done.current { width: 22px; height: 10px; border-radius: 999px; border-color: var(--brand); background: var(--brand); box-shadow: none }
  .lf-steprow .lf-dot.current::after { display: none }
  .lf-step { padding: 20px 16px; gap: 20px }
  .lf-step-title { font-size: 19px }
  .lf-layout-choices { gap: 6px }
  .lf-layout { padding: 8px }
  .lf-layout-words span { display: none }
  .lf-look-grid { grid-template-columns: minmax(0, 1fr) }
  .lf-field-row { grid-template-columns: minmax(0, 1fr) minmax(128px, 150px); gap: 12px }
  .lf-service-grid { grid-template-columns: minmax(0, 1fr) }
  /* Back and Next as two equal buttons, the save line above them, stuck above the tab dock. */
  .lf-stepbar { position: sticky; bottom: var(--mobile-clearance, 0px); z-index: 5; display: grid; grid-template-columns: 1fr 1fr;
    gap: 8px; padding: 10px 16px 12px; background: var(--surface); border-radius: 0 0 var(--radius-card) var(--radius-card) }
  .lf-autosave { grid-column: 1 / -1; grid-row: 1; justify-content: center; text-align: center; min-height: 20px }
  .lf-stepbar .button { width: 100%; min-height: 48px }
  .lf-stepbar .lf-next { margin-left: 0 }
  .lf-stepbar:has(.lf-back[hidden]) .lf-next { grid-column: 1 / -1 }
  .lf-way { padding: 14px }
  .lf-record-row { grid-template-columns: minmax(0, 1fr) auto; padding: 8px 4px 8px 12px }
  .lf-record-row dt { grid-column: 1 / -1 }
  .lf-area-card .lf-area-map { height: 420px }
  .lf-area-row { grid-template-columns: 12px minmax(0, 1fr) 44px 44px; padding-left: 10px }
  .lf-area-meta { display: none }
  .lfa-editbar { flex-wrap: nowrap; padding: 6px 6px 6px 12px }
  .lfa-editname { flex: 1 1 auto }
  .lfa-hint { white-space: normal; text-align: center; border-radius: var(--radius-card) }
  [data-mode=edit] .lfa-hint { text-align: left }
  /* The preview waits behind its button and opens as a full-screen sheet. */
  .lf-preview { display: none }
  .lf-preview.open { position: fixed; inset: 0; z-index: 80; display: block; margin: 0; border: 0; border-radius: 0; overflow-y: auto;
    padding: calc(12px + env(safe-area-inset-top, 0px)) 16px calc(16px + env(safe-area-inset-bottom, 0px)); background: var(--canvas) }
  .lf-preview.open .lf-sheet-close { display: inline-flex; min-height: 44px }
  .lf-preview.open .lf-preview-link { display: none }
}
@media (min-width: 768px) {
  .lf-preview-open { display: none }
}

/* A desktop pointer gets the workspace's compact controls: 32px buttons and fields, 28px segments
   and icon buttons. A finger, and anything phone-wide, keeps every 44px target above. */
@media (pointer: fine) and (min-width: 768px) {
  .lf-main .switch-row, .lf-look-tile .switch-row { min-height: 32px }
  .lf-main .lf-field input:not([type=checkbox]):not([type=color]):not([type=radio]):not([type=range]), .lf-main .lf-field select,
  .lf-main .lf-q input:not([type=checkbox]):not([type=radio]), .lf-area-row input.lf-area-name, .lf-notify-add-field input {
    min-height: 32px; height: 32px; padding-top: 0; padding-bottom: 0; font-size: 13px }
  .lf-stepbar .button, .lf-retry, .lf-copy .button, .lf-domain-actions .button, .lf-notify-add-open, .lf-notify-add-buttons .button,
  .lf-q-add, .lf-manage, .lf-other-code summary, .lf-q-link, .lfa-editbar .button, .lf-domain-go.button, .lf-toast .lf-toast-undo {
    min-height: 32px }
  .lf-rail-item, .lf-menu-item { min-height: 32px }
  .lf-device-button { min-height: 28px; min-width: 64px; font-size: 12px }
  .lf-q-page { min-height: 28px; min-width: 40px }
  .lf-q-chip { min-height: 28px }
  .lf-q-switch, .lf-q-head { min-height: 32px }
  .lf-grip { width: 28px; height: 28px }
  .lf-q > :not(.lf-q-head) { margin-left: 32px }
  .lf-q-choice { grid-template-columns: 28px minmax(0, 1fr) 28px }
  .lf-icon { width: 28px; height: 28px }
  .lf-icon svg { width: 16px; height: 16px }
  .lfa-tools .lf-icon { width: 32px; height: 32px }
  .lf-switch { width: 28px; height: 32px }
  .lf-switch::before { top: 8px; height: 16px }
  .lf-switch-thumb { top: 10px; left: 2px; width: 12px; height: 12px }
  .lf-switch[aria-checked=true] .lf-switch-thumb { transform: translateX(12px) }
  .lf-color input[type=color] { width: 32px; height: 32px; min-height: 32px; padding: 2px }
  .lf-area-row { grid-template-columns: 12px minmax(0, 1fr) auto 28px 28px; padding: 4px 4px 4px 12px }
  .lf-main input.lf-range-input { min-height: 28px; height: 28px }
  .lf-steps-button { width: 32px; height: 32px }
}
html.lf-sheet-lock, html.lf-sheet-lock body { overflow: hidden }

/* The previewed form is light; a matching colour scheme keeps the frame transparent in dark mode. */
.lf-frame{color-scheme:light}
