/* The form template gallery (/templates) and the live forms on each template page. Built by tools/templates.py.
   The page chrome follows assets/site.css (ring shadows, pills, Inter); the live forms take every color, font and
   corner from their style (assets/themes.css). */

/* ═══ Page heads ═══ */
.thero { padding: 64px 0 48px; }
.thero--sm { padding: 48px 0 24px; }
.thero--tpl { padding: 40px 0 32px; }
.thero__in { display: flex; flex-direction: column; gap: 18px; max-width: 860px; }
.thero .hero__ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.tcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.tcrumb a:hover { color: var(--ink); }
.tcrumb span[aria-hidden] { color: var(--light); }

/* ═══ Gallery ═══ */
.tgal { padding: 8px 0 96px; }
.tgal__in { display: grid; gap: 32px; }
@media (min-width: 1024px) { .tgal__in { grid-template-columns: 220px minmax(0, 1fr); gap: 40px; } }
.trail { display: none; }
@media (min-width: 1024px) {
  .trail { display: flex; flex-direction: column; gap: 1px; position: sticky; top: calc(var(--header-h) + 16px); align-self: start; max-height: calc(100vh - var(--header-h) - 32px); overflow-y: auto; scrollbar-width: thin; }
}
.trail__h { padding: 0 10px 8px; font-size: 13px; font-weight: 500; color: var(--meta); }
.trail__i { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; padding: 0 10px; border-radius: var(--r-sm); font-size: 14px; color: var(--muted); transition: background-color var(--fast) var(--ease-out), color var(--fast) var(--ease-out); }
.trail__i span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trail__i small { font-size: 12px; color: var(--faint); }
.trail__i:hover { background: var(--hover); color: var(--ink); }
.trail__i.is-on { background: var(--surface); box-shadow: var(--sh-chip); color: var(--ink); font-weight: 500; }
.trail__i--sub { padding-left: 22px; font-size: 13.5px; }
.trail__m { margin-top: 10px; }
.trail__m > summary { display: flex; align-items: center; justify-content: space-between; padding-top: 6px; cursor: pointer; list-style: none; }
.trail__m > summary::-webkit-details-marker { display: none; }
.trail__m > summary svg { width: 12px; height: 12px; transition: transform var(--normal) var(--ease-out); }
.trail__m:not([open]) > summary svg { transform: rotate(-90deg); }
.trail__m > summary:hover { color: var(--ink); }

.tgal__main { display: flex; min-width: 0; flex-direction: column; gap: 16px; }
.tfilter { display: none; flex-direction: column; gap: 12px; }
.js .tfilter { display: flex; }
.tsearch { position: relative; display: block; }
.tsearch svg { position: absolute; left: 14px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.tsearch input { width: 100%; height: 44px; padding: 0 16px 0 40px; box-shadow: var(--sh-input); border-radius: 999px; background: var(--panel); font-size: 15px; outline: none; transition: box-shadow var(--fast) var(--ease-out); }
.tsearch input::placeholder { color: var(--faint); }
.tsearch input:focus { box-shadow: var(--sh-focus); }
.tsearch input::-webkit-search-cancel-button { cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 30px; padding: 0 12px; box-shadow: var(--sh-chip); border-radius: 999px; background: var(--panel); font-size: 13px; font-weight: 500; color: var(--nav); transition: background-color var(--fast) var(--ease-out), color var(--fast) var(--ease-out), box-shadow var(--fast) var(--ease-out); }
.chip:hover { box-shadow: var(--sh-outline); color: var(--ink); }
.chip.is-on { background: var(--green-100); color: var(--green-ink); box-shadow: 0 0 0 1px var(--green-300); }
.tjump { box-shadow: var(--sh-rest); border-radius: var(--r-lg); background: var(--panel); }
@media (min-width: 1024px) { .tjump { display: none; } }
.tjump summary { display: flex; align-items: center; justify-content: space-between; height: 44px; padding: 0 14px; font-size: 14.5px; font-weight: 500; }
.tjump summary svg { width: 14px; height: 14px; transition: transform var(--normal) var(--ease-out); }
.tjump[open] summary svg { transform: rotate(180deg); }
.tjump__list { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 4px 8px 10px; border-top: 1px solid var(--line); }
.tjump__list a { padding: 8px 6px; border-radius: var(--r-sm); font-size: 14px; color: var(--muted); }
.tjump__list a:hover { background: var(--hover); color: var(--ink); }
.tjump__h { grid-column: 1 / -1; padding: 12px 6px 2px; font-size: 13px; font-weight: 500; color: var(--meta); }
.tag--link:hover { background: var(--green-100); color: var(--green-ink); }
.trel__more { display: flex; flex-wrap: wrap; gap: 16px; }
.tcats { display: grid; gap: 28px 24px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.tcats__g h3 { margin-bottom: 10px; }
.tcats__g h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.tcats__g ul { display: flex; flex-direction: column; gap: 2px; }
.tcats__g li { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.tcats__g li a { padding: 4px 0; font-size: 14.5px; color: var(--muted); }
.tcats__g li a:hover { color: var(--ink); }
.tcats__g small { font-size: 12px; color: var(--faint); }
.tcount { font-size: 14px; color: var(--meta); }
.tnone { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 64px 16px; border: 1px dashed var(--line-strong); border-radius: var(--r-lg); text-align: center; color: var(--muted); }

.tgrid { display: grid; gap: 16px; }
@media (min-width: 640px) { .tgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .tgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .tgrid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.trel__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 32px; }

/* A card: the drawing of the form, then the name */
.tcard { display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--sh-rest); border-radius: var(--r-lg); background: var(--panel); content-visibility: auto; contain-intrinsic-size: auto 360px; transition: box-shadow var(--fast) var(--ease-out), transform var(--normal) var(--ease-out); }
.tcard:hover { box-shadow: var(--sh-hover); }
@media (prefers-reduced-motion: no-preference) { .tcard:hover { transform: translateY(-2px); } }
.tcard[hidden] { display: none; }
.tcard__body { display: flex; flex: 1; flex-direction: column; gap: 6px; padding: 16px 18px 18px; }
.tcard__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.tcard__name { font-size: 15.5px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.35; }
.tcard__blurb { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 14px; line-height: 1.5; color: var(--muted); }
.tcard__meta { margin-top: auto; padding-top: 6px; font-size: 13px; color: var(--meta); }
.tag--warn { background: var(--tag-orange); color: var(--tag-orange-ink); }

/* ═══ A template's page ═══ */
.tpl__top { display: flex; flex-direction: column; gap: 24px; margin-top: 20px; }
@media (min-width: 900px) { .tpl__top { flex-direction: row; align-items: flex-end; justify-content: space-between; } }
.tpl__copy { display: flex; flex-direction: column; gap: 14px; max-width: 720px; }
.tpl__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tpl__ctas { display: flex; flex-wrap: wrap; gap: 10px; flex-shrink: 0; }
.tpl { padding: 8px 0 96px; scroll-margin-top: var(--header-h); }
.tpl__in { display: grid; gap: 24px; }
@media (min-width: 1024px) { .tpl__in { grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: start; } }
.tpl__main { display: flex; min-width: 0; flex-direction: column; gap: 12px; }
.tpl__side { display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 1024px) { .tpl__side { position: sticky; top: calc(var(--header-h) + 16px); } }
.tbox { box-shadow: var(--sh-rest); border-radius: var(--r-lg); background: var(--panel); }
.tbox__h { padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 500; color: var(--muted); }
.tasks { max-height: 360px; overflow-y: auto; }
.tasks li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: baseline; gap: 8px; padding: 9px 16px; border-bottom: 1px solid var(--line-light); font-size: 13.5px; }
.tasks li:last-child { border-bottom: 0; }
.tasks li.tasks__page { background: var(--surface-3); font-weight: 500; color: var(--ink); }
.tasks li.tasks__page .tasks__n, .tasks li.tasks__page .tasks__k { color: var(--meta); }
.tasks__n { font-size: 11px; color: var(--faint); }
.tasks__k { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
.tchecks { margin: 0; padding: 14px 16px 16px; gap: 10px; }
.tchecks li { font-size: 13.5px; }
.tbox__cta { width: 100%; height: 44px; }
.tsteps { display: grid; gap: 16px; margin-top: 40px; }
@media (min-width: 900px) { .tsteps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tsteps li { display: flex; flex-direction: column; gap: 10px; padding: 24px; box-shadow: var(--sh-rest); border-radius: var(--r-lg); background: var(--panel); }
.tsteps__n { font-size: 13px; font-weight: 500; color: var(--signal-text); }
.tsteps p { font-size: 15px; line-height: 1.6; color: var(--muted); }

/* ═══ Styles: a stage in one style (assets/themes.css sets the colors) ═══ */
.fth { position: relative; display: block; background-color: var(--f-bg); color: var(--f-text); font-family: var(--f-font); }
.fth[data-pattern="dots"] { background-image: radial-gradient(circle, var(--f-pattern) 1.2px, transparent 1.2px); background-size: 18px 18px; }
.fth[data-pattern="grid"] { background-image: linear-gradient(var(--f-pattern) 1px, transparent 1px), linear-gradient(90deg, var(--f-pattern) 1px, transparent 1px); background-size: 28px 28px; }
.fth[data-dark] { color-scheme: dark; }
.fth__card { position: relative; display: flex; flex-direction: column; overflow: hidden; background: var(--f-card); border: var(--f-bw) solid var(--f-border); border-radius: var(--f-card-radius); }
.fth[data-shadow="soft"] .fth__card { box-shadow: 0 24px 48px -28px rgb(10 10 10 / 0.35), 0 2px 6px rgb(10 10 10 / 0.05); }
.fth[data-shadow="hard"] .fth__card { box-shadow: 6px 6px 0 var(--f-text); }
.fth[data-layout="plain"] .fth__card { border-color: transparent; background: transparent; box-shadow: none; }
.fart { display: none; background-color: var(--f-art-bg, var(--f-accent)); background-size: cover; background-position: center; background-repeat: no-repeat; }
.fth[data-layout="cover"] .fart { display: block; height: 140px; border-bottom: var(--f-bw) solid var(--f-border); }
.fth[data-layout="split"] .fart { display: block; height: 140px; }
@media (min-width: 900px) {
  .fth[data-layout="split"] .fth__card { flex-direction: row; }
  .fth[data-layout="split"] .fart { width: 38%; height: auto; flex-shrink: 0; background-size: 100% auto; background-position: center top; }
}

/* The stage on a template page */
.tpl .fth { padding: 20px; border-radius: var(--r-2xl); box-shadow: var(--sh-rest); transition: background-color var(--slow) var(--ease-out); }
@media (min-width: 768px) { .tpl .fth { padding: 48px 40px; } }
.tpl .fth__card { max-width: 680px; margin-inline: auto; }
.tpl .fth[data-layout="split"] .fth__card { max-width: 880px; }
.tpl .fth__body { flex: 1; min-width: 0; padding: 28px 22px; }
@media (min-width: 768px) { .tpl .fth__body { padding: 40px; } }
.tpl .fth[data-layout="plain"] .fth__body { padding-inline: 4px; }

/* The style menu */
.tbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.tsty { display: none; align-items: center; gap: 8px; }
.js .tsty { display: flex; }
.tsty__l { font-size: 13px; font-weight: 500; color: var(--meta); }
.tsty__dd { position: relative; }
.tsty__btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 10px; box-shadow: var(--sh-outline); border-radius: 999px; background: var(--panel); font-size: 14px; font-weight: 500; transition: box-shadow var(--fast) var(--ease-out); }
.tsty__btn:hover { box-shadow: 0 0 0 1px rgba(0,0,0,.14), 0 2px 4px rgba(0,0,0,.16); }
.tsty__btn b { font-weight: 500; }
.tsty__chev { width: 12px; height: 12px; color: var(--faint); transition: transform var(--normal) var(--ease-out); }
.tsty__btn[aria-expanded="true"] .tsty__chev { transform: rotate(180deg); }
.tsty__list { position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; display: none; width: min(290px, calc(100vw - 24px)); max-height: 420px; overflow-y: auto; padding: 6px; border-radius: var(--r-lg); background: var(--panel); box-shadow: var(--shadow-pop); }
.tsty.is-open .tsty__list { display: block; }
.tsty__list li { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 10px; border-radius: var(--r-sm); cursor: pointer; }
.tsty__list li.is-active { background: var(--hover); }
.tsty__list li[aria-selected="true"] b::after { content: " ✓"; color: var(--signal-text); }
.tsty__list li > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.tsty__list b { font-size: 14px; font-weight: 500; }
.tsty__list small { font-size: 12.5px; color: var(--muted); }
.tsty__shuffle { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--muted); transition: color var(--fast), background-color var(--fast); }
.tsty__shuffle:hover { background: var(--hover); color: var(--ink); }
.tsty__shuffle svg { width: 15px; height: 15px; }
.sw { display: inline-flex; flex-shrink: 0; overflow: hidden; width: 30px; height: 18px; border: 1px solid rgb(10 10 10 / 0.12); border-radius: 999px; }
.sw i { flex: 1; }
.sw--own i:nth-child(1) { background: #ff5a36; } .sw--own i:nth-child(2) { background: #5b8cff; } .sw--own i:nth-child(3) { background: #3dff7a; }

/* Card previews: the first questions in the template's style */
.tp { display: block; height: 214px; overflow: hidden; padding: 16px 16px 0; border-bottom: 1px solid var(--line); }
.tp .fth__card { height: 100%; border-bottom: 0; border-radius: var(--f-card-radius) var(--f-card-radius) 0 0; }
.tp[data-shadow="hard"] .fth__card { box-shadow: 4px 4px 0 var(--f-text); }
.tp[data-shadow="soft"] .fth__card { box-shadow: 0 10px 24px -16px rgb(10 10 10 / 0.4); }
.tp[data-layout="plain"] { padding-top: 10px; }
.tp[data-layout="cover"] .fart { height: 46px; flex-shrink: 0; }
.tp[data-layout="split"] .fth__card { flex-direction: row; }
.tp[data-layout="split"] .fart { width: 34%; height: auto; flex-shrink: 0; background-size: auto 100%; }
.tp__in { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 8px; padding: 14px 14px 0; overflow: hidden; }
.tp[data-layout="plain"] .tp__in { padding-inline: 4px; }
.tp__title { font-family: var(--f-head); font-weight: var(--f-head-weight); font-style: var(--f-head-style); font-size: 13.5px; letter-spacing: -0.01em; line-height: 1.2; }
.tp[data-layout="plain"] .tp__title { font-size: 17px; }
.tp__intro { margin-top: -5px; font-size: 9.5px; line-height: 1.4; color: var(--f-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp__f { display: flex; flex-direction: column; gap: 4px; }
.tp__l { font-size: 9.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp__box { display: block; height: 16px; border: var(--f-bw) solid var(--f-border); border-radius: min(var(--f-radius), 8px); background: var(--f-field); }
.tp[data-input="line"] .tp__box { border-width: 0 0 var(--f-bw); border-radius: 0; background: transparent; }
.tp[data-input="fill"] .tp__box, .tp[data-input="fill"] .tp__opt { border-color: transparent; }
.tp__box--tall { height: 30px; }
.tp__box--dash { border-style: dashed; }
.tp__box--dd { position: relative; }
.tp__box--dd::after { content: ""; position: absolute; right: 6px; top: 4px; width: 4px; height: 4px; border-right: 1px solid var(--f-faint); border-bottom: 1px solid var(--f-faint); transform: rotate(45deg); }
.tp__row { display: flex; gap: 5px; }
.tp__row .tp__opt, .tp__row .tp__box { flex: 1; }
.tp__opt { display: flex; align-items: center; gap: 5px; height: 16px; padding: 0 6px; border: var(--f-bw) solid var(--f-border); border-radius: min(var(--f-radius), 8px); background: var(--f-field); font-size: 8.5px; white-space: nowrap; overflow: hidden; }
.tp__opt--plain { border: 0; padding: 0; background: transparent; }
.tp__dot, .tp__sq { flex-shrink: 0; width: 6px; height: 6px; border: 1px solid var(--f-faint); }
.tp__dot { border-radius: 999px; }
.tp__sq { border-radius: 1.5px; }
.tp__stars { display: flex; gap: 3px; color: var(--f-faint); }
.tp__stars svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.tp__steps { display: flex; gap: 2px; }
.tp__steps i { flex: 1; height: 14px; border: var(--f-bw) solid var(--f-border); border-radius: min(var(--f-radius), 4px); background: var(--f-field); }
.tp__btn { align-self: flex-start; margin-top: 2px; padding: 4px 11px; border-radius: min(var(--f-btn-radius), 99px); background: var(--f-accent); font-size: 9px; font-weight: 600; color: var(--f-accent-ink); }
.tp[data-shadow="hard"] .tp__btn { box-shadow: 2px 2px 0 var(--f-text); }

/* Style strips */
.tlooks { display: grid; gap: 14px; margin-top: 40px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .tlooks { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .tlooks--all { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.tlook { display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--sh-rest); border-radius: var(--r-lg); background: var(--panel); text-align: left; transition: box-shadow var(--normal) var(--ease-out), transform var(--normal) var(--ease-out); }
.tlook:hover, .tlook.is-on { box-shadow: 0 0 0 1px var(--green), 0 0 0 4px rgba(12,140,94,.1); }
@media (prefers-reduced-motion: no-preference) { .tlook:hover { transform: translateY(-2px); } }
.tlooks--all .tp { height: 150px; padding: 10px 10px 0; }
.tlook__n { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 2px 10px; padding: 12px 14px; }
.tlook__n .sw { grid-row: span 2; }
.tlook__n b { font-size: 14px; font-weight: 600; }
.tlook__n small { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Question types, features, steps and logos */
.tsplit { display: grid; gap: 32px; }
@media (min-width: 1024px) { .tsplit { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 64px; } }
.tkinds { display: flex; flex-wrap: wrap; gap: 8px; }
.tkinds li { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; box-shadow: var(--sh-chip); border-radius: 999px; background: var(--panel); font-size: 14px; color: var(--ink-2); }
.tkinds li:nth-child(5n + 1) { box-shadow: 0 0 0 1px var(--green-300); background: var(--signal-soft); color: var(--signal-text); }
.tfeats { display: grid; gap: 16px; margin-top: 48px; }
@media (min-width: 640px) { .tfeats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .tfeats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tfeat { display: flex; flex-direction: column; gap: 8px; padding: 22px; box-shadow: var(--sh-rest); border-radius: var(--r-lg); background: var(--panel); }
.tfeat p { font-size: 14.5px; line-height: 1.55; color: var(--muted); }
.tlogos { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.tlogos li { display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: var(--r-lg); box-shadow: var(--sh-rest); background: var(--panel); }
.tlogos img { width: 28px; height: 28px; object-fit: contain; }

/* ═══ The live form: every color, font and corner comes from the style ═══ */
.cf { display: flex; flex-direction: column; gap: 24px; color: var(--f-text); font-family: var(--f-font); }
.cf__head { display: flex; flex-direction: column; gap: 8px; }
.cf__title { font-family: var(--f-head); font-size: 28px; line-height: 1.12; font-weight: var(--f-head-weight); font-style: var(--f-head-style); letter-spacing: -0.02em; }
.fth[data-layout="plain"] .cf__title { font-size: clamp(34px, 5vw, 46px); line-height: 1.02; }
.cf__intro { font-size: 15px; line-height: 1.55; color: var(--f-muted); }
.cf__prog { display: grid; grid-template-columns: 1fr auto; gap: 8px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--f-muted); }
.cf__bar { grid-column: 1 / -1; height: 4px; overflow: hidden; border-radius: 999px; background: var(--f-soft); }
.cf__bar i { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--f-accent); transition: width var(--slow) var(--ease-out); }
.cf__page { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.cf__page + .cf__page { padding-top: 24px; border-top: 1px dashed var(--f-border); }
.js .cf__page + .cf__page { padding-top: 0; border-top: 0; }
.cf__ptitle { font-size: 11.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--f-muted); }
.js .cf__prog:not([hidden]) ~ .cf__page .cf__ptitle { display: none; }
.cf__fields { display: grid; gap: 20px 14px; }
@media (min-width: 560px) { .cf__fields { grid-template-columns: 1fr 1fr; } }
.cf__f { display: flex; min-width: 0; flex-direction: column; gap: 7px; grid-column: 1 / -1; }
@media (min-width: 560px) { .cf__f--half { grid-column: auto; } }
.cf__f[hidden], .cf__page[hidden] { display: none; }
.cf__label { font-size: 14px; font-weight: 500; }
.cf__req { color: var(--f-faint); }
.cf__help { margin-top: -3px; font-size: 13px; line-height: 1.5; color: var(--f-muted); }
.cf__err { font-size: 12.5px; color: #d93a23; }
.fth[data-dark] .cf__err { color: #ff8a73; }
.cf__f--note .cf__note-h { font-size: 15px; font-weight: 500; }
.cf__f--note p:not(.cf__note-h) { font-size: 14px; line-height: 1.6; color: var(--f-muted); }

.cf__in { width: 100%; height: 42px; padding: 0 12px; border: var(--f-bw) solid var(--f-border); border-radius: var(--f-radius); background: var(--f-field); font: inherit; font-size: 14px; color: var(--f-text); outline: none; transition: border-color var(--fast) var(--ease-out), box-shadow var(--fast) var(--ease-out); }
.cf__in::placeholder { color: var(--f-faint); }
.cf__in:hover { border-color: var(--f-hover); }
.cf__in:focus { border-color: var(--f-accent); box-shadow: 0 0 0 1px var(--f-accent); }
.cf__in--area { height: auto; min-height: 104px; padding: 10px 12px; line-height: 1.55; resize: vertical; }
.fth[data-input="box"][data-shadow="hard"] .cf__in { box-shadow: var(--f-shadow-hard); }
.fth[data-input="box"][data-shadow="hard"] .cf__in:focus { box-shadow: 3px 3px 0 var(--f-accent); }
.fth[data-input="fill"] .cf__in { border-color: transparent; }
.fth[data-input="fill"] .cf__in:hover { border-color: var(--f-hover); }
.fth[data-input="line"] .cf__in { padding-inline: 0; border-width: 0 0 var(--f-bw); border-radius: 0; background: transparent; }
.fth[data-input="line"] .cf__in:focus { box-shadow: 0 1px 0 var(--f-accent); }
.fth[data-input="line"] .cf__in--area { border-width: var(--f-bw); padding-inline: 12px; }
.cf__in--short { max-width: 220px; }
.is-bad .cf__in, .is-bad .cf__drop, .is-bad .cf__sig canvas { border-color: #d93a23; }
.cf__money { position: relative; display: block; }
.cf__pre { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 14px; color: var(--f-muted); }
.cf__in--pre { padding-left: 26px; }
.fth[data-input="line"] .cf__pre { left: 0; }
.fth[data-input="line"] .cf__in--pre { padding-left: 14px; }
.cf__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cf__to { font-size: 13px; color: var(--f-muted); }
.cf__grid2 { display: grid; gap: 8px; }
@media (min-width: 480px) { .cf__grid2 { grid-template-columns: 1fr 1fr; } }
.cf__addr { display: grid; gap: 8px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.cf__a6, .cf__a3, .cf__a2, .cf__a4 { grid-column: span 6; }
@media (min-width: 480px) { .cf__a3 { grid-column: span 3; } .cf__a2 { grid-column: span 2; } .cf__a4 { grid-column: span 4; } }

/* Choices */
.cf__opts { display: grid; gap: 8px; }
@media (min-width: 480px) { .cf__opts--2 { grid-template-columns: 1fr 1fr; } }
.cf__opts--yn { max-width: 340px; grid-template-columns: 1fr 1fr; }
.cf__opt, .cf__agree { position: relative; display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.cf__opt { min-height: 42px; padding: 8px 12px; border: var(--f-bw) solid var(--f-border); border-radius: var(--f-radius); background: var(--f-field); transition: border-color var(--fast) var(--ease-out), background-color var(--fast) var(--ease-out); }
.fth[data-input="line"] .cf__opt { border-width: var(--f-bw); border-radius: 0; }
.fth[data-input="fill"] .cf__opt { border-color: transparent; }
.fth[data-shadow="hard"] .cf__opt { box-shadow: var(--f-shadow-hard); }
.cf__opt:hover { border-color: var(--f-hover); }
.cf__opt:has(input:checked) { border-color: var(--f-accent); background: var(--f-soft); }
.cf__agree { align-items: flex-start; }
.cf__opt input, .cf__agree input, .cf__cell input, .cf__star input, .cf__step input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.cf__mark { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border: 1px solid var(--f-faint); background: var(--f-card); transition: background-color var(--fast), border-color var(--fast); }
.cf__agree .cf__mark { margin-top: 2px; }
.cf__mark--radio { border-radius: 999px; }
.cf__mark--checkbox { border-radius: min(var(--f-radius), 4px); }
input:checked + .cf__mark { border-color: var(--f-accent); background: var(--f-accent); }
input:checked + .cf__mark--radio::after { content: ""; width: 6px; height: 6px; border-radius: 999px; background: var(--f-accent-ink); }
input:checked + .cf__mark--checkbox::after { content: ""; width: 8px; height: 4px; margin-top: -2px; border-left: 2px solid var(--f-accent-ink); border-bottom: 2px solid var(--f-accent-ink); transform: rotate(-45deg); }
input:focus-visible + .cf__mark, .cf__step input:focus-visible + span, .cf__star input:focus-visible + svg { outline: 2px solid var(--f-accent); outline-offset: 2px; }
.cf__other { margin-top: 2px; }

/* Stars, steps and the matrix */
.cf__stars { display: flex; gap: 2px; }
.cf__star { cursor: pointer; padding: 2px; color: var(--f-faint); }
.cf__star svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; transition: color var(--fast), fill var(--fast); }
.cf__star.is-on { color: var(--f-accent); }
.cf__star.is-on svg { fill: currentColor; }
.cf__steps { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 4px; }
.cf__step { position: relative; cursor: pointer; }
.cf__step span { display: flex; align-items: center; justify-content: center; height: 42px; border: var(--f-bw) solid var(--f-border); border-radius: min(var(--f-radius), 10px); background: var(--f-field); font-size: 14px; font-variant-numeric: tabular-nums; transition: background-color var(--fast), border-color var(--fast), color var(--fast); }
.fth[data-input="fill"] .cf__step span { border-color: transparent; }
.cf__step:hover span { border-color: var(--f-hover); }
.cf__step input:checked + span { border-color: var(--f-accent); background: var(--f-accent); color: var(--f-accent-ink); }
.cf__ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--f-muted); }
.cf__matrix { overflow-x: auto; border: var(--f-bw) solid var(--f-border); border-radius: min(var(--f-radius), 12px); background: var(--f-field); }
.cf__matrix table { width: 100%; font-size: 13.5px; }
.cf__matrix th, .cf__matrix td { padding: 9px 8px; border-bottom: 1px solid var(--f-border); }
.cf__matrix tr:last-child th, .cf__matrix tr:last-child td { border-bottom: 0; }
.cf__matrix thead th { font-size: 12px; font-weight: 500; color: var(--f-muted); text-align: center; }
.cf__matrix tbody th { padding-left: 12px; font-weight: 400; text-align: left; }
.cf__cell { position: relative; display: flex; justify-content: center; cursor: pointer; }

/* The dropdown: the form's own list. Without JavaScript the choices show as a list. */
.cf__dd { position: relative; }
.cf__dd-btn { display: none; align-items: center; justify-content: space-between; gap: 8px; text-align: left; cursor: pointer; }
.js .cf__dd-btn { display: flex; }
.cf__dd-btn svg { width: 14px; height: 14px; color: var(--f-faint); }
.cf__dd-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--f-faint); }
.cf__dd.has-val .cf__dd-val { color: var(--f-text); }
.cf__dd-list { display: grid; gap: 4px; }
.cf__dd-list label { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.js .cf__dd-list { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); display: none; max-height: 260px; overflow-y: auto; padding: 4px; border: 1px solid var(--f-border); border-radius: min(var(--f-radius), 10px); background: var(--f-card); box-shadow: var(--shadow-pop); }
.js .cf__dd.is-open .cf__dd-list { display: block; }
.js .cf__dd-list li { display: flex; align-items: center; min-height: 36px; padding: 6px 10px; border-radius: min(var(--f-radius), 6px); font-size: 14px; cursor: pointer; }
.js .cf__dd-list li.is-active { background: var(--f-soft); }
.js .cf__dd-list li[aria-selected="true"] { font-weight: 600; }
.js .cf__dd-list label { pointer-events: none; }
.js .cf__dd-list input { position: absolute; opacity: 0; width: 1px; height: 1px; }

/* Ranking, files and the signature pad */
.cf__rank { display: flex; flex-direction: column; gap: 6px; }
.cf__rank li { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 4px 0 12px; border: var(--f-bw) solid var(--f-border); border-radius: var(--f-radius); background: var(--f-field); font-size: 14px; }
.cf__rank-n { width: 16px; font-size: 12px; font-weight: 600; color: var(--f-muted); }
.cf__rank-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf__rank-b { display: none; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 999px; color: var(--f-muted); }
.js .cf__rank-b { display: inline-flex; }
.cf__rank-b:hover { background: var(--f-soft); color: var(--f-text); }
.cf__rank-b:disabled { opacity: 0.3; pointer-events: none; }
.cf__rank-b svg { width: 14px; height: 14px; }
.cf__rank-b--down svg { transform: rotate(180deg); }
.cf__drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 84px; padding: 14px; border: var(--f-bw) dashed var(--f-border); border-radius: min(var(--f-radius), 14px); background: var(--f-field); text-align: center; font-size: 14px; cursor: pointer; }
.cf__drop:hover { border-color: var(--f-hover); }
.cf__drop small { font-size: 12px; color: var(--f-muted); }
.cf__drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cf__drop:has(input:focus-visible) { outline: 2px solid var(--f-accent); outline-offset: 2px; }
.cf__files { display: flex; flex-direction: column; gap: 4px; }
.cf__files li { padding: 6px 10px; border: 1px solid var(--f-border); border-radius: min(var(--f-radius), 8px); font-size: 13px; }
.cf__sig { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.cf__sig canvas { display: block; width: 100%; height: 140px; border: var(--f-bw) solid var(--f-border); border-radius: min(var(--f-radius), 14px); background: #ffffff; touch-action: none; cursor: crosshair; }
.cf__sig-clear { font-size: 12.5px; color: var(--f-muted); }
.cf__sig-clear:hover { color: var(--f-text); text-decoration: underline; }

/* Buttons, the notice and the end screen */
.cf__acts { display: flex; gap: 8px; }
.cf__btn { display: inline-flex; align-items: center; height: 44px; padding: 0 22px; border: var(--f-bw) solid var(--f-accent); border-radius: var(--f-btn-radius); background: var(--f-accent); font: inherit; font-size: 14.5px; font-weight: 600; color: var(--f-accent-ink); transition: opacity var(--fast), transform var(--normal) var(--ease-spring); }
.cf__btn:hover { opacity: 0.88; }
.cf__btn:active { transform: scale(0.97); }
.fth[data-shadow="hard"] .cf__btn { box-shadow: var(--f-shadow-hard); }
.cf__btn--ghost { border-color: var(--f-border); background: transparent; color: var(--f-text); }
.cf__btn[hidden] { display: none; }
/* Multi-page: a cover screen before the first page, and Save and finish later beside Next. */
.cf__cover { display: none; }
.cf.has-cover .cf__cover { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 8px 0 4px; }
.cf.has-cover .cf__head, .cf.has-cover .cf__page, .cf.has-cover .cf__acts, .cf.has-cover .cf__prog, .cf.has-cover .cf__notice, .cf.has-cover .cf__later-note { display: none !important; }
.cf__cover-t { font-family: var(--f-head); font-size: 22px; line-height: 1.2; font-weight: var(--f-head-weight); letter-spacing: -0.015em; }
.cf__cover-p { font-size: 15px; line-height: 1.55; color: var(--f-muted); }
.cf__cover-n { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--f-muted); }
.cf__cover .cf__btn { margin-top: 6px; }
.cf__acts { flex-wrap: wrap; align-items: center; }
.cf__later { margin-left: auto; height: 44px; padding: 0 6px; font: inherit; font-size: 14px; color: var(--f-muted); background: none; border: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.cf__later:hover { color: var(--f-text); }
.cf__later + .cf__btn { margin-left: 0; }
.cf__later-note { margin-top: -12px; font-size: 12.5px; line-height: 1.5; color: var(--f-muted); }
.cf__notice { margin-top: -12px; font-size: 12px; line-height: 1.55; color: var(--f-muted); }
.cf__end { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.cf__end[hidden] { display: none; }
.cf__end-ic { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: min(var(--f-btn-radius), 14px); background: var(--f-accent); color: var(--f-accent-ink); }
.cf__end-ic svg { width: 20px; height: 20px; }
.cf__end-t { font-family: var(--f-head); font-style: var(--f-head-style); font-weight: var(--f-head-weight); font-size: 26px; line-height: 1.15; letter-spacing: -0.02em; }
.cf__end-p { font-size: 15px; line-height: 1.6; color: var(--f-muted); }
.cf__score { display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 16px; border: 1px solid var(--f-border); border-radius: min(var(--f-radius), 12px); background: var(--f-soft); }
.cf__score[hidden] { display: none; }
.cf__score small { font-size: 11.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--f-accent); }
.cf__score b { font-size: 18px; font-weight: 600; }
.cf__score span { font-size: 14px; line-height: 1.55; color: var(--f-muted); }
.cf__demo { width: 100%; padding: 12px 14px; border-radius: min(var(--f-radius), 10px); background: var(--f-soft); font-size: 13.5px; line-height: 1.5; color: var(--f-text); }
.cf__demo a { font-weight: 600; color: var(--f-text); text-decoration: underline; text-underline-offset: 3px; }
.cf__restart { font: inherit; font-size: 13px; color: var(--f-muted); }
.cf__restart:hover { color: var(--f-text); text-decoration: underline; }
.cf.is-done .cf__head, .cf.is-done .cf__prog, .cf.is-done .cf__page, .cf.is-done .cf__acts, .cf.is-done .cf__notice { display: none; }

@media (prefers-reduced-motion: reduce) {
  .tcard, .tlook, .cf__bar i, .tpl .fth { transition: none; }
}

/* Calculations and payments in the live forms */
.cf__calc, .cf__pay { padding: 14px 16px; border: var(--f-bw, 1px) solid var(--f-border); border-radius: var(--f-radius); background: var(--f-soft); }
.cf__total { display: block; font-family: var(--f-head, inherit); font-size: 28px; font-weight: 600; line-height: 1.2; color: var(--f-text); font-variant-numeric: tabular-nums; }
.cf__pay-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cf__pay-card { padding: 4px 10px; border: 1px solid var(--f-border); border-radius: var(--f-btn-radius); font-size: 12px; color: var(--f-muted); }
.tp__box--total { height: 18px; background: var(--f-soft); }

/* Describe your form */
.tdesc { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; padding: 20px; box-shadow: var(--sh-rest); border-radius: var(--r-lg); background: var(--panel); }
.tdesc__l { font-size: 15px; font-weight: 500; color: var(--ink); }
.tdesc__row { display: flex; flex-wrap: wrap; gap: 8px; }
.tdesc__in { flex: 1; min-width: 220px; height: 44px; padding: 0 14px; border-radius: var(--r-sm); box-shadow: var(--sh-input); background: #fff; font: inherit; font-size: 15px; color: var(--ink); }
.tdesc__in:focus { outline: none; box-shadow: var(--sh-focus); }
.tdesc__picks { display: flex; flex-wrap: wrap; gap: 6px; }
.tdesc__picks .chip { display: inline-flex; align-items: center; }

.tbar--tpl { margin-bottom: 14px; }
.cf__logo { width: auto; max-width: 140px; height: 28px; object-fit: contain; object-position: left center; margin-bottom: 6px; }

/* The sample booking step on a template's end screen */
.cf__book { display: flex; flex-direction: column; gap: 10px; width: 100%; margin-top: 4px; text-align: left; }
.cf__days, .cf__times { display: flex; flex-wrap: wrap; gap: 6px; }
.cf__days button, .cf__times button { height: 36px; padding: 0 12px; border: var(--f-bw, 1px) solid var(--f-border); border-radius: var(--f-btn-radius); background: var(--f-field); color: var(--f-text); font: inherit; font-size: 14px; }
.cf__days button:hover, .cf__times button:hover { border-color: var(--f-hover); }
.cf__days button.is-on, .cf__times button.is-on { border-color: var(--f-accent); background: var(--f-accent); color: var(--f-accent-ink); }
.cf__book-note { font-size: 13px; color: var(--f-muted); }

/* Starter kits */
.tkit { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 16px; padding: 16px 18px; box-shadow: var(--sh-rest); border-radius: var(--r-lg); background: var(--panel); transition: box-shadow var(--fast) var(--ease-out); }
.tkit:hover { box-shadow: var(--sh-hover); }
.tkit__l { grid-row: 1 / 3; font-size: 13px; font-weight: 500; color: var(--meta); }
.tkit b { font-size: 15px; font-weight: 500; color: var(--ink); }
.tkit__t { grid-column: 2; font-size: 13.5px; color: var(--muted); }
.tkit__go { grid-row: 1 / 3; grid-column: 3; font-size: 14px; font-weight: 500; color: var(--ink); white-space: nowrap; }
.tkit__wrap { margin-top: -8px; margin-bottom: 8px; }
.tkits { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); }
@media (max-width: 640px) { .tkit { grid-template-columns: 1fr; } .tkit__l, .tkit__go, .tkit__t { grid-row: auto; grid-column: auto; } }

.tcombo { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: -8px; margin-bottom: 8px; }
.tcombo__l { margin-right: 4px; font-size: 13px; font-weight: 500; color: var(--meta); }
.tcombo .chip { display: inline-flex; align-items: center; }

/* The Multi-page shelf on the gallery */
.tmore { display: flex; justify-content: center; margin-top: 28px; }
