Files
gabrielvidalandClaude Opus 5.5 550dd74c44 feat(web): a field's help sits between its title and its options/input
Every field type drew help after the control (a hint under the input), so on a
choice field the description came after every option. It now follows the
label/legend on every type except checkbox (whose label sits beside the box).
New .help-top spacing in app.css.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 10:29:51 +01:00

476 lines
34 KiB
CSS

/* ask-form answer page. Works on its own; app.js only adds to it. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
margin: 0;
background: hsl(var(--background));
color: hsl(var(--foreground));
font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}
a { color: hsl(var(--primary)); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 680px; margin: 0 auto; padding: 32px 16px 24px; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.top { margin-bottom: 24px; }
.eyebrow { margin: 0 0 6px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: hsl(var(--muted-foreground)); }
h1 { margin: 0 0 10px; font-size: clamp(24px, 5vw, 32px); line-height: 1.2; letter-spacing: -.01em; }
.desc { color: hsl(var(--muted-foreground)); }
.lead { font-size: 18px; }
.lead.ok { color: hsl(140 55% 36%); }
@media (prefers-color-scheme: dark) { .lead.ok { color: hsl(140 50% 60%); } }
/* In a hub's frame (<html data-embed>, serve --embed-origins): the hub's
panel names the form and its machine, so the brand line goes; the hub's
theme may force a scheme the OS doesn't have (data-scheme, app.js) — its
tokens cover the colours, these the rest. Keyed on new attributes only: an
older machine's page never has them. */
html[data-embed] .brand { display: none; }
html[data-embed] .wrap { padding-top: 20px; }
html[data-scheme="dark"] .lead.ok { color: hsl(140 50% 60%); }
html[data-scheme="light"] .lead.ok { color: hsl(140 55% 36%); }
html[data-scheme="dark"] {
--code-foreground: 30 20% 88%; --code-comment: 30 6% 52%; --code-keyword: 280 70% 72%; --code-string: 140 45% 62%;
--code-number: 30 90% 65%; --code-function: 210 80% 70%; --code-tag: 0 75% 70%; --code-variable: 200 70% 70%;
}
html[data-scheme="light"] {
--code-foreground: 24 10% 20%; --code-comment: 30 8% 50%; --code-keyword: 280 60% 45%; --code-string: 140 50% 32%;
--code-number: 24 85% 42%; --code-function: 210 70% 42%; --code-tag: 0 65% 45%; --code-variable: 200 60% 35%;
}
/* markdown */
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p, .md ul, .md ol, .md blockquote, .md pre, .md .table { margin: 0 0 .75em; }
.md ul, .md ol { padding-left: 1.3em; }
.md h3, .md h4, .md h5, .md h6 { margin: 1em 0 .4em; font-size: 1em; }
.md code { font: .88em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: hsl(var(--muted)); padding: .1em .35em; border-radius: 5px; }
.md pre { background: hsl(var(--muted)); padding: 10px 12px; border-radius: 10px; overflow-x: auto; }
.md pre code { background: none; padding: 0; }
.md blockquote { border-left: 3px solid hsl(var(--border)); padding-left: 12px; color: hsl(var(--muted-foreground)); }
.md .table { overflow-x: auto; overscroll-behavior-x: contain; }
.md table { border-collapse: collapse; font-size: 14px; }
/* A table takes its content's width (the column's at least) and its box
scrolls sideways; a cell wraps past a readable measure. Keyed on .cell: a
machine before it (this file serves them all) has no cap on its cells. */
.md table:has(.cell) { width: max-content; min-width: 100%; }
.md .cell { max-width: 50ch; overflow-wrap: break-word; }
/* app.js: a fade on the side that has more table. */
.md .table.fade-l, .md .table.fade-r {
--fade-l: #000; --fade-r: #000;
-webkit-mask-image: linear-gradient(to right, var(--fade-l), #000 16px, #000 calc(100% - 16px), var(--fade-r));
mask-image: linear-gradient(to right, var(--fade-l), #000 16px, #000 calc(100% - 16px), var(--fade-r));
}
.md .table.fade-l { --fade-l: transparent; }
.md .table.fade-r { --fade-r: transparent; }
.md th, .md td { border: 1px solid hsl(var(--border)); padding: 5px 9px; text-align: left; vertical-align: top; }
.md th { background: hsl(var(--muted)); }
/* errors */
.errors { border: 1px solid hsl(var(--destructive) / .5); background: hsl(var(--destructive) / .08); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 20px; }
.errors p { margin: 0 0 4px; }
.errors ul { margin: 0; padding-left: 1.2em; }
.err { margin: 6px 0 0; color: hsl(var(--destructive)); font-size: 14px; font-weight: 500; }
.field.has-error input:not([type=radio]):not([type=checkbox]), .field.has-error select, .field.has-error textarea { border-color: hsl(var(--destructive)); }
/* layout */
.form { display: block; }
.group { border: 1px solid hsl(var(--border)); background: hsl(var(--card)); border-radius: calc(var(--radius) + 4px); padding: 20px; margin-bottom: 16px; }
.group-title { margin: 0 0 14px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: hsl(var(--primary)); }
.field { margin: 0 0 22px; scroll-margin-top: 80px; }
.field:last-child { margin-bottom: 0; }
.catchall { padding: 4px 0; margin-bottom: 16px; scroll-margin-top: 24px; }
.catchall textarea { border-color: transparent; background: hsl(var(--muted)); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.label, legend.label { display: block; font-weight: 600; margin-bottom: 8px; padding: 0; }
.req { color: hsl(var(--destructive)); margin-left: 3px; }
.block-label { margin: 0 0 6px; font-size: 15px; }
.help { margin-top: 6px; font-size: 13.5px; color: hsl(var(--muted-foreground)); }
.help.help-top { margin: -2px 0 10px; }
/* controls */
input[type=text], input[type=email], input[type=number], input[type=date], input[type=time], input[type=datetime-local], input[type=password], select, textarea {
width: 100%; font: inherit; color: inherit;
background: hsl(var(--background)); border: 1px solid hsl(var(--border)); border-radius: 10px;
padding: 10px 12px; min-height: 44px;
}
textarea { resize: vertical; min-height: 88px; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .card:focus-within, .choice:focus-within, button:focus-visible, summary:focus-visible {
outline: 2px solid hsl(var(--ring)); outline-offset: 2px;
}
input[type=radio], input[type=checkbox] { accent-color: hsl(var(--primary)); width: 18px; height: 18px; margin: 0; flex: none; }
.choices { display: grid; gap: 6px; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid hsl(var(--border)); border-radius: 10px; cursor: pointer; background: hsl(var(--background)); }
.choice input { margin-top: 3px; }
.choice:has(input:checked) { border-color: hsl(var(--primary)); background: hsl(var(--primary) / .07); }
.choice-text { display: grid; }
.choice-text small { color: hsl(var(--muted-foreground)); font-size: 13px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; cursor: pointer; }
.check input { margin-top: 4px; }
.other { margin-top: 8px; }
/* "Other…" text wraps and grows with what is typed (app.js sizes it; a
browser with field-sizing does without). */
.other textarea { min-height: 44px; max-height: 16em; resize: none; field-sizing: content; }
@supports selector(:has(*)) {
.field:not(:has(input[value="__other__"]:checked, option[value="__other__"]:checked)) .other { display: none; }
}
.range { display: flex; gap: 12px; align-items: center; }
.range input { flex: 1; accent-color: hsl(var(--primary)); }
.range output { min-width: 3ch; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.range-ends { display: flex; justify-content: space-between; gap: 16px; font-size: 12px; color: hsl(var(--muted-foreground)); }
.range-ends span:last-child { text-align: right; }
.secret { position: relative; }
.secret input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; padding-right: 64px; }
.secret-note { margin: 6px 0 0; font-size: 13px; color: hsl(var(--muted-foreground)); }
.reveal { position: absolute; right: 6px; top: 6px; bottom: 6px; border: 0; background: hsl(var(--muted)); color: inherit; border-radius: 7px; padding: 0 10px; font: inherit; font-size: 13px; cursor: pointer; }
/* conditions: a hidden field or an emptied page is gone, not greyed */
.field[hidden], .group.group-empty, .toc li[hidden], .pager-seg[hidden] { display: none !important; }
/* date range */
.daterange { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.daterange label { display: grid; gap: 4px; font-size: 13px; color: hsl(var(--muted-foreground)); }
@media (max-width: 420px) { .daterange { grid-template-columns: minmax(0, 1fr); } }
/* rating: radios drawn as stars or numbers, one tap */
.rating { display: flex; flex-wrap: wrap; gap: 6px; }
.rate { position: relative; cursor: pointer; }
.rate input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rate-face { display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 8px; border: 1px solid hsl(var(--border)); border-radius: 10px; background: hsl(var(--background)); font-weight: 600; font-variant-numeric: tabular-nums; }
.rate:has(input:checked) .rate-face { border-color: hsl(var(--primary)); background: hsl(var(--primary) / .1); color: hsl(var(--primary)); }
.rate input:focus-visible + .rate-face { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }
.rating.stars { gap: 2px; }
.rating.stars .rate-face { min-width: 40px; border-color: transparent; background: transparent; font-size: 30px; line-height: 1; color: hsl(var(--border)); }
.rating.stars .rate:has(input:checked) .rate-face, .rating.stars .rate:has(~ .rate input:checked) .rate-face { color: hsl(var(--primary)); background: transparent; }
@media (hover: hover) { .rating.stars .rate:hover .rate-face, .rating.stars .rate:has(~ .rate:hover) .rate-face { color: hsl(var(--primary) / .6); } }
/* list / table: rows of inputs */
.list { display: grid; gap: 8px; }
.list-row { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); align-items: center; }
.list-row[data-cols="1"] { grid-template-columns: minmax(0, 1fr) auto; }
@media (min-width: 560px) {
.list-row[data-cols="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)) auto; }
.list-row[data-cols="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; }
.list-row[data-cols="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)) auto; }
.list-row[data-cols="5"], .list-row[data-cols="6"], .list-row[data-cols="7"], .list-row[data-cols="8"] { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; }
}
.js .list-row[data-cols]:not([data-cols="1"]) { padding: 8px; border: 1px solid hsl(var(--border)); border-radius: 12px; }
.row-remove, .list-add { font: inherit; border: 1px solid hsl(var(--border)); background: hsl(var(--card)); color: inherit; border-radius: 10px; min-height: 44px; cursor: pointer; }
.row-remove { width: 44px; color: hsl(var(--muted-foreground)); }
.list-add { margin-top: 8px; padding: 0 14px; font-weight: 600; }
.list-add[disabled] { opacity: .5; cursor: default; }
/* diff and details blocks */
.diff { border: 1px solid hsl(var(--border)); border-radius: 10px; background: hsl(var(--muted)); overflow-x: auto; }
.diff pre { margin: 0; padding: 8px 0; font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; min-width: max-content; }
.diff span { display: block; padding: 0 12px; white-space: pre; }
.diff .d-add { background: hsl(140 55% 40% / .16); }
.diff .d-del { background: hsl(0 70% 50% / .16); }
.diff .d-hunk { color: hsl(var(--code-function)); background: hsl(210 70% 50% / .08); }
.diff .d-file, .diff .d-meta { color: hsl(var(--muted-foreground)); font-weight: 600; }
.block-details { border: 1px solid hsl(var(--border)); border-radius: 10px; background: hsl(var(--card)); }
.block-details summary { cursor: pointer; padding: 11px 14px; font-weight: 600; min-height: 44px; }
.block-details > .md { padding: 0 14px 12px; }
/* html blocks */
.frame { display: block; width: 100%; border: 1px solid hsl(var(--border)); border-radius: 10px; background: transparent; resize: vertical; overflow: auto; }
.frame-open { display: inline-block; margin-top: 4px; font-size: 12.5px; color: hsl(var(--muted-foreground)); }
.js .frame.autosize { resize: none; }
.js .frame-open { display: none; }
html:not(.js) .widget-frame { display: none; }
/* choice cards: a picture or a mockup is what's being judged, so it gets the
room — one per row on a phone, two on anything wider. A field's `columns`
(the page's <style>) replaces the two, never the phone's one. Each card is
the picture, whole and uncovered, over a title bar holding its check. */
.cards { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 560px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.card { position: relative; display: flex; flex-direction: column; border: 1px solid hsl(var(--border)); border-radius: 12px; overflow: hidden; cursor: pointer; background: hsl(var(--background)); }
.card:has(.card-input:checked) { border-color: hsl(var(--primary)); box-shadow: 0 0 0 2px hsl(var(--primary) / .55); }
/* The visual takes the field's ratio (`aspect`, the page's <style>) or, by
default (.fit-content), the ratio of what it shows: a picture's own height,
the size a mockup's frame reports (app.js; 4/3 until then). It grows to the
row's tallest card, and stops at three quarters of the screen. A mockup is
scaled into it whole by its frame; a picture fills it, cropped. */
.visual { position: relative; display: flex; flex-direction: column; flex: 1 0 auto; width: 100%; aspect-ratio: 4/3; max-height: 75vh; background: hsl(var(--muted)); overflow: hidden; }
.visual img, .visual iframe { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border: 0; object-fit: cover; }
.visual iframe { pointer-events: none; }
.fit-content .visual:not(.mock) { aspect-ratio: auto; min-height: 64px; }
.fit-content .visual img { position: static; flex: 1 0 auto; height: auto; max-height: 75vh; }
.cover { position: absolute; inset: 0; }
.bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; font-size: 14px; line-height: 1.35; }
.visual + .bar { border-top: 1px solid hsl(var(--border)); }
.card:has(.card-input:checked) .bar { background: hsl(var(--primary) / .07); }
.bar-text { display: grid; min-width: 0; }
.bar-text small { color: hsl(var(--muted-foreground)); font-size: 13px; }
/* A plain option among pictures is its title bar alone, level with the
others' at the bottom of the row. */
.card.plain { justify-content: flex-end; }
/* "Other…" next to cards is a plain row, like a text-only choice. */
.other-row { margin-top: 10px; }
.zoom { position: absolute; right: 8px; bottom: 8px; z-index: 2; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: rgb(20 16 12 / .6); color: #fff; box-shadow: 0 1px 4px rgb(0 0 0 / .25); transition: opacity .15s, background-color .15s; }
.zoom:hover { background: rgb(20 16 12 / .82); }
.zoom svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* With a mouse it shows on the hovered card only; a touch screen has no
hover, so there it stays. */
@media (hover: hover) {
.zoom { opacity: 0; }
.card:hover .zoom, .card:has(:focus-visible) .zoom { opacity: 1; }
}
/* Cards drawn by machines older than the title bar (v0.7 and before: check
over the picture, caption under it). The relay serves this file to every
version, so their markup keeps its look until they upgrade. */
.card > .card-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tick + .visual img { position: static; }
.text-card { display: flex; align-items: center; justify-content: center; text-align: center; padding: 10px; font-size: 14px; color: hsl(var(--muted-foreground)); aspect-ratio: 4/3; }
.card.plain .text-card { aspect-ratio: auto; flex: 1; min-height: 64px; }
.caption { display: grid; padding: 8px 10px; font-size: 14px; line-height: 1.35; }
.caption small { color: hsl(var(--muted-foreground)); font-size: 13px; }
.tick { position: absolute; top: 7px; right: 7px; z-index: 2; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; background: rgb(0 0 0 / .28); box-shadow: 0 1px 3px rgb(0 0 0 / .3); }
.multi .tick { border-radius: 6px; }
.card:has(.card-input:checked) .tick { background: hsl(var(--primary)); }
.card:has(.card-input:checked) .tick::after { content: ""; position: absolute; left: 6px; top: 2px; width: 6px; height: 11px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
/* actions */
.actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
.btn { font: inherit; font-weight: 600; border-radius: 10px; padding: 11px 18px; min-height: 44px; cursor: pointer; border: 1px solid hsl(var(--border)); background: hsl(var(--card)); color: inherit; }
.btn.primary { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); border-color: transparent; }
.btn.ghost { background: transparent; }
.btn[disabled] { opacity: .6; cursor: progress; }
.decline { margin-top: 28px; font-size: 14px; color: hsl(var(--muted-foreground)); }
.decline summary { cursor: pointer; }
.decline p { margin: 8px 0; }
.decline-note { margin: 12px 0; color: hsl(var(--foreground)); }
.decline-note label { display: block; font-weight: 600; margin-bottom: 6px; }
.decline-note textarea { min-height: 72px; font-size: 16px; }
.decline-note.has-error textarea { border-color: hsl(var(--destructive)); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
/* closed page */
.recap { margin: 20px 0 0; border: 1px solid hsl(var(--border)); border-radius: var(--radius); background: hsl(var(--card)); padding: 6px 16px; }
.recap dt { font-weight: 600; margin-top: 10px; }
.recap dd { margin: 2px 0 10px; color: hsl(var(--muted-foreground)); white-space: pre-wrap; overflow-wrap: anywhere; }
/* ── what app.js adds ─────────────────────────────────────────────────────── */
.pager { position: sticky; top: 0; z-index: 5; background: hsl(var(--background) / .92); backdrop-filter: blur(8px); padding: 10px 0; margin-bottom: 12px; }
.pager-row { display: flex; align-items: center; gap: 10px; }
.pager-count { font-size: 13px; font-variant-numeric: tabular-nums; color: hsl(var(--muted-foreground)); min-width: 3.2em; }
.pager-segs { display: flex; gap: 4px; flex: 1; }
.pager-seg { position: relative; flex: 1; height: 6px; border-radius: 3px; border: 0; padding: 0; background: hsl(var(--muted)); cursor: pointer; }
.pager-seg.done { background: hsl(var(--primary) / .45); }
.pager-seg.current { background: hsl(var(--primary)); }
.pager-seg.pending::after, .pending-dot { content: ""; position: absolute; top: -4px; right: -1px; width: 7px; height: 7px; border-radius: 50%; background: hsl(var(--primary)); animation: ping 1.6s infinite; }
.pager-title { margin-top: 4px; font-size: 13px; font-weight: 600; }
/* A phone shows one page at a time. The others stay laid out, out of sight,
so the mockups and html blocks on them measure at their real width (and
print whole). */
@media (max-width: 1023.98px) {
.js .paged { position: relative; }
.js .paged .group:not(.current) { position: absolute; top: 0; left: 0; right: 0; height: 0; margin: 0; overflow: hidden; visibility: hidden; }
.js .paged .group-title { display: none; }
}
.nav { display: flex; gap: 10px; justify-content: space-between; margin: 4px 0 8px; }
/* Back stays on the left and Next on the right, even when the other one is
hidden (first / last page) and Next is alone in the row. */
.nav > :last-child { margin-inline-start: auto; }
.label .pending-dot { position: relative; display: inline-block; top: -2px; right: auto; margin-left: 6px; }
@keyframes ping { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .pager-seg.pending::after, .pending-dot { animation: none; } }
.overlay { position: fixed; inset: 0; z-index: 50; background: rgb(0 0 0 / .86); display: flex; align-items: center; justify-content: center; padding: 16px; }
.overlay img { max-width: 100%; max-height: 100%; object-fit: contain; touch-action: pinch-zoom; }
.overlay iframe { width: min(1280px, 100%); height: 100%; border: 0; border-radius: 10px; background: hsl(var(--background)); }
.overlay-close, .overlay-prev, .overlay-next { position: absolute; border: 0; background: rgb(255 255 255 / .14); color: #fff; font: inherit; font-size: 20px; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; }
.overlay-close { top: 14px; right: 14px; }
.overlay-prev { left: 14px; top: 50%; }
.overlay-next { right: 14px; top: 50%; }
.overlay-label { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; color: #fff; font-size: 14px; }
.confirm { position: fixed; inset: 0; z-index: 40; background: rgb(0 0 0 / .45); display: flex; align-items: flex-end; justify-content: center; }
.confirm-box { width: min(680px, 100%); max-height: 88vh; overflow: auto; background: hsl(var(--card)); border-radius: 18px 18px 0 0; padding: 20px 20px max(20px, env(safe-area-inset-bottom)); }
.confirm-box h2 { margin: 0 0 4px; font-size: 18px; }
.confirm-box .recap { margin-top: 12px; }
@media (min-width: 720px) { .confirm { align-items: center; } .confirm-box { border-radius: 18px; } }
/* examples */
/* Opaque (the page scrolls under it on a desktop): the tint is mixed in. */
.demo-banner { background: linear-gradient(hsl(var(--primary) / .1), hsl(var(--primary) / .1)), hsl(var(--background)); border-bottom: 1px solid hsl(var(--primary) / .3); font-size: 14.5px; }
.demo-banner-in { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 24px; max-width: 1440px; margin: 0 auto; padding: 12px 16px; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.demo-banner p { margin: 0; }
.demo-banner .demo-links { margin-left: auto; white-space: nowrap; }
.demo-banner code { background: hsl(var(--muted)); padding: .1em .35em; border-radius: 5px; }
.demo-banner code, .json, .lead code, .help code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
.examples { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 12px; }
.example-card { position: relative; border: 1px solid hsl(var(--border)); background: hsl(var(--card)); border-radius: calc(var(--radius) + 4px); }
.example-card:hover { border-color: hsl(var(--primary) / .6); }
.example-main { display: grid; gap: 4px; padding: 18px 20px; color: inherit; text-decoration: none; }
.example-title { font-weight: 700; font-size: 18px; padding-right: 80px; }
.example-summary { color: hsl(var(--muted-foreground)); }
.example-meta { font-size: 13px; color: hsl(var(--primary)); }
.example-spec { position: absolute; top: 18px; right: 18px; font-size: 13px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.json { background: hsl(var(--muted)); border: 1px solid hsl(var(--border)); border-radius: var(--radius); padding: 14px 16px; overflow-x: auto; font-size: 13px; line-height: 1.5; white-space: pre; }
.closed .actions { justify-content: flex-start; margin-top: 20px; }
.closed .actions .btn { text-decoration: none; display: inline-flex; align-items: center; }
.closed .group-title { margin-top: 28px; }
/* multi forms */
.count { margin: 10px 0 0; font-size: 14px; color: hsl(var(--muted-foreground)); }
.hosted-note { margin: 10px 0 0; padding: 8px 12px; border-radius: 10px; font-size: 13px; color: hsl(var(--muted-foreground)); background: hsl(var(--muted) / .6); }
@media print { .hosted-note { display: none; } }
/* ── desktop: the whole form at once, its sections listed in the margin ──── */
.toc { display: none; }
.toc-h { margin: 0 0 10px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: hsl(var(--muted-foreground)); }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.toc a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 12px; border-left: 2px solid hsl(var(--border)); font-size: 14.5px; line-height: 1.35; color: hsl(var(--muted-foreground)); text-decoration: none; }
.toc a:hover { color: hsl(var(--foreground)); }
.toc a.current { border-left-color: hsl(var(--primary)); background: hsl(var(--primary) / .07); border-radius: 0 8px 8px 0; color: hsl(var(--foreground)); font-weight: 600; }
.toc-state { flex: none; }
.toc a.pending .toc-state { width: 7px; height: 7px; margin-right: 4px; border-radius: 50%; background: hsl(var(--primary)); }
.toc a.done .toc-state { position: relative; width: 16px; height: 16px; border-radius: 50%; background: hsl(var(--primary) / .18); }
.toc a.done .toc-state::after { content: ""; position: absolute; left: 5.5px; top: 3px; width: 4px; height: 8px; border: solid hsl(var(--primary)); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.toc-progress { margin: 14px 0 0; font-size: 13px; color: hsl(var(--muted-foreground)); }
.toc-bar { height: 4px; margin-top: 6px; border-radius: 2px; background: hsl(var(--muted)); overflow: hidden; }
.toc-bar i { display: block; height: 100%; background: hsl(var(--primary)); transition: width .2s; }
@media (min-width: 1024px) {
/* The title across the top, then the section list beside the form. */
.wrap.has-toc { max-width: 1008px; display: grid; grid-template-columns: 200px minmax(0, 1fr); grid-template-areas: "top top" "toc page"; column-gap: 56px; padding-top: 48px; padding-left: 24px; padding-right: 24px; }
.has-toc .top { grid-area: top; }
.has-toc .top .desc { max-width: 720px; }
.has-toc .page { grid-area: page; min-width: 0; }
.has-toc .toc { display: block; grid-area: toc; position: sticky; top: 24px; align-self: start; }
.has-toc .group { scroll-margin-top: 24px; }
.paged .pager, .paged .nav { display: none; }
/* An example's banner stays pinned above the page. */
.demo-banner { position: sticky; top: 0; z-index: 10; }
.demo-banner-in { flex-wrap: nowrap; }
.demo-banner-in > p:first-child { flex: 1; min-width: 0; }
.demo-banner ~ .wrap .toc { top: 88px; }
.demo-banner ~ .wrap .group { scroll-margin-top: 88px; }
.demo-banner ~ .wrap .field { scroll-margin-top: 128px; }
}
@media (prefers-reduced-motion: reduce) { .toc-bar i { transition: none; } }
/* ── print: the whole form on paper, blank or answered ───────────────────── */
/* What only paper shows carries the `hidden` attribute, so a page served with
an older copy of this file keeps it out of sight everywhere. */
@media print {
@page { margin: 14mm 12mm; }
/* Paper is light whatever the screen is: a dark brand's tokens too. */
:root { color-scheme: light !important; }
@media (prefers-color-scheme: dark) {
:root {
--background: 0 0% 100% !important; --foreground: 24 10% 12% !important;
--card: 0 0% 100% !important; --card-foreground: 24 10% 12% !important;
--secondary: 30 20% 92% !important; --secondary-foreground: 24 10% 15% !important;
--muted: 30 20% 93% !important; --muted-foreground: 24 6% 40% !important;
--accent: 30 40% 90% !important; --accent-foreground: 24 10% 12% !important;
--border: 30 15% 80% !important; --destructive: 0 72% 50% !important;
--code-foreground: 24 10% 20% !important; --code-function: 210 70% 42% !important;
}
}
body { background: #fff; font-size: 14px; }
.wrap, .wrap.has-toc { display: block; max-width: none; padding: 0; }
.top { margin-bottom: 20px; }
h1 { font-size: 24px; }
.print-legend[hidden] { display: block !important; margin: 10px 0 0; font-size: 12.5px; color: hsl(var(--muted-foreground)); }
.print-legend .req { margin: 0; }
/* What's for the screen only. */
.demo-banner, .toc, .pager, .nav, .actions, .decline, .errors, .count, .hp,
.overlay, .confirm, .pending-dot, .list-add, .row-remove, .reveal, .frame-open,
.zoom, .file-rm, .file-retry, .file-item progress, .drop-main, .drop-or { display: none !important; }
/* Every section, one after the other, its title a heading: no card. */
.group, .js .paged .group:not(.current) {
position: static; height: auto; overflow: visible; visibility: visible;
border: 0; border-radius: 0; background: none; padding: 0; margin: 0 0 26px;
}
.group-title, .js .paged .group-title { display: block; margin: 0 0 14px; font-size: 19px; letter-spacing: 0; text-transform: none; color: hsl(var(--foreground)); }
/* Every question too, those shown only sometimes with when they apply. */
.form .field[hidden], .form .group.group-empty { display: block !important; }
.print-if[hidden] { display: block !important; margin: 0 0 4px; font-size: 12.5px; font-style: italic; color: hsl(var(--muted-foreground)); }
/* A question or a block stays on one page (unless it's taller than one). */
.field { margin-bottom: 20px; break-inside: avoid; }
.group-title, .block-label, .label, legend.label, .check, .print-if { break-after: avoid; }
.card, .list-row, .choice, .diff span { break-inside: avoid; }
/* Boxes to write in: drawn by their border (backgrounds don't print). */
input[type=text], input[type=email], input[type=number], input[type=date], input[type=time], input[type=datetime-local], input[type=password], select, textarea {
background: none; border-color: hsl(var(--foreground) / .35); min-height: 40px;
}
::placeholder { color: hsl(var(--muted-foreground) / .7); }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
select { appearance: none; }
input::-webkit-inner-spin-button, input::-webkit-outer-spin-button, input::-webkit-calendar-picker-indicator { display: none; }
/* Long answers get room for a few handwritten lines, or all of a typed one. */
textarea, .catchall textarea { height: auto !important; min-height: 10em; field-sizing: content; resize: none; border-color: hsl(var(--foreground) / .35); background: none; }
/* Choices: the option and its tick, no box around each. */
.choices { gap: 2px; }
.choice { border: 0; padding: 4px 0; background: none !important; }
/* "Other…" gets its line while nothing is picked (or it is). */
@supports selector(:has(*)) {
.field:not(:has(select, input:checked)) .other, .field:has(select > option[value=""]:checked) .other { display: block !important; }
}
.other { margin: 4px 0 0 28px; }
.other textarea { min-height: 40px; max-height: none; }
.other-row { margin-top: 6px; }
/* A dropdown on paper is its options, a circle each, while nothing is
picked; picked, it shows what is. (A page from a machine older than the
list keeps its dropdown.) */
.print-options[hidden] { list-style: none; margin: 0; padding: 0; display: grid !important; gap: 2px; }
.print-options li { display: flex; gap: 10px; align-items: baseline; padding: 4px 0; }
.print-options li::before { content: ""; flex: none; width: 16px; height: 16px; border: 1.5px solid hsl(var(--foreground) / .55); border-radius: 50%; transform: translateY(3px); }
@supports selector(:has(*)) {
.field:has(.print-options):has(> fieldset > select > option[value=""]:checked) > fieldset > select { display: none !important; }
.field:has(> fieldset > select > option:not([value=""]):checked) .print-options { display: none !important; }
}
/* Sliders: its values to circle (a line to mark when there are too many),
until it has been moved (app.js: .print-moved). */
.t-slider:not(.print-moved):has(.print-scale, .print-line) .range { display: none; }
.t-slider:not(.print-moved) .print-scale[hidden] { display: flex !important; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.print-scale span { flex: 1 1 0; display: grid; place-items: center; min-width: 38px; height: 38px; padding: 0 6px; border: 1px solid hsl(var(--foreground) / .35); border-radius: 10px; font-weight: 600; font-variant-numeric: tabular-nums; }
.t-slider:not(.print-moved) .print-line[hidden] { display: block !important; height: 16px; margin: 14px 0 4px; border: 1.5px solid hsl(var(--foreground) / .55); border-top: 0; }
/* Ratings: numbers to circle, stars outlined until one is picked. */
.rate-face { border-color: hsl(var(--foreground) / .35); background: none; }
.rating.stars .rate-face { color: transparent; -webkit-text-stroke: 1.2px hsl(var(--foreground) / .55); }
.rating.stars .rate:has(input:checked) .rate-face, .rating.stars .rate:has(~ .rate input:checked) .rate-face { color: hsl(var(--primary)); -webkit-text-stroke: 0; }
/* Pictures and mockups: whole, never cut across two pages. */
.card { background: none; box-shadow: none; }
.card:has(.card-input:checked) { border-width: 2px; }
.visual { max-height: 70mm; }
.card:has(.card-input:checked) .bar { background: none; }
/* Blocks: opened (app.js), wrapped, a diff keeps its colours. */
.diff { overflow: visible; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
.diff pre { min-width: 0; }
.diff span { white-space: pre-wrap; overflow-wrap: anywhere; }
.md pre, .json { white-space: pre-wrap; overflow-wrap: anywhere; overflow: visible; }
.md .table, .md .table.fade-l, .md .table.fade-r { overflow: visible; -webkit-mask-image: none; mask-image: none; }
.md table:has(.cell) { width: auto; min-width: 0; }
.block-details summary { min-height: 0; }
.frame { resize: none; }
/* Lists: rows of boxes, three of them at least (app.js), no buttons. */
.js .list-row[data-cols]:not([data-cols="1"]) { border-color: hsl(var(--foreground) / .2); }
.list-row[data-cols="1"] { grid-template-columns: minmax(0, 1fr); }
.list-row[data-cols="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.list-row[data-cols="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.list-row[data-cols="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.list-row[data-cols="5"], .list-row[data-cols="6"], .list-row[data-cols="7"], .list-row[data-cols="8"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.list-row select:has(option[value=""]:checked) { color: hsl(var(--muted-foreground) / .7); }
/* Files: the drop area is a box to staple to, with what it takes. */
.uploader .drop { min-height: 64px; border-color: hsl(var(--foreground) / .35); background: none; }
.secret input { padding-right: 12px; }
.recap { background: none; }
.closed .group-title { margin-top: 20px; }
}