[hidden]{display:none!important}
:focus-visible{outline:3px solid #2563eb;outline-offset:3px}
.data-actions{display:flex;gap:8px;flex-wrap:wrap}.data-actions button{flex:1;min-width:125px}
.storage-warning{padding:12px;background:#fff4c2;color:#553b00;position:relative;z-index:150}
.share-url{overflow-wrap:anywhere}
.print-view{position:fixed;inset:0;width:100%;max-width:none;height:100%;max-height:none;margin:0;padding:0;border:0;background:#eef1f6;color:#111;overflow:auto}
.print-view::backdrop{background:#eef1f6}
.print-controls{position:sticky;top:0;display:flex;gap:12px;justify-content:center;padding:12px;background:white;border-bottom:1px solid #ddd;z-index:2}
.print-controls button{padding:12px;border:1px solid #d4dbe5;border-radius:10px;background:#fff;color:#1e3a8a;font-size:14px;cursor:pointer}
.print-controls button:last-child{background:#1e3a8a;color:white}
.print-sheet{max-width:900px;margin:20px auto;background:white;padding:24px;font:14px/1.45 system-ui,sans-serif;overflow-wrap:anywhere}
.print-sheet h1{font-size:22px;margin:0 0 8px}.print-sheet h3{font-size:15px;margin:0 0 8px}.print-sheet .muted{font-size:12px;color:#536174}.print-sheet .box{border:1px solid #d9dfe6;border-radius:12px;padding:12px;margin:12px 0}.print-sheet .row{display:flex;gap:12px;justify-content:space-between}.print-sheet ul{padding-left:20px}.print-sheet .chip{font-size:11px;font-weight:700;border-radius:12px;padding:5px 8px;display:inline-flex}.print-sheet .ok{color:#1f7a5c;background:#e8f5ef}.print-sheet .todo{color:#8a5b00;background:#fff6d8}.print-sheet .med{color:#9a1f1f;background:#ffe5e5}
@media(max-width:640px){input,select{font-size:16px!important}.topRow{flex-wrap:wrap}.topRow>div:last-child{justify-content:flex-start!important}.top{position:relative!important}.tabs{position:static!important}.row.two,.row.three{grid-template-columns:1fr!important}.bottom{padding-bottom:env(safe-area-inset-bottom,0px)}.content{padding-bottom:230px!important}.print-sheet{margin:0;padding:12px}.print-sheet .row,.print-sheet .pro3{flex-direction:column!important}.print-controls{gap:6px}.print-controls button{font-size:13px}}
/* Read the patient action plan comfortably on a phone; keep the A4 layout for printing. */
@media screen and (max-width:640px){
  .print-sheet .patientPdfGrid,.print-sheet .priorities3{grid-template-columns:minmax(0,1fr);gap:12px}
  .print-sheet .patientPdfGrid>*{min-width:0;box-sizing:border-box}
  .print-sheet .patientPdfCard{min-height:0;padding:14px}
  .print-sheet .patientPdfCard h3{font-size:1rem;line-height:1.4}
  .print-sheet .shieldRow{flex-direction:column;align-items:stretch;gap:12px}
  .print-sheet .shieldRow>canvas{align-self:center}
  .print-sheet #pdfPatientRadar{display:block;width:100%!important;max-width:320px;height:auto!important;flex:none;margin:4px auto 8px}
  .print-sheet .patientMini{width:100%;min-width:0;font-size:1rem;line-height:1.5}
  .print-sheet .shieldRow .patientMini>div{margin:0;padding:8px 0;border-bottom:1px solid #e5eaf1}
  .print-sheet .shieldRow .patientMini>div:last-child{border-bottom:0}
  .print-sheet .priorityBox{padding:14px;font-size:1rem;line-height:1.5}
  .print-sheet .priorityBox b{font-size:1rem}
  .print-sheet .patientPdfHeader{flex-wrap:wrap;gap:12px}
  .print-sheet .muted,.print-sheet .chip{font-size:.875rem;line-height:1.5}
}
@page{size:A4;margin:12mm}
/* Apply paper colors only when printing; allow the browser to remove dark-mode backgrounds. */
@media print{
  :root,body.printing,#printView,.print-sheet{color-scheme:only light;background:#fff!important;color:#111!important}
  body.printing{display:block!important;padding:0!important}
  body.printing> :not(#printView){display:none!important}
  #printView{position:static!important;display:block!important;height:auto!important;overflow:visible!important}
  #printView .print-controls{display:none!important}
  .print-sheet{max-width:none;margin:0;padding:0;font-size:10pt}
  .print-sheet .box{break-inside:avoid}
  .print-sheet h3{break-after:avoid}
  .print-sheet .row,.print-sheet .pro3{flex-direction:row!important}
  *{-webkit-print-color-adjust:economy!important;print-color-adjust:economy!important}
}
/* Optional three-action follow-up within the existing summary. */
.followup-title{display:flex;align-items:baseline;justify-content:space-between;gap:8px;flex-wrap:wrap}.followup-title h3{margin:4px 0}.followup-card{border:1px solid #dce3ee;border-radius:14px;padding:14px;margin-top:12px;background:#fff}.followup-heading{display:flex;align-items:center;gap:9px;flex-wrap:wrap;font-size:14px}.followup-number{display:inline-grid;place-items:center;width:26px;height:26px;border-radius:50%;background:#eaf0fd;color:#1e3a8a;font-weight:800}.followup-priority{font-size:11px;border-radius:12px;padding:4px 7px;background:#fff0e8;color:#873414}.followup-card p{font-size:14px;line-height:1.5;margin:10px 0}.followup-controls{display:flex;flex-wrap:wrap;gap:12px}.followup-controls>label{display:flex;flex-direction:column;gap:5px;flex:1 1 170px;margin:0}.followup-controls select,.followup-controls input{min-height:44px;min-width:0;width:100%}.followup-controls label[hidden]{display:none!important}.followup-details{margin-top:16px}.followup-details summary{padding:3px 0}.followup-alert{padding:12px;background:#fff4dd;border-radius:10px;line-height:1.4}
/* Copy feedback remains inside the share dialog, including on narrow screens. */
.copy-feedback { margin-top:12px; overflow-wrap:anywhere; }
.copy-status { font-size:14px; line-height:1.4; margin:0 0 8px; }
.copy-manual-value { display:block; box-sizing:border-box; width:100%; max-width:100%; min-height:44px; padding:10px; font:16px/1.4 system-ui,sans-serif; border:1px solid #667085; border-radius:10px; color:#111; background:#fff; resize:vertical; }
.copy-feedback .btn { margin-top:8px; width:100%; }
