/* Prescrição médica infantil — layout mensal A4 */
.pprx-workspace .section-head h2 {
  margin-bottom: 0.25rem;
}

.pprx-home-toolbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 180px)) 1fr auto auto;
  gap: 0.85rem;
  align-items: end;
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid var(--border-subtle, #d8dee8);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
}

.pprx-home-toolbar label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
}

.pprx-import-label {
  cursor: pointer;
}

.pprx-import-btn {
  display: inline-block;
  padding: 0.78rem 1rem;
  border-radius: 14px;
}

.pprx-import-target {
  margin: 0.35rem 0 0.75rem;
}

.profile-subnav-slot .pprx-inner-tabs {
  display: flex;
  gap: 8px;
  padding: 4px 0 2px;
}

.pprx-inner-tab {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
  color: var(--text);
  font: inherit;
  cursor: default;
}

.pprx-inner-tab span {
  font-weight: 700;
  line-height: 1.2;
}

.pprx-inner-tab small {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.2;
}

.pprx-inner-tab.is-active {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 22%, transparent);
}

.pprx-home-toolbar .secondary,
.pprx-home-toolbar .primary,
.pprx-view-actions .secondary,
.pprx-view-actions .primary,
.pprx-card__actions .secondary,
.pprx-card__actions .primary {
  min-height: 46px;
  border-radius: 14px;
  font-weight: 800;
}

@media (max-width: 980px) {
  .pprx-home-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .pprx-home-toolbar {
    grid-template-columns: 1fr;
  }
}

.pprx-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

@media (max-width: 960px) {
  .pprx-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .pprx-cards-grid {
    grid-template-columns: 1fr;
  }
}

.pprx-institution-head {
  text-align: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border, #d8dee8);
}

.pprx-institution-head h2 {
  text-transform: uppercase;
}

.pprx-institution-head h2 {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: 0.04em;
}

.pprx-card__title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.pprx-card__title-row h3 {
  margin: 0;
  flex: 1;
}

.pprx-badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  white-space: nowrap;
}

.pprx-badge--active {
  background: #e6f4ea;
  color: #137333;
  border: 1px solid #b7dfc0;
}

.pprx-badge--expired {
  background: #fce8e6;
  color: #c5221f;
  border: 1px solid #f5c6c4;
}

.pprx-badge--pending {
  background: #fef7e0;
  color: #b06000;
  border: 1px solid #f0d4a8;
}

.pprx-badge--archived {
  background: #eef2f7;
  color: #5f6368;
  border: 1px solid #d8dee8;
}

.pprx-alert--abx {
  background: #e8f0fe;
  color: #1967d2;
  border-color: #aecbfa;
}

.pprx-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pprx-view-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pprx-block {
  margin-bottom: 0.75rem;
  padding: 0.35rem;
  border-radius: 6px;
}

.pprx-block--controlled {
  background: #fffbeb;
}

.pprx-block--antibiotic {
  background: #eff6ff;
}

.pprx-block--free {
  background: #fff;
}

.pprx-block-title {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pprx-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.pprx-history-table th,
.pprx-history-table td {
  border: 1px solid var(--border, #d8dee8);
  padding: 0.5rem 0.65rem;
  text-align: left;
}

.pprx-history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.pprx-upload-inline {
  cursor: pointer;
}

.pprx-edit-panel {
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid var(--border, #d8dee8);
  border-radius: 10px;
  background: var(--surface-alt, #f8fafc);
}

.pprx-edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin: 0.75rem 0;
}

.pprx-med-actions,
.pprx-edit-med-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.pprx-edit-med-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.65rem;
  margin: 0 0 0.85rem;
  padding: 0.85rem;
  border: 1px solid var(--border, #d8dee8);
  border-radius: 10px;
  background: color-mix(in srgb, var(--primary) 6%, var(--surface, #fff));
}

.pprx-edit-med-form h4 {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
}

.pprx-edit-med-actions {
  grid-column: 1 / -1;
}

.pprx-edit-med-reason {
  grid-column: 1 / -1;
}

.pprx-edit-med-reason textarea {
  min-height: 72px;
  resize: vertical;
}

.pprx-edit-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
}

.pprx-import-list {
  margin: 0.75rem 0 1rem;
  padding-left: 1.2rem;
  max-height: 280px;
  overflow: auto;
}

.pprx-meta-name {
  min-width: 8rem;
}

.pprx-meta-table th {
  width: auto;
  font-size: 0.78rem;
  padding: 0.2rem 0.35rem;
}

.pprx-meta-table td {
  font-size: 0.82rem;
  padding: 0.2rem 0.35rem;
}

.pprx-month-grid .pprx-med-name {
  width: 35%;
}

.pprx-month-grid .pprx-med-dose {
  width: 8%;
}

.pprx-month-grid .pprx-med-hour {
  width: 7%;
}

.pprx-day {
  width: 1.6%;
}

.pprx-admin-cell {
  font-size: 7px;
}

.pprx-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0.35rem 0 0.5rem;
  font-size: 0.82rem;
  color: var(--muted, #667085);
}

.pprx-legend span {
  padding: 0.15rem 0.45rem;
  border: 1px solid var(--border, #d8dee8);
  border-radius: 6px;
}

.pprx-card {
  border: 1px solid var(--border, #d8dee8);
  border-radius: 18px;
  padding: 1rem;
  background: var(--surface, #fff);
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.08);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.pprx-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--primary, #14b8a6) 45%, var(--border, #d8dee8));
  box-shadow: 0 22px 56px rgba(15, 23, 42, 0.12);
}

.pprx-card__head h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.pprx-card__meta {
  margin: 0;
  color: var(--muted, #667085);
  font-size: 0.88rem;
}

.pprx-card__alerts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.75rem 0;
}

.pprx-alert {
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: #fff4e5;
  color: #9a6700;
  border: 1px solid #f0d4a8;
}

.pprx-view-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.pprx-history {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border, #d8dee8);
}

.pprx-med-manager {
  margin: 0 0 1rem;
  padding: 1rem;
  border: 1px solid var(--border, #d8dee8);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
}

.pprx-subhead {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.pprx-subhead h3 {
  margin: 0 0 0.2rem;
}

.pprx-med-table-wrap {
  overflow-x: auto;
  margin-bottom: 0.9rem;
}

.pprx-med-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

.pprx-bulk-actions {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  min-width: 380px;
  padding: 0.45rem;
  border: 1px solid color-mix(in srgb, var(--primary, #059669) 22%, var(--border, #d8dee8));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface, #fff) 92%, var(--primary, #059669) 8%);
}

.pprx-select-all {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 38px;
  padding: 0 0.45rem;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text, #0f172a);
  white-space: nowrap;
  cursor: pointer;
}

.pprx-select-all input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: var(--primary, #059669);
}

.pprx-bulk-actions [data-pprx-delete-selected] {
  flex: 0 0 auto;
  width: auto;
  min-height: 38px;
  padding-inline: 0.9rem;
  border-radius: 8px;
  background: var(--surface, #fff);
}

.pprx-select-col {
  width: 42px;
  text-align: center;
}

.pprx-select-col input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary, #059669);
}

.pprx-med-table th,
.pprx-med-table td {
  padding: 0.65rem 0.7rem;
  border-bottom: 1px solid var(--border, #d8dee8);
  text-align: left;
  vertical-align: top;
}

.pprx-med-table td span {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  color: var(--muted, #667085);
}

.pprx-add-med-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: end;
}

.pprx-add-med-form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.pprx-add-med-form button {
  min-height: 46px;
}

.pprx-book-panel {
  border: 1px solid var(--border, #d8dee8);
  border-radius: 18px;
  overflow: auto;
  background: #fff;
  padding: 0.85rem;
}

@media (max-width: 900px) {
  .pprx-subhead {
    flex-direction: column;
  }

  .pprx-bulk-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 760px) {
  .pprx-add-med-form {
    grid-template-columns: 1fr;
  }
}

.pprx-upload input[type="file"] {
  margin-top: 0.35rem;
}

.pprx-attachment-cards {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.8rem;
}

.pprx-attachment-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.8rem;
  border: 1px solid color-mix(in srgb, var(--primary, #0f766e) 24%, var(--border, #d8dee8));
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface, #fff) 88%, var(--primary, #0f766e) 12%);
}

.pprx-attachment-card strong,
.pprx-attachment-card span {
  display: block;
}

.pprx-attachment-card span {
  margin-top: 0.15rem;
  color: var(--muted, #667085);
  font-size: 0.84rem;
}

.pprx-attachment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.pprx-attachment-actions a {
  text-decoration: none;
}

@media (max-width: 560px) {
  .pprx-attachment-card {
    align-items: stretch;
    flex-direction: column;
  }

  .pprx-attachment-actions a {
    flex: 1 1 auto;
    text-align: center;
  }
}

.pprx-sheet {
  background: #fff;
  color: #000;
  padding: 0.5rem 0 1.5rem;
}

.pprx-sheet-head {
  text-align: center;
  margin-bottom: 0.75rem;
}

.pprx-print-logo {
  display: block;
  width: 118px;
  height: auto;
  object-fit: contain;
  margin: 0 auto 0.25rem;
}

.pprx-sheet-head h1 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  font-weight: 700;
}

.pprx-sheet-head h2 {
  margin: 0.15rem 0;
  font-size: 1rem;
  font-weight: 700;
}

.pprx-sheet-period {
  margin: 0.25rem 0 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.pprx-meta-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.pprx-meta-table th,
.pprx-meta-table td {
  border: 1px solid #000;
  padding: 0.25rem 0.4rem;
  text-align: left;
  vertical-align: top;
}

.pprx-meta-table th {
  width: 72px;
  white-space: nowrap;
  font-weight: 700;
}

.pprx-section {
  margin-top: 0.5rem;
}

.pprx-section-title {
  margin: 0.35rem 0;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.pprx-month-grid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.62rem;
  margin-bottom: 0.75rem;
}

.pprx-col-med {
  width: 20%;
}

.pprx-col-dose {
  width: 9%;
}

.pprx-col-hour {
  width: 5%;
}

.pprx-col-day {
  width: calc(66% / var(--pprx-day-count, 31));
}

.pprx-month-grid th,
.pprx-month-grid td {
  border: 1px solid #000;
  padding: 0.12rem 0.08rem;
  text-align: center;
  vertical-align: middle;
  word-break: break-word;
}

.pprx-month-grid thead tr:first-child th {
  font-size: 0.68rem;
  font-weight: 700;
}

.pprx-month-grid .pprx-med-name {
  width: 20%;
  text-align: left;
  font-size: 0.62rem;
  padding: 0.2rem 0.25rem;
}

.pprx-month-grid .pprx-med-dose {
  width: 9%;
  text-align: left;
  font-size: 0.6rem;
}

.pprx-month-grid .pprx-med-hour {
  width: 5%;
  text-align: left;
  font-size: 0.6rem;
}

.pprx-day-row th {
  font-size: 0.55rem;
  padding: 0.08rem 0;
}

.pprx-day {
  width: 1.6%;
}

.pprx-med-name small {
  display: block;
  margin-top: 0.15rem;
  font-weight: 400;
  font-size: 0.55rem;
}

.pprx-med-row--blank .pprx-med-name,
.pprx-med-row--blank .pprx-med-dose,
.pprx-med-row--blank .pprx-med-hour {
  height: 34px;
  background: #fff;
}

.pprx-cat {
  display: none;
}

.pprx-admin-cell {
  cursor: pointer;
  height: 1rem;
}

.pprx-med-row--controlled {
  background: #fff7d6;
}

.pprx-med-row--antibiotic {
  background: #eaf3ff;
}

.pprx-med-row--non_controlled {
  background: #fff;
}

.pprx-mark-box {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  border: 1px solid #000;
  vertical-align: middle;
}

.pprx-admin-cell.is-marked .pprx-mark-box {
  background: #000;
  color: #fff;
}

.pprx-admin-cell.is-x .pprx-mark-box {
  background: #fff;
  color: #000;
  font-weight: 800;
}

.pprx-empty {
  font-size: 0.9rem;
  color: var(--muted, #667085);
}

.visually-hidden-screen {
  position: absolute;
  left: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Formulário hospitalar — blueprint de impressão */
.pprx-hosp-print {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 8.6pt;
  color: #000;
  background: #fff;
  width: 100%;
  line-height: 1.1;
  margin: 0;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
}

.pprx-hosp-print table {
  border-collapse: collapse;
  width: 100%;
  table-layout: fixed;
  border-spacing: 0;
}

.pprx-hosp-print th,
.pprx-hosp-print td {
  border: 1px solid #000;
  padding: 1px 2px;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
  background: #fff;
  color: #000;
}

.pprx-hosp-header {
  margin: 0;
}

.pprx-hosp-header-line {
  text-align: center;
  font-weight: 700;
  font-size: 9.5pt;
  padding: 1px 2px !important;
  text-transform: uppercase;
  vertical-align: middle;
}

.pprx-hosp-meta-row td {
  font-size: 8pt;
  padding: 1px 3px !important;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pprx-hosp-meta-cell--name {
  width: 42%;
}

.pprx-hosp-meta-cell--allergy {
  width: 26%;
}

.pprx-hosp-meta-cell--weight {
  width: 16%;
}

.pprx-hosp-meta-cell--dn {
  width: 16%;
}

.pprx-hosp-allergy {
  color: #c00;
  font-weight: 700;
}

.pprx-hosp-grid {
  margin: 0;
  font-size: 7.8pt;
  height: 140mm;
}

.pprx-hosp-colgroup-med {
  width: 18%;
}

.pprx-hosp-colgroup-dose {
  width: 8%;
}

.pprx-hosp-colgroup-hour {
  width: 4%;
}

.pprx-hosp-colgroup-day {
  width: calc(70% / var(--pprx-day-count, 31));
}

.pprx-hosp-col-med {
  width: 18%;
  text-align: left;
  font-weight: 700;
  font-size: 7.8pt;
  vertical-align: middle;
}

.pprx-hosp-col-dose {
  width: 8%;
  text-align: center;
  font-weight: 700;
  font-size: 7.8pt;
  vertical-align: middle;
}

.pprx-hosp-col-hour {
  width: 4%;
  text-align: center;
  font-weight: 700;
  font-size: 7.8pt;
  vertical-align: middle;
}

.pprx-hosp-day {
  width: calc(70% / var(--pprx-day-count, 31));
  min-width: 0;
  font-size: 6.6pt;
  text-align: center;
  font-weight: 700;
  padding: 0 1px !important;
  vertical-align: middle;
  white-space: nowrap;
  line-height: 1;
}

.pprx-hosp-dose {
  text-align: center;
  vertical-align: top;
  font-size: 7.2pt;
  padding: 2px 2px 1px !important;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: normal;
  line-height: 1.15;
  overflow: hidden;
}

.pprx-hosp-dose-text {
  display: block;
  max-width: 100%;
  margin: 0 auto;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: normal;
  hyphens: manual;
  line-height: 1.15;
  overflow: hidden;
}

.pprx-hosp-med {
  vertical-align: top;
  text-align: left;
  padding: 2px 2px 1px !important;
}

.pprx-hosp-med > div:first-child {
  margin-top: 0;
}

.pprx-hosp-med-line {
  font-size: 7.8pt;
  line-height: 1.08;
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.pprx-hosp-hour {
  text-align: center;
  vertical-align: top;
  font-size: 7.6pt;
  padding: 2px 1px 1px !important;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.pprx-hosp-day-cell {
  padding: 0 !important;
  height: auto;
  min-height: 0;
  vertical-align: middle;
}

.pprx-hosp-med-row td {
  background: #fff !important;
}

.pprx-hosp-grid tbody tr {
  height: calc(140mm / var(--pprx-row-count, 1));
}

@media print {
  @page pprx {
    size: A4 landscape;
    margin: 4mm;
  }

  html.print-portrait @page pprx {
    size: A4 portrait;
    margin: 4mm;
  }

  html.print-landscape @page pprx {
    size: A4 landscape;
    margin: 4mm;
  }

  html,
  body {
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
    background: #fff !important;
  }

  body.pprx-print-mode > *:not(#pprx-print-host) {
    display: none !important;
  }

  body.pprx-print-mode * {
    visibility: hidden !important;
  }

  body.pprx-print-mode #pprx-print-host,
  body.pprx-print-mode #pprx-print-host *,
  body.pprx-print-mode .pprx-print-host,
  body.pprx-print-mode .pprx-print-host * {
    visibility: visible !important;
  }

  body.pprx-print-mode .print-only,
  body.pprx-print-mode .official-gov-letterhead {
    display: block !important;
  }

  body.pprx-print-mode #pprx-print-host,
  body.pprx-print-mode .pprx-print-host,
  body.pprx-print-mode .pprx-print-host.visually-hidden-screen {
    position: static !important;
    left: auto !important;
    top: auto !important;
    width: calc(297mm - 8mm) !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    clip: auto !important;
    clip-path: none !important;
    -webkit-clip-path: none !important;
    padding: 0 !important;
    margin: 0 auto !important;
    display: block !important;
    border: 0 !important;
    box-sizing: border-box !important;
  }

  html.print-portrait body.pprx-print-mode #pprx-print-host,
  html.print-portrait body.pprx-print-mode .pprx-print-host,
  html.print-portrait body.pprx-print-mode .pprx-print-host.visually-hidden-screen {
    width: calc(210mm - 8mm) !important;
  }

  @page pprx {
    size: A4 landscape;
    margin: 4mm;
  }

  html.print-portrait .pprx-hosp-print .pprx-hosp-col-med {
    width: 18% !important;
  }

  html.print-portrait .pprx-hosp-print .pprx-hosp-col-dose {
    width: 10% !important;
  }

  html.print-portrait .pprx-hosp-print .pprx-hosp-col-hour {
    width: 4% !important;
  }

  html.print-portrait .pprx-hosp-print .pprx-hosp-day {
    width: calc(68% / var(--pprx-day-count, 31)) !important;
    font-size: 5pt !important;
  }

  html.print-portrait .pprx-hosp-print .pprx-hosp-dose-text {
    font-size: 5.5pt !important;
  }

  html.print-landscape .pprx-hosp-print .pprx-hosp-day {
    font-size: 6.6pt !important;
  }

  .pprx-print-root.pprx-hosp-print {
    page: pprx;
    width: 100% !important;
    max-width: none !important;
    margin: 0 auto !important;
    padding: 0 !important;
    background: #fff !important;
    color: #000 !important;
    box-sizing: border-box !important;
    break-after: page;
    page-break-after: always;
    font-family: Arial, Helvetica, sans-serif !important;
  }

  .pprx-print-root.pprx-hosp-print .official-gov-letterhead {
    width: 100% !important;
    margin: 0 0 1.5mm !important;
    padding: 0 !important;
    font-family: Arial, Helvetica, sans-serif !important;
  }

  .pprx-print-root.pprx-hosp-print .official-gov-logo {
    display: block !important;
    width: 26mm !important;
    height: 13mm !important;
    margin: 0 auto 1mm !important;
    object-fit: contain !important;
  }

  .pprx-print-root.pprx-hosp-print .official-print-child-id__line {
    margin: 0 0 0.55mm !important;
    font-size: 7.7pt !important;
    line-height: 1.08 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
  }

  .pprx-print-root.pprx-hosp-print:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  .pprx-hosp-print .pprx-hosp-header,
  .pprx-hosp-print .pprx-hosp-grid {
    width: 100% !important;
    max-width: none !important;
  }

  .pprx-hosp-print .pprx-hosp-grid {
    height: 140mm !important;
  }

  .pprx-hosp-print th,
  .pprx-hosp-print td {
    border: 1px solid #000 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .pprx-hosp-print .pprx-hosp-allergy {
    color: #c00 !important;
    font-weight: 700 !important;
  }

  .pprx-hosp-print .pprx-hosp-day-cell {
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
  }

  .pprx-hosp-print .pprx-hosp-med,
  .pprx-hosp-print .pprx-hosp-dose,
  .pprx-hosp-print .pprx-hosp-hour {
    vertical-align: top !important;
    padding-top: 2px !important;
  }

  .pprx-hosp-print .pprx-hosp-dose-text,
  .pprx-hosp-print .pprx-hosp-med-line {
    margin-top: 0 !important;
  }

  .pprx-hosp-print .pprx-hosp-grid tbody tr {
    height: calc(140mm / var(--pprx-row-count, 1)) !important;
  }

  .pprx-hosp-print tr {
    page-break-inside: avoid;
  }

  .pprx-hosp-print thead {
    display: table-header-group;
  }
}

[data-theme="dark"] .pprx-card {
  background: var(--surface, #1f2937);
  color: var(--text, #f3f4f6);
}

[data-theme="dark"] .pprx-sheet {
  background: #fff;
  color: #000;
}

[data-theme="dark"] .pprx-meta-table th,
[data-theme="dark"] .pprx-meta-table td,
[data-theme="dark"] .pprx-month-grid th,
[data-theme="dark"] .pprx-month-grid td {
  border-color: #000;
}
