/* October 15, 2026. Batch 4 ephemeral tools and printable sheets. */
.b4-form fieldset { min-width: 0; margin: 0 0 24px; }
.b4-form .opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.b4-form .result-list li { display: block; }
.b4-form .result-list strong { display: block; margin-bottom: 4px; }
.b4-form .field { display: block; margin-bottom: 20px; }
.b4-form input, .b4-form select, .b4-form textarea { font: inherit; max-width: 100%; }
.b4-form textarea { width: 100%; min-height: 80px; }
.b4-form [data-letter-output] { white-space: pre-wrap; overflow-wrap: anywhere; }
.b4-letter { margin-top: 24px; box-shadow: none; }
.b4-sheets { display: grid; gap: 24px; }
.b4-print-page, .b4-print-fridge { min-height: 600px; }
.b4-print-wallet { max-width: 360px; }
.b4-write-field { margin: 12px 0; }
.b4-write-field .fc-write { height: auto; min-height: 36px; white-space: pre-wrap; overflow-wrap: anywhere; }
.b4-account-list { min-width: 700px; }
.b4-account-list .fc-write { min-width: 75px; }
@media (max-width: 640px) {
  .b4-form .opts { grid-template-columns: 1fr; }
  .b4-print-page, .b4-print-fridge { min-height: 0; }
  .b4-print-wallet { max-width: 100%; }
}
@media print {
  @page { size: letter; margin: 0.4in; }
  body.b4-tool main > section:not(.b4-tool-section):not(.b4-tool-support) { display: none !important; }
  .b4-tool-support > .container > :not([data-legacy-method]):not([data-legacy-reference]) { display: none !important; }
  body.b4-letter-live [data-legacy-reference], body.b4-tool:not(.b4-letter-live) .b4-letter { display: none !important; }
  .b4-tool-support, .b4-tool-support .container { padding: 0; max-width: none; }
  .b4-tool-support [data-legacy-method] { font-size: 10pt; line-height: 1.35; }
  .b4-tool-support [data-legacy-method] .std-list { display: block; overflow: visible; border: 0; }
  .b4-tool-support [data-legacy-method] li { break-inside: avoid; }
  body.b4-tool .b4-tool-section { padding: 0; }
  body.b4-tool .b4-tool-section .container { max-width: none; padding: 0; }
  .b4-form { border: 0; padding: 0; box-shadow: none; }
  .b4-form button { display: none !important; }
  .b4-form > .fine, .b4-form .actions, .b4-form [data-b4-status] { display: none; }
  .b4-form .b4-tool-inputs { display: none; }
  .b4-form .result-list { font-size: 11pt; line-height: 1.35; }
  .b4-form .result-list li { padding: 7px 0; break-inside: avoid; }
  .b4-letter { max-width: none; margin: 0; padding: 0; border: 0; font-size: 11pt; line-height: 1.35; break-after: page; }
  .b4-letter:last-of-type { break-after: auto; }
  .b4-form:has(.b4-letter) .b4-tool-inputs { display: none; }
  .b4-sheets { display: block; }
  .b4-sheets .fill-card { width: 100%; border-color: var(--line-strong); margin: 0; gap: 8px; }
  .b4-sheets .b4-print-page { height: 9.9in; padding: 0.2in; break-after: page; }
  .b4-sheets .b4-print-page:last-child { break-after: auto; }
  .b4-sheets .b4-print-fridge { height: 5.8in; margin-top: 0.3in; }
  .b4-sheets .b4-print-wallet { width: 3.5in; max-width: 3.5in; height: 2.4in; padding: 0.12in; gap: 3px; }
  .b4-print-wallet .fine { font-size: 8pt; margin: 0; }
  .b4-print-wallet .fc-top { font-size: 8pt; }
  .b4-print-wallet .fc-line { font-size: 11pt; }
  .b4-print-wallet .b4-write-field { margin: 2px 0; }
  .b4-print-wallet .fc-write { min-height: 0.2in; }
  .b4-print-wallet .fc-brand { font-size: 7pt; }
  .b4-pet-plan .b4-print-wallet { break-after: page; }
  .b4-account-list { min-width: 0; width: 100%; font-size: 9pt; }
  .b4-account-list th, .b4-account-list td { padding: 5px; }
  .b4-account-list .fc-write { height: 0.58in; min-width: 0; }
}

/* October 17, 2026. Layout polish: checkbox and writing groups stack under their heading. */
.b4-form > .fine:first-child { margin: 0 0 14px; }
.b4-form .q { margin: 0 0 10px; }
.b4-form .q:has(input[type="checkbox"]), .b4-form .q:has(textarea), .b4-form .q:has(select) { display: block; padding: 20px 22px 22px; }
.b4-form .q:has(input[type="checkbox"]) legend, .b4-form .q:has(textarea) legend { float: none; display: block; width: 100%; margin: 0 0 14px; font-size: 1.08rem; font-weight: 700; }
.b4-form .q:has(input[type="checkbox"]) .opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.b4-form .q:has(input[type="checkbox"]) .opt span { width: 100%; min-width: 0; min-height: 48px; justify-content: flex-start; text-align: left; }
.b4-form .q:has(textarea) + .q:has(textarea) { margin-top: 16px; }
.b4-form label.field { display: grid; gap: 6px; margin: 0 0 14px; font-weight: 600; font-size: .95rem; }
.b4-form label.field:last-child { margin-bottom: 0; }
.b4-form label.field textarea { font-weight: 400; font-size: 1rem; min-height: 76px; resize: vertical; }
.b4-form .q:has(input[type="radio"]) .opts { display: flex; gap: 8px; }
.b4-form .actions { margin: 20px 0 0; }
.b4-form .b4-letter { max-width: none; margin-top: 20px; padding: 32px 36px; }
.b4-form .b4-letter h2 { margin: 0 0 4px; }
.b4-form .b4-letter [data-letter-output] p { margin: 0 0 14px; }
@media (max-width: 640px) {
  .b4-form .q:has(input[type="checkbox"]) .opts { grid-template-columns: 1fr 1fr; }
  .b4-form .q:has(input[type="radio"]) .opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .b4-form .q:has(textarea), .b4-form .q:has(input[type="checkbox"]) { padding: 16px; }
  .b4-form .b4-letter { padding: 22px 18px; }
}
@media (max-width: 440px) {
  .b4-form .q:has(input[type="checkbox"]) .opts { grid-template-columns: 1fr; }
}
