/* Ajustes de usabilidade: mesma identidade, hierarquia e contraste por função. */
:root { --action: #067572; --action-hover: #075e5c; --accent-grad-a: var(--action); --accent-grad-b: #075e5c; --accent: var(--action); --wa-ink: #13773d; }
.dark { --action: #067572; --action-hover: #075e5c; --wa-ink: #65df91; --accent: var(--link); }
.rp-btn-primary { font-size: 14px; }
.rp-btn-primary:hover { filter: none; background: var(--action-hover); }
.rp-btn-secondary, .rp-input, .rp-select { font-size: 14px; }
.rp-label { font-size: 12px; text-transform: none; letter-spacing: .01em; }
.rp-td-sub, .rp-hint { font-size: 12px; }
.rp-table { font-size: 14px; }
.rp-table th { font-size: 12px; }
.rp-tab, .rp-status { font-size: 12px; }
.rp-patient-link { color: var(--text); text-decoration: none; }
.rp-patient-link:hover { text-decoration: underline; color: var(--link); }
.rp-pessoa-fone a.rp-pessoa-wa, .rp-pessoa-fone button.rp-pessoa-wa, .rp-pessoa-wa.rp-btn-secondary, .rp-lrow .acts button.wa { color: var(--wa-ink); }
.rp-tab.active, .rp-pf-pilula.on, .rp-th-sort--on, .rp-pf-avatar { color: var(--link); }
.rp-seg button.on, .rp-datestrip button.on, .rp-choice input:checked + label, .rp-tab-btn.active, .rp-inbox-badge, .rp-audio-play, .rp-view-toggle a.active, .rp-mini-d.today, .rp-mes-dia.today .rp-mes-n { background: var(--action); }
.rp-item-btn.active-item, .rp-item-btn.active, .rp-drawer .rp-drawer-items a.active { background: var(--action); }
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: 3px solid var(--link); outline-offset: 3px; }
.rp-modal-footer { position: sticky; bottom: 0; background: var(--surface); z-index: 2; border-radius: 0 0 20px 20px; }
.rp-modal-box { scroll-padding: 24px 0 90px; max-height: calc(100dvh - 32px); }
.rp-modal-body input, .rp-modal-body select, .rp-modal-body textarea { scroll-margin: 24px 0 90px; }
.rp-form-intro { margin: 0 0 16px; color: var(--text-sub); font-size: 14px; line-height: 1.5; }
.rp-form-details { border-top: 1px solid var(--border); margin-top: 18px; }
.rp-form-details > summary { cursor: pointer; padding: 14px 0; font-weight: 600; font-size: 14px; color: var(--text); }
.rp-form-details > summary span { display: block; margin: 4px 0 0 16px; font-size: 12px; font-weight: 400; color: var(--text-muted); }
.rp-form-details > .rp-form-grid { padding-bottom: 4px; }
.rp-list-filters > summary { display: none; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--link); }
.rp-list-filters .rp-pf-pilulas { margin-bottom: 10px; }
.rp-mobile-alert, .rp-funnel-select, .rp-action-label { display: none; }
.rp-cash-empty { padding: 36px 18px; }
.rp-cash-empty span { color: var(--text-muted); font-size: 14px; }
.rp-pessoa-steps { font-size: 12px; text-transform: none; letter-spacing: 0; }
.rp-pessoa-steps > span:not(.cur) { display: none; }
.rp-pessoa-steps > span.cur { border: 0; padding-left: 0; margin-left: 0; }
@container pessoa (width < 640px) {
  .rp-pessoa-cab { position: static; }
  .rp-pessoa-nome { font-size: 21px; }
  .rp-pessoa-numeros { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; }
  .rp-pessoa-num { min-width: 0; white-space: normal; }
  .rp-pessoa-v, .rp-pessoa-s { overflow-wrap: anywhere; }
  .rp-pessoa-visoes { display: flex; flex-wrap: wrap; gap: 4px; overflow: visible; }
  .rp-pessoa-visoes a { min-height: 44px; padding: 10px 12px; font-size: 13px; }
}
@media (max-width: 760px) {
  .rp-agenda-layout.rail-off.panel { grid-template-columns: minmax(0, 1fr); }
  .rp-lrow { grid-template-columns: 48px minmax(0, 1fr); gap: 6px 10px; padding: 14px 12px; }
  .rp-lrow .nm, .rp-lrow .nm a, .rp-lrow .pr { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
  .rp-lrow .nm { font-size: 15px; align-items: baseline; }
  .rp-lrow .side { grid-column: 2; justify-content: space-between; flex-wrap: wrap; }
  .rp-lrow .acts button { width: 44px; height: 44px; }
}
@media (max-width: 640px) {
  .rp-input, .rp-select, .rp-pf-qinput, textarea { font-size: 16px; }
  .rp-btn-primary, .rp-btn-secondary, .rp-action-btn, .rp-modal-close { min-height: 44px; }
  .rp-action-btn, .rp-modal-close { min-width: 44px; }
  .rp-section-header { gap: 12px; margin-bottom: 14px; }
  .rp-pf-barra { gap: 8px; }
  .rp-pf-abas { flex-wrap: nowrap; overflow-x: auto; margin-bottom: 10px; }
  .rp-pf-abas .rp-tab { flex: none; min-height: 40px; }
  .rp-list-filters { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
  .rp-list-filters > summary { display: list-item; margin-left: 28px; padding: 12px 10px 12px 0; }
  .rp-list-filters[open] > .rp-pf-pilulas, .rp-list-filters[open] > .rp-pf-ferramentas { margin: 0; padding: 8px 12px 12px; }
  .rp-list-filters .rp-pf-ferramentas { align-items: stretch; }
  .rp-list-filters .rp-pf-ferramentas .rp-select-auto { width: 100%; }
  #pf-compacto, [data-lt-compacto] { display: none; }
  .rp-records-card { overflow: visible; border: 0; background: none; box-shadow: none; }
  .rp-records-table, .rp-records-table tbody { display: block; width: 100%; min-width: 0; }
  .rp-records-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .rp-records-table tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: 14px; margin-bottom: 12px; padding: 14px; background: var(--surface); }
  .rp-records-table tbody td { display: block; min-width: 0; border: 0; padding: 8px 0; white-space: normal; overflow-wrap: anywhere; }
  .rp-records-table td.rp-record-identity, .rp-records-table .rp-td-actions, .rp-records-table td[colspan], .rp-records-table td[data-label="Alertas"] { grid-column: 1 / -1; }
  .rp-records-table td.rp-record-identity { padding-top: 0; }
  .rp-records-table td[data-label]::before { content: attr(data-label); display: block; color: var(--text-muted); font-size: 12px; margin-bottom: 4px; }
  .rp-records-table .rp-td-name { font-size: 16px; white-space: normal; }
  .rp-records-table .rp-td-sub { white-space: normal; }
  .rp-records-table td.rp-no-alerts { display: none; }
  .rp-record-select { grid-column: 1 / -1; }
  .rp-record-select label { display: flex; align-items: center; gap: 10px; min-height: 44px; }
  .rp-record-select input { width: 20px; height: 20px; }
  .rp-records-table .rp-record-identity + td { padding-left: 0; }
  .rp-mobile-alert { display: inline; font-size: 13px; }
  .rp-records-table .rp-action-row { justify-content: flex-end; gap: 8px; border-top: 1px solid var(--border); padding-top: 10px; }
  .rp-records-table .rp-action-btn { width: auto; min-width: 64px; height: auto; min-height: 52px; padding: 7px 8px; flex-direction: column; gap: 5px; }
  .rp-records-table .rp-action-label { display: block; font-size: 12px; }
  .rp-funnel-tabs { display: none; }
  .rp-funnel-select { display: block; font-size: 12px; color: var(--text-sub); margin-bottom: 12px; }
  .rp-funnel-select select { margin-top: 4px; }
  .rp-kb-board { flex-direction: column; overflow: visible; }
  .rp-kb-col { flex: none; width: 100%; min-width: 0; max-width: none; }
  .rp-kb-name { font-size: 16px; white-space: normal; overflow-wrap: anywhere; }
  .rp-modal-overlay { padding: 8px; }
  .rp-modal-body { padding: 16px; }
  .rp-modal-header { padding: 16px 16px 0; }
  .rp-modal-footer { padding: 12px 16px; }
  #form-paciente .rp-form-grid { grid-template-columns: 1fr; }
  #form-paciente .rp-form-grid > .rp-field { grid-column: 1 / -1 !important; }
}
@media (prefers-reduced-motion: reduce) {
  .rp-modal-overlay, .rp-btn-primary, .rp-btn-secondary { transition: none; }
}

.rp-setup-help { margin: 0 0 16px; border: 1px solid var(--border); border-radius: 12px; padding: 0 16px; background: var(--surface); }
.rp-setup-help p { font-size: 14px; color: var(--text-sub); margin-bottom: 12px; }
.rp-setup-links { display: flex; flex-wrap: wrap; gap: 8px 16px; padding-bottom: 16px; }
.rp-setup-links a { color: var(--link); min-height: 44px; display: inline-flex; align-items: center; text-decoration: underline; font-size: 14px; }
