/* The free brief templates: fill in online (screen), or a fillable A4 PDF (print).
   Uses guide.css for the brand; this adds the form. In print, every answer box carries its own
   near-Mist colour (--fc) so brief.py can find it and lay a real form field on top. */
.brief .chapter { max-width: 900px; }
.brief .ch-body > * { max-width: none; }
.fld { margin: 0 0 22px; border: 0; padding: 0; min-width: 0; break-inside: avoid; }
.f-l { display: block; font-size: 16px; font-weight: 600; color: var(--ink); line-height: 1.35; padding: 0; margin: 0 0 4px; }
.f-h { margin: 0 0 8px !important; font-size: 14px; line-height: 1.45; color: var(--muted); }
.f-box { position: relative; background: var(--mist); border-radius: 10px; border-bottom: 2px solid var(--teal-deep); }
.f-box input, .f-box textarea { display: block; width: 100%; border: 0; background: transparent; font: 400 16px/1.5 var(--font); color: var(--ink); padding: 11px 14px; outline: none; resize: vertical; border-radius: 10px; }
.f-box:focus-within { box-shadow: 0 0 0 3px var(--blue); }
.f-val { display: none; white-space: pre-wrap; padding: 2mm 3mm; font-size: 9.5pt; line-height: 1.45; color: var(--ink); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.pair .fld { margin-bottom: 8px; }
.pair-h { margin: 0 0 22px !important; }
.pair + .fld, .pair + .chk { margin-top: 14px; }
fieldset.chk legend { margin-bottom: 4px; }
.opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 22px; margin-top: 8px; }
.opts.many { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.opt { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; line-height: 1.35; color: var(--ink-2); cursor: pointer; }
.cb-box { position: relative; flex: none; width: 20px; height: 20px; margin-top: 1px; border: 2px solid var(--teal-deep); border-radius: 5px; background: var(--white); }
.cb-box input { position: absolute; inset: -4px; width: calc(100% + 8px); height: calc(100% + 8px); margin: 0; opacity: 0; cursor: pointer; }
.cb-box:has(input:checked), .cb-box.on { background: var(--teal); border-color: var(--teal); }
.cb-box:has(input:checked)::after, .cb-box.on::after { content: ""; position: absolute; left: 5px; top: 1px; width: 6px; height: 11px; border: solid var(--ink); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.cb-box:has(input:focus-visible) { outline: 3px solid var(--blue); outline-offset: 2px; }
.b-tip { position: relative; margin: 4px 0 22px !important; padding: 14px 18px 14px 22px; background: var(--white); border: 1.5px solid var(--line); border-radius: 12px; font-size: 14px; color: var(--ink-2); }
.b-tip::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px; border-radius: 0 3px 3px 0; background: var(--teal); }
.other { margin-top: 10px; font-size: 15px; color: var(--muted); }
.btn.ghost { background: var(--white); color: var(--blue) !important; box-shadow: inset 0 0 0 2px var(--blue); }
.btn.ghost:hover { background: var(--blue-tint, #EEEEFD); }
.how .ch-head h2 { margin-top: 4px; }

/* The answer bar on the web page */
.actions { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap; padding: 12px clamp(16px, 4vw, 40px); background: rgba(255,255,255,.94); backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
.actions .saved { margin-right: auto; font-size: 13px; color: var(--muted); }
body.brief { padding-bottom: 80px; }
@media screen and (max-width: 700px) {
  .pair, .opts, .opts.many { grid-template-columns: 1fr; }
  .actions .saved { flex-basis: 100%; margin: 0; }
  .actions .btn { flex: 1; padding: 11px 10px; font-size: 13px; }
  body.brief { padding-bottom: 130px; }
}

/* ---------- Print: the fillable PDF (blank) ---------- */
@media print {
  body.brief { padding-bottom: 0; }
  .actions { display: none !important; }
  .brief .chapter { max-width: none; }
  .bsec { break-before: page; }
  .how { break-before: page; }
  .how .cards { margin-top: 2mm; }
  .fld { margin-bottom: 4.2mm; }
  .f-l { font-size: 10pt; margin-bottom: .8mm; }
  .f-h { font-size: 8.4pt; margin-bottom: 1.6mm !important; }
  .f-box { border-radius: 2mm; border-bottom-width: 1.2pt; background: var(--fc) !important; }
  .f-box input, .f-box textarea { display: none; }
  .f-box.h1 { height: 8.5mm; }
  .f-box.rows-2 { height: 16mm; }
  .f-box.rows-3 { height: 23mm; }
  .f-box.rows-4 { height: 30mm; }
  .pair { gap: 5mm; }
  .pair .fld { margin-bottom: 1.6mm; }
  .pair-h { margin-bottom: 4.2mm !important; }
  .pair + .fld, .pair + .chk { margin-top: 2.5mm; }
  .opts { gap: 2mm 6mm; margin-top: 1.5mm; }
  .opt { font-size: 9pt; gap: 2.2mm; }
  .cb-box { width: 3.8mm; height: 3.8mm; border-width: 1.1pt; border-radius: 1mm; margin-top: .3mm; background: var(--fc) !important; }
  .cb-box input { display: none; }
  .b-tip { font-size: 8.8pt; padding: 3mm 4mm 3mm 5mm; margin-bottom: 4mm !important; }
  .other { font-size: 9pt; }
  /* When someone saves their filled-in brief from the web page */
  body.filled .f-box { background: var(--mist) !important; height: auto !important; min-height: 8.5mm; }
  body.filled .f-val { display: block; }
  body.filled .cb-box { background: var(--white) !important; }
  body.filled .cb-box.on { background: var(--teal) !important; }
  body.filled .cb-box.on::after { left: .9mm; top: .1mm; width: 1.1mm; height: 2.1mm; border-width: 0 .7mm .7mm 0; }
}
.figs.trio { grid-template-columns: repeat(3, 1fr); max-width: 640px; }
.figs.trio .fig-img { aspect-ratio: 9 / 16; }
.trio-cap { margin: -20px 0 24px; font-size: 13px; color: var(--faint); }
@media print { .figs.trio { max-width: 120mm; gap: 3mm; } .trio-cap { font-size: 7.6pt; margin: -3mm 0 5mm; } }
