/* Printable clinical forms (/lukmanlar/formalar/, p12-forms). Screen: 48px
   targets, one column on phones, the IMCI layout (ASSESS | CLASSIFY) from
   760px. Paper: A4 portrait, text 10.5 pt, column heads, the growth table and
   the footer 9.5 pt at least; boxes print as boxes, nothing depends on colour
   (dossier H5). */
.fm-list { margin: 0 0 8px; padding-left: 20px; }
.fm-list li { margin: 6px 0; }
.fm-epds { margin-top: 22px; }
.fm-epds .h2 { margin-top: 4px; }
.fm-quotes { margin: 0 0 12px; padding-left: 20px; font-size: 14.5px; color: var(--ink-mid); }
.fm-quotes li { margin: 6px 0; }
.fm-bar { margin: 4px 0 8px; }
.fm-bar .btnrow { margin-top: 0; }
.fm-confirm { margin-top: 12px; border-color: var(--red-line); }
.fm-confirm .fm-q { margin: 0; font-weight: 800; }
.fm-danger { border-color: var(--red-strong); color: var(--red-strong); }
.fm-live:empty { display: none; }
.fm-pend { margin: 4px 0 14px; border-color: var(--amber-line); background: var(--amber-bg); }
.fm-pend .fm-q, .fm-next .fm-q { margin: 0; font-weight: 800; }
.fm-pend .btnrow { margin-top: 12px; }
.fm-next { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.fm-next:empty, .fm-next[hidden] { display: none; }
/* whole buttons wrap to the next line; a label never breaks inside its pill */
.fm-bar .btnrow > *, .fm-pend .btnrow > * { flex: 1 1 auto; }
.fm-bar .btn2, .fm-pend .btn2, .fm-next .btn2 { white-space: nowrap; }
.fm-next .btn2 { margin-top: 10px; }
.fm-wait { opacity: .45; }
.fm-live { margin: 10px 0 0; font-size: 14px; font-weight: 700; color: var(--olive-d); }
.fm-links { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 8px 0 14px; }
.fm-link { display: inline-flex; align-items: center; min-height: 48px; color: var(--olive-d); font-weight: 800; text-underline-offset: 3px; }

/* the sheet */
.fm-sheet { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px; }
.fm-h { font-size: 18px; line-height: 1.25; margin: 0 0 12px; letter-spacing: -.01em; }
.fm-head { display: grid; grid-template-columns: 1fr; gap: 10px 14px; margin-bottom: 12px; }
.fm-colhead { display: none; }
.fm-sec { border-top: 2px solid var(--line); padding: 10px 0 6px; }
.fm-sh { font-size: 14.5px; font-weight: 800; margin: 0 0 8px; line-height: 1.3; }
.fm-sub { font-size: 14px; font-weight: 800; margin: 10px 0 4px; color: var(--ink-mid); }
.fm-note { margin: 6px 0; font-size: 14px; color: var(--ink-mid); }
.fm-sbody, .fm-band { display: grid; grid-template-columns: 1fr; gap: 6px 16px; }
.fm-ask, .fm-look, .fm-cls, .fm-assess { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fm-cls:empty { display: none; }
.fm-clsh { font-size: 12.5px; font-weight: 800; color: var(--ink-soft); letter-spacing: .04em; text-transform: uppercase; }
.fm-l { font-size: 14.5px; font-weight: 700; }

/* tick box: the real checkbox is invisible; the square is what shows and prints */
.fm-chk { display: flex; align-items: flex-start; gap: 10px; min-height: 48px; padding: 12px 0 6px; cursor: pointer; position: relative; font-size: 14.5px; }
.fm-chk input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.fm-box { flex: none; width: 22px; height: 22px; border: 2px solid var(--ink-soft); border-radius: 4px; background: var(--surface); display: inline-flex; align-items: center; justify-content: center; font-weight: 900; line-height: 1; }
.fm-chk input:checked + .fm-box::after, .fm-opt[aria-pressed="true"] .fm-box::after { content: "\2713"; font-size: 16px; }
.fm-chk input:checked + .fm-box, .fm-opt[aria-pressed="true"] .fm-box { border-color: var(--olive-d); background: var(--tint-o); }
.fm-chk input:focus-visible + .fm-box { outline: 3px solid var(--olive-d); outline-offset: 2px; }
.fm-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; border-bottom: 1px solid var(--line); }
.fm-choice { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 4px 0; }
.fm-opts { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.fm-opt { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 10px 0 4px; border: 0; background: none; cursor: pointer; font-size: 14.5px; font-weight: 700; color: var(--ink); text-align: left; }
.fm-num, .fm-text, .fm-date, .fm-area, .fm-agel { display: flex; flex-direction: column; gap: 4px; padding: 4px 0; }
.fm-iu, .fm-agein { display: flex; align-items: center; gap: 8px; }
.fm-inp { background: var(--surface); border: 2px solid var(--line); border-radius: 12px; min-height: 48px; padding: 0 12px; font-size: 16px; font-weight: 700; width: 100%; min-width: 0; color: var(--ink); }
.fm-iu .fm-inp, .fm-agein .fm-inp { max-width: 9em; }
.fm-inp:focus, .fm-ta:focus, .fm-sel:focus { outline: none; border-color: var(--olive-d); }
.fm-inp[aria-invalid="true"] { border-color: var(--red-strong); }
.fm-u { font-size: 14px; font-weight: 800; color: var(--ink-soft); white-space: nowrap; }
.fm-sel { min-height: 48px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); padding: 0 10px; font-weight: 700; }
.fm-ta { width: 100%; min-height: 96px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); padding: 10px 12px; font: inherit; font-size: 15px; resize: vertical; color: var(--ink); }
.fm-err { font-size: 13px; font-weight: 700; color: var(--red-strong); }
.fm-err:empty { display: none; }
.fm-scope { margin: 4px 0 0; font-size: 14px; font-weight: 700; color: var(--amber-ink); }
.fm-scope:empty { display: none; }
.fm-blankrow { display: flex; align-items: flex-end; gap: 8px; min-height: 40px; padding: 4px 0; }
.fm-blankrow .fm-l { flex: none; max-width: 60%; }
.fm-line { flex: 1; border-bottom: 1px dashed var(--ink-soft); min-height: 24px; display: flex; align-items: flex-end; }
.fm-hand { font-size: 12px; color: var(--ink-soft); font-style: italic; padding-bottom: 2px; }
.fm-imm { display: flex; flex-wrap: wrap; gap: 0 18px; }
.fm-immcol { display: flex; flex-direction: column; min-width: 7.5em; }
.fm-page { margin: 14px 0; border-top: 2px dashed var(--line); text-align: center; font-size: 12.5px; font-weight: 800; color: var(--ink-soft); padding-top: 6px; }

/* growth record */
.fm-vcard { margin: 10px 0; }
.fm-vtop { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fm-vgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; }
.fm-vgrid > .fm-choice, .fm-vgrid > .fm-chk { grid-column: 1 / -1; }
.fm-vres { margin-top: 6px; }
.fm-vres p { margin: 4px 0; }
.fm-vage { font-weight: 800; }
.fm-vmsg { font-weight: 700; color: var(--amber-ink); }
.fm-zlist { list-style: none; margin: 4px 0 0; padding: 0; }
.fm-zlist li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; }
.fm-zlist b.st { font-weight: 700; color: var(--ink-soft); text-align: right; }
.fm-add { margin-top: 8px; }
.fm-gtable td.st { color: var(--ink-soft); font-size: 13px; }
.fm-foot { margin-top: 16px; }
.fm-src, .fm-lic { font-size: 12.5px; color: var(--ink-soft); margin: 6px 0; }

@media (max-width: 380px) {
  .fm-pair, .fm-vgrid { grid-template-columns: 1fr; }
  .fm-pair .fm-chk { flex-wrap: wrap; }
  .fm-pair .fm-chk::before { content: attr(data-side); flex-basis: 100%; font-size: 12px; font-weight: 800; color: var(--ink-soft); }
}
/* the observation aid's two column heads line up with its two tick columns */
@media (min-width: 381px) and (max-width: 759px) {
  .fm-colhead.pairs { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; font-size: 12.5px; font-weight: 800; color: var(--ink-soft); padding-bottom: 6px; }
}
/* phones: the bar's buttons stack full width, each label on one line */
@media (max-width: 480px) {
  .fm-bar .btnrow, .fm-pend .btnrow { flex-direction: column; align-items: stretch; }
  .fm-bar .btnrow > *, .fm-pend .btnrow > * { flex: none; }
  .fm-bar .printwrap { display: block; }
  .fm-bar .btn2, .fm-pend .btn2, .fm-next .btn2 { width: 100%; }
}

@media (min-width: 560px) {
  .fm-head { grid-template-columns: repeat(3, 1fr); }
  .fm-head.two { grid-template-columns: 1fr 1fr; grid-auto-flow: row dense; }
  .fm-head.two .c-l { grid-column: 1; }
  .fm-head.two .c-r { grid-column: 2; }
  .fm-head .c-f { grid-column: 1 / -1; }
  .fm-band { grid-template-columns: 1fr 1fr; }
  .fm-band.only-ask, .fm-band.only-look { grid-template-columns: 1fr; }
}
@media (min-width: 760px) {
  .fm-clsh { display: none; }
  .fm-sheet { padding: 20px 22px; }
  .fm-colhead { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); gap: 16px; font-size: 12.5px; font-weight: 800; color: var(--ink-soft); letter-spacing: .04em; text-transform: uppercase; padding-bottom: 6px; }
  .fm-colhead.pairs { grid-template-columns: 1fr 1fr; }
  .fm-sbody { grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); }
  .fm-sec.nocls .fm-sbody { grid-template-columns: 1fr; }
  .fm-cls { border-left: 1px solid var(--line); padding-left: 14px; }
}

/* ---------------------------------------------------------------- paper --- */
@media print {
  @page { size: A4 portrait; margin: 10mm; }
  body { font-size: 10.5pt; line-height: 1.25; }
  .draftbar { font-size: 8pt; padding: 2px 6px; margin: 0 0 4px; border-radius: 0; }
  .fm-sheet { border: 0; padding: 0; border-radius: 0; background: #fff; }
  .fm-h { font-size: 12pt; margin: 0 0 4pt; }
  .fm-head { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2pt 10pt; margin-bottom: 4pt; }
  .fm-head.two { grid-template-columns: 1fr 1fr; grid-auto-flow: row dense; }
  .fm-head.two .c-l { grid-column: 1; }
  .fm-head.two .c-r { grid-column: 2; }
  .fm-head .c-f { grid-column: 1 / -1; }
  .fm-colhead { display: grid; grid-template-columns: 3fr 1fr; gap: 8pt; font-size: 9.5pt; font-weight: 800; border: 1px solid #000; border-bottom: 0; padding: 2pt 4pt; }
  .fm-colhead.pairs { grid-template-columns: 1fr 1fr; }
  .fm-sec { border: 1px solid #000; padding: 3pt 4pt; margin: 0 0 -1px; break-inside: avoid; }
  .fm-sh { font-size: 10.5pt; margin: 0 0 2pt; }
  .fm-sub { font-size: 10.5pt; margin: 3pt 0 1pt; color: #000; }
  .fm-note { font-size: 10.5pt; margin: 1pt 0; color: #000; }
  .fm-sbody { display: grid; grid-template-columns: 3fr 1fr; gap: 0 8pt; }
  .fm-sec.nocls .fm-sbody { grid-template-columns: 1fr; }
  .fm-cls { border-left: 1px solid #000; padding-left: 4pt; }
  .fm-clsh, .fm-pair .fm-chk::before { display: none; }
  .fm-band { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8pt; }
  .fm-band.only-ask, .fm-band.only-look { grid-template-columns: 1fr; }
  .fm-ask, .fm-look, .fm-cls, .fm-assess { gap: 0; }
  .fm-l, .fm-t, .fm-opt { font-size: 10.5pt; font-weight: 400; color: #000; }
  .fm-chk { min-height: 0; padding: 1pt 0; gap: 4pt; font-size: 10.5pt; }
  /* a ticked box differs from an empty one by its tick only (review M1) */
  .fm-box { width: 10pt; height: 10pt; border: 1px solid #000 !important; border-radius: 0; background: #fff !important; }
  .fm-chk input:checked + .fm-box::after, .fm-opt[aria-pressed="true"] .fm-box::after { font-size: 9pt; color: #000; }
  .fm-imm { gap: 0 8pt; }
  .fm-immcol { min-width: 0; }
  .fm-pair { gap: 0 8pt; border-bottom: 1px solid #999; }
  .fm-choice { padding: 1pt 0; gap: 1pt 6pt; }
  .fm-opts { gap: 1pt 8pt; }
  .fm-opt { min-height: 0; padding: 0; gap: 3pt; }
  .fm-num, .fm-text, .fm-date, .fm-agel { flex-direction: row; align-items: baseline; gap: 4pt; padding: 1pt 0; flex-wrap: wrap; }
  .fm-inp { border: 0; border-bottom: 1px solid #000; border-radius: 0; min-height: 0; height: auto; padding: 0 2pt; font-size: 10.5pt; font-weight: 400; background: #fff; color: #000; flex: 1; min-width: 4em; }
  .fm-iu .fm-inp, .fm-agein .fm-inp { max-width: 6em; }
  .fm-inp.empty { color: transparent; }
  .fm-iu, .fm-agein { gap: 3pt; flex: 1; }
  .fm-u { font-size: 10.5pt; color: #000; font-weight: 400; display: inline !important; }
  .fm-agein .fm-uall { display: none !important; }
  .fm-area { padding: 1pt 0; gap: 1pt; }
  .fm-paper { display: block !important; }
  .fm-ptext { white-space: pre-wrap; font-size: 10.5pt; }
  .fm-plines { display: block; }
  .fm-pl { display: block; height: 14pt; border-bottom: 1px solid #999; }
  .fm-blankrow { min-height: 0; padding: 2pt 0; }
  .fm-line { border-bottom: 1px solid #000; min-height: 12pt; }
  .fm-page { break-before: page; border: 0; margin: 0; padding: 0; }
  .fm-growth .fm-vcards { display: none; }
  .fm-gwrap { border: 0; border-radius: 0; overflow: visible; margin: 4pt 0; }
  .fm-gtable { font-size: 9.5pt; }
  .fm-gtable td.st { color: #000; font-size: 9.5pt; }
  .fm-gtable th, .fm-gtable td { border: 1px solid #000; padding: 2pt 3pt; color: #000; background: #fff; position: static; }
  .fm-gtable .fm-erow td { height: 16pt; }
  .fm-erow { display: table-row !important; }
  .fm-foot { margin-top: 6pt; }
  .fm-src, .fm-lic, .fm-foot .foot { font-size: 9.5pt; color: #000; margin: 2pt 0; }
  /* "Print blank": entries, ticks and chosen options vanish; boxes and lines stay */
  body.fm-blank .fm-inp { color: transparent; }
  body.fm-blank .fm-ptext, body.fm-blank .fm-gtable tbody td { color: transparent; }
  body.fm-blank .fm-chk input:checked + .fm-box::after, body.fm-blank .fm-opt[aria-pressed="true"] .fm-box::after { content: none; }
  body.fm-blank .fm-agein .fm-u1 { display: none !important; }
  body.fm-blank .fm-agein .fm-uall { display: inline !important; }
}
