/* QB21 responsive update 1: one workspace, intrinsic sizing, and the existing clinical controls. */
@media screen {
  .excel-page { padding: 10px; }
  #autoscaleShell { max-width:1420px; }
}
@media screen {
  body.responsive-touch #autoscaleShell .worksheet-frame { width:100% !important; min-width:0 !important; height:auto !important; min-height:0 !important; padding:12px !important; overflow:visible !important; }
  body.responsive-touch #autoscaleShell .main-title { width:100% !important; font-size:clamp(20px,3vw,29px) !important; height:auto !important; }
  body.responsive-touch #autoscaleShell .top-strip { position:relative !important; inset:auto !important; width:100% !important; max-width:none !important; margin:12px 0 !important; display:grid !important; grid-template-columns:repeat(2,minmax(0,1fr)) !important; gap:10px !important; height:auto !important; }
  body.responsive-touch #autoscaleShell .top-strip > * { width:auto !important; min-width:0 !important; height:auto !important; min-height:90px !important; }
  body.responsive-touch #autoscaleShell .excel-grid { display:flex !important; flex-direction:column !important; width:100% !important; gap:18px !important; }
  body.responsive-touch #autoscaleShell .chart-area { order:0; width:100% !important; min-width:0; }
  body.responsive-touch #autoscaleShell .left-column { order:1; width:100% !important; min-width:0 !important; }
  body.responsive-touch #autoscaleShell .chart-wrap { width:100% !important; height:clamp(340px,55vw,610px) !important; }
  body.responsive-touch #autoscaleShell .xaxis-controls { position:relative !important; inset:auto !important; width:100% !important; height:auto !important; display:flex !important; flex-wrap:wrap !important; gap:10px 16px !important; margin:12px 0 !important; padding:10px !important; }
  body.responsive-touch #autoscaleShell .clinical-side-panel { position:static !important; width:100% !important; height:auto !important; min-height:0 !important; }
  body.responsive-touch #autoscaleShell .clinical-data-panel { position:relative !important; inset:auto !important; width:100% !important; height:auto !important; min-height:0 !important; max-height:none !important; overflow:visible !important; padding:12px !important; box-shadow:none !important; }
  body.responsive-touch #autoscaleShell .patient-table-scroll { position:relative !important; inset:auto !important; width:100% !important; height:auto !important; max-height:560px !important; overflow:auto !important; padding:0 !important; margin:10px 0 !important; }
  body.responsive-touch #autoscaleShell #patientTable { position:relative !important; inset:auto !important; display:table !important; width:100% !important; height:auto !important; table-layout:fixed !important; }
  body.responsive-touch #autoscaleShell #patientTable > thead { display:table-header-group !important; position:static !important; height:auto !important; }
  body.responsive-touch #autoscaleShell #patientTable > tbody { display:table-row-group !important; position:static !important; height:auto !important; width:auto !important; overflow:visible !important; }
  body.responsive-touch #autoscaleShell #patientTable > thead > tr, body.responsive-touch #autoscaleShell #patientTable > tbody > tr:nth-child(n) { display:table-row !important; position:static !important; height:48px !important; min-height:48px !important; max-height:none !important; width:auto !important; }
  body.responsive-touch #autoscaleShell #patientTable th, body.responsive-touch #autoscaleShell #patientTable td { position:relative !important; inset:auto !important; width:auto !important; height:48px !important; min-height:48px !important; max-height:none !important; font-size:16px !important; padding:2px !important; }
  body.responsive-touch #autoscaleShell #patientTable tbody input { height:44px !important; min-height:44px !important; max-height:none !important; width:100% !important; font-size:16px !important; }
  body.responsive-touch #autoscaleShell .patient-virtual-scrollbar { display:none !important; }
  body.responsive-touch #autoscaleShell .age-entry-hint, body.responsive-touch #autoscaleShell .patient-age-calculator-link-row, body.responsive-touch #autoscaleShell .expanded-birth-fields, body.responsive-touch #autoscaleShell .expanded-age-calculator-message, body.responsive-touch #autoscaleShell .expanded-storage-notice, body.responsive-touch #autoscaleShell .expanded-delete-selected-row, body.responsive-touch #autoscaleShell .patient-reorder-row, body.responsive-touch #autoscaleShell .logged-on-user-display, body.responsive-touch #autoscaleShell .clinical-data-button-row, body.responsive-touch #autoscaleShell .clinical-print-button-row { position:relative !important; inset:auto !important; width:100% !important; height:auto !important; margin:10px 0 !important; white-space:normal !important; }
  body.responsive-touch #autoscaleShell .clinical-data-button-row, body.responsive-touch #autoscaleShell .clinical-print-button-row { display:flex !important; flex-wrap:wrap !important; gap:8px !important; }
  body.responsive-touch #autoscaleShell button, body.responsive-touch #autoscaleShell select { min-height:44px !important; height:auto !important; font-size:16px !important; }
  body.responsive-touch #autoscaleShell label { white-space:normal !important; }
  body.responsive-touch #autoscaleShell .controls-box label, body.responsive-touch #autoscaleShell .ga-range-box label, body.responsive-touch #autoscaleShell .xaxis-controls label { min-height:44px !important; font-size:15px !important; }
  body.responsive-touch #autoscaleShell input[type=radio], body.responsive-touch #autoscaleShell input[type=checkbox] { width:22px !important; height:22px !important; flex-shrink:0; }
  body.responsive-touch #autoscaleShell .worksheet-frame::before, body.responsive-touch #autoscaleShell .worksheet-frame::after { display:none !important; }
  body.responsive-touch.age-calculator-expanded #autoscaleShell #patientTable { min-width:650px !important; }
  body.responsive-touch #autoscaleShell .expanded-storage-notice { font-size:14px !important; }
  body.responsive-touch #autoscaleShell .selector-input-wrap { height:44px !important; }
  body.responsive-touch #autoscaleShell .expanded-birth-fields input { height:44px !important; font-size:16px !important; }
  body.responsive-touch #autoscaleShell .field-selector-button { min-width:32px !important; width:32px !important; font-size:20px !important; }

}
@media screen and (max-width:600px) {
  body.responsive-touch .excel-page { padding:4px; }
  body.responsive-touch #autoscaleShell .worksheet-frame { padding:8px !important; }
  body.responsive-touch #autoscaleShell .top-strip { grid-template-columns:minmax(0,1fr) !important; }
  body.responsive-touch #autoscaleShell .top-legend { min-height:0 !important; }
  body.responsive-touch #autoscaleShell .legend-item { font-size:14px !important; }
  body.responsive-touch #autoscaleShell .clinical-ga-combined { display:flex !important; flex-wrap:wrap !important; gap:8px !important; }
  body.responsive-touch #autoscaleShell .ga-week-display, body.responsive-touch #autoscaleShell #gaDays { width:64px !important; }
  body.responsive-touch #autoscaleShell .ga-range-box { display:flex !important; flex-wrap:wrap !important; gap:14px !important; width:100% !important; }
  body.responsive-touch #autoscaleShell .data-header-row { flex-wrap:wrap !important; height:auto !important; }
  body.responsive-touch #autoscaleShell .age-entry-hint { display:flex !important; flex-direction:column; gap:5px; }

}
@media screen {
  body.responsive-touch #autoscaleShell .top-strip > *, body.responsive-touch #autoscaleShell .top-strip > * > *, body.responsive-touch #autoscaleShell .top-strip .ga-range-box { position:static !important; inset:auto !important; transform:none !important; }
  body.responsive-touch #autoscaleShell .ga-strip { height:auto !important; }
  body.responsive-touch #autoscaleShell #patientTable th, body.responsive-touch #autoscaleShell #patientTable td { display:table-cell !important; float:none !important; }
  body.responsive-touch:not(.age-calculator-expanded) #autoscaleShell #patientTable .age-calculator-only { display:none !important; }
  body.responsive-touch #autoscaleShell #patientTable .record-delete-heading, body.responsive-touch #autoscaleShell #patientTable .record-delete-cell { width:44px !important; }
  body.responsive-touch #autoscaleShell .clinical-data-panel .age-entry-hint { font-size:14px !important; line-height:1.4 !important; }
  body.responsive-touch #autoscaleShell .age-entry-hint span { font-size:14px !important; }
  body.responsive-touch #autoscaleShell .worksheet-frame { max-height:none !important; }
  body.responsive-touch #autoscaleShell .clinical-data-button-row button, body.responsive-touch #autoscaleShell .clinical-print-button-row button { width:auto !important; min-width:100px !important; padding:8px !important; }
  body.responsive-touch #autoscaleShell .clinical-save-split, body.responsive-touch #autoscaleShell .clinical-delete-split { width:auto !important; height:auto !important; }

}
@media screen {
  body.responsive-touch #autoscaleShell .top-strip { min-height:0 !important; max-height:none !important; grid-template-rows:none !important; grid-auto-rows:auto !important; }
  body.responsive-touch #autoscaleShell .top-strip > * { max-height:none !important; display:block !important; }
  body.responsive-touch #autoscaleShell .top-strip .ga-strip { display:flex !important; flex-wrap:wrap !important; align-items:center !important; }
  body.responsive-touch #autoscaleShell .ga-range-box { display:flex !important; flex-wrap:wrap !important; gap:12px !important; width:100% !important; }
  body.responsive-touch #autoscaleShell .controls-box label { display:flex !important; align-items:center !important; gap:8px !important; }
  body.responsive-touch #autoscaleShell .clinical-data-button-row { min-height:0 !important; max-height:none !important; }

}
@media screen {
  body.responsive-touch #clinicalAccessOverlay { overflow:auto !important; align-items:flex-start !important; padding:12px !important; }
  body.responsive-touch #clinicalAccessOverlay .clinical-access-scale-shell { width:100% !important; height:auto !important; }
  body.responsive-touch #clinicalAccessOverlay .clinical-access-card { width:100% !important; max-width:920px !important; max-height:none !important; padding:16px !important; transform:none !important; margin:auto; }
  body.responsive-touch #clinicalAccessOverlay input, body.responsive-touch #clinicalAccessOverlay select, body.responsive-touch #clinicalAccessOverlay button { min-height:44px !important; font-size:16px !important; max-width:100% !important; }
  body.responsive-touch #clinicalAccessOverlay .clinical-returning-grid { display:grid !important; grid-template-columns:1fr !important; }
  body.responsive-touch #clinicalAccessOverlay .clinical-role-grid, body.responsive-touch #clinicalAccessOverlay .clinical-region-row { grid-template-columns:1fr !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-overlay { position:fixed !important; inset:0 !important; width:100% !important; height:100dvh !important; padding:12px !important; overflow:auto !important; transform:none !important; align-items:flex-start !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-overlay > div { max-width:100% !important; max-height:calc(100dvh - 24px) !important; overflow:auto !important; }

}
@media screen {
  body.responsive-touch #autoscaleShell .clinical-side-panel, body.responsive-touch #autoscaleShell .clinical-left-column { max-height:none !important; height:auto !important; overflow:visible !important; }
  body.responsive-touch #autoscaleShell #riskLowLine, body.responsive-touch #autoscaleShell #riskHighLine { position:static !important; transform:none !important; margin-left:auto !important; }
  body.responsive-touch #autoscaleShell .patient-table-scroll { overflow-x:auto !important; overflow-y:auto !important; }
  body.responsive-touch #autoscaleShell .clinical-print-button-row { min-height:44px !important; max-height:none !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel { position:relative !important; inset:auto !important; transform:none !important; width:100% !important; min-width:0 !important; max-width:720px !important; height:auto !important; min-height:0 !important; margin:0 auto !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel input, body.responsive-touch #clinicalModalRoot .clinical-modal-panel select, body.responsive-touch #clinicalModalRoot .clinical-modal-panel button { font-size:16px !important; min-height:44px !important; max-width:100% !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel .save-form-row, body.responsive-touch #clinicalModalRoot .clinical-modal-panel .clinical-form-row { grid-template-columns:1fr !important; height:auto !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel .save-dialog-panel-inner { width:100% !important; min-width:0 !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel .save-actions { position:static !important; height:auto !important; display:flex !important; flex-wrap:wrap !important; }

}
@media screen {
  body.responsive-touch #clinicalAccessOverlay .clinical-access-card * { position:static !important; inset:auto !important; transform:none !important; min-width:0 !important; max-height:none !important; }
  body.responsive-touch #clinicalAccessOverlay .clinical-access-card .clinical-registration-top { display:flex !important; flex-direction:column !important; width:100% !important; }
  body.responsive-touch #clinicalAccessOverlay .clinical-access-card .clinical-registration-demographics, body.responsive-touch #clinicalAccessOverlay .clinical-access-card .clinical-ga-preferences, body.responsive-touch #clinicalAccessOverlay .clinical-access-card .clinical-team-explain { width:100% !important; height:auto !important; }
  body.responsive-touch #clinicalAccessOverlay .clinical-access-card .clinical-role-grid, body.responsive-touch #clinicalAccessOverlay .clinical-access-card .clinical-region-row, body.responsive-touch #clinicalAccessOverlay .clinical-access-card .clinical-ga-columns { display:flex !important; flex-direction:column !important; gap:8px !important; }
  body.responsive-touch #clinicalAccessOverlay .clinical-access-card label { white-space:normal !important; min-height:44px !important; }
  body.responsive-touch #clinicalAccessOverlay .clinical-access-card .clinical-code-row { display:flex !important; flex-wrap:wrap !important; gap:8px !important; }
  body.responsive-touch #clinicalAccessOverlay .clinical-access-card .clinical-team-explain { margin:12px 0 !important; font-size:14px !important; }
  body.responsive-touch #clinicalAccessOverlay .clinical-access-card .clinical-returning-grid { gap:10px !important; }

}
@media screen {
  body.responsive-touch #clinicalAccessOverlay .clinical-access-card .clinical-returning-section { display:block !important; width:100% !important; }
  body.responsive-touch #clinicalAccessOverlay .clinical-access-card .clinical-returning-left { width:100% !important; }
  body.responsive-touch #clinicalAccessOverlay .clinical-access-card * { grid-column:auto !important; grid-row:auto !important; }
  body.responsive-touch #clinicalAccessOverlay .clinical-access-card .clinical-team-explain { display:block !important; }
  body.responsive-touch #clinicalAccessOverlay .clinical-access-card .clinical-team-explain ul { padding-left:20px !important; }

}
@media screen {
  body.responsive-touch #autoscaleShell #pasteDataButton, body.responsive-touch #autoscaleShell #storedRecordsButton, body.responsive-touch #autoscaleShell #saveDataButton, body.responsive-touch #autoscaleShell #clearButton, body.responsive-touch #autoscaleShell #printButton, body.responsive-touch #autoscaleShell #removePatientButton, body.responsive-touch #autoscaleShell #expandedDeleteSelectedRecordsButton { min-height:44px !important; height:auto !important; font-size:16px !important; padding:8px !important; }
  body.responsive-touch #autoscaleShell #ageCalculatorLink, body.responsive-touch #autoscaleShell #ageCalculatorDoneLink { min-height:44px !important; height:auto !important; display:inline-flex !important; align-items:center !important; font-size:16px !important; padding:8px !important; }
  body.responsive-touch #autoscaleShell #ageCalculatorLink[hidden], body.responsive-touch #autoscaleShell #ageCalculatorDoneLink[hidden] { display:none !important; }

}
@media screen {
  body.responsive-touch #clinicalAccessOverlay .clinical-access-card .clinical-returning-label-row { display:grid !important; grid-template-columns:repeat(2,minmax(0,1fr)) !important; gap:8px !important; width:100% !important; }
  body.responsive-touch #clinicalAccessOverlay .clinical-access-card .clinical-returning-label-row label { width:auto !important; margin:0 !important; }

}
@media screen {
  body.responsive-touch #clinicalAccessOverlay .clinical-access-card .clinical-code-row { display:grid !important; grid-template-columns:repeat(2,minmax(0,1fr)) !important; }
  body.responsive-touch #clinicalAccessOverlay .clinical-code-row .clinical-code-input { width:100% !important; }
  body.responsive-touch #clinicalAccessOverlay .clinical-access-card .clinical-team-edit-row { grid-column:1 / -1 !important; }

}
@media screen {
  body.responsive-touch #autoscaleShell .top-strip .ga-range-box { height:auto !important; min-height:44px !important; max-height:none !important; overflow:visible !important; margin:0 !important; }
  body.responsive-touch #autoscaleShell .top-strip .ga-range-box label { height:auto !important; min-height:44px !important; max-height:none !important; width:auto !important; display:flex !important; align-items:center !important; }
  body.responsive-touch #autoscaleShell .ga-week-display, body.responsive-touch #autoscaleShell #gaDays { width:64px !important; flex:0 0 64px !important; }

}
@media screen {
  body.responsive-touch #autoscaleShell #aboutModalOverlay, body.responsive-touch #autoscaleShell #pasteDataAboutOverlay { position:fixed !important; inset:0 !important; width:100% !important; height:100dvh !important; padding:12px !important; align-items:flex-start !important; overflow:auto !important; }
  body.responsive-touch #autoscaleShell .about-modal-panel, body.responsive-touch #autoscaleShell .paste-data-about-panel { position:relative !important; inset:auto !important; transform:none !important; width:100% !important; min-width:0 !important; max-width:860px !important; height:auto !important; min-height:0 !important; max-height:none !important; margin:0 auto !important; overflow:visible !important; }
  body.responsive-touch #autoscaleShell .about-modal-content, body.responsive-touch #autoscaleShell .paste-data-about-content { width:100% !important; min-width:0 !important; height:auto !important; max-height:none !important; overflow:visible !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel { padding:16px !important; overflow:auto !important; }
  body.responsive-touch #clinicalModalRoot .stored-code-row { grid-template-columns:minmax(0,1fr) !important; }
  body.responsive-touch #clinicalModalRoot .stored-team-table-wrap { overflow:auto !important; max-width:100% !important; }
  body.responsive-touch #clinicalModalRoot .stored-team-table { min-width:700px !important; }

}
@media screen {
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-stored-panel .stored-code-row { display:grid !important; grid-template-columns:minmax(0,1fr) !important; width:100% !important; height:auto !important; gap:8px !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-stored-panel input, body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-stored-panel button { font-size:16px !important; min-height:44px !important; height:auto !important; max-height:none !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-stored-panel .stored-start-cancel { height:auto !important; position:static !important; margin:16px 0 0 !important; }

}
@media screen {
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel { width:100% !important; min-width:0 !important; max-width:720px !important; min-height:0 !important; height:auto !important; padding:16px !important; overflow:auto !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel .save-form-row { display:grid !important; grid-template-columns:minmax(0,1fr) !important; height:auto !important; gap:8px !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel .save-actions { position:static !important; height:auto !important; min-height:44px !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel input, body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel select, body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel button { min-height:44px !important; height:auto !important; max-height:none !important; font-size:16px !important; }

}
@media screen {
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-stored-panel > * { position:static !important; inset:auto !important; width:100% !important; height:auto !important; margin:8px 0 !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-stored-panel .stored-code-row > * { position:static !important; inset:auto !important; grid-column:auto !important; width:100% !important; max-width:none !important; height:auto !important; margin:0 !important; text-align:left !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-stored-panel .stored-code-row input { text-align:center !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-stored-panel .stored-start-cancel button.secondary { min-height:44px !important; max-height:none !important; height:auto !important; font-size:16px !important; }

}
@media screen {
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-stored-panel, body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-stored-team-panel { width:100% !important; min-width:0 !important; max-width:720px !important; height:auto !important; min-height:0 !important; max-height:calc(100dvh - 24px) !important; padding:16px !important; overflow:auto !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-stored-team-panel > * { position:relative !important; inset:auto !important; width:100% !important; max-width:100% !important; height:auto !important; margin:8px 0 !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-stored-team-panel .stored-team-table-wrap { position:relative !important; inset:auto !important; width:100% !important; overflow-x:auto !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-stored-team-panel .stored-team-cancel-button { position:static !important; min-height:44px !important; max-height:none !important; height:auto !important; font-size:16px !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel .save-risk-row label { min-height:44px !important; text-align:left !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel .save-risk-row input[type=radio] { width:22px !important; height:22px !important; min-height:22px !important; }
  body.responsive-touch #autoscaleShell .expanded-birth-fields { display:grid !important; grid-template-columns:repeat(2,minmax(0,1fr)) !important; gap:12px !important; }
  body.responsive-touch #autoscaleShell .expanded-birth-fields label { display:flex !important; flex-direction:column !important; gap:6px !important; width:100% !important; }
  body.responsive-touch #autoscaleShell .expanded-birth-fields .selector-input-wrap { width:100% !important; height:44px !important; }
  body.responsive-touch #autoscaleShell #expandedDobDate, body.responsive-touch #autoscaleShell #expandedDobTime { width:100% !important; height:44px !important; min-height:44px !important; max-height:none !important; font-size:16px !important; }
  body.responsive-touch.age-calculator-expanded #autoscaleShell #patientTable { min-width:800px !important; }
  body.responsive-touch #autoscaleShell .responsive-table-hint { display:none; }
  body.responsive-touch.age-calculator-expanded #autoscaleShell .responsive-table-hint { display:block; margin:8px 0; font-size:14px; color:#001a80; }

}
@media screen and (max-width:600px) {
  body.responsive-touch #autoscaleShell .expanded-birth-fields { grid-template-columns:minmax(0,1fr) !important; }

}
.responsive-table-hint, .responsive-tabs { display:none; }
@media print { .responsive-tabs { display:none !important; } }
@media screen {
  body.responsive-touch #autoscaleShell #expandedAgeCalculatorHeader { position:relative !important; inset:auto !important; height:auto !important; min-height:0 !important; max-height:none !important; width:100% !important; }

}
@media screen {
  body.responsive-touch.age-calculator-expanded #autoscaleShell .age-entry-hint { display:none !important; }
  body.responsive-touch #autoscaleShell .expanded-birth-fields .selector-input-wrap { min-height:44px !important; max-height:none !important; }

}
/* Revision 2: compact touch workspace. Desktop retains QB21's scaled worksheet. */
@media screen {
  body.responsive-touch { background:#eef3f8 !important; }
  body.responsive-touch .excel-page { padding:12px !important; }
  body.responsive-touch #autoscaleShell .worksheet-frame { border:0 !important; background:transparent !important; padding:0 !important; box-shadow:none !important; font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif !important; }
  body.responsive-touch #autoscaleShell .main-title { font-size:20px !important; line-height:1.3 !important; text-align:left !important; color:#16324f !important; margin:4px 0 14px !important; }
  body.responsive-touch #autoscaleShell .responsive-tabs { display:flex; background:#dfe8f1; padding:4px; gap:4px; border-radius:12px; margin:0 0 12px; }
  body.responsive-touch #autoscaleShell .responsive-tabs button { flex:1; border:0 !important; background:transparent !important; color:#43566c !important; font-weight:650; border-radius:9px; padding:10px !important; }
  body.responsive-touch #autoscaleShell .responsive-tabs button[aria-selected=true] { background:#fff !important; color:#123d68 !important; box-shadow:0 1px 4px #20364b22; }
  body.responsive-touch #autoscaleShell .top-strip { grid-template-columns:repeat(2,minmax(0,1fr)) !important; gap:10px !important; margin:0 0 12px !important; border:0 !important; background:transparent !important; padding:0 !important; }
  body.responsive-touch #autoscaleShell .top-strip > * { min-height:0 !important; border:1px solid #dae3ed !important; border-radius:12px; padding:12px !important; background:#fff !important; }
  body.responsive-touch #autoscaleShell .top-strip .ga-strip { grid-column:1 / -1; display:grid !important; grid-template-columns:auto minmax(54px,1fr) auto minmax(54px,1fr) !important; gap:8px !important; }
  body.responsive-touch #autoscaleShell .ga-label { font-size:13px !important; color:#43566c !important; }
  body.responsive-touch #autoscaleShell .ga-label span { font-size:11px !important; }
  body.responsive-touch #autoscaleShell .ga-week-display, body.responsive-touch #autoscaleShell #gaDays { width:100% !important; }
  body.responsive-touch #autoscaleShell .ga-cell { border:1px solid #cbd7e3 !important; background:#f8fafc !important; border-radius:8px; color:#16324f !important; font-size:18px !important; }
  body.responsive-touch #autoscaleShell .ga-range-box { grid-column:1 / -1; gap:4px !important; margin-top:4px !important; justify-content:space-between; }
  body.responsive-touch #autoscaleShell .ga-range-box label { font-size:13px !important; gap:5px !important; }
  body.responsive-touch #autoscaleShell .control-label, body.responsive-touch #autoscaleShell .box-title { color:#16324f !important; font-size:14px !important; line-height:1.35 !important; margin-bottom:6px !important; }
  body.responsive-touch #autoscaleShell .controls-box label { font-size:13px !important; line-height:1.35 !important; padding:5px 0 !important; margin:0 !important; }
  body.responsive-touch #autoscaleShell input[type=radio], body.responsive-touch #autoscaleShell input[type=checkbox] { width:18px !important; height:18px !important; accent-color:#17669c; }
  body.responsive-touch #autoscaleShell #riskLowLine, body.responsive-touch #autoscaleShell #riskHighLine { display:none !important; }
  body.responsive-touch #autoscaleShell .top-strip .top-legend { grid-column:1 / -1; display:flex !important; flex-wrap:wrap !important; align-items:center !important; gap:6px 14px !important; padding:8px 12px !important; }
  body.responsive-touch #autoscaleShell .top-legend .box-title { display:none !important; }
  body.responsive-touch #autoscaleShell .legend-item { font-size:11px !important; line-height:1.4 !important; }
  body.responsive-touch #autoscaleShell .chart-area { background:#fff !important; border:1px solid #dae3ed; border-radius:12px; padding:6px !important; box-sizing:border-box; }
  body.responsive-touch #autoscaleShell .chart-wrap { height:clamp(290px,74vw,490px) !important; }
  body.responsive-touch #autoscaleShell .xaxis-controls { background:#f5f8fb !important; border:0 !important; border-radius:9px; padding:10px !important; gap:6px 12px !important; margin:8px 0 !important; }
  body.responsive-touch #autoscaleShell .xaxis-controls .control-label { width:100%; margin:0 !important; }
  body.responsive-touch #autoscaleShell .xaxis-controls label { font-size:13px !important; margin:0 !important; gap:5px !important; }
  body.responsive-touch #autoscaleShell .demo-note { margin:10px 0 4px !important; text-align:center; }
  body.responsive-touch #autoscaleShell .about-info-link { font-size:13px !important; color:#17669c !important; }
  body.responsive-touch:not(.responsive-data-view) #autoscaleShell .left-column { display:none !important; }
  body.responsive-touch.responsive-data-view #autoscaleShell .chart-area, body.responsive-touch.responsive-data-view #autoscaleShell .top-strip { display:none !important; }
  body.responsive-touch #autoscaleShell .clinical-data-panel { border:1px solid #dae3ed !important; border-radius:12px; background:#fff !important; padding:12px !important; }
  body.responsive-touch #autoscaleShell .clinical-data-title-row { margin:0 0 8px !important; }
  body.responsive-touch #autoscaleShell .age-entry-hint { color:#52667a !important; font-size:12px !important; text-align:left !important; gap:3px !important; }
  body.responsive-touch #autoscaleShell .age-entry-hint span { font-size:12px !important; color:#52667a !important; }
  body.responsive-touch #autoscaleShell #patientTable th { background:#edf3f8 !important; font-size:13px !important; color:#16324f !important; border:1px solid #e0e7ef !important; }
  body.responsive-touch #autoscaleShell #patientTable td { border:1px solid #e0e7ef !important; }
  body.responsive-touch #autoscaleShell #patientTable tbody input { background:transparent !important; color:#16324f !important; }
  body.responsive-touch #autoscaleShell #patientTable tbody tr:nth-child(even) { background:#f8fafc !important; }
  body.responsive-touch #autoscaleShell #patientTable input:focus { outline:2px solid #17669c !important; outline-offset:-2px; background:#eef7ff !important; }
  body.responsive-touch #autoscaleShell .patient-table-scroll { max-height:380px !important; border-radius:8px; }
  body.responsive-touch #autoscaleShell .clinical-data-button-row { display:grid !important; grid-template-columns:repeat(2,minmax(0,1fr)) !important; gap:8px !important; }
  body.responsive-touch #autoscaleShell .clinical-data-button-row button, body.responsive-touch #autoscaleShell .clinical-print-button-row button { border:1px solid #cbd7e3 !important; border-radius:8px; background:#fff !important; color:#16324f !important; font-size:14px !important; font-weight:600; min-width:0 !important; width:100% !important; }
  body.responsive-touch #autoscaleShell .clinical-print-button-row { display:grid !important; grid-template-columns:1fr 2fr !important; }
  body.responsive-touch #autoscaleShell .clinical-delete-split { display:flex !important; }
  body.responsive-touch #autoscaleShell #deleteRecordsSplitMenuButton { width:44px !important; min-width:44px !important; }
  body.responsive-touch #autoscaleShell #ageCalculatorLink, body.responsive-touch #autoscaleShell #ageCalculatorDoneLink { border:1px solid #cbd7e3 !important; border-radius:8px; background:#f5f8fb !important; color:#17669c !important; font-size:14px !important; width:100% !important; justify-content:center; box-sizing:border-box; text-decoration:none !important; }
  body.responsive-touch #autoscaleShell .logged-on-user-display { font-size:12px !important; color:#52667a !important; line-height:1.5 !important; }
  body.responsive-touch #autoscaleShell button:focus-visible, body.responsive-touch #autoscaleShell a:focus-visible { outline:2px solid #17669c !important; outline-offset:2px; }

}
@media screen {
  body.responsive-touch #autoscaleShell .responsive-settings { border:1px solid #dae3ed; border-radius:12px; background:#fff; margin:0 0 12px; }
  body.responsive-touch #autoscaleShell .responsive-settings summary { cursor:pointer; padding:12px; font-size:14px; font-weight:650; color:#16324f; min-height:44px; box-sizing:border-box; }
  body.responsive-touch #autoscaleShell .responsive-settings-value { display:block; margin:4px 0 0; font-size:12px; font-weight:400; color:#43566c; }
  body.responsive-touch #autoscaleShell .responsive-settings[open] summary { border-bottom:1px solid #e0e7ef; margin-bottom:10px; }
  body.responsive-touch #autoscaleShell .top-strip { border:none !important; outline:none !important; box-shadow:none !important; }
  body.responsive-touch #autoscaleShell .top-strip::before, body.responsive-touch #autoscaleShell .top-strip::after { display:none !important; }
  body.responsive-touch.responsive-data-view #autoscaleShell .responsive-settings { display:none; }
  body.responsive-touch #autoscaleShell .clinical-side-panel .clinical-data-panel .patient-age-calculator-link-row #ageCalculatorLink,
  body.responsive-touch #autoscaleShell .clinical-side-panel .clinical-data-panel .patient-age-calculator-link-row #ageCalculatorDoneLink { display:flex !important; width:100% !important; border-radius:8px !important; font-size:14px !important; white-space:nowrap !important; line-height:1.4 !important; min-height:44px !important; padding:8px !important; }
  body.responsive-touch #autoscaleShell .clinical-side-panel .clinical-data-panel .patient-age-calculator-link-row #ageCalculatorLink[hidden],
  body.responsive-touch #autoscaleShell .clinical-side-panel .clinical-data-panel .patient-age-calculator-link-row #ageCalculatorDoneLink[hidden] { display:none !important; }
}
@media screen {
  /* Keep the graph rendered for the existing Print action while Data is active. */
  body.responsive-touch.responsive-data-view #autoscaleShell .chart-area { display:block !important; position:absolute !important; left:0 !important; top:0 !important; visibility:hidden !important; pointer-events:none !important; }
}
/* Revision 3: explicit grid placement avoids the legacy desktop positions on Safari. */
@media screen {
  body.responsive-touch #autoscaleShell .top-strip .clinical-ga-combined { grid-template-rows:auto auto !important; align-items:center !important; }
  body.responsive-touch #autoscaleShell .top-strip .ga-week-display { position:relative !important; grid-row:1 !important; grid-column:2 !important; height:44px !important; }
  body.responsive-touch #autoscaleShell .top-strip .ga-label:first-child { grid-row:1 !important; grid-column:1 !important; }
  body.responsive-touch #autoscaleShell .top-strip .ga-label:nth-child(3) { grid-row:1 !important; grid-column:3 !important; }
  body.responsive-touch #autoscaleShell .top-strip #gaDays { grid-row:1 !important; grid-column:4 !important; height:44px !important; }
  body.responsive-touch #autoscaleShell .top-strip #gaWeeks { width:100% !important; height:44px !important; }
  body.responsive-touch #autoscaleShell .top-strip .ga-week-current #gaWeeksCompact { position:absolute !important; inset:0 !important; display:flex !important; width:100% !important; height:44px !important; border:0 !important; background:transparent !important; }
  body.responsive-touch #autoscaleShell .top-strip .ga-range-box { grid-row:2 !important; grid-column:1 / -1 !important; position:static !important; inset:auto !important; display:grid !important; grid-template-columns:repeat(3,minmax(0,1fr)) !important; gap:4px !important; width:100% !important; min-height:44px !important; height:auto !important; margin:8px 0 0 !important; }
  body.responsive-touch #autoscaleShell .top-strip .ga-range-box label { display:flex !important; align-items:center !important; justify-content:flex-start !important; margin:0 !important; padding:0 !important; text-align:left !important; white-space:nowrap !important; font-size:13px !important; }
  body.responsive-touch #autoscaleShell .top-strip .ga-range-box input { margin:0 !important; flex:0 0 18px !important; }
  body.responsive-touch #autoscaleShell .xaxis-controls { display:grid !important; grid-template-columns:minmax(0,1fr) !important; align-items:center !important; gap:4px !important; }
  body.responsive-touch #autoscaleShell .xaxis-controls > label { position:static !important; display:flex !important; align-items:center !important; justify-content:flex-start !important; gap:8px !important; margin:0 !important; padding:0 !important; min-height:44px !important; width:100% !important; }
  body.responsive-touch #autoscaleShell .xaxis-controls > label > input[type=radio] { margin:0 !important; align-self:center !important; flex:0 0 18px !important; }
  body.responsive-touch #autoscaleShell .xaxis-controls > .current-axis-option { display:grid !important; grid-template-columns:18px 30px 112px minmax(0,1fr) !important; column-gap:8px !important; }
  body.responsive-touch #autoscaleShell .current-axis-combo { position:relative !important; display:flex !important; align-items:stretch !important; width:112px !important; height:44px !important; min-width:0 !important; margin:0 !important; }
  body.responsive-touch #autoscaleShell #currentAxisDaysInput { width:68px !important; flex:0 0 68px !important; height:44px !important; min-height:44px !important; max-height:44px !important; padding:0 6px !important; box-sizing:border-box !important; border:1px solid #b6c7d8 !important; border-right:0 !important; border-radius:8px 0 0 8px !important; background:#fff !important; color:#16324f !important; font-size:16px !important; }
  body.responsive-touch #autoscaleShell #currentAxisDaysDropdownButton { width:44px !important; flex:0 0 44px !important; height:44px !important; min-height:44px !important; max-height:44px !important; padding:0 !important; box-sizing:border-box !important; border:1px solid #b6c7d8 !important; border-radius:0 8px 8px 0 !important; background:#edf3f8 !important; color:#16324f !important; font-size:18px !important; }
  body.responsive-touch #autoscaleShell #currentAxisDaysDropdown { width:112px !important; max-height:240px !important; border:1px solid #b6c7d8 !important; border-radius:8px !important; background:#fff !important; box-sizing:border-box !important; }
  body.responsive-touch #autoscaleShell #currentAxisDaysDropdown button { min-height:44px !important; border:0 !important; background:#fff !important; color:#16324f !important; }
  body.responsive-touch #autoscaleShell #currentAxisSuffix { white-space:normal !important; line-height:1.35 !important; font-size:13px !important; }
}
@media screen {
  body.responsive-touch #autoscaleShell .top-strip .ga-range-box { max-width:none !important; min-width:0 !important; box-sizing:border-box !important; }
}
/* Revision 4: denser measurement rows, equal actions, and a touch calendar. */
@media screen {
  body.responsive-touch #autoscaleShell #patientTable > tbody > tr:nth-child(n),
  body.responsive-touch #autoscaleShell #patientTable tbody td { height:32px !important; min-height:32px !important; max-height:32px !important; padding:0 !important; box-sizing:border-box !important; }
  body.responsive-touch #autoscaleShell #patientTable tbody input { height:30px !important; min-height:30px !important; max-height:30px !important; font-size:16px !important; padding-top:0 !important; padding-bottom:0 !important; box-sizing:border-box !important; }
  body.responsive-touch #autoscaleShell #patientTable .selector-input-wrap { height:30px !important; min-height:30px !important; max-height:30px !important; }
  body.responsive-touch #autoscaleShell #patientTable .field-selector-button { height:30px !important; min-height:30px !important; max-height:30px !important; width:30px !important; min-width:30px !important; padding:0 !important; }
  body.responsive-touch #autoscaleShell .clinical-print-button-row { grid-template-columns:repeat(2,minmax(0,1fr)) !important; align-items:stretch !important; }
  body.responsive-touch #autoscaleShell .clinical-delete-split { position:relative !important; display:block !important; min-width:0 !important; width:100% !important; }
  body.responsive-touch #autoscaleShell #printButton { width:100% !important; height:100% !important; }
  body.responsive-touch #autoscaleShell #removePatientButton { width:100% !important; height:100% !important; padding-right:46px !important; }
  body.responsive-touch #autoscaleShell #deleteRecordsSplitMenuButton { position:absolute !important; right:0 !important; top:0 !important; bottom:0 !important; width:40px !important; min-width:40px !important; height:100% !important; border-left:1px solid #cbd7e3 !important; border-radius:0 8px 8px 0 !important; }
  body.responsive-touch #autoscaleShell .clinical-delete-split-menu { width:100% !important; min-width:0 !important; }
  body.responsive-touch #autoscaleShell .expanded-birth-fields .date-selector-input-wrap { position:relative !important; display:flex !important; align-items:stretch !important; border:1px solid #cbd7e3 !important; border-radius:8px !important; }
  body.responsive-touch #autoscaleShell #expandedDobDate { width:calc(100% - 44px) !important; padding:0 10px !important; }
  body.responsive-touch #autoscaleShell .expanded-birth-fields .date-field-selector { position:absolute !important; top:0 !important; right:0 !important; bottom:0 !important; width:44px !important; min-width:44px !important; height:44px !important; min-height:44px !important; padding:0 !important; border-left:1px solid #cbd7e3 !important; background:#edf3f8 !important; font-size:20px !important; }
  body.responsive-touch .date-selector-panel { position:fixed !important; left:12px !important; right:12px !important; top:auto !important; bottom:max(12px,env(safe-area-inset-bottom)) !important; width:auto !important; max-width:420px !important; max-height:calc(100dvh - 24px) !important; overflow:auto !important; margin:0 auto !important; padding:12px !important; box-sizing:border-box !important; border:1px solid #cbd7e3 !important; border-radius:14px !important; box-shadow:0 4px 24px #16324f40 !important; font-family:system-ui,-apple-system,sans-serif !important; }
  body.responsive-touch .date-selector-header { grid-template-columns:44px 1fr 44px !important; gap:6px !important; }
  body.responsive-touch .date-selector-title { font-size:16px !important; line-height:1.4 !important; color:#16324f !important; }
  body.responsive-touch .date-selector-nav { width:44px !important; height:44px !important; min-height:44px !important; font-size:24px !important; line-height:1 !important; border:0 !important; border-radius:8px !important; background:#edf3f8 !important; }
  body.responsive-touch .date-selector-dow div { height:24px !important; font-size:12px !important; line-height:24px !important; }
  body.responsive-touch .date-selector-grid { gap:3px !important; }
  body.responsive-touch .date-selector-day, body.responsive-touch .date-selector-empty { height:40px !important; min-height:40px !important; font-size:16px !important; line-height:1 !important; border-radius:6px !important; }
  body.responsive-touch .date-selector-day.selected { background:#dfeefa !important; border-color:#17669c !important; }
  body.responsive-touch .responsive-calendar-close { display:block; width:100%; height:44px; margin-top:10px; border:1px solid #cbd7e3; border-radius:8px; background:#edf3f8; color:#16324f; font-size:15px; }
}
@media screen {
  body.responsive-touch #autoscaleShell .expanded-birth-fields .date-field-selector { display:flex !important; align-items:center !important; justify-content:center !important; }
  body.responsive-touch #autoscaleShell #expandedDobTime { border:1px solid #cbd7e3 !important; border-radius:8px !important; padding:0 10px !important; color:#16324f !important; }
}
/* Revision 5: date and time of birth share one row on phones and tablets. */
@media screen {
  body.responsive-touch #autoscaleShell .expanded-birth-fields { grid-template-columns:repeat(2,minmax(0,1fr)) !important; gap:10px !important; }
  body.responsive-touch #autoscaleShell .expanded-birth-fields > label { font-size:14px !important; line-height:1.4 !important; text-align:left !important; }
  body.responsive-touch #autoscaleShell .expanded-birth-fields .responsive-birth-time-wrap { position:relative !important; display:flex !important; align-items:stretch !important; border:1px solid #cbd7e3 !important; border-radius:8px !important; background:#fff !important; overflow:hidden !important; box-sizing:border-box !important; }
  body.responsive-touch #autoscaleShell #expandedDobDate { padding:0 6px !important; }
  body.responsive-touch #autoscaleShell #expandedDobTime { width:calc(100% - 44px) !important; border:0 !important; border-radius:0 !important; padding:0 6px !important; box-sizing:border-box !important; background:#fff !important; }
  body.responsive-touch #autoscaleShell .expanded-birth-fields .time-field-selector { position:absolute !important; top:0 !important; right:0 !important; bottom:0 !important; width:44px !important; min-width:44px !important; height:44px !important; min-height:44px !important; padding:0 !important; border:0 !important; border-left:1px solid #cbd7e3 !important; background:#edf3f8 !important; display:flex !important; align-items:center !important; justify-content:center !important; color:#365f91 !important; }
  body.responsive-touch .time-selector-panel { position:fixed !important; left:12px !important; right:12px !important; top:auto !important; bottom:max(12px,env(safe-area-inset-bottom)) !important; width:auto !important; min-width:0 !important; max-width:420px !important; max-height:calc(100dvh - 24px) !important; overflow:auto !important; margin:0 auto !important; padding:16px !important; box-sizing:border-box !important; border:1px solid #cbd7e3 !important; border-radius:14px !important; box-shadow:0 4px 24px #16324f40 !important; background:#fff !important; font-family:system-ui,-apple-system,sans-serif !important; }
  body.responsive-touch .time-selector-title { font-size:16px !important; line-height:1.4 !important; color:#16324f !important; margin-bottom:12px !important; }
  body.responsive-touch .time-selector-fields { display:grid !important; grid-template-columns:minmax(0,1fr) 12px minmax(0,1fr) !important; gap:8px !important; align-items:end !important; }
  body.responsive-touch .time-selector-minute-digits { display:none !important; }
  body.responsive-touch .time-selector-fields label { display:flex !important; flex-direction:column !important; gap:6px !important; color:#43566c !important; font-size:14px !important; }
  body.responsive-touch .time-selector-fields select { width:100% !important; height:44px !important; font-size:18px !important; border:1px solid #cbd7e3 !important; border-radius:8px !important; background:#f8fafc !important; padding:0 10px !important; }
  body.responsive-touch .time-selector-colon { line-height:44px !important; font-size:20px !important; }
  body.responsive-touch .time-selector-actions { display:grid !important; grid-template-columns:repeat(2,minmax(0,1fr)) !important; gap:8px !important; margin-top:16px !important; }
  body.responsive-touch .time-selector-actions button { width:100% !important; height:44px !important; font-size:15px !important; border:1px solid #cbd7e3 !important; border-radius:8px !important; background:#edf3f8 !important; color:#16324f !important; }
}
/* Revision 6: Patient Details follows normal flow instead of desktop coordinates. */
@media screen {
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel { background:#fff !important; border:1px solid #cbd7e3 !important; border-radius:14px !important; padding:16px !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel .save-dialog-panel-inner { position:static !important; inset:auto !important; width:100% !important; min-width:0 !important; height:auto !important; display:flex !important; flex-direction:column !important; gap:16px !important; padding:0 !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel .save-dialog-panel-inner > *,
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel .save-form-row > * { position:static !important; inset:auto !important; transform:none !important; width:auto !important; min-width:0 !important; height:auto !important; min-height:0 !important; max-height:none !important; margin:0 !important; float:none !important; text-align:left !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel .save-patient-heading { display:flex !important; align-items:baseline !important; flex-wrap:wrap !important; gap:8px !important; font-size:16px !important; line-height:1.4 !important; color:#16324f !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel .save-patient-heading strong { font-size:24px !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel .save-form-row { display:grid !important; grid-template-columns:minmax(0,1fr) !important; gap:8px !important; padding:0 !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel .save-form-row:nth-child(2) { grid-template-columns:90px minmax(0,1fr) !important; align-items:center !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel .save-form-row:nth-child(2) .save-auto { grid-column:2 !important; display:flex !important; align-items:center !important; gap:8px !important; min-height:44px !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel .save-form-row > label { font-size:14px !important; line-height:1.4 !important; color:#43566c !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel #saveTeamCode { display:block !important; position:static !important; width:100% !important; height:48px !important; min-height:48px !important; max-height:48px !important; border:1px solid #b6c7d8 !important; border-radius:8px !important; background:#fff !important; color:#16324f !important; font-size:18px !important; text-align:center !important; padding:0 8px !important; box-sizing:border-box !important; opacity:1 !important; visibility:visible !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel #saveTeamCode[readonly] { background:#f5f8fb !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel .save-ga-box { display:grid !important; grid-template-columns:minmax(0,1fr) auto minmax(0,.7fr) auto !important; align-items:center !important; gap:6px !important; width:100% !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel #saveGaWeeks,
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel #saveGaDays { position:static !important; width:100% !important; height:48px !important; min-height:48px !important; max-height:48px !important; font-size:18px !important; padding:0 6px !important; border:1px solid #b6c7d8 !important; border-radius:8px !important; background:#f8fafc !important; box-sizing:border-box !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel .save-unit { font-size:13px !important; color:#43566c !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel .save-risk-row label:not(:first-child) { display:flex !important; align-items:center !important; gap:8px !important; min-height:44px !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel #saveAutoTeam,
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel input[name=saveRisk] { position:static !important; width:22px !important; height:22px !important; min-height:22px !important; margin:0 !important; flex:0 0 22px !important; accent-color:#17669c; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel .save-instructions { font-size:13px !important; line-height:1.5 !important; color:#43566c !important; text-align:left !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel .save-copy-link { font-size:13px !important; line-height:1.5 !important; white-space:normal !important; min-height:44px !important; display:flex !important; align-items:center !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel .save-actions { display:grid !important; grid-template-columns:repeat(2,minmax(0,1fr)) !important; gap:8px !important; width:100% !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel .save-actions button { position:static !important; width:100% !important; height:48px !important; min-height:48px !important; padding:6px !important; margin:0 !important; font-size:15px !important; border:1px solid #cbd7e3 !important; border-radius:8px !important; background:#edf3f8 !important; color:#16324f !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel .save-actions button:disabled { color:#78889a !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel .clinical-modal-message,
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel #saveGaRequiredMessage { font-size:13px !important; line-height:1.4 !important; margin:0 !important; }
}
@media screen {
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel .save-form-row { grid-template-rows:none !important; grid-auto-rows:auto !important; min-height:0 !important; max-height:none !important; align-content:start !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel .save-form-row:nth-child(3) { grid-template-columns:90px minmax(0,1fr) !important; align-items:start !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel .save-form-row:nth-child(3) > label { padding-top:12px !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel .save-ga-box { grid-template-columns:minmax(0,1.4fr) minmax(0,1fr) !important; grid-template-rows:48px auto !important; gap:4px 6px !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel #saveGaWeeks { grid-column:1 !important; grid-row:1 !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel #saveGaDays { grid-column:2 !important; grid-row:1 !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel .save-unit:nth-child(2) { grid-column:1 !important; grid-row:2 !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel .save-unit:nth-child(4) { grid-column:2 !important; grid-row:2 !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel .save-unit { text-align:center !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel .save-risk-row { grid-template-columns:90px minmax(0,1fr) !important; grid-template-rows:auto auto !important; gap:4px 8px !important; align-items:start !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel .save-risk-row > label:first-child { grid-column:1 !important; grid-row:1 !important; padding-top:12px !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel .save-risk-row > label:nth-child(2) { grid-column:2 !important; grid-row:1 !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel .save-risk-row > label:nth-child(3) { grid-column:2 !important; grid-row:2 !important; }
}
@media screen {
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel .save-actions button { max-width:none !important; min-width:0 !important; justify-self:stretch !important; }
}
/* QC1: full-screen Patient ID form and natural instruction wrapping. */
@media screen {
  body.responsive-touch #clinicalModalRoot .clinical-modal-overlay.responsive-patient-overlay { padding:0 !important; background:#fff !important; align-items:stretch !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-overlay.responsive-patient-overlay .clinical-modal-panel.clinical-save-panel { width:100% !important; max-width:none !important; height:100dvh !important; min-height:100dvh !important; max-height:100dvh !important; margin:0 !important; padding:max(20px,env(safe-area-inset-top)) 16px max(20px,env(safe-area-inset-bottom)) !important; border:0 !important; border-radius:0 !important; box-sizing:border-box !important; overflow:auto !important; background:#fff !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel .save-patient-heading { position:relative !important; display:block !important; width:100% !important; min-height:68px !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel .save-patient-heading > span { display:block !important; width:auto !important; margin:0 !important; text-align:left !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel .save-patient-heading strong { display:block !important; width:100% !important; text-align:center !important; font-size:26px !important; margin:4px 0 0 !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel .save-instructions br { display:none !important; }
  body.responsive-touch #autoscaleShell .clinical-side-panel .clinical-data-panel .patient-age-calculator-link-row { width:100% !important; max-width:none !important; min-width:0 !important; }
  body.responsive-touch #autoscaleShell .clinical-side-panel .clinical-data-panel .patient-age-calculator-link-row #ageCalculatorLink,
  body.responsive-touch #autoscaleShell .clinical-side-panel .clinical-data-panel .patient-age-calculator-link-row #ageCalculatorDoneLink { width:100% !important; max-width:none !important; min-width:0 !important; margin:0 !important; box-sizing:border-box !important; }
}
/* QC2: registration alignment and visible access to Date-Time columns. */
@media screen {
  body.responsive-touch #clinicalAccessOverlay .clinical-registration-demographics .clinical-role-list,
  body.responsive-touch #clinicalAccessOverlay .clinical-registration-demographics .clinical-region-list { width:100% !important; margin-left:0 !important; margin-right:0 !important; padding-left:0 !important; padding-right:0 !important; box-sizing:border-box !important; }
  body.responsive-touch #clinicalAccessOverlay .clinical-registration-demographics .clinical-region-list { border-top:1px solid #bfc7d0 !important; padding-top:12px !important; margin-top:12px !important; }
  body.responsive-touch #clinicalAccessOverlay .clinical-role-list > label,
  body.responsive-touch #clinicalAccessOverlay .clinical-region-list > label { display:flex !important; align-items:center !important; justify-content:flex-start !important; width:100% !important; margin:0 !important; padding:0 !important; gap:8px !important; text-align:left !important; line-height:1.4 !important; min-height:44px !important; }
  body.responsive-touch #clinicalAccessOverlay .clinical-role-list input[type=radio],
  body.responsive-touch #clinicalAccessOverlay .clinical-region-list input[type=radio] { margin:0 !important; width:20px !important; height:20px !important; flex:0 0 20px !important; }
  body.responsive-touch #clinicalAccessOverlay .clinical-region-list .clinical-based-in-row { display:grid !important; grid-template-columns:20px 56px minmax(0,1fr) !important; }
  body.responsive-touch #clinicalAccessOverlay #clinicalContinentSelect { width:100% !important; height:44px !important; font-size:14px !important; min-width:0 !important; }
  body.responsive-touch #autoscaleShell #patientTable .record-delete-heading,
  body.responsive-touch #autoscaleShell #patientTable .record-delete-cell { display:none !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 { display:table-cell !important; width:40px !important; }
  body.responsive-touch.age-calculator-expanded #autoscaleShell #patientTable { --qc-column:calc((100vw - 156px) / 3); width:calc(94px + var(--qc-column) * 5) !important; min-width:calc(94px + var(--qc-column) * 5) !important; max-width:none !important; }
  body.responsive-touch.age-calculator-expanded.clinical-selected-delete-mode #autoscaleShell #patientTable { width:calc(134px + var(--qc-column) * 5) !important; min-width:calc(134px + var(--qc-column) * 5) !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:var(--qc-column) !important; }
  body.responsive-touch.age-calculator-expanded #autoscaleShell #patientTable th:first-child,
  body.responsive-touch.age-calculator-expanded #autoscaleShell #patientTable td:first-child { width:94px !important; }
  body.responsive-touch.age-calculator-expanded #autoscaleShell #patientTable th { font-size:12px !important; }
  body.responsive-touch.age-calculator-expanded #autoscaleShell #patientTable input[data-key=measurementDate],
  body.responsive-touch.age-calculator-expanded #autoscaleShell #patientTable input[data-key=measurementTime] { font-size:14px !important; }
  body.responsive-touch.age-calculator-expanded #autoscaleShell #patientTable input[data-key=measurementDate] { padding-right:24px !important; }
  body.responsive-touch.age-calculator-expanded #autoscaleShell #patientTable .date-field-selector { width:24px !important; min-width:24px !important; }
  .qc-table-navigation { display:none; }
  body.responsive-touch.age-calculator-expanded #autoscaleShell .qc-table-navigation { display:grid; grid-template-columns:44px minmax(0,1fr) 110px; gap:6px; align-items:center; margin:8px 0; }
  body.responsive-touch #autoscaleShell .qc-table-navigation button { min-height:36px !important; font-size:13px !important; border:1px solid #cbd7e3; border-radius:7px; background:#edf3f8; color:#16324f; }
  body.responsive-touch #autoscaleShell .qc-table-navigation input { width:100%; min-width:0; height:30px; margin:0; accent-color:#17669c; }
  body.responsive-touch.age-calculator-expanded #autoscaleShell .responsive-table-hint { font-size:12px !important; line-height:1.4 !important; text-align:left !important; color:#43566c !important; }
  body.responsive-touch #autoscaleShell .expanded-storage-notice { font-size:12px !important; line-height:1.5 !important; text-align:left !important; color:#43566c !important; }
  body.responsive-touch #autoscaleShell .expanded-delete-selected-row { width:100% !important; }
  body.responsive-touch #autoscaleShell #expandedDeleteSelectedRecordsButton { width:100% !important; max-width:none !important; min-width:0 !important; height:44px !important; min-height:44px !important; padding:6px 10px !important; border:1px solid #cbd7e3 !important; border-radius:8px !important; font-size:14px !important; line-height:1.4 !important; background:#edf3f8 !important; color:#16324f !important; box-sizing:border-box !important; }
}
@media print { .qc-table-navigation { display:none !important; } }
@media screen {
  body.responsive-touch #autoscaleShell #patientTable .record-delete-button { width:30px !important; height:30px !important; min-height:30px !important; max-height:30px !important; padding:0 !important; font-size:20px !important; }
  body.responsive-touch.age-calculator-expanded.clinical-selected-delete-mode #autoscaleShell #patientTable th.record-delete-heading,
  body.responsive-touch.age-calculator-expanded.clinical-selected-delete-mode #autoscaleShell #patientTable td.record-delete-cell { width:40px !important; }
}
@media screen {
  body.responsive-touch #autoscaleShell input.qc-entry-target { outline:2px solid #17669c !important; outline-offset:-2px; background:#e7f3ff !important; }
  .qc-decimal-tools { display:none; }
  body.responsive-touch #autoscaleShell .qc-decimal-tools:not([hidden]) { display:flex; align-items:center; gap:8px; margin:6px 0; padding:6px 8px; border:1px solid #cbd7e3; border-radius:8px; background:#f5f8fb; font-size:13px; }
  body.responsive-touch #autoscaleShell .qc-decimal-tools button { min-height:44px !important; min-width:44px; border:1px solid #b6c7d8; border-radius:7px; background:#fff; color:#16324f; }
  body.responsive-touch #autoscaleShell .qc-decimal-tools button[aria-label="Insert decimal point"] { font-size:28px !important; font-weight:bold; }
  .qc-time-trigger { display:none !important; }
}
@media print { .qc-decimal-tools { display:none !important; } }
@media screen { body.responsive-touch #autoscaleShell .qc-decimal-tools:not([hidden]) { position:sticky; top:8px; z-index:20; } }
@media screen {
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel .save-patient-heading { display:flex !important; align-items:center !important; gap:12px !important; min-height:44px !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel .save-patient-heading > span { flex:0 0 auto; font-size:14px !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel .save-patient-heading strong { flex:1; width:auto !important; margin:0 !important; font-size:26px !important; }
  body.responsive-touch.clinical-selected-delete-mode #autoscaleShell #patientTable tr { display:grid !important; width:100% !important; grid-template-columns:40px repeat(4,minmax(0,1fr)) !important; }
  body.responsive-touch.clinical-selected-delete-mode #autoscaleShell #patientTable th:nth-child(n), body.responsive-touch.clinical-selected-delete-mode #autoscaleShell #patientTable td:nth-child(n) { width:100% !important; min-width:0 !important; box-sizing:border-box !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; }
  body.responsive-touch.clinical-selected-delete-mode #autoscaleShell #patientTable th:nth-child(3), body.responsive-touch.clinical-selected-delete-mode #autoscaleShell #patientTable td:nth-child(3) { grid-column:2; grid-row:1; }
  body.responsive-touch.clinical-selected-delete-mode #autoscaleShell #patientTable th:nth-child(4), body.responsive-touch.clinical-selected-delete-mode #autoscaleShell #patientTable td:nth-child(4) { grid-column:3; grid-row:1; }
  body.responsive-touch.clinical-selected-delete-mode #autoscaleShell #patientTable th:nth-child(5), body.responsive-touch.clinical-selected-delete-mode #autoscaleShell #patientTable td:nth-child(5) { grid-column:4; grid-row:1; }
  body.responsive-touch.clinical-selected-delete-mode #autoscaleShell #patientTable th:nth-child(6), body.responsive-touch.clinical-selected-delete-mode #autoscaleShell #patientTable td:nth-child(6) { grid-column:5; grid-row:1; }
  body.responsive-touch.age-calculator-expanded.clinical-selected-delete-mode #autoscaleShell #patientTable tr { grid-template-columns:40px 94px repeat(5,var(--qc-column)) !important; }
  body.responsive-touch.age-calculator-expanded.clinical-selected-delete-mode #autoscaleShell #patientTable th:nth-child(n), body.responsive-touch.age-calculator-expanded.clinical-selected-delete-mode #autoscaleShell #patientTable td:nth-child(n) { grid-column:auto; }
  body.responsive-touch.age-calculator-expanded.clinical-selected-delete-mode #autoscaleShell #patientTable th:nth-child(1), body.responsive-touch.age-calculator-expanded.clinical-selected-delete-mode #autoscaleShell #patientTable td:nth-child(1) { grid-column:2 !important; grid-row:1; }
  body.responsive-touch.age-calculator-expanded.clinical-selected-delete-mode #autoscaleShell #patientTable th:nth-child(2), body.responsive-touch.age-calculator-expanded.clinical-selected-delete-mode #autoscaleShell #patientTable td:nth-child(2) { grid-column:3 !important; grid-row:1; }
  body.responsive-touch.age-calculator-expanded.clinical-selected-delete-mode #autoscaleShell #patientTable th:nth-child(3), body.responsive-touch.age-calculator-expanded.clinical-selected-delete-mode #autoscaleShell #patientTable td:nth-child(3) { grid-column:4 !important; }
  body.responsive-touch.age-calculator-expanded.clinical-selected-delete-mode #autoscaleShell #patientTable th:nth-child(4), body.responsive-touch.age-calculator-expanded.clinical-selected-delete-mode #autoscaleShell #patientTable td:nth-child(4) { grid-column:5 !important; }
  body.responsive-touch.age-calculator-expanded.clinical-selected-delete-mode #autoscaleShell #patientTable th:nth-child(5), body.responsive-touch.age-calculator-expanded.clinical-selected-delete-mode #autoscaleShell #patientTable td:nth-child(5) { grid-column:6 !important; }
  body.responsive-touch.age-calculator-expanded.clinical-selected-delete-mode #autoscaleShell #patientTable th:nth-child(6), body.responsive-touch.age-calculator-expanded.clinical-selected-delete-mode #autoscaleShell #patientTable td:nth-child(6) { grid-column:7 !important; }
  .qc-number-pad[hidden] { display:none !important; }
  body.responsive-touch .qc-number-pad:not([hidden]) { position:fixed; z-index:10010; bottom:12px; left:12px; right:12px; max-width:380px; margin:auto; padding:12px; background:#fff; border:1px solid #b6c7d8; border-radius:14px; box-shadow:0 4px 24px #16324f40; }
  body.responsive-touch .qc-pad-title { font-size:15px; color:#16324f; margin-bottom:8px; font-weight:600; }
  body.responsive-touch .qc-pad-keys { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
  body.responsive-touch #autoscaleShell .qc-pad-keys button { min-height:44px !important; font-size:22px !important; background:#f5f8fb; border:1px solid #b6c7d8; border-radius:8px; color:#16324f; }
  body.responsive-touch #autoscaleShell .qc-pad-keys .qc-pad-decimal { font-size:16px !important; font-weight:700; background:#dfeefa; border:2px solid #17669c; }
}
@media print { .qc-number-pad { display:none !important; } }
@media screen {
  body.responsive-touch.clinical-selected-delete-mode #autoscaleShell #patientTable > tbody > tr:nth-child(n),
  body.responsive-touch.clinical-selected-delete-mode #autoscaleShell #patientTable > thead > tr { display:grid !important; width:100% !important; }
}
@media screen {
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel .save-patient-heading strong { position:absolute !important; left:50% !important; top:50% !important; transform:translate(-50%,-50%) !important; flex:none !important; width:auto !important; }
  body.responsive-touch .qc-pad-keys .qc-pad-done { grid-column:span 2; }
}
@media screen and (max-width:359px) {
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel .save-patient-heading > span { font-size:12px !important; }
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel .save-patient-heading strong { font-size:24px !important; }
}
@media screen {
  body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel .save-patient-heading { justify-content:flex-start !important; }
}
@media screen {
  body.responsive-touch #autoscaleShell #patientTable .record-delete-button { min-width:30px !important; max-width:30px !important; border-radius:50% !important; }
}
/* QC5: keypad lives outside worksheet stacking contexts, with an opaque viewport. */
@media screen {
  body.responsive-touch .qc-number-pad:not([hidden]) { position:fixed !important; inset:0 !important; width:100% !important; height:100dvh !important; max-width:none !important; margin:0 !important; padding:max(12px,env(safe-area-inset-top)) 12px max(12px,env(safe-area-inset-bottom)) !important; box-sizing:border-box !important; display:flex !important; align-items:center !important; justify-content:center !important; overflow:auto !important; background:#eef3f8 !important; z-index:2147483000 !important; border:0 !important; border-radius:0 !important; isolation:isolate; }
  body.responsive-touch .qc-pad-card { width:100%; max-width:380px; padding:16px; box-sizing:border-box; background:#fff; border:1px solid #b6c7d8; border-radius:14px; box-shadow:0 4px 24px #16324f30; }
  body.responsive-touch .qc-pad-value { display:block; min-height:48px; margin:8px 0 12px; padding:8px; border:1px solid #b6c7d8; border-radius:8px; text-align:right; color:#16324f; background:#f8fafc; font:32px system-ui,-apple-system,sans-serif; overflow-wrap:anywhere; }
  body.responsive-touch .qc-pad-keys button { min-height:48px !important; font-size:22px !important; font-family:system-ui,-apple-system,sans-serif; background:#f5f8fb !important; border:1px solid #b6c7d8 !important; border-radius:8px !important; color:#16324f !important; }
  body.responsive-touch .qc-pad-keys .qc-pad-decimal { font-size:14px !important; font-weight:700 !important; background:#dfeefa !important; border:2px solid #17669c !important; white-space:normal !important; line-height:1.3 !important; }
  body.qc-number-pad-open { overflow:hidden !important; }
}
@media screen {
  body.responsive-touch .qc-number-pad:not([hidden]) { align-items:flex-start !important; z-index:2147483647 !important; }
  body.responsive-touch .qc-pad-card { margin:auto; }
}
@media screen {
  .qc-options-panel { display:none; }
  body.responsive-touch.qc-options-view #autoscaleShell .qc-options-panel { display:block; padding:16px; background:#fff; border:1px solid #d5e0ea; border-radius:12px; }
  body.responsive-touch.qc-options-view #autoscaleShell .chart-area { position:absolute !important; visibility:hidden !important; pointer-events:none !important; top:0 !important; left:0 !important; }
  body.responsive-touch.qc-options-view #autoscaleShell .left-column,
  body.responsive-touch.qc-options-view #autoscaleShell .responsive-settings { display:none !important; }
  body.responsive-touch #responsiveOptionsPanel h2 { margin:0 0 12px; font:600 21px system-ui,-apple-system,sans-serif; color:#16324f; }
  body.responsive-touch #autoscaleShell .qc-graph-preview { display:block; width:100% !important; padding:8px !important; background:#f7fafc; border:1px solid #d5e0ea; border-radius:10px; }
  body.responsive-touch .qc-graph-preview svg { display:block; width:100%; }
  body.responsive-touch .qc-options-description { font-size:13px; color:#526b7f; margin:14px 0 8px; }
  body.responsive-touch #responsiveOptionsPanel .clinical-data-button-row,
  body.responsive-touch #responsiveOptionsPanel .clinical-print-button-row { position:static !important; margin:8px 0 !important; width:100% !important; }
  body.responsive-touch #responsiveOptionsPanel .expanded-delete-selected-row { position:static !important; margin:8px 0 !important; width:100% !important; }
  body.responsive-touch #responsiveOptionsPanel .logged-on-user-display { position:static !important; margin:16px 0 0 !important; font-size:12px !important; }
}
@media print { .qc-options-panel { display:none !important; } }
@media screen {
  body.responsive-touch #responsiveOptionsPanel #storedRecordsButton,
  body.responsive-touch #responsiveOptionsPanel #saveDataButton,
  body.responsive-touch #responsiveOptionsPanel #clearButton,
  body.responsive-touch #responsiveOptionsPanel #pasteDataButton,
  body.responsive-touch #responsiveOptionsPanel #printButton,
  body.responsive-touch #responsiveOptionsPanel #removePatientButton { font-size:14px !important; white-space:normal !important; line-height:1.3 !important; }
  body.responsive-touch #responsiveOptionsPanel .expanded-delete-selected-row { display:none !important; }
}
@media screen {
  body.responsive-touch #responsiveOptionsPanel .clinical-data-button-row,
  body.responsive-touch #responsiveOptionsPanel .clinical-print-button-row { visibility:visible !important; pointer-events:auto !important; }
}

body.responsive-touch .qc-graph-preview strong, body.responsive-touch .qc-preview-status {display:block; font:14px Arial,sans-serif; color:#173650; white-space:normal;}

/* QC8: generic preview, persistent graph controls, and roomier Data view. */
body.responsive-touch .qc-graph-preview svg { filter:blur(4px); opacity:.55; pointer-events:none; }
body.responsive-touch .qc-preview-status { display:none !important; }
body.responsive-touch #autoscaleShell .legend-box { display:flex !important; flex-wrap:nowrap !important; gap:12px !important; }
body.responsive-touch #autoscaleShell .legend-item { display:flex !important; align-items:center; white-space:nowrap; font-size:11px !important; gap:4px !important; }
#removePatientButton { text-align:center !important; }
body.responsive-touch #autoscaleShell #removePatientButton { text-align:center !important; padding-left:8px !important; padding-right:46px !important; }
#autoscaleShell .clinical-data-button-row > #clearButton { order:1 !important; }
#autoscaleShell .clinical-data-button-row > #storedRecordsButton { order:3 !important; }
#autoscaleShell .clinical-print-button-row .clinical-delete-split #removePatientButton { text-align:center !important; }
body.responsive-touch #autoscaleShell .legend-box .box-title { display:none !important; }
body.responsive-touch #autoscaleShell .legend-item { font-size:10px !important; }
body.responsive-touch #autoscaleShell .legend-dot { flex:none; width:9px !important; height:9px !important; }
body.responsive-touch #autoscaleShell .legend-box { gap:8px !important; padding:10px 8px !important; }
body.responsive-touch #autoscaleShell .top-strip .top-legend { flex-wrap:nowrap !important; gap:8px !important; padding:10px 8px !important; }

/* QC9: phone sign-in, registration and compact graph refinements. */
body.responsive-touch .qc-graph-preview svg { filter:blur(2px); }
body.responsive-touch #clinicalAccessOverlay .clinical-access-card .clinical-code-row .clinical-team-edit-row { grid-column:2 !important; display:flex !important; align-items:center !important; justify-content:flex-start !important; gap:6px !important; margin:0 !important; }
body.responsive-touch #clinicalAccessOverlay .clinical-access-card .clinical-tos-row,
body.responsive-touch #clinicalAccessOverlay .clinical-access-card .clinical-remember-row { display:flex !important; align-items:flex-start !important; gap:8px !important; text-align:left !important; }
body.responsive-touch #clinicalAccessOverlay .clinical-tos-row input,
body.responsive-touch #clinicalAccessOverlay .clinical-remember-row input { flex:none !important; width:18px !important; height:18px !important; min-height:18px !important; margin:2px 0 0 !important; align-self:flex-start !important; }
body.responsive-touch #clinicalAccessOverlay .clinical-code-assigned-box { display:flex !important; flex-wrap:wrap !important; width:100% !important; max-width:100% !important; min-width:0 !important; box-sizing:border-box !important; padding:12px !important; gap:10px !important; }
body.responsive-touch #clinicalAccessOverlay .clinical-assigned-pair { display:flex !important; flex-wrap:wrap !important; align-items:baseline !important; gap:6px !important; max-width:100% !important; }
body.responsive-touch #clinicalAccessOverlay .clinical-code-assigned-label { font-size:15px !important; white-space:nowrap !important; }
body.responsive-touch #clinicalAccessOverlay .clinical-user-code-display { font-size:22px !important; letter-spacing:1px !important; }
body.responsive-touch #clinicalAccessOverlay .clinical-copied-note { flex-basis:100%; font-size:12px !important; }
body.responsive-touch #autoscaleShell .top-strip .ga-strip { row-gap:2px !important; padding:8px 12px !important; }
body.responsive-touch #autoscaleShell .top-strip .ga-range-box { margin:2px 0 0 !important; }
body.responsive-touch #autoscaleShell .top-strip .guideline-box,
body.responsive-touch #autoscaleShell .top-strip .risk-box { padding:8px !important; }
body.responsive-touch #autoscaleShell .top-strip .risk-box label { font-size:11px !important; gap:5px !important; line-height:1.2 !important; }
body.responsive-touch #autoscaleShell .top-strip .controls-box .control-label { margin-bottom:2px !important; }
body.responsive-touch #autoscaleShell .about-info-link { display:block !important; width:100% !important; left:auto !important; right:auto !important; margin:12px auto 0 !important; text-align:center !important; box-sizing:border-box !important; }

/* QC10: center the complete containers, not only their text. */
body.responsive-touch .qc-graph-preview svg { filter:blur(1px); }
body.responsive-touch #autoscaleShell .chart-area .demo-note,
body.responsive-touch #autoscaleShell .chart-area .demo-line { position:static !important; inset:auto !important; width:100% !important; max-width:100% !important; margin:12px 0 0 !important; padding:0 !important; transform:none !important; text-align:center !important; box-sizing:border-box !important; }
body.responsive-touch #clinicalAccessOverlay .clinical-access-card .clinical-code-row { row-gap:0 !important; align-items:start !important; }
body.responsive-touch #clinicalAccessOverlay .clinical-access-card .clinical-code-row .clinical-team-edit-row { justify-content:center !important; min-height:32px !important; padding:0 !important; margin:0 !important; gap:5px !important; }
body.responsive-touch #clinicalAccessOverlay .clinical-team-edit-row input { min-height:18px !important; height:18px !important; width:18px !important; margin:0 !important; }
body.responsive-touch #autoscaleShell .clinical-print-button-row .clinical-delete-split #removePatientButton { width:calc(100% - 40px) !important; padding:8px 2px !important; text-align:center !important; }
body.responsive-touch #autoscaleShell .clinical-print-button-row .clinical-delete-split #deleteRecordsSplitMenuButton { width:40px !important; min-width:40px !important; max-width:40px !important; }
body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-stored-team-panel .stored-team-display-row { display:flex !important; flex-wrap:wrap !important; justify-content:center !important; align-items:center !important; gap:8px !important; }
body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-stored-team-panel .stored-team-display-row > *,
body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-stored-team-panel .stored-archive-filter,
body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-stored-team-panel .stored-archive-filter * { position:static !important; inset:auto !important; transform:none !important; }
body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-stored-team-panel .stored-archive-filter [role=radiogroup] { display:flex !important; flex-wrap:wrap !important; align-items:center !important; gap:8px 16px !important; }
body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-stored-team-panel .stored-archive-filter label { display:inline-flex !important; align-items:center !important; min-height:44px !important; gap:6px !important; font-size:14px !important; white-space:nowrap !important; }
body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-stored-team-panel .stored-archive-filter input { appearance:auto !important; display:inline-block !important; opacity:1 !important; visibility:visible !important; width:20px !important; height:20px !important; min-height:20px !important; margin:0 !important; }
@media(max-width:359px){body.responsive-touch #responsiveOptionsPanel .clinical-delete-split #removePatientButton {font-size:12px !important;}}

/* QC11: main Delete button always fills its grid cell, with centered text.
   The optional menu arrow overlays the edge and never subtracts button width. */
body.responsive-touch #autoscaleShell .clinical-print-button-row .clinical-delete-split { display:block !important; width:100% !important; height:100% !important; min-height:44px !important; }
body.responsive-touch #autoscaleShell .clinical-print-button-row .clinical-delete-split #removePatientButton { display:block !important; width:100% !important; min-width:100% !important; max-width:100% !important; height:100% !important; padding:8px 28px !important; text-align:center !important; border:1px solid #cbd7e3 !important; border-radius:8px !important; box-sizing:border-box !important; }
body.responsive-touch #autoscaleShell .clinical-print-button-row .clinical-delete-split #deleteRecordsSplitMenuButton { position:absolute !important; right:0 !important; top:0 !important; bottom:0 !important; width:28px !important; min-width:28px !important; max-width:28px !important; height:100% !important; padding:0 !important; border-radius:0 8px 8px 0 !important; }
body.responsive-touch #autoscaleShell .clinical-print-button-row .clinical-delete-split.delete-records-disabled #removePatientButton { padding:8px !important; }

/* QC12: account footer and clearer informational dialogs. */
body.responsive-touch #autoscaleShell .qc-graph-preview { background:#f1f2f3 !important; }
.qc-info-footer { position:absolute; left:0; width:100%; text-align:center; }
body.responsive-touch #autoscaleShell .qc-info-footer { position:static !important; margin:40px 0 8px !important; width:100% !important; }
body.responsive-touch #autoscaleShell .qc-info-footer .about-info-link { margin:0 !important; top:0 !important; }
.stored-team-note span { display:inline-block; white-space:nowrap; }
body.responsive-touch #clinicalModalRoot .stored-team-note { font-size:12px !important; line-height:1.45 !important; }
body.responsive-touch #autoscaleShell .legend-item { font-size:10px !important; }
@media(max-width:359px){body.responsive-touch #autoscaleShell .top-strip .top-legend { flex-direction:column !important; align-items:flex-start !important; gap:6px !important; }body.responsive-touch #autoscaleShell .legend-item {font-size:12px !important;}}
#recentChangesDialog { border:3px solid #586673 !important; background:#e2e5e8 !important; box-shadow:0 8px 32px #15253655 !important; }
body.responsive-touch #recentChangesClose { min-width:110px !important; min-height:44px !important; padding:10px 24px !important; font-size:16px !important; }
body.responsive-touch #recentChangesDialog { width:calc(100vw - 24px) !important; max-width:calc(100vw - 24px) !important; max-height:calc(100dvh - 24px) !important; left:12px !important; top:12px !important; transform:none !important; margin:0 !important; font-size:15px !important; }

body:not(.responsive-touch) #autoscaleShell .worksheet-frame {height:872px !important; min-height:872px !important; max-height:none !important;}

/* QC13: center New Patient validation across its full form width. */
#clinicalModalRoot .clinical-save-panel .clinical-modal-message,
#clinicalModalRoot .clinical-save-panel #saveGaRequiredMessage { width:100% !important; text-align:center !important; justify-content:center !important; box-sizing:border-box !important; }
body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel .clinical-modal-message,
body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-save-panel #saveGaRequiredMessage { text-align:center !important; }
body:not(.responsive-touch) #autoscaleShell .chart-area .demo-note { width:100% !important; max-width:100% !important; margin:16px auto 0 !important; padding:0 !important; text-align:center !important; }

/* QC14: approved compact bear and graph-aligned BiliGuide heading. */
#autoscaleShell .bg-masthead {position:relative;display:flex;align-items:center;width:1110px;height:52px;margin:-8px 0 8px;box-sizing:border-box;}
#autoscaleShell .bg-masthead #chartTitle.main-title {display:none !important;}
#autoscaleShell .bg-bear {position:absolute;left:0;top:0;width:52px;height:52px;object-fit:contain;}
#autoscaleShell .bg-heading {width:100%;margin:0;padding:0 0 0 62px;box-sizing:border-box;font:700 25px/1.2 Arial,sans-serif;text-align:left;color:#16324f;white-space:nowrap;}
body.responsive-touch #autoscaleShell .bg-masthead {width:100%;height:auto;min-height:52px;margin:0 0 12px;gap:7px;}
body.responsive-touch #autoscaleShell .bg-bear {position:static;width:42px;height:48px;flex:none;mix-blend-mode:multiply;}
body.responsive-touch #autoscaleShell .bg-heading {flex:1;min-width:0;width:auto;padding:0;font:600 clamp(12px,3.95vw,17px)/1.45 system-ui,-apple-system,sans-serif;letter-spacing:-.25px;}
body.responsive-touch #autoscaleShell .bg-heading span {display:block;white-space:nowrap;}
@media print {.bg-masthead {break-inside:avoid;}}

/* QC15: remove the redundant settings enclosure and compact X-axis options. */
body:not(.responsive-touch) #autoscaleShell .bg-bear {content:url("biliguide-bear-desktop.svg?v=QC29-20261022");width:62.014px;height:71.78px;left:-10px;top:0px;}
body.responsive-touch #autoscaleShell .responsive-settings {border:0 !important;background:transparent !important;padding:0 !important;margin:0 !important;border-radius:0 !important;}
body.responsive-touch #autoscaleShell .top-strip {margin-bottom:8px !important;}
body.responsive-touch #autoscaleShell .xaxis-controls {display:grid !important;grid-template-columns:auto minmax(0,1fr) minmax(0,1fr) !important;column-gap:8px !important;row-gap:2px !important;padding:8px !important;}
body.responsive-touch #autoscaleShell .xaxis-controls > .control-label {grid-column:1;grid-row:1;white-space:nowrap !important;width:auto !important;font-size:13px !important;}
body.responsive-touch #autoscaleShell .xaxis-controls > label {width:auto !important;font-size:12px !important;gap:6px !important;white-space:nowrap !important;}
body.responsive-touch #autoscaleShell .xaxis-controls > label:nth-of-type(1) {grid-column:2;grid-row:1;}
body.responsive-touch #autoscaleShell .xaxis-controls > label:nth-of-type(2) {grid-column:3;grid-row:1;}
body.responsive-touch #autoscaleShell .xaxis-controls > .current-axis-option {grid-column:2 / -1 !important;grid-row:2;grid-template-columns:18px 30px 100px auto !important;column-gap:6px !important;}
body.responsive-touch #autoscaleShell .current-axis-combo {width:100px !important;}
body.responsive-touch #autoscaleShell #currentAxisSuffix {display:none !important;}
body.responsive-touch #autoscaleShell .current-axis-option::after {content:'days';}
body.responsive-touch #clinicalModalRoot .clinical-stored-team-panel .stored-team-note {white-space:nowrap !important;line-height:1.3 !important;margin:2px 0 !important;letter-spacing:0 !important;}
body.responsive-touch #clinicalModalRoot .stored-team-note span {display:inline !important;white-space:normal !important;}
body.responsive-touch #autoscaleShell .xaxis-controls > .current-axis-option {grid-template-columns:18px 24px 112px auto !important;}
body.responsive-touch #autoscaleShell .current-axis-combo {width:112px !important;}

/* QC16: compact Stored Records actions and deliberate graph alignment. */
body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-stored-team-panel .stored-team-actions {display:grid !important;grid-template-columns:repeat(2,minmax(0,1fr)) !important;gap:8px !important;margin:0 0 8px !important;width:100% !important;}
body.responsive-touch #clinicalModalRoot .clinical-modal-panel.clinical-stored-team-panel .stored-team-actions > button {position:static !important;inset:auto !important;transform:none !important;width:100% !important;min-width:0 !important;max-width:none !important;height:44px !important;min-height:44px !important;margin:0 !important;padding:6px !important;box-sizing:border-box !important;font-size:15px !important;}
body.responsive-touch #autoscaleShell .top-strip .top-legend {justify-content:center !important;}
body.responsive-touch #autoscaleShell .xaxis-controls {grid-template-columns:auto 127px minmax(0,1fr) !important;}
@media(max-width:359px){body.responsive-touch #autoscaleShell .xaxis-controls > label:nth-of-type(2) {font-size:11px !important;gap:4px !important;}body.responsive-touch #autoscaleShell .top-strip .top-legend {align-items:center !important;}}

body.responsive-touch #autoscaleShell .responsive-table-hint {width:100% !important;text-align:center !important;box-sizing:border-box !important;}
body.responsive-touch.age-calculator-expanded #autoscaleShell .responsive-table-hint {text-align:center !important;}

/* QC18: consistent iPhone-style GA list, using the original select values. */
body.responsive-touch .qc-ga-source {opacity:0 !important;pointer-events:none !important;}
body.responsive-touch .qc-ga-trigger {display:flex !important;align-items:center !important;justify-content:space-between !important;gap:6px !important;position:relative !important;width:100% !important;min-width:0 !important;height:48px !important;min-height:48px !important;margin:0 !important;padding:0 8px !important;border:1px solid #b6c7d8 !important;border-radius:8px !important;background:#f8fafc !important;color:#16324f !important;font:700 18px/1.2 system-ui,-apple-system,sans-serif !important;box-sizing:border-box !important;z-index:3;}
body.responsive-touch .qc-ga-trigger .qc-ga-arrow {font-size:13px;font-weight:400;color:#43566c;}
body.responsive-touch .qc-ga-placeholder {color:#c00000 !important;}
body.responsive-touch #clinicalModalRoot .save-ga-box > .qc-ga-weeks {grid-column:1 !important;grid-row:1 !important;}
body.responsive-touch #clinicalModalRoot .save-ga-box > .qc-ga-days {grid-column:2 !important;grid-row:1 !important;}
body.responsive-touch #autoscaleShell .ga-week-display > .qc-ga-trigger {position:absolute !important;inset:0 !important;height:44px !important;min-height:44px !important;}
body.responsive-touch #autoscaleShell .ga-strip > .qc-ga-trigger {grid-column:4 !important;grid-row:1 !important;height:44px !important;min-height:44px !important;}
body.responsive-touch .qc-ga-trigger:disabled {opacity:.55;}
body.responsive-touch dialog.qc-ga-picker {position:fixed !important;inset:0 !important;margin:auto !important;width:min(290px,calc(100vw - 48px)) !important;min-width:0 !important;max-width:calc(100vw - 24px) !important;max-height:min(520px,calc(100dvh - 48px)) !important;padding:0 !important;border:1px solid #dbe2e8 !important;border-radius:22px !important;box-shadow:0 12px 36px #17365040 !important;background:#fafafb !important;color:#111 !important;overflow:hidden !important;font-family:system-ui,-apple-system,sans-serif !important;}
body.responsive-touch dialog.qc-ga-picker::backdrop {background:#142c4633;}
.qc-ga-picker .qc-ga-header {display:flex;align-items:center;justify-content:space-between;gap:8px;padding:12px 16px;border-bottom:1px solid #e1e5e9;background:#fff;}
.qc-ga-picker .qc-ga-header h2 {font:650 15px/1.3 system-ui,-apple-system,sans-serif;color:#16324f;margin:0;}
.qc-ga-picker .qc-ga-cancel {border:0;background:transparent;color:#17669c;font:400 14px system-ui,-apple-system,sans-serif;min-height:44px;padding:6px 0;}
.qc-ga-picker .qc-ga-values {overflow-y:auto;overscroll-behavior:contain;max-height:min(440px,calc(100dvh - 125px));padding:6px 0;scrollbar-width:thin;}
.qc-ga-picker .qc-ga-choice {display:grid;grid-template-columns:28px 1fr;align-items:center;gap:6px;width:100%;min-height:56px;border:0;background:transparent;text-align:left;font:500 24px/1.2 system-ui,-apple-system,sans-serif;color:#111;padding:10px 22px;}
.qc-ga-picker .qc-ga-choice[aria-selected=true] {background:#edf3f8;font-weight:650;}
.qc-ga-picker .qc-ga-choice:disabled {opacity:.4;}
.qc-ga-picker .qc-ga-check {font-size:23px;font-weight:600;}
.qc-ga-picker button:focus-visible,.qc-ga-trigger:focus-visible {outline:3px solid #17669c;outline-offset:-3px;}
body.responsive-touch.age-calculator-expanded #autoscaleShell .responsive-table-hint > .qc-scroll-instruction {display:block !important;width:100% !important;margin:0 !important;padding:0 !important;text-align:center !important;}
body.responsive-touch dialog.qc-ga-picker:focus {outline:none !important;}

/* QC19: Import Records preference checkbox follows the first text line. */
body.responsive-touch #autoscaleShell .paste-data-controls .paste-data-preference-row {display:grid !important;grid-template-columns:18px minmax(0,1fr) !important;align-items:start !important;column-gap:10px !important;text-align:left !important;}
body.responsive-touch #autoscaleShell .paste-data-controls .paste-data-preference-row #pasteDataInformationCheckbox {position:static !important;align-self:start !important;width:18px !important;min-width:18px !important;max-width:18px !important;height:18px !important;min-height:18px !important;max-height:18px !important;margin:0 !important;padding:0 !important;transform:none !important;}
body.responsive-touch #autoscaleShell .paste-data-controls .paste-data-preference-row > span {display:block !important;margin:0 !important;padding:0 !important;line-height:18px !important;}

/* QC22: keep clipboard guidance compact on phones. */
body.responsive-touch #autoscaleShell .paste-data-manual-entry > p {font-size:11.7px !important;line-height:1.3 !important;}

/* QC25: enlarged decimal glyph without changing the keypad grid size. */
body.responsive-touch .qc-pad-keys .qc-pad-decimal {position:relative !important;}
body.responsive-touch .qc-pad-decimal .qc-pad-period {position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:48px;font-weight:700;line-height:1;pointer-events:none;}


/* QC30: add NNP below Neonatologist; keep the two-column desktop grouping. */
body:not(.responsive-touch) .clinical-access-scaled .clinical-registration-demographics .clinical-role-grid {grid-template-columns:200px minmax(0,1fr) !important;}
body:not(.responsive-touch) .clinical-role-grid > label:nth-child(1) {grid-column:1;grid-row:1;}
body:not(.responsive-touch) .clinical-role-grid > label:nth-child(2) {grid-column:1;grid-row:2;}
body:not(.responsive-touch) .clinical-role-grid > label:nth-child(3) {grid-column:2;grid-row:1;}
body:not(.responsive-touch) .clinical-role-grid > label:nth-child(4) {grid-column:1;grid-row:3;}
body:not(.responsive-touch) .clinical-role-grid > label:nth-child(5) {grid-column:2;grid-row:2;}
body:not(.responsive-touch) .clinical-access-scaled .clinical-registration-demographics .clinical-role-other-label {grid-template-columns:14px 52px 154px !important;}
body:not(.responsive-touch) .clinical-access-scaled .clinical-registration-demographics .clinical-role-other {width:154px !important;max-width:154px !important;}

/* QC31: persistent help links and readable serif instructions, matching About. */
.qc-user-info-links {display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:8px 24px;}
body.responsive-touch #autoscaleShell .qc-info-footer .qc-user-info-links a {display:inline-block !important;width:auto !important;margin:0 !important;}
.qc-user-info-links a,.qc-registration-help {color:#001a80;text-decoration:underline;font:14px Arial,sans-serif;}
.qc-registration-help {display:block;margin:0 0 10px;}
dialog.qc-user-info {box-sizing:border-box;width:min(860px,calc(100vw - 24px));max-height:calc(100dvh - 24px);padding:0 24px 24px;border:2px solid #657483;border-radius:12px;background:#fff;color:#111;overflow:auto;font:16px/1.45 Georgia,"Times New Roman",Times,serif;}
dialog.qc-user-info::backdrop {background:rgba(20,35,50,.35);}
.qc-user-info-header {position:sticky;top:0;display:flex;align-items:center;justify-content:space-between;gap:16px;background:#fff;padding:14px 0;border-bottom:1px solid #ccd5de;z-index:1;}
.qc-user-info-header h1 {margin:0;font-size:24px;}
.qc-user-info-close {flex:none;min-height:44px;min-width:80px;padding:8px 14px;border:1px solid #b6c7d8;border-radius:6px;background:#eef3f8;color:#16324f;font:16px Arial,sans-serif;}
.qc-user-info-text h2 {font-size:21px;line-height:1.25;margin:24px 0 12px;color:#16324f;}
.qc-user-info-text h3 {font-size:18px;margin:20px 0 8px;}
.qc-user-info-text p {margin:0 0 16px;}
.qc-user-info-text ol {padding-left:26px;margin:0 0 16px;}
.qc-user-info-text li {margin:0 0 10px;}
@media(max-width:500px){dialog.qc-user-info {padding:0 16px 18px;}.qc-user-info-header h1 {font-size:22px;}}

/* QC32: move the information row together, aligned with the account links. */
body:not(.responsive-touch) #autoscaleShell .qc-user-info-links {position:relative;top:6px;align-items:baseline;}
body:not(.responsive-touch) #autoscaleShell .qc-user-info-links a {position:static !important;top:auto !important;font-size:13.2px !important;line-height:1.2 !important;}
body:not(.responsive-touch) #autoscaleShell #logOnUserLink {position:relative;top:6px;}

/* QC34: center the information links over the desktop plot, like its X-axis controls. */
body:not(.responsive-touch) #autoscaleShell .chart-area .demo-note {width:1034px !important;max-width:none !important;margin-left:62px !important;margin-right:0 !important;}

/* Update notices never reload automatically or take focus from data entry. */
#bgUpdateNotice {position:fixed;left:12px;right:12px;bottom:calc(12px + env(safe-area-inset-bottom));z-index:100010;max-width:680px;margin:0 auto;padding:12px;box-sizing:border-box;display:flex;align-items:center;gap:10px;background:#fff8cf;color:#16324f;border:2px solid #6a7785;border-radius:8px;box-shadow:0 3px 16px #0003;font:14px/1.35 Arial,sans-serif;}
#bgUpdateNotice span {flex:1;}
#bgUpdateNotice button {min-height:44px;padding:8px 12px;font:700 14px Arial,sans-serif;border:1px solid #8a99a8;border-radius:6px;background:#fff;color:#16324f;}
@media(max-width:450px){#bgUpdateNotice {flex-wrap:wrap;}#bgUpdateNotice span {flex-basis:100%;}}
@media print {#bgUpdateNotice {display:none !important;}}

/* QC36: unread change messages join the centered desktop information row. */
body:not(.responsive-touch) #autoscaleShell .qc-user-info-links #recentChangesLink {margin:0 !important;white-space:nowrap;}

/* QC37: changes belongs with information on phone Options as well. */
body.responsive-touch #autoscaleShell .qc-info-footer #recentChangesLink {position:static !important;top:auto !important;margin:0 !important;}
body:not(.responsive-touch) #autoscaleShell .qc-user-info-links {flex-wrap:nowrap;}
/* Match phone information-link type and give Recent Changes a separate airy row. */
body.responsive-touch #autoscaleShell .qc-info-footer .qc-user-info-links {row-gap:14px;}
body.responsive-touch #autoscaleShell .qc-info-footer .qc-user-info-links a {font:13px/1.3 Arial,sans-serif !important;}
body.responsive-touch #autoscaleShell .qc-info-footer .qc-user-info-links #recentChangesLink {flex-basis:100%;text-align:center;}

/* QC38: never reveal unavailable account-specific links via phone link styles. */
body.responsive-touch #autoscaleShell .qc-info-footer .qc-user-info-links a[hidden] {display:none !important;}
/* Blur inside the SVG rather than compositing the whole preview surface. */
body.responsive-touch .qc-graph-preview svg {filter:none !important;}

/* QC39: User information follows About BiliGuide's explanatory typography. */
dialog.qc-user-info {font-family:Georgia,"Times New Roman",serif;font-size:15px;line-height:1.22;}
.qc-user-info-text p,.qc-user-info-text ol {margin-bottom:10px;}
.qc-user-info-header h1 {font:700 17px/1.22 Arial,Helvetica,sans-serif;color:#000;}
.qc-user-info-text h2 {font:700 17px/1.22 Arial,Helvetica,sans-serif;color:#000;margin:20px 0 10px;}
.qc-user-info-text h3 {font:700 15px/1.22 Arial,Helvetica,sans-serif;color:#000;margin:16px 0 8px;}
@media(max-width:500px){.qc-user-info-header h1 {font-size:17px;}}

/* Prototype: matching persistent top-right Close controls in both documents. */
#autoscaleShell .worksheet-frame > #aboutModalOverlay .about-modal-panel {height:auto !important;min-height:0 !important;max-height:min(848px,calc(100dvh - 24px)) !important;padding:0 24px 24px !important;overflow:auto !important;border:2px solid #657483 !important;border-radius:12px !important;display:block !important;background:#fff !important;}
#autoscaleShell #aboutModalOverlay .about-modal-content {flex:none !important;overflow:visible !important;}
.qc-about-header .about-title {margin:0 !important;font:17px/1.22 Arial,Helvetica,sans-serif !important;}
.qc-about-header .about-title-main {font-size:17px !important;}
.qc-about-header .about-title-version {font-size:13px !important;margin-top:3px;}
.qc-about-header {margin-bottom:20px;align-items:flex-start;}
.qc-user-info-close,#autoscaleShell .qc-about-header #aboutModalClose {box-sizing:border-box !important;flex:none !important;min-height:44px !important;height:44px !important;min-width:80px !important;width:80px !important;padding:8px 14px !important;border:1px solid #b6c7d8 !important;border-radius:6px !important;background:#eef3f8 !important;color:#16324f !important;font:16px/1.2 Arial,sans-serif !important;}
body.responsive-touch #autoscaleShell .worksheet-frame > #aboutModalOverlay .about-modal-panel {padding:0 16px 18px !important;max-height:calc(100dvh - 24px) !important;overflow:auto !important;}
/* Programmatically focused reading containers need no control-like outline. */
#qcUserInfoTitle:focus,#autoscaleShell #aboutModalOverlay .about-modal-panel:focus {outline:none !important;}

/* QC41: document Close controls match the existing square gray buttons. */
.qc-user-info-close,#autoscaleShell .qc-about-header #aboutModalClose {border-radius:0 !important;border:1px solid #999 !important;background:#e6e6e6 !important;color:#000 !important;font-weight:700 !important;}

/* QC44: explain a delayed message check and allow retry without interrupting work. */
#recentChangesLoading {font:13px/1.3 Arial,sans-serif;color:#52667a;}
body.responsive-touch #autoscaleShell .qc-info-footer .qc-user-info-links #recentChangesLoading,body.responsive-touch #autoscaleShell .qc-info-footer .qc-user-info-links #recentChangesRetry {flex-basis:100%;text-align:center;}
#recentChangesLoading[hidden],#recentChangesRetry[hidden],body.responsive-touch #autoscaleShell .qc-info-footer .qc-user-info-links #recentChangesRetry[hidden] {display:none !important;}

/* QC50: keep the Home Screen title out of the system's top scroll edge.
   An opaque sticky surface also prevents graph/table content showing through.
   This is a layout workaround; native iOS blur still requires device testing. */
@media screen {
  /* Let the document scroll; an auto-overflow body traps sticky positioning. */
  body.responsive-touch.bg-home-screen { overflow:visible; }
  body.responsive-touch.bg-home-screen .excel-page { padding-top:0 !important; }
  body.responsive-touch.bg-home-screen #autoscaleShell .bg-masthead {
    position:sticky;
    top:0;
    z-index:20;
    padding-top:calc(env(safe-area-inset-top, 0px) + 12px);
    padding-bottom:8px;
    background:#eef3f8;
    isolation:isolate;
  }
  body.responsive-touch.bg-home-screen #autoscaleShell .bg-masthead::before {
    content:"";
    position:absolute;
    inset:0 -12px;
    z-index:-1;
    background:#eef3f8;
    pointer-events:none;
  }
}

/* QC54: initial Stored Records layout, matching the approved phone screen. */
body.responsive-touch #clinicalModalRoot .clinical-stored-panel {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 32px minmax(0, 1fr) !important;
  align-content: start;
  column-gap: 0;
}
body.responsive-touch #clinicalModalRoot .clinical-stored-panel .stored-start-title {
  grid-column: 1 / -1;
  font-size: 20px !important;
  font-weight: 700;
  text-align: center;
  padding: 12px 0 !important;
}
body.responsive-touch #clinicalModalRoot .clinical-stored-panel .stored-patient-row { grid-column: 1; grid-row: 2; }
body.responsive-touch #clinicalModalRoot .clinical-stored-panel .stored-team-row { grid-column: 3; grid-row: 2; }
body.responsive-touch #clinicalModalRoot .clinical-stored-panel::before {
  content: 'or'; grid-column: 2; grid-row: 2; align-self: center; justify-self: center;
}
body.responsive-touch #clinicalModalRoot .clinical-stored-panel .stored-row-show-button { display: none !important; }
body.responsive-touch #clinicalModalRoot .clinical-stored-panel .stored-shared-show {
  grid-column: 1 / -1;
  margin-top: 16px;
  min-height: 48px;
  width: 100%;
  background: #607680;
  color: white;
  font-size: 18px;
  font-weight: 700;
}
body.responsive-touch #clinicalModalRoot .clinical-stored-panel .stored-shared-show:disabled { background: #808080; }
body.responsive-touch #clinicalModalRoot .clinical-stored-panel .stored-start-cancel,
body.responsive-touch #clinicalModalRoot .clinical-stored-panel .clinical-team-results,
body.responsive-touch #clinicalModalRoot .clinical-stored-panel .clinical-modal-message { grid-column: 1 / -1; }


/* QC54 alignment correction: center or on the input rectangles. */
body.responsive-touch #clinicalModalRoot .clinical-stored-panel::before {
  align-self: end;
  height: 44px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
}
