/* Newborn calculators (/lukmanlar/hasap/): only what hubs/hub.css does not
   already give. Colours from the CSS variables only, so dark mode follows. */

/* labels and fields: <div.field><label.nb-l/><input/><div.fhelp/></div> */
.nb-l { display: block; font-size: 14px; font-weight: 800; color: var(--ink-mid); margin-bottom: 6px; line-height: 1.3; padding: 0; }
.nb .field .fhelp { margin-top: 6px; line-height: 1.4; }
.nb .inp[aria-invalid="true"] { border-color: var(--red); }
.nb .inp[type="date"], .nb .inp[type="time"] { font-size: 17px; padding: 0 10px; }
.nb .inp[type="date"]::-webkit-date-and-time-value, .nb .inp[type="time"]::-webkit-date-and-time-value { text-align: left; }
.nb-fs { border: 0; margin: 0; padding: 0; min-width: 0; }
.nb .seg-pick span { min-height: 48px; }
.nb .seg-pick input:focus-visible + span { outline-color: var(--olive-d); }
.nb .opt { font-size: 15.5px; min-height: 56px; padding: 12px 14px; }
.nb .opt.sel { border-color: var(--olive-d); background: var(--tint-o); }
.nb .opt.sel .radio { border-color: var(--olive-d); }
.nb .opt:has(input:focus-visible) { outline-color: var(--olive-d); }
.nb .ans { gap: 8px; }
.nb-now { color: var(--olive-d); margin-top: 2px; }
.nb .err:empty { display: none; }

.nb .dochead { margin-bottom: 14px; }
.nb-store { margin: 0 0 16px; }

/* the shared baby card */
.nb-baby { margin: 0; }
.nb-baby .h2 { margin: 0 0 12px; }
.nb-baby > .fhelp { margin-top: 10px; }

/* calculator switch: four in-page links */
.nb-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; background: var(--band); border-radius: 18px; padding: 4px; margin: 18px 0 4px; }
.nb-nav a {
  display: flex; align-items: center; justify-content: center; text-align: center; min-height: 48px; padding: 4px 6px;
  border-radius: 14px; font-weight: 800; font-size: 14px; line-height: 1.15; color: var(--ink-mid); text-decoration: none;
}
.nb-nav a[aria-current="true"] { background: var(--olive-d); color: var(--solid-ink); }
/* four across from 421 px; two by two on phones, so no label is ever broken mid-word */
@media (max-width: 420px) { .nb-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* panels */
.nb-panel > .h2:first-child { margin-top: 22px; }
.nb-scope { margin: -2px 0 10px; }
.nb-caveat { background: var(--band); border-radius: 16px; padding: 12px 14px; font-size: 13.5px; color: var(--ink-mid); margin: 0 0 16px; line-height: 1.45; }
.nb-caveat p { margin: 0; }
.nb-caveat p + p { margin-top: 6px; }
.res .nb-tone { color: var(--ink); font-weight: 700; }
.nb-h3 { font-size: 16.5px; font-weight: 800; margin: 22px 0 4px; line-height: 1.3; }
.nb-rflead { margin: 0 0 6px; }
.nb-tsb { margin: 14px 0 0; }
.nb-row { display: flex; gap: 8px; align-items: stretch; }
.nb-row > .inp-unit { flex: 1 1 52%; min-width: 0; }
.nb-row > .nb-ufs { flex: 1 1 48%; min-width: 0; }
.nb-ufs .seg-pick { height: 100%; }
.nb-ufs .seg-pick span { padding: 0 2px; font-size: 14px; }
@media (max-width: 360px) { .nb-ufs .seg-pick span { font-size: 13px; } }
.nb-q { border: 0; margin: 0; padding: 14px 0; min-width: 0; border-top: 1px solid var(--line); }
.nb-q > legend { float: left; width: 100%; padding: 0; margin: 0 0 8px; font-size: 15px; color: var(--ink); }
.nb-q > legend + * { clear: both; }
.nb-q .nb-qhelp { margin: -2px 0 8px; }
.nb-q > .fhelp:last-child { margin-top: 8px; }
.nb-ph { border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.nb-wunit { margin-bottom: 14px; max-width: 320px; }
.nb-when { margin-bottom: 0; }
.nb-lead2 { margin: 0 0 14px; font-size: 15px; }

/* results */
.nb-slot:empty { display: none; }
.nb-slot > * + *, .nb-side > * + * { margin-top: 14px; }
.nb-res h2.vh { font-size: 19px; line-height: 1.25; margin: 10px 0 6px; }
/* thresholds and results as label / value rows: legible at 320 px and in the narrow result column */
.nb .kpis { grid-template-columns: minmax(0, 1fr); gap: 8px; }
.nb .kpi { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: baseline; padding: 10px 14px; }
.nb .kpi .nb-klab { grid-column: 1; grid-row: 1; margin: 0; font-size: 15px; font-weight: 800; color: var(--ink); line-height: 1.3; }
.nb .kpi b { grid-column: 2; grid-row: 1; text-align: right; font-size: 21px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nb .kpi .nb-alt { grid-column: 2; grid-row: 2; text-align: right; font-size: 13px; font-weight: 700; color: var(--ink-mid); margin-top: 2px; white-space: nowrap; }
.nb .kpi .nb-ksrc { grid-column: 1; grid-row: 2; font-size: 12px; font-weight: 600; color: var(--ink-soft); margin-top: 2px; line-height: 1.35; }
.nb .res .kpi.nb-hit { border: 2px solid var(--ink-soft); }
.nb .res.amber .kpi.nb-hit { border-color: var(--amber); }
.nb .res.red .kpi.nb-hit { border-color: var(--red); }
.nb-reached { font-style: normal; font-weight: 800; color: var(--ink-mid); }
.nb-why { margin: 0; padding-left: 18px; color: var(--ink-mid); font-size: 14px; }
.nb-why li + li { margin-top: 4px; }
.nb-protocol { font-weight: 800; color: var(--ink) !important; margin-top: 10px !important; }
.nb-esc { margin-top: 14px; }
.nb-esc .nb-exch { margin: 10px 0 0; }
.nb-line { margin: 10px 0 0; line-height: 1.45; }
.nb-loading { margin: 0; }
.nb-retry { margin-top: 12px; }
.nb-status { font-size: 15px; color: var(--ink-mid); margin: 12px 0 0; line-height: 1.45; }
.nb-abm { margin-top: 14px; }
.nb-abm .nb-h3 { margin-top: 0; }
.nb-abm p { margin: 8px 0 0; }
.nb-quote { margin: 10px 0 0; padding: 4px 0 4px 12px; border-left: 3px solid var(--olive); font-weight: 700; font-size: 15px; }
.nb-newt { margin: 14px 0 0; }
.nb-newt a { display: inline-flex; align-items: center; min-height: 48px; color: var(--olive-d); font-weight: 800; text-underline-offset: 3px; }
.nb-newt .fhelp { margin-top: 0; }
.nb .btnrow > .printwrap { flex: 0 1 auto; }
.nb .fold { margin: 14px 0 0; }
.nb .fold > div > p { margin: 10px 0 0; }
.nb .fold > div > p:first-child { margin-top: 0; }

/* tables */
.nb .dtable tbody th { font-weight: 800; color: var(--ink); white-space: nowrap; }
.doc .nb .dtable tr.hit th { background: var(--tint-o); }
.nb .dtable tr[aria-current] th, .nb .dtable tr[aria-current] td { font-weight: 800; }
.nb-fig7 tbody th { white-space: normal; width: 6.5em; }
.nb-both thead th, .nb-both thead th.num { white-space: normal; }
.nb-both tbody th { white-space: normal; }
.nb .dtable .nb-sub { font-weight: 600; }
.nb .dtable .nb-sub + .nb-sub { margin-top: 8px; }
.nb .dtable .nb-sub.nb-on { font-weight: 800; }
.nb .dtable .nb-sub.nb-off { color: var(--ink-soft); }
.nb .dtable td.nb-used { font-weight: 800; color: var(--ink); }
.nb-both td:not(.nb-used) { color: var(--ink-mid); font-weight: 600; }
.nb-ageout .kpis { margin-top: 4px; }

/* desktop: form and result side by side for bilirubin and weight */
@media (min-width: 900px) {
  .nb-split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 32px; align-items: start; }
  .nb-split > .nb-side > :first-child { margin-top: 0; }
  .nb-side .redcard { margin-top: 0; }
  .nb-slot:not(:empty) + .nb-flag .redcard { margin-top: 14px; }
  .nb-nav { max-width: 640px; }
  .nb-nav a { font-size: 15px; }
  .nb-fig7 tbody th { width: 9em; }
}
@media (max-width: 899px) {
  .nb-side { margin-top: 18px; }
}

@media print {
  .nb-nav, .nb-now, .nb .go, .nb .err { display: none !important; }
  .nb .inp { border-width: 1px; min-height: 40px; }
  .nb-split { display: block; }
  .nb .seg-pick { background: none; }
  .nb .seg-pick span { color: #666; }
  .nb .seg-pick input:checked + span { color: #000; outline: 2px solid #000; }
  .nb .opt.sel { border-color: #000; }
  .nb .res .kpi { border: 1px solid #999; }
}
