/* Forms: the shared fill-in renderer (ff-, web/js/formrender.js), the form builder (fb-, web/js/pages/formbuilder.js)
   and the public link page (/f/). Forms sit on a 12-column grid; phones stack every field. */

/* ------------------------------------------------------------------ filling a form in */
.ff-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px 16px; align-items: start; }
.ff-f { grid-column: span var(--w, 12); min-width: 0; }
.ff-f[hidden] { display: none; }
@media (max-width: 640px) { .ff-f { grid-column: 1 / -1 !important; grid-row: auto !important; } }
.ff-field, .ff-group { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; font-size: 14px; }
.ff-group legend { padding: 0; margin-bottom: 6px; }
.ff-l { font-weight: 600; color: var(--ink); }
.ff-req { color: var(--maroon-text); font-style: normal; }
.ff-help { font-size: 12.5px; line-height: 1.4; color: var(--ink-3); }
.ff-field input, .ff-field select, .ff-field textarea, .ff-money input { min-height: 44px; padding: 8px 12px; border: 1px solid #D5CFC2; border-radius: var(--r-sm); background: #fff; width: 100%; font-size: 16px; box-sizing: border-box; }
.ff-field textarea { min-height: 104px; resize: vertical; line-height: 1.45; }
.ff-field input:focus, .ff-field select:focus, .ff-field textarea:focus { outline: 2px solid color-mix(in srgb, var(--maroon) 55%, transparent); outline-offset: 1px; border-color: var(--maroon); }
.ff-money { position: relative; display: block; }
.ff-money > span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.ff-money input { padding-left: 26px; }
.ff-opts { display: flex; flex-direction: column; gap: 6px; }
.ff-opt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; cursor: pointer; font-size: 15px; transition: border-color .12s, background .12s; }
.ff-opt:hover { border-color: var(--sage-line); }
.ff-opt input { width: 18px; height: 18px; margin: 0; accent-color: var(--maroon); flex: none; }
.ff-opt:has(input:checked) { border-color: var(--maroon); background: var(--maroon-wash); }
.ff-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--chip-soft); align-self: flex-start; }
.ff-seg label, .ff-rate label { position: relative; cursor: pointer; }
.ff-seg input, .ff-rate input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.ff-seg span { display: block; padding: 8px 22px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--ink-3); }
.ff-seg input:checked + span { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.ff-seg input:focus-visible + span, .ff-rate input:focus-visible + span { outline: 2px solid var(--maroon); outline-offset: 2px; }
.ff-rate { display: flex; flex-wrap: wrap; gap: 6px; }
.ff-rate span { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-weight: 700; color: var(--ink-2); }
.ff-rate input:checked + span { background: var(--maroon); border-color: var(--maroon); color: var(--on-maroon); }
.ff-consent { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--sage-mist); cursor: pointer; font-size: 15px; line-height: 1.45; }
.ff-consent input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--maroon); flex: none; }
.ff-h { font-family: var(--serif); font-size: 21px; font-weight: 600; margin: 8px 0 0; padding-bottom: 6px; border-bottom: 2px solid var(--maroon); color: var(--ink); }
.ff-layout .ff-help { margin: 6px 0 0; }
.ff-p { margin: 0; white-space: pre-wrap; line-height: 1.55; color: var(--ink-2); font-size: 15px; }
.ff-hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.ff-sign { display: flex; flex-direction: column; gap: 6px; }
.ff-sign input { font-family: var(--serif); font-size: 22px; }

/* ------------------------------------------------------------------ the builder (full screen, like the course builder) */
.fb-app { position: fixed; inset: 0; z-index: 40; background: var(--page); display: flex; flex-direction: column; }
/* three columns: the sides are as wide as each other, so the title in the middle never moves (Edit ⇄ Preview) */
.fb-top { height: 58px; flex: none; display: grid; grid-template-columns: minmax(max-content, 1fr) minmax(0, max-content) minmax(max-content, 1fr); position: relative; align-items: center; gap: 10px; padding: 0 14px; background: var(--card); border-bottom: 1px solid var(--line); }
.fb-ident { min-width: 0; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 1px; pointer-events: none; text-align: center; padding: 0 12px; }   /* takes only the room the buttons leave */
.fb-ident .k { max-width: 100%; overflow: hidden; white-space: nowrap; }
.fb-ident .k { display: inline-flex; align-items: center; gap: 6px; font: 700 11px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.fb-ident .k .jb-ico { width: 14px; height: 14px; }
.fb-ident .k.tpl { color: var(--accent-text); } .fb-ident .k.live { color: var(--sage-text); }
.fb-ident .k i { font-style: normal; padding: 1px 7px; border-radius: 99px; background: var(--chip); color: var(--ink-2); letter-spacing: .06em; }
.fb-ident .k.live i { background: var(--sage-mist); color: var(--sage-text); }
.fb-ident b { font: 600 15px var(--sans); color: var(--ink); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1180px) { .fb-top .fb-l > a span, .fb-top #pdf span { display: none; } }
@media (max-width: 1000px) { .fb-ident { display: none; } }
.fb-l, .fb-r { display: flex; align-items: center; gap: 10px; }
.fb-l #main { display: inline-flex; gap: 8px; }
.fb-r { justify-content: flex-end; }
/* Access / Format tags in the forms list */
.fb-tag { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 5px 12px 5px 9px; font: 600 12.5px var(--sans); color: var(--ink-2); white-space: nowrap; }
.fb-tag .jb-ico { width: 15px; height: 15px; color: var(--ink-4); }
.fb-tag.link { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: var(--accent-tint); color: var(--accent-text); }
.fb-tag.link .jb-ico { color: var(--accent-text); }
.fb-tag.pdf { border-color: var(--maroon-line); background: var(--maroon-wash); color: var(--maroon-text); }
.fb-tag.pdf .jb-ico { color: var(--maroon-text); }
.fb-app.previewing .cb-save { visibility: hidden; }
@media (max-width: 1300px) { .fb-top .cb-save { display: none; } }
.fb-info { width: 30px; height: 30px; flex: none; border-radius: 50%; border: 1.5px solid var(--line); background: var(--card); color: var(--ink-3); font: italic 700 15px/1 var(--serif); cursor: pointer; display: inline-grid; place-items: center; }
.fb-info:hover { border-color: var(--ink-4); color: var(--ink); }
.fb-body { flex: 1; display: flex; min-height: 0; }

.fb-palette { width: 248px; flex: none; background: var(--card); border-right: 1px solid var(--line); overflow-y: auto; padding: 14px 12px 40px; }
.fb-palette h2 { font: 700 12px var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-4); margin: 0 4px 10px; }
.fb-pgrp { font: 700 11px var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-4); margin: 16px 4px 6px; }
.fb-pitems { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.fb-pitem { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: 600 12.5px var(--sans); color: var(--ink); cursor: grab; text-align: left; touch-action: none; user-select: none; transition: border-color .12s, box-shadow .12s, transform .12s; }
.fb-pitem:hover { border-color: var(--maroon-line); box-shadow: var(--shadow); transform: translateY(-1px); }
.fb-pitem .jb-ico { width: 18px; height: 18px; color: var(--maroon-text); }
.fb-ptip { margin: 18px 4px 0; font-size: 12.5px; line-height: 1.45; color: var(--ink-3); }

.fb-canvas { flex: 1; overflow-y: auto; padding: 26px 22px 80px; min-width: 0; }
.fb-page { margin: 0 auto; max-width: 880px; background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 38px 44px 44px; transition: max-width .25s; }
.fb-page.tablet { max-width: 768px; } .fb-page.phone { max-width: 390px; padding: 26px 18px 32px; }
.fb-page.phone .ff-f { grid-column: 1 / -1 !important; grid-row: auto !important; }
.fb-eyebrow { font: 700 11.5px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--maroon-text); margin-bottom: 6px; }
.fb-title { font-family: var(--serif); font-size: 34px; font-weight: 600; line-height: 1.12; margin: 0 0 8px; outline: none; border-radius: 6px; padding: 2px 4px; margin-left: -4px; }
.fb-desc { margin: 0 0 22px; color: var(--ink-2); font-size: 15.5px; line-height: 1.5; outline: none; border-radius: 6px; padding: 2px 4px; margin-left: -4px; min-height: 1.5em; white-space: pre-wrap; }
.fb-title:hover, .fb-desc:hover { background: var(--chip-soft); }
.fb-title:focus, .fb-desc:focus { background: var(--sage-mist); box-shadow: 0 0 0 2px var(--sage-line); }
.fb-title:empty::before { content: 'Untitled form'; color: var(--ink-4); }
.fb-desc:empty::before { content: 'Add a short description families will see at the top (optional)'; color: var(--ink-4); }
.fb-rule { height: 1px; background: var(--line); margin: 0 0 22px; }

/* the editing grid: the 12 columns show while you drag or resize */
.fb-grid { position: relative; min-height: 140px; border-radius: 12px; row-gap: 30px; padding-bottom: 46px; }
.fb-cell.ph.insert { min-height: 8px; height: 8px; padding: 0; border-width: 0; background: var(--maroon); border-radius: 4px; align-self: center; }
.fb-grid.busy { background-image: repeating-linear-gradient(to right, color-mix(in srgb, var(--maroon) 7%, transparent) 0 calc((100% - 11 * 16px) / 12), transparent calc((100% - 11 * 16px) / 12) calc((100% - 11 * 16px) / 12 + 16px)); }
.fb-cell { position: relative; border: 1px dashed transparent; border-radius: 10px; padding: 10px 12px 12px; margin: -11px -13px -13px; cursor: pointer; transition: border-color .12s, background .12s, box-shadow .12s; outline: none; }
.fb-cell:hover { border-color: var(--line); background: color-mix(in srgb, var(--chip-soft) 60%, transparent); }
.fb-cell.sel { border: 1.5px solid var(--maroon); background: color-mix(in srgb, var(--maroon-wash) 55%, #fff); box-shadow: 0 0 0 3px color-mix(in srgb, var(--maroon) 12%, transparent); }
.fb-cell:focus-visible { border-color: var(--maroon); }
.fb-cell .ff-field, .fb-cell .ff-group, .fb-cell .ff-consent { pointer-events: none; }
.fb-cell input, .fb-cell select, .fb-cell textarea { background: #fff !important; color: var(--ink-3) !important; cursor: pointer !important; }
.fb-cell.dragging { opacity: .25; }
.fb-cell.ph { border: 2px dashed var(--maroon); background: var(--maroon-wash); min-height: 64px; opacity: 1; }
.fb-cell.ph > * { visibility: hidden; }
.fb-grip { position: absolute; left: -12px; top: 50%; transform: translateY(-50%); width: 22px; height: 34px; border-radius: 7px; border: 1px solid var(--line); background: #fff; color: var(--ink-4); display: none; place-items: center; cursor: grab; touch-action: none; box-shadow: var(--shadow); z-index: 3; }
.fb-grip .jb-ico { width: 16px; height: 16px; }
.fb-cell:hover .fb-grip, .fb-cell.sel .fb-grip { display: grid; }
.fb-tools { position: absolute; right: 6px; top: -14px; display: none; gap: 4px; z-index: 3; }
.fb-cell.sel .fb-tools { display: flex; }
.fb-tools button { width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow); }
.fb-tools button:hover { border-color: var(--maroon); color: var(--maroon-text); }
.fb-tools .jb-ico { width: 15px; height: 15px; }
.fb-size { position: absolute; right: -7px; top: 50%; transform: translateY(-50%); width: 12px; height: 40px; border-radius: 6px; background: #fff; border: 1px solid var(--maroon); cursor: ew-resize; display: none; touch-action: none; z-index: 3; }
.fb-size::after { content: ''; position: absolute; left: 4px; top: 12px; width: 2px; height: 14px; border-left: 1px solid var(--maroon); border-right: 1px solid var(--maroon); }
.fb-cell:hover .fb-size, .fb-cell.sel .fb-size { display: block; }
.fb-wtag { position: absolute; right: 10px; bottom: -11px; font: 700 11px var(--sans); color: #fff; background: rgba(27, 27, 27, .78); padding: 2px 8px; border-radius: 99px; pointer-events: none; z-index: 4; }
.fb-ghost { position: fixed; z-index: 60; pointer-events: none; opacity: .92; box-shadow: 0 12px 30px rgba(0, 0, 0, .18); border-radius: 10px; background: #fff; }
.fb-ghost.chip { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; font: 600 13px var(--sans); border: 1px solid var(--maroon); color: var(--maroon-text); }
.fb-ghost.chip .jb-ico { width: 16px; height: 16px; }
.fb-empty { grid-column: 1 / -1; border: 2px dashed var(--line); border-radius: 12px; padding: 34px 20px; text-align: center; color: var(--ink-3); }
.fb-empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.fb-submit { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.fb-submit .jb-btn { pointer-events: none; }
.fb-submit small { color: var(--ink-4); font-size: 12.5px; }
.fb-sigline { margin-top: 26px; padding-top: 18px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 6px; color: var(--ink-3); font-size: 13px; }
.fb-sigline b { color: var(--ink); font-size: 14px; }
.fb-sigline span { display: block; height: 40px; border-bottom: 1px solid var(--ink-3); max-width: 420px; }

/* the settings panel (right): closes to a tab on the edge, like Discussions in the course player */
.fb-set { width: 316px; flex: none; background: var(--card); border-left: 1px solid var(--line); overflow-y: auto; padding: 16px 16px 40px; display: flex; flex-direction: column; gap: 14px; }
.fb-ihead { display: flex; align-items: center; gap: 10px; }
.fb-ihead .jb-ico { width: 20px; height: 20px; color: var(--maroon-text); }
.fb-ihead b { font: 600 16px var(--sans); }
.fb-ihead .jb-grow { min-width: 0; }
.fb-set .jb-field textarea { min-height: 72px; }
.fb-set[hidden] { display: none; }
.fb-sethead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -16px -16px 2px; padding: 0 8px 0 16px; height: 52px; flex: none; border-bottom: 1px solid var(--line); background: var(--chip-soft); position: sticky; top: -16px; z-index: 2; }
.fb-sethead b { display: inline-flex; align-items: center; gap: 8px; font: 700 12.5px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.fb-sethead b .jb-ico { width: 17px; height: 17px; color: var(--maroon-text); }
.fb-srow { display: flex; flex-direction: column; gap: 6px; }
.fb-srow > small { color: var(--ink-3); font-size: 12.5px; line-height: 1.4; }
.fb-srow > small a { color: var(--accent-text); }
.fb-srow.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fb-srow.two label { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fb-srow input:not([type=checkbox]), .fb-srow select, .fb-more input:not([type=checkbox]), .fb-more select { width: 100%; min-height: 38px; padding: 6px 10px; border: 1px solid #D5CFC2; border-radius: var(--r-sm); font-size: 14px; background: #fff; box-sizing: border-box; }
.fb-srow .ff-money input { padding-left: 26px; min-height: 38px; font-size: 14px; }
.fb-slab { font: 700 11.5px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-4); }
.fb-seg2 { display: flex; border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 3px; background: var(--chip-soft); }
.fb-seg2 button { flex: 1 1 0; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: none; border-radius: 7px; padding: 7px 6px; font: 600 13px var(--sans); color: var(--ink-3); cursor: pointer; line-height: 1.2; text-align: center; }
.fb-seg2 button .jb-ico { width: 15px; height: 15px; flex: none; }
.fb-seg2 button:hover { color: var(--ink); }
.fb-seg2 button[aria-pressed="true"] { background: var(--card); color: var(--maroon-text); box-shadow: 0 1px 3px rgba(40, 30, 20, .14); }
.fb-switch small { display: block; font-weight: 400; font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.fb-more { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0 12px; }
.fb-more summary { cursor: pointer; padding: 11px 0; font-weight: 600; font-size: 14px; list-style-position: inside; }
.fb-more[open] { padding-bottom: 12px; display: flex; flex-direction: column; gap: 14px; }
.fb-switch input:focus-visible { outline: 2px solid var(--maroon); outline-offset: 2px; }
.fb-more[open] summary { border-bottom: 1px solid var(--line-soft); }
.fb-more .jb-btn { align-self: flex-start; }
.fb-more .fb-srow + .fb-srow { margin-top: 8px; }
.fb-sfoot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--ink-3); }
.fb-edge { position: absolute; right: 0; top: 42%; z-index: 5; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 9px; border: 1px solid var(--line); border-right: 0; border-radius: 12px 0 0 12px; background: var(--card); box-shadow: -4px 4px 18px rgba(40, 30, 20, .12); cursor: pointer; color: var(--ink-2); font: 600 13px var(--sans); }
.fb-edge[hidden], .fb-app.previewing .fb-edge { display: none; }
.fb-edge .jb-ico { width: 17px; height: 17px; color: var(--maroon-text); }
.fb-edge span { writing-mode: vertical-rl; transform: rotate(180deg); letter-spacing: .04em; }
.fb-edge:hover { color: var(--ink); }
/* the ⋯ pop-over on a field */
.fb-canvas { position: relative; }
.fb-pop { position: absolute; z-index: 30; width: 290px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 34px rgba(40, 30, 20, .2); padding: 12px 14px 10px; display: flex; flex-direction: column; gap: 10px; }
.fb-pop .jb-field select, .fb-pop .jb-field input { width: 100%; }
.fb-pop p { margin: 0; }
.fb-pophead { display: flex; align-items: center; justify-content: space-between; font-size: 14px; }
.fb-bar [data-more].on { color: var(--maroon-text); background: var(--maroon-wash); }
/* the dismissible template band */
.fb-mode[hidden] { display: none; }
.fb-bandx { margin-left: auto; flex: none; width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: inherit; cursor: pointer; display: grid; place-items: center; opacity: .75; }
.fb-bandx:hover { opacity: 1; background: rgba(0, 0, 0, .06); }
.fb-bandx .jb-ico { width: 16px; height: 16px; }
.fb-switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); font-weight: 600; font-size: 14px; cursor: pointer; }
.fb-switch input { width: 40px; height: 22px; appearance: none; border-radius: 99px; background: var(--line); position: relative; cursor: pointer; transition: background .15s; flex: none; margin: 0; }
.fb-switch input::after { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: left .15s; }
.fb-switch input:checked { background: var(--maroon); }
.fb-switch input:checked::after { left: 21px; }
.fb-wseg { display: grid; grid-template-columns: repeat(6, 1fr); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.fb-wseg button { border: 0; border-right: 1px solid var(--line); background: #fff; padding: 8px 0 6px; font: 600 12px var(--sans); color: var(--ink-3); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.fb-wseg button:last-child { border-right: 0; }
.fb-wseg button i { display: block; height: 6px; border-radius: 3px; background: var(--line); width: 26px; position: relative; overflow: hidden; }
.fb-wseg button i::after { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--f); background: var(--ink-4); }
.fb-wseg button[aria-pressed="true"] { background: var(--maroon-wash); color: var(--maroon-text); }
.fb-wseg button[aria-pressed="true"] i::after { background: var(--maroon); }
.fb-opts { display: flex; flex-direction: column; gap: 6px; }
.fb-opt { display: flex; align-items: center; gap: 6px; }
.fb-opt input { flex: 1; min-height: 38px; padding: 6px 10px; border: 1px solid #D5CFC2; border-radius: var(--r-sm); font-size: 14px; min-width: 0; }
.fb-ilabel { font-weight: 600; font-size: 14px; }
.fb-iacts { display: flex; gap: 8px; margin-top: 4px; }
.fb-iacts .jb-btn { flex: 1; justify-content: center; }
.fb-hint { display: flex; flex-direction: column; gap: 12px; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.fb-hint ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.fb-stat { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fb-stat div { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.fb-stat b { display: block; font-size: 22px; font-family: var(--serif); }
.fb-stat span { font-size: 12px; color: var(--ink-3); }

/* preview */
.fb-app.previewing .fb-palette, .fb-app.previewing .fb-set { display: none; }
.fb-pvbar { display: flex; align-items: center; justify-content: center; gap: 10px; margin: -10px auto 18px; max-width: 880px; font-size: 13px; color: var(--ink-3); }
.fb-pvnote { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px; background: var(--accent-tint); color: var(--accent-text); font-size: 13.5px; margin-bottom: 20px; }
.fb-pvnote .jb-ico { width: 18px; height: 18px; flex: none; }

/* settings panel */
.fb-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fb-cards.three { grid-template-columns: repeat(3, 1fr); }
.fb-card { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; font-size: 13px; color: var(--ink-3); line-height: 1.35; }
.fb-card input { position: absolute; opacity: 0; }
.fb-card b { display: flex; align-items: center; gap: 6px; color: var(--ink); font-size: 14px; }
.fb-card b .jb-ico { width: 16px; height: 16px; color: var(--ink-4); }
.fb-card:has(input:checked) { border-color: var(--maroon); background: var(--maroon-wash); box-shadow: 0 0 0 2px color-mix(in srgb, var(--maroon) 15%, transparent); }
.fb-card:has(input:checked) b .jb-ico { color: var(--maroon-text); }
.fb-card:has(input:focus-visible) { outline: 2px solid var(--maroon); outline-offset: 2px; }
.fb-sec { font: 700 12px var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-4); margin: 18px 0 8px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.fb-sec:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.fb-link { display: flex; gap: 6px; }
.fb-link input { flex: 1; min-width: 0; font: 13px ui-monospace, monospace; }

@media (max-width: 1100px) { .fb-set { width: 290px; } .fb-palette { width: 216px; } }
@media (max-width: 860px) {
  .fb-body { flex-direction: column; overflow-y: auto; }
  .fb-palette { width: auto; border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; padding: 10px; }
  .fb-palette .fb-pgrp, .fb-palette h2, .fb-ptip { display: none; }
  .fb-pitems { display: flex; overflow-x: auto; gap: 6px; }
  .fb-pitem { flex: none; flex-direction: row; align-items: center; padding: 8px 10px; }
  .fb-palette .fb-pall { display: flex; gap: 6px; overflow-x: auto; }
  .fb-canvas { overflow: visible; padding: 14px 12px 30px; }
  .fb-page { padding: 24px 18px 28px; }
  .fb-set { width: auto; border-left: 0; border-top: 1px solid var(--line); overflow: visible; }
  .fb-top .hide-sm { display: none; }
  .fb-top .cb-save { display: none; }
  .fb-top { gap: 6px; padding: 0 8px; grid-template-columns: auto 0 1fr; }
  .fb-r { justify-content: flex-end; }
  .fb-edge { display: none; }
}

/* ------------------------------------------------------------------ the public link page (/f/) */
.ffp-wrap { max-width: 760px; margin: 0 auto; padding: 28px 16px 60px; }
.ffp-card { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 34px 40px 38px; }
@media (max-width: 640px) { .ffp-card { padding: 22px 18px 26px; } }
.ffp-org { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.ffp-org img { max-height: 46px; max-width: 160px; object-fit: contain; }
.ffp-org b { font-family: var(--serif); font-size: 19px; color: var(--maroon-text); }
.ffp-who { padding: 16px; border-radius: 12px; background: var(--sage-mist); border: 1px solid var(--sage-line); margin: 4px 0 22px; }
.ffp-who p { margin: 0 0 10px; font-size: 13.5px; color: var(--ink-2); }
.ffp-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.ffp-done { text-align: center; padding: 30px 10px; }
.ffp-done .jb-ico { width: 46px; height: 46px; color: var(--sage); }
.ffp-foot { text-align: center; font-size: 12px; color: var(--ink-4); margin-top: 18px; }

/* ------------------------------------------------------------------ approval types (Templates → Approvals) and request progress */
.jb-tplcard.off { opacity: .6; }
.ap-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.ap-step { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 99px; background: var(--chip-soft); border: 1px solid var(--line); font-size: 12.5px; }
.ap-step .jb-ico { width: 14px; height: 14px; color: var(--ink-4); }
.ap-step b { font-weight: 600; } .ap-step i { font-style: normal; color: var(--ink-3); }
.ap-arrow { color: var(--ink-4); font-weight: 700; }
.ap-srow { display: grid; grid-template-columns: 26px minmax(0, 1fr) minmax(0, 1.2fr) auto; gap: 8px; align-items: center; }
.ap-srow input, .ap-srow select { min-height: 40px; padding: 6px 10px; border: 1px solid #D5CFC2; border-radius: var(--r-sm); background: #fff; font-size: 14px; min-width: 0; width: 100%; }
.ap-n { width: 26px; height: 26px; border-radius: 50%; background: var(--maroon); color: var(--on-maroon); display: grid; place-items: center; font: 700 12px var(--sans); }
.ap-sbtns { display: inline-flex; gap: 2px; }
@media (max-width: 520px) { .ap-srow { grid-template-columns: 26px 1fr auto; } .ap-srow select { grid-column: 2 / -1; } }
.ap-progress { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 0; }
.ap-progress li { display: flex; gap: 12px; position: relative; padding-bottom: 14px; }
.ap-progress li:not(:last-child)::before { content: ''; position: absolute; left: 13px; top: 28px; bottom: 0; border-left: 2px solid var(--line); }
.ap-progress .dot { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; font: 700 12px var(--sans); background: var(--chip); color: var(--ink-3); border: 2px solid var(--card); box-shadow: 0 0 0 1px var(--line); }
.ap-progress li.done .dot { background: var(--sage); color: #fff; box-shadow: none; }
.ap-progress li.no .dot { background: var(--maroon); color: var(--on-maroon); box-shadow: none; }
.ap-progress li.now .dot { background: var(--accent-tint); color: var(--accent-text); box-shadow: 0 0 0 2px var(--accent); }
.ap-progress li > div { display: flex; flex-direction: column; gap: 1px; padding-top: 3px; min-width: 0; }
.ap-progress b { font-size: 14px; } .ap-progress span { font-size: 13px; color: var(--ink-3); } .ap-progress em { font-size: 13px; color: var(--ink-2); }

/* Manage account → Automations */
.aa-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.aa-search { flex: 1 1 280px; display: flex; align-items: center; gap: 8px; border: 1px solid #D5CFC2; border-radius: var(--r-sm); background: #fff; padding: 0 12px; min-height: 42px; }
.aa-search .jb-ico { width: 17px; height: 17px; color: var(--ink-4); }
.aa-search input { border: 0; outline: none; flex: 1; font-size: 15px; background: none; min-width: 0; }
.aa-tbl td { vertical-align: top; }
.aa-steps { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aa-off td { opacity: .55; } .aa-off td:last-child { opacity: 1; }
.aa-switch { display: inline-flex; padding: 0; border: 0; }
.ff-parts { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 10px 12px; }
.ff-part { grid-column: span var(--pw, 12); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ff-part input { min-height: 44px; padding: 8px 12px; border: 1px solid #D5CFC2; border-radius: var(--r-sm); background: #fff; width: 100%; font-size: 16px; box-sizing: border-box; }
.ff-part small { font-size: 12px; color: var(--ink-3); }
@media (max-width: 640px) { .ff-part { grid-column: 1 / -1; } }
.ff-p a, .ff-help a { color: var(--maroon-text); }

/* in-place editing: the selected field's text is typed right on the page; the bar sits above it */
.fb-cell.sel .ff-field, .fb-cell.sel .ff-group, .fb-cell.sel .ff-consent { pointer-events: auto; }
.fb-cell.sel input:disabled, .fb-cell.sel select:disabled, .fb-cell.sel textarea:disabled { pointer-events: none; }
.fb-ed { outline: none; border-radius: 4px; cursor: text; transition: background .12s, box-shadow .12s; }
.fb-ed:hover { background: color-mix(in srgb, var(--maroon) 6%, transparent); }
.fb-ed:focus { background: #fff; box-shadow: 0 0 0 2px color-mix(in srgb, var(--maroon) 45%, transparent); }
.fb-ed.empty::before { content: attr(data-ph); color: var(--ink-4); font-weight: 400; pointer-events: none; }
.fb-ed.empty:focus::before { content: attr(data-ph); }
.fb-cell.sel .ff-help.fb-ed { display: block; min-height: 1.4em; padding: 1px 4px; margin-left: -4px; }
.fb-cell.sel .ff-l .fb-ed, .fb-cell.sel .ff-consent .fb-ed { padding: 1px 4px; margin-left: -4px; }
.fb-cell.sel .ff-opt { pointer-events: auto; } .fb-cell.sel .ff-opt span.fb-ed { flex: 1; padding: 1px 4px; }
.fb-optx { border: 0; background: none; color: var(--ink-4); width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; cursor: pointer; flex: none; }
.fb-optx:hover { background: var(--chip); color: var(--maroon-text); } .fb-optx .jb-ico { width: 14px; height: 14px; }
.fb-addopt { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; border: 1px dashed var(--line); background: #fff; border-radius: 8px; padding: 7px 12px; font: 600 13px var(--sans); color: var(--ink-3); cursor: pointer; }
.fb-addopt:hover { border-color: var(--maroon); color: var(--maroon-text); } .fb-addopt .jb-ico { width: 14px; height: 14px; }
.fb-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.fb-chip { display: inline-flex; align-items: center; gap: 2px; padding: 3px 4px 3px 10px; border: 1px solid var(--line); border-radius: 99px; background: #fff; font-size: 13.5px; }
.fb-cell.sel input.fb-phedit, .fb-cell.sel textarea.fb-phedit { cursor: text !important; color: var(--ink-3) !important; font-style: italic; border-style: dashed; }
.fb-cell.sel input.fb-phedit:focus, .fb-cell.sel textarea.fb-phedit:focus { font-style: normal; border-style: solid; }
.fb-bar { position: absolute; left: 8px; bottom: calc(100% + 6px); z-index: 8; display: flex; flex-direction: column; gap: 2px; padding: 4px 6px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 6px 20px rgba(40, 30, 20, .14); font: 500 13px var(--sans); color: var(--ink-2); white-space: nowrap; animation: lp-in .12s ease-out; min-width: 300px; }
.fb-brow { display: flex; align-items: center; gap: 2px; } .fb-brow + .fb-brow { border-top: 1px solid var(--line-soft); padding-top: 2px; }
.fb-grow { flex: 1; min-width: 8px; } .fb-blab { font: 700 11px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-4); padding: 0 6px 0 4px; }
.fb-bar select { border: 0; background: var(--chip-soft); border-radius: 7px; font: 600 13px var(--sans); padding: 5px 8px; min-height: 30px; color: var(--ink); cursor: pointer; }
.fb-bar button { border: 0; background: none; min-width: 30px; height: 30px; padding: 0 7px; border-radius: 7px; font: 600 13px var(--sans); color: var(--ink-2); cursor: pointer; display: inline-grid; place-items: center; }
.fb-bar button:hover { background: var(--chip); color: var(--ink); }
.fb-bar button .jb-ico { width: 16px; height: 16px; }
.fb-bar button[aria-pressed="true"] { background: var(--maroon-wash); color: var(--maroon-text); }
.fb-bar .bold { font-weight: 800; } .fb-bar .italic { font-style: italic; font-family: Georgia, serif; } .fb-bar .underline { text-decoration: underline; }
.fb-bar .fb-fmt { display: inline-flex; gap: 1px; opacity: .4; transition: opacity .12s; } .fb-bar.rich-on .fb-fmt { opacity: 1; }
.fb-bar .fb-req { padding: 0 10px; } .fb-bar .fb-req[aria-pressed="true"] { background: var(--maroon); color: var(--on-maroon); }
.fb-bar .fb-ws { display: inline-flex; gap: 1px; } .fb-bar .fb-ws button { min-width: 30px; font-size: 12px; }
.fb-bk { display: inline-flex; align-items: center; gap: 6px; padding: 0 8px; font-weight: 600; color: var(--ink); } .fb-bk .jb-ico { width: 15px; height: 15px; color: var(--maroon-text); }
.fb-sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
@media (max-width: 860px) { .fb-bar { min-width: 0; max-width: calc(100vw - 40px); } }

/* which kind of thing you're editing: template (amber, blueprint), draft (blue), live (green), closed (grey) */
.fb-mode { flex: none; display: flex; align-items: center; gap: 12px; padding: 9px 18px; font-size: 13.5px; border-bottom: 1px solid transparent; }
.fb-mode .jb-ico { width: 20px; height: 20px; flex: none; }
.fb-mode div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; min-width: 0; }
.fb-mode b { font: 800 13px var(--sans); letter-spacing: .06em; text-transform: uppercase; }
.fb-app.m-tpl .fb-mode, .fb-app.m-apr .fb-mode { background: #FFF3D6; color: #7A4A00; border-color: #F1D08A; }
.fb-app.m-draft .fb-mode { background: #E8EEFB; color: #24407A; border-color: #C3D2F0; }
.fb-app.m-live .fb-mode { background: var(--sage-mist); color: var(--sage-text); border-color: var(--sage-line); }
.fb-app.m-closed .fb-mode { background: var(--chip); color: var(--ink-2); border-color: var(--line); }
.fb-app.m-tpl .fb-top, .fb-app.m-apr .fb-top { box-shadow: inset 0 3px 0 #E0A526; }
.fb-app.m-draft .fb-top { box-shadow: inset 0 3px 0 #4A6FC1; }
.fb-app.m-live .fb-top { box-shadow: inset 0 3px 0 var(--sage); }
.fb-app.m-tpl .fb-canvas, .fb-app.m-apr .fb-canvas { background-color: #FBF6EA; background-image: linear-gradient(rgba(201, 150, 40, .12) 1px, transparent 1px), linear-gradient(90deg, rgba(201, 150, 40, .12) 1px, transparent 1px); background-size: 24px 24px; }
.fb-app.m-tpl .fb-page, .fb-app.m-apr .fb-page { outline: 2px dashed #E0A526; outline-offset: 6px; }
.fb-app.m-draft .fb-page { outline: 2px solid #C3D2F0; outline-offset: 6px; }
.fb-page { position: relative; }
.fb-ribbon { position: absolute; top: 18px; right: -8px; padding: 5px 14px; font: 800 11px var(--sans); letter-spacing: .14em; text-transform: uppercase; border-radius: 6px 0 0 6px; box-shadow: 0 2px 6px rgba(0, 0, 0, .12); }
.fb-ribbon::after { content: ''; position: absolute; right: 0; bottom: -8px; border-left: 8px solid rgba(0, 0, 0, .25); border-bottom: 8px solid transparent; }
.fb-app.m-tpl .fb-ribbon, .fb-app.m-apr .fb-ribbon { background: #E0A526; color: #3D2600; }
.fb-app.m-draft .fb-ribbon { background: #4A6FC1; color: #fff; }
.fb-app.m-live .fb-ribbon { background: var(--sage); color: #fff; }
.fb-app.m-closed .fb-ribbon { background: var(--ink-3); color: #fff; }
.fb-app.previewing .fb-ribbon { display: none; }
@media (max-width: 860px) { .fb-mode span { display: none; } }
