/* QC58 PhotoRx: preserve the graph width and add 48 worksheet pixels. */
body:not(.responsive-touch) .worksheet-frame { width:1468px !important; }
body:not(.responsive-touch) #autoscaleShell { max-width:1468px; }
body:not(.responsive-touch) .excel-grid.excel-grid-left-data { grid-template-columns:1110px 293px !important; }
body:not(.responsive-touch) .logged-on-user-display { width:100% !important; }
body:not(.responsive-touch) .clinical-data-button-row,
body:not(.responsive-touch) .clinical-print-button-row { width:100% !important; }
body:not(.responsive-touch) #patientTable > thead > tr,
body:not(.responsive-touch) #patientTable tbody > tr { grid-template-columns:minmax(0,1.15fr) repeat(3,minmax(0,1fr)) 48px !important; }
body:not(.responsive-touch).clinical-selected-delete-mode #patientTable > thead > tr,
body:not(.responsive-touch).clinical-selected-delete-mode #patientTable tbody > tr { grid-template-columns:minmax(0,1.15fr) repeat(3,minmax(0,1fr)) 48px 18px !important; }
body:not(.responsive-touch).age-calculator-expanded #patientTable > thead > tr,
body:not(.responsive-touch).age-calculator-expanded #patientTable tbody > tr { grid-template-columns:88px 72px minmax(0,1.15fr) repeat(3,minmax(0,1fr)) 48px !important; }
body:not(.responsive-touch).age-calculator-expanded.clinical-selected-delete-mode #patientTable > thead > tr,
body:not(.responsive-touch).age-calculator-expanded.clinical-selected-delete-mode #patientTable tbody > tr { grid-template-columns:88px 72px minmax(0,1.15fr) repeat(3,minmax(0,1fr)) 48px 18px !important; }
body:not(.responsive-touch).age-calculator-expanded .worksheet-frame::before { width:522px !important; }
#patientTable .phototherapy-heading { line-height:12px !important; font-size:12px !important; }
#patientTable .phototherapy-cell { padding:0 !important; }
#patientTable .phototherapy-button { display:block; width:100% !important; min-width:0 !important; height:100% !important; min-height:0 !important; max-height:none !important; margin:0 !important; padding:0 !important; border:0 !important; border-radius:0 !important; background:transparent !important; color:#000 !important; font:14px Arial,sans-serif !important; cursor:pointer; }
#patientTable .phototherapy-button:focus-visible { outline:2px solid #17669c !important; outline-offset:-2px; }
#patientTable .phototherapy-button:disabled { cursor:default; }
.phototherapy-dialog { box-sizing:border-box; width:360px; max-width:calc(100vw - 24px); max-height:calc(100dvh - 24px); overflow:auto; margin:auto; padding:20px; background:#fff; color:#111; border:2px solid #333; box-shadow:0 8px 28px #0004; font:16px Arial,sans-serif; }
.phototherapy-dialog::backdrop { background:#0005; }
.phototherapy-dialog h2 { margin:0 0 12px; font-size:19px; color:#001a80; }
.phototherapy-dialog .phototherapy-record { font-size:13px; margin:0 0 12px; }
.phototherapy-dialog label { display:flex; align-items:center; gap:8px; min-height:44px; }
.phototherapy-dialog input { width:18px; height:18px; margin:0; }
.phototherapy-previous { background:#edf3f8; padding:10px; font-size:14px; line-height:1.4; }
.phototherapy-actions { display:flex; gap:8px; justify-content:flex-end; margin-top:14px; }
.phototherapy-actions button { min-height:40px; padding:8px 18px; font:15px Arial,sans-serif; color:#111; background:#eee; border:1px solid #888; }
.phototherapy-actions [data-photo-save] { background:#001a80; color:#fff; }
@media screen {
  body.responsive-touch #autoscaleShell #patientTable { width:100% !important; min-width:0 !important; max-width:100% !important; table-layout:fixed !important; }
  body.responsive-touch #autoscaleShell #patientTable > thead > tr,
  body.responsive-touch #autoscaleShell #patientTable > tbody > tr:nth-child(n) { display:grid !important; position:relative !important; width:100% !important; grid-template-columns:repeat(4,minmax(0,1fr)) 44px !important; }
  body.responsive-touch #autoscaleShell #patientTable th:nth-child(n),
  body.responsive-touch #autoscaleShell #patientTable td:nth-child(n) { width:100% !important; min-width:0 !important; grid-column:auto !important; grid-row:1 !important; }
  body.responsive-touch.clinical-selected-delete-mode #autoscaleShell #patientTable > thead > tr,
  body.responsive-touch.clinical-selected-delete-mode #autoscaleShell #patientTable > tbody > tr:nth-child(n) { grid-template-columns:30px repeat(4,minmax(0,1fr)) 44px !important; }
  body.responsive-touch.clinical-selected-delete-mode #autoscaleShell #patientTable .record-delete-heading,
  body.responsive-touch.clinical-selected-delete-mode #autoscaleShell #patientTable .record-delete-cell { grid-column:1 !important; grid-row:1 !important; width:30px !important; order:-1; }
  body.responsive-touch #autoscaleShell #patientTable .phototherapy-button { height:32px !important; }
  /* Date/Time and Days/Hours share two lines; keep all original inputs. */
  body.responsive-touch.age-calculator-expanded #autoscaleShell #patientTable > thead > tr,
  body.responsive-touch.age-calculator-expanded #autoscaleShell #patientTable > tbody > tr:nth-child(n) { grid-template-columns:minmax(74px,1.6fr) minmax(42px,.9fr) repeat(2,minmax(32px,.8fr)) 44px !important; grid-template-rows:32px 32px !important; height:64px !important; min-height:64px !important; max-height:64px !important; }
  body.responsive-touch.age-calculator-expanded.clinical-selected-delete-mode #autoscaleShell #patientTable > thead > tr,
  body.responsive-touch.age-calculator-expanded.clinical-selected-delete-mode #autoscaleShell #patientTable > tbody > tr:nth-child(n) { grid-template-columns:30px minmax(74px,1.6fr) minmax(42px,.9fr) repeat(2,minmax(32px,.8fr)) 44px !important; }
  body.responsive-touch.age-calculator-expanded #autoscaleShell #patientTable { --photo-offset:0; }
  body.responsive-touch.age-calculator-expanded.clinical-selected-delete-mode #autoscaleShell #patientTable { --photo-offset:1; }
  body.responsive-touch.age-calculator-expanded:is(.clinical-selected-delete-mode, :not(.clinical-selected-delete-mode)) #autoscaleShell #patientTable tr > :nth-child(1) { grid-column:calc(1 + var(--photo-offset)) !important; grid-row:1 !important; }
  body.responsive-touch.age-calculator-expanded:is(.clinical-selected-delete-mode, :not(.clinical-selected-delete-mode)) #autoscaleShell #patientTable tr > :nth-child(2) { grid-column:calc(1 + var(--photo-offset)) !important; grid-row:2 !important; }
  body.responsive-touch.age-calculator-expanded:is(.clinical-selected-delete-mode, :not(.clinical-selected-delete-mode)) #autoscaleShell #patientTable tr > :nth-child(3) { grid-column:calc(2 + var(--photo-offset)) !important; grid-row:1 !important; }
  body.responsive-touch.age-calculator-expanded:is(.clinical-selected-delete-mode, :not(.clinical-selected-delete-mode)) #autoscaleShell #patientTable tr > :nth-child(4) { grid-column:calc(2 + var(--photo-offset)) !important; grid-row:2 !important; }
  body.responsive-touch.age-calculator-expanded:is(.clinical-selected-delete-mode, :not(.clinical-selected-delete-mode)) #autoscaleShell #patientTable tr > :nth-child(5) { grid-column:calc(3 + var(--photo-offset)) !important; grid-row:1 / 3 !important; }
  body.responsive-touch.age-calculator-expanded:is(.clinical-selected-delete-mode, :not(.clinical-selected-delete-mode)) #autoscaleShell #patientTable tr > :nth-child(6) { grid-column:calc(4 + var(--photo-offset)) !important; grid-row:1 / 3 !important; }
  body.responsive-touch.age-calculator-expanded:is(.clinical-selected-delete-mode, :not(.clinical-selected-delete-mode)) #autoscaleShell #patientTable tr > :nth-child(7) { grid-column:calc(5 + var(--photo-offset)) !important; grid-row:1 / 3 !important; }
  body.responsive-touch.age-calculator-expanded:is(.clinical-selected-delete-mode, :not(.clinical-selected-delete-mode)) #autoscaleShell #patientTable tr > :nth-child(n+5) { height:64px !important; min-height:64px !important; max-height:64px !important; display:flex !important; align-items:center !important; justify-content:center; }
  body.responsive-touch.age-calculator-expanded #autoscaleShell #patientTable .record-delete-heading,
  body.responsive-touch.age-calculator-expanded #autoscaleShell #patientTable .record-delete-cell { display:none !important; }
  body.responsive-touch.age-calculator-expanded.clinical-selected-delete-mode #autoscaleShell #patientTable .record-delete-heading,
  body.responsive-touch.age-calculator-expanded.clinical-selected-delete-mode #autoscaleShell #patientTable .record-delete-cell { display:flex !important; grid-row:1 / 3 !important; }
  body.responsive-touch.age-calculator-expanded #autoscaleShell #patientTable input[data-key=measurementDate] { font-size:12px !important; padding-left:1px !important; padding-right:16px !important; }
  body.responsive-touch.age-calculator-expanded #autoscaleShell #patientTable .date-field-selector { width:16px !important; min-width:16px !important; }
  body.responsive-touch.age-calculator-expanded #autoscaleShell #patientTable input[data-key=measurementTime] { font-size:14px !important; }
  body.responsive-touch.age-calculator-expanded #autoscaleShell .qc-table-navigation,
  body.responsive-touch.age-calculator-expanded #autoscaleShell .responsive-table-hint { display:none !important; }
}
@media print { .phototherapy-dialog { display:none !important; } }
@media screen {
  body.responsive-touch.age-calculator-expanded #autoscaleShell #patientTable,
  body.responsive-touch.age-calculator-expanded.clinical-selected-delete-mode #autoscaleShell #patientTable { width:100% !important; min-width:0 !important; max-width:100% !important; }
  body.responsive-touch.age-calculator-expanded #autoscaleShell #patientTable th:nth-child(n),
  body.responsive-touch.age-calculator-expanded #autoscaleShell #patientTable td:nth-child(n) { width:100% !important; min-width:0 !important; }
  body.responsive-touch.age-calculator-expanded #autoscaleShell #patientTable tr > .record-delete-cell:nth-child(n),
  body.responsive-touch.age-calculator-expanded #autoscaleShell #patientTable tr > .record-delete-heading:nth-child(n) { display:none !important; }
  body.responsive-touch.age-calculator-expanded.clinical-selected-delete-mode #autoscaleShell #patientTable tr > .record-delete-cell:nth-child(n),
  body.responsive-touch.age-calculator-expanded.clinical-selected-delete-mode #autoscaleShell #patientTable tr > .record-delete-heading:nth-child(n) { display:flex !important; }
}
@media screen {
  body:not(.responsive-touch) .clinical-left-column,
  body:not(.responsive-touch) .clinical-side-panel { width:293px !important; min-width:293px !important; max-width:293px !important; }
  body:not(.responsive-touch):not(.age-calculator-expanded) .clinical-data-panel { width:293px !important; min-width:293px !important; max-width:293px !important; }
  body:not(.responsive-touch) .patient-table-scroll,
  body:not(.responsive-touch) .patient-age-calculator-link-row { width:calc(100% - 14px) !important; }
  body.responsive-touch #autoscaleShell #patientTable > thead > tr,
  body.responsive-touch #autoscaleShell #patientTable > tbody > tr:nth-child(n) { position:static !important; inset:auto !important; }
}
@media screen {
  body.responsive-touch.clinical-selected-delete-mode #autoscaleShell #patientTable tr > .record-delete-cell:nth-child(n),
  body.responsive-touch.clinical-selected-delete-mode #autoscaleShell #patientTable tr > .record-delete-heading:nth-child(n),
  body.responsive-touch.age-calculator-expanded.clinical-selected-delete-mode #autoscaleShell #patientTable tr > .record-delete-cell:nth-child(n),
  body.responsive-touch.age-calculator-expanded.clinical-selected-delete-mode #autoscaleShell #patientTable tr > .record-delete-heading:nth-child(n) { width:30px !important; min-width:0 !important; }
  body.responsive-touch.clinical-selected-delete-mode #autoscaleShell #patientTable .record-delete-button { width:26px !important; min-width:26px !important; max-width:26px !important; }
}

/* QC58: match adjacent desktop headings and anchor a compact editor over the list. */
body:not(.responsive-touch) #autoscaleShell #patientTable .phototherapy-heading { font-size:10px !important; line-height:12px !important; }
.phototherapy-dialog { position:fixed; inset:auto; margin:0; width:260px; padding:10px; font-size:13px; }
.phototherapy-dialog h2 { font-size:14px; margin-bottom:6px; }
.phototherapy-dialog .phototherapy-record { font-size:11px; margin-bottom:6px; }
.phototherapy-dialog label { min-height:28px; gap:6px; }
.phototherapy-dialog input { width:14px; height:14px; }
.phototherapy-previous { font-size:12px; padding:6px; margin:6px 0; }
.phototherapy-actions { margin-top:8px; gap:6px; }
.phototherapy-actions button { min-height:28px; padding:4px 10px; font-size:12px; }
body.responsive-touch #autoscaleShell #patientTable .phototherapy-button { font-size:14px !important; color:#000 !important; }

/* QC59: use the shared clinical dialog framing, heading and button treatment. */
.phototherapy-dialog.clinical-modal-panel { border:2px solid #777; box-shadow:0 4px 18px rgba(0,0,0,.30); padding:12px; }
.phototherapy-dialog h2.clinical-modal-title { color:#000; font-weight:700; margin:0 0 8px; }
.phototherapy-dialog::backdrop { background:rgba(0,0,0,.28); }
.phototherapy-dialog .phototherapy-previous { background:transparent; padding:0; font-weight:700; }
.phototherapy-dialog .clinical-modal-actions button { min-width:90px; height:28px; padding:0 8px; font-size:13px; border:1px solid #777; border-radius:0; background:#e6e6e6; color:#000; font-weight:700; }
body.responsive-touch .phototherapy-dialog label { min-height:36px; }
body.responsive-touch .phototherapy-dialog .clinical-modal-actions button { height:36px; min-height:36px; }
.phototherapy-dialog .phototherapy-previous strong { font-weight:700; }

/* QC60: retain the existing instruction type size, on one line. */
body:not(.age-calculator-expanded) #autoscaleShell .age-entry-hint { display:block !important; height:auto !important; white-space:nowrap !important; }
body:not(.age-calculator-expanded) #autoscaleShell .age-entry-hint span { display:inline !important; }
#autoscaleShell #patientTable .phototherapy-cell { position:relative !important; }
#autoscaleShell #patientTable .phototherapy-button { position:absolute !important; inset:0 !important; display:flex !important; align-items:center !important; justify-content:center !important; width:100% !important; height:100% !important; line-height:normal !important; }
body:not(.responsive-touch) #autoscaleShell #patientTable .phototherapy-button.phototherapy-off { font-size:11.5px !important; }
body.responsive-touch #autoscaleShell #patientTable .phototherapy-button.phototherapy-off { font-size:16px !important; }
@media screen {
 body.responsive-touch #autoscaleShell #patientTable > thead > tr,
 body.responsive-touch #autoscaleShell #patientTable > tbody > tr:nth-child(n) { grid-template-columns:repeat(2,minmax(0,1fr)) repeat(2,minmax(0,.92fr)) 50px !important; }
 body.responsive-touch.clinical-selected-delete-mode #autoscaleShell #patientTable > thead > tr,
 body.responsive-touch.clinical-selected-delete-mode #autoscaleShell #patientTable > tbody > tr:nth-child(n) { grid-template-columns:30px repeat(2,minmax(0,1fr)) repeat(2,minmax(0,.92fr)) 50px !important; }
 body.responsive-touch.age-calculator-expanded #autoscaleShell #patientTable > thead > tr,
 body.responsive-touch.age-calculator-expanded #autoscaleShell #patientTable > tbody > tr:nth-child(n) { grid-template-columns:minmax(74px,1.6fr) minmax(42px,.9fr) repeat(2,minmax(29px,.75fr)) 50px !important; }
 body.responsive-touch.age-calculator-expanded.clinical-selected-delete-mode #autoscaleShell #patientTable > thead > tr,
 body.responsive-touch.age-calculator-expanded.clinical-selected-delete-mode #autoscaleShell #patientTable > tbody > tr:nth-child(n) { grid-template-columns:30px minmax(74px,1.6fr) minmax(42px,.9fr) repeat(2,minmax(29px,.75fr)) 50px !important; }
}
body.responsive-touch #autoscaleShell #patientTable .phototherapy-button { position:absolute !important; inset:0 !important; height:100% !important; display:flex !important; align-items:center !important; justify-content:center !important; }
body.responsive-touch #autoscaleShell #patientTable .phototherapy-button { min-height:0 !important; max-height:none !important; }
@media screen and (max-width:370px) {
 body.responsive-touch:not(.age-calculator-expanded) #autoscaleShell .age-entry-hint { white-space:normal !important; }
}

/* QC61: separate Date and Time, retaining calculated ages in the record but
   hiding the age columns on the compact date-time entry screen. */
@media screen {
 body.responsive-touch.age-calculator-expanded #autoscaleShell #patientTable { --qc61-offset:0; }
 body.responsive-touch.age-calculator-expanded.clinical-selected-delete-mode #autoscaleShell #patientTable { --qc61-offset:1; }
 body.responsive-touch.age-calculator-expanded #autoscaleShell #patientTable > thead > tr,
 body.responsive-touch.age-calculator-expanded #autoscaleShell #patientTable > tbody > tr:nth-child(n) { grid-template-columns:minmax(78px,1.6fr) minmax(48px,1fr) repeat(2,minmax(30px,.8fr)) 50px !important; grid-template-rows:44px !important; height:44px !important; min-height:44px !important; max-height:44px !important; }
 body.responsive-touch.age-calculator-expanded.clinical-selected-delete-mode #autoscaleShell #patientTable > thead > tr,
 body.responsive-touch.age-calculator-expanded.clinical-selected-delete-mode #autoscaleShell #patientTable > tbody > tr:nth-child(n) { grid-template-columns:30px minmax(78px,1.6fr) minmax(48px,1fr) repeat(2,minmax(30px,.8fr)) 50px !important; }
 body.responsive-touch.age-calculator-expanded:is(.clinical-selected-delete-mode,:not(.clinical-selected-delete-mode)) #autoscaleShell #patientTable tr > :nth-child(n) { display:flex !important; align-items:center !important; justify-content:center !important; grid-row:1 !important; height:44px !important; min-height:44px !important; max-height:44px !important; }
 body.responsive-touch.age-calculator-expanded:is(.clinical-selected-delete-mode,:not(.clinical-selected-delete-mode)) #autoscaleShell #patientTable tr > :nth-child(1) { grid-column:calc(1 + var(--qc61-offset)) !important; }
 body.responsive-touch.age-calculator-expanded:is(.clinical-selected-delete-mode,:not(.clinical-selected-delete-mode)) #autoscaleShell #patientTable tr > :nth-child(2) { grid-column:calc(2 + var(--qc61-offset)) !important; }
 body.responsive-touch.age-calculator-expanded:is(.clinical-selected-delete-mode,:not(.clinical-selected-delete-mode)) #autoscaleShell #patientTable tr > :nth-child(3),
 body.responsive-touch.age-calculator-expanded:is(.clinical-selected-delete-mode,:not(.clinical-selected-delete-mode)) #autoscaleShell #patientTable tr > :nth-child(4) { display:none !important; }
 body.responsive-touch.age-calculator-expanded:is(.clinical-selected-delete-mode,:not(.clinical-selected-delete-mode)) #autoscaleShell #patientTable tr > :nth-child(5) { grid-column:calc(3 + var(--qc61-offset)) !important; }
 body.responsive-touch.age-calculator-expanded:is(.clinical-selected-delete-mode,:not(.clinical-selected-delete-mode)) #autoscaleShell #patientTable tr > :nth-child(6) { grid-column:calc(4 + var(--qc61-offset)) !important; }
 body.responsive-touch.age-calculator-expanded:is(.clinical-selected-delete-mode,:not(.clinical-selected-delete-mode)) #autoscaleShell #patientTable tr > :nth-child(7) { grid-column:calc(5 + var(--qc61-offset)) !important; }
 body.responsive-touch.age-calculator-expanded:is(.clinical-selected-delete-mode,:not(.clinical-selected-delete-mode)) #autoscaleShell #patientTable tr > .record-delete-heading:nth-child(n),
 body.responsive-touch.age-calculator-expanded:is(.clinical-selected-delete-mode,:not(.clinical-selected-delete-mode)) #autoscaleShell #patientTable tr > .record-delete-cell:nth-child(n) { display:none !important; }
 body.responsive-touch.age-calculator-expanded.clinical-selected-delete-mode #autoscaleShell #patientTable tr > .record-delete-heading:nth-child(n),
 body.responsive-touch.age-calculator-expanded.clinical-selected-delete-mode #autoscaleShell #patientTable tr > .record-delete-cell:nth-child(n) { display:flex !important; grid-column:1 !important; grid-row:1 !important; }
}
/* QC63: explicit focus styling also covers browsers that omit :focus-visible
   after a programmatic focus move caused by intercepted Tab/Return. */
#autoscaleShell #patientTable .phototherapy-button:focus { outline:2px solid #17669c !important; outline-offset:-2px !important; background:#e6f1ff !important; }
