/* Escala tipográfica y controles legibles sin perder densidad visual. */
:root{--ui-copy:13px;--ui-small:11px;--ui-label:12px}
body{font-size:14px}
.sidebar .brand small,.sidebar .profile-card small,.sidebar .sidebar-plan small{font-size:11px}
.sidebar .nav-item b{font-size:13px;line-height:1.25}.sidebar .nav-label{font-size:10px}.sidebar .nav-item em{font-size:10px}
.topbar .search input,.timezone-button,.primary-button,.secondary-button,.soft-button{font-size:12px}
.page-head p,.welcome-card p{font-size:13px;line-height:1.55}.eyebrow{font-size:10px}
.card-title h3{font-size:15px}.card-title a,.text-link{font-size:12px}
.metric-top,.metric-foot,.activity strong,.activity p,.activity time{font-size:11px;line-height:1.45}
.field,.patient-filterbar .field{font-size:13px}.count-chip{font-size:12px}
.data-table th{font-size:11px;letter-spacing:.035em}.data-table td{font-size:12px;line-height:1.45}.person strong{font-size:13px}.person small{font-size:11px}.badge{font-size:10px}
.modal p{font-size:12px;line-height:1.5}.form-group{gap:7px}.form-group label{font-size:12px;line-height:1.3}.form-group input,.form-group select,.form-group textarea{font-size:13px;min-height:42px}.field-help{font-size:11px;line-height:1.45}
.patient-section-title strong,.patient-detail-card h3{font-size:14px}.patient-section-title small,.patient-summary-card small,.patient-facts small,.detail-list-row small{font-size:11px;line-height:1.45}
.patient-record-tabs button,.patient-admin-tabs button,.payment-tabs button{font-size:12px}
.row-action{font-size:11px;font-weight:700;padding:7px 10px}
.package-badge,.package-ledger-foot button,.whatsapp-reminder-button{font-size:10px}
.agenda-rule-strip span,.agenda-navigation strong,.agenda-editor-form>label,.editor-two label{font-size:11px}.agenda-editor-form input,.agenda-editor-form select,.agenda-editor-form textarea{font-size:12px}
.calendar-item span{font-size:10px}.session-flow-note p,.section-heading p,.payment-origin{font-size:11px}
.toast{font-size:12px}

/* Navegación más estable y recambios de vista sin golpes visuales. */
.main-area{scrollbar-gutter:stable}
.view{min-height:calc(100vh - 96px);animation:none!important}
.view.view-soft-enter{animation:view-soft-enter .22s cubic-bezier(.22,.75,.25,1)!important}
@keyframes view-soft-enter{from{opacity:.72;transform:translateY(3px)}to{opacity:1;transform:none}}

/* Ficha del paciente: escala legible y altura estable entre solapas. */
.patient-detail-head h2{font-size:24px;line-height:1.15}.patient-detail-head p{font-size:12px;line-height:1.45}
.patient-record-tabs button{min-height:44px;padding:13px 12px;transition:color .18s ease,border-color .18s ease,background-color .18s ease}
.patient-record-tabs button:hover{background:#eef4f1}
.patient-record-tabs button:focus-visible{outline:2px solid rgba(23,100,86,.28);outline-offset:-3px;border-radius:6px 6px 0 0}
.patient-section-content{min-height:360px;padding-top:15px;transition:height .24s cubic-bezier(.22,.75,.25,1),opacity .12s ease,transform .18s ease;will-change:height,opacity,transform}
.patient-section-content.is-changing,.patient-section-content.is-entering{opacity:0;transform:translateY(4px)}
.patient-detail-card{line-height:1.45}.patient-detail-card>p{font-size:12px;color:var(--muted)}
.patient-detail-metrics small{font-size:11px;line-height:1.35}.patient-detail-metrics strong{font-size:18px;line-height:1.2}.patient-detail-metrics span{font-size:10px;line-height:1.4}
.patient-facts{gap:16px 28px}.patient-facts dt{font-size:11px;line-height:1.35}.patient-facts dd{min-height:18px;margin-top:4px;font-size:13px;line-height:1.45}
.patient-facts dd:empty::after{content:'—';color:#a7b0ac;font-weight:400}
.detail-appointment strong,.detail-list-row strong{font-size:12px;line-height:1.4}.detail-appointment small,.detail-list-row small{font-size:11px;line-height:1.45}
.detail-date,.clinical-note{font-size:12px!important;line-height:1.55!important}

/* Edición de pacientes: encabezado y acciones fijos; sólo se desplaza el formulario. */
.modal.patient-edit-modal{height:min(88vh,850px);max-height:calc(100dvh - 32px);display:flex;flex-direction:column}
.patient-edit-modal #modalContent{display:flex;flex:1;min-height:0;height:100%}
.patient-edit-shell{display:flex;flex:1;min-height:0;width:100%;flex-direction:column;overflow:hidden;background:#f5f8f6}
.patient-edit-head{flex:none;display:flex;align-items:flex-start;justify-content:space-between;gap:24px;padding:24px 30px;background:#194c43;color:#fff}
.patient-edit-head .eyebrow{color:#a9d7cb}.patient-edit-head h2{margin:5px 0 6px;color:#fff;font-size:25px}.patient-edit-head p{margin:0;color:#d6e7e2;font-size:12px}
.patient-edit-status{margin:8px 34px 0 0;padding:7px 11px;border-radius:999px;background:rgba(255,255,255,.13);font-size:11px;font-weight:700;white-space:nowrap}
.patient-edit-form{display:flex;flex:1;min-height:0;flex-direction:column}
.patient-edit-scroll{flex:1;min-height:0;overflow:auto;padding:18px 26px 24px;scrollbar-width:thin;scrollbar-color:#8aa79f transparent}
.patient-edit-scroll::-webkit-scrollbar{width:8px}.patient-edit-scroll::-webkit-scrollbar-track{background:transparent}.patient-edit-scroll::-webkit-scrollbar-thumb{border:2px solid #f5f8f6;border-radius:99px;background:#8aa79f}
.patient-edit-section{margin-bottom:14px;padding:18px 20px;border:1px solid #dfe7e3;border-radius:13px;background:#fff}
.patient-edit-section-title{display:flex;align-items:center;gap:11px;padding-bottom:13px;border-bottom:1px solid #e7ece9}
.patient-edit-section-title>span{display:grid;place-items:center;width:31px;height:31px;border-radius:8px;background:#e6f1ed;color:#176456;font-size:10px;font-weight:800}
.patient-edit-section-title strong,.patient-edit-section-title small{display:block}.patient-edit-section-title strong{font-size:14px}.patient-edit-section-title small{margin-top:2px;color:var(--muted);font-size:11px}
.patient-edit-section .form-grid{margin-top:15px}.patient-edit-section textarea{min-height:92px}
.patient-edit-actions{flex:none;display:flex;align-items:center;justify-content:space-between;gap:18px;padding:14px 26px;border-top:1px solid #dce5e1;background:#fff;box-shadow:0 -8px 22px rgba(18,51,45,.05)}
.patient-edit-actions>span{color:var(--muted);font-size:11px}.patient-edit-actions>span.error{color:#b4433c;font-weight:650}.patient-edit-actions>div{display:flex;gap:9px}.patient-edit-actions button{min-width:122px}.patient-edit-actions .primary-button{min-width:160px}.patient-edit-actions button:disabled{cursor:wait;opacity:.7}
.patient-edit-section .patient-price-setting{margin-top:2px}.patient-price-copy small{font-size:11px;line-height:1.4}

/* Submódulos reales de pacientes. */
.patient-admin-content{padding-top:16px}.patient-subpage-head{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin-bottom:16px}.patient-subpage-head h2{margin:0 0 5px;font-size:22px;letter-spacing:-.025em}.patient-subpage-head p{margin:0;color:var(--muted);font-size:12px}
.patient-mini-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-bottom:14px}.patient-mini-summary article{display:flex;align-items:center;gap:11px;padding:15px;border:1px solid var(--line);border-radius:11px;background:#fff}.patient-mini-summary article>span{display:grid;place-items:center;width:32px;height:32px;border-radius:9px;background:#e9f3f0;color:#176456;font-weight:800}.patient-mini-summary small,.patient-mini-summary strong{display:block}.patient-mini-summary small{color:var(--muted);font-size:11px}.patient-mini-summary strong{margin-top:2px;font-size:18px}
.patient-subtoolbar{margin-bottom:10px}.patient-subtoolbar .search-field{min-width:320px}.table-subtext{display:block;margin-top:3px;color:var(--muted);font-size:11px;max-width:620px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.channel-pill{display:inline-flex;padding:5px 8px;border-radius:7px;background:#edf3f1;color:#315d55;font-size:10px;font-weight:750}.channel-pill.email{background:#edf2fa;color:#365f91}.channel-pill.whatsapp{background:#e7f6ee;color:#13734f}
.patient-empty{padding:34px;text-align:center;color:var(--muted)}.patient-empty>span{display:grid;place-items:center;width:40px;height:40px;margin:0 auto 9px;border-radius:11px;background:#e8f2ef;color:#176456;font-size:18px}.patient-empty strong{display:block;color:var(--ink);font-size:14px}.patient-empty p{margin:5px 0 14px;font-size:12px}
.patient-contact-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.patient-contact-card{padding:17px}.patient-contact-top{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:10px}.patient-contact-top strong,.patient-contact-top small{display:block}.patient-contact-top strong{font-size:13px}.patient-contact-top small{margin-top:3px;color:var(--muted);font-size:11px}.patient-contact-card dl{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:15px 0}.patient-contact-card dl>div{padding:9px;border-radius:8px;background:#f5f7f6;min-width:0}.patient-contact-card dt{color:var(--muted);font-size:10px}.patient-contact-card dd{margin:3px 0 0;overflow:hidden;text-overflow:ellipsis;font-size:11px}.danger-link{color:#b2443e}.portal-access-callout,.portal-invite-note{display:flex;align-items:flex-start;gap:12px;padding:15px;margin-bottom:14px;border:1px solid #cfe2dc;border-radius:11px;background:#edf6f3}.portal-access-callout>span,.portal-invite-note>span{display:grid;place-items:center;width:31px;height:31px;border-radius:8px;background:#fff;color:#176456}.portal-access-callout strong,.portal-access-callout p,.portal-invite-note strong,.portal-invite-note small{display:block}.portal-access-callout p,.portal-invite-note small{margin:3px 0 0;color:var(--muted);font-size:11px;line-height:1.5}.table-actions{display:flex;justify-content:flex-end;gap:5px;white-space:nowrap}

@media(max-width:760px){
  body{font-size:14px}.modal.patient-edit-modal{height:calc(100dvh - 16px);max-height:none}
  .patient-edit-head{padding:20px 18px}.patient-edit-head h2{font-size:22px}.patient-edit-status{display:none}
  .patient-edit-scroll{padding:12px}.patient-edit-section{padding:15px}.patient-edit-section .form-grid{grid-template-columns:1fr}.patient-edit-section .form-group.full{grid-column:auto}
  .patient-edit-actions{align-items:stretch;flex-direction:column;padding:11px 12px}.patient-edit-actions>span{display:none}.patient-edit-actions>div{display:grid;grid-template-columns:1fr 1.5fr}.patient-edit-actions button,.patient-edit-actions .primary-button{width:100%;min-width:0}
  .patient-admin-tabs{overflow-x:auto}.patient-admin-tabs button{flex:0 0 auto}.patient-subpage-head{align-items:flex-start;flex-direction:column}.patient-subpage-head .primary-button{width:100%}.patient-mini-summary,.patient-contact-grid{grid-template-columns:1fr}.patient-subtoolbar .search-field{min-width:100%}.patient-admin-content .table-card{overflow:auto}.patient-contact-card dl{grid-template-columns:1fr}.table-actions{justify-content:flex-start}
  .view{min-height:calc(100dvh - 72px)}.patient-section-content{min-height:0;padding-top:12px}.patient-detail-body{padding-left:15px;padding-right:15px}.patient-facts{gap:14px}.patient-detail-head h2{font-size:22px}
}

@media(prefers-reduced-motion:reduce){.view.view-soft-enter{animation:none!important}.patient-section-content,.patient-record-tabs button{transition:none!important}}

/* Escala mínima común para todas las áreas autenticadas. */
.app-shell small{font-size:11px!important;line-height:1.45!important}
.app-shell :is(.card,.modal) p{font-size:12px!important;line-height:1.55!important}
.app-shell :is(.form-group,.agenda-editor-form,.editor-two,.email-field) label{font-size:11px!important;line-height:1.35!important}
.app-shell :is(.primary-button,.secondary-button,.soft-button,.row-action,.text-link){font-size:12px!important}
.app-shell :is(.card-title h3,.section-heading h3){font-size:16px!important;line-height:1.3}
.app-shell :is(.automation-row,.reminder-step,.meet-preview,.integration,.block-row,.side-meet,.section-note,.dsm-safety-note,.dsm-recent,.patient-diagnosis,.feature-toggle,.individual-permission-row,.package-history-item,.package-automation-note,.collection-toggle,.collection-channels,.exchange-box,.report-template) strong{font-size:12px!important;line-height:1.4}
.app-shell :is(.channel-chip,.permission,.permission-value,.matrix-legend span,.entity-facts span,.calendar-legend,.agenda-list-repeat,.repeat-end>span,.control-label,.autosave-note,.package-badge,.package-history-stats,.package-mini-stats,.payment-origin,.agenda-origin,.session-subtext,.currency-code,.report-step-head>span,.public-booking-summary span){font-size:10px!important;line-height:1.35}
.app-shell :is(.eyebrow,.data-table th,.month-weekdays span,.week-day small,.all-day-row>span,.time-column span:not(:empty),.agenda-rule-strip span,.timezone-button b){font-size:11px!important}

/* Integraciones y recordatorios: lectura cómoda sin perder densidad. */
.google-brand h3{font-size:16px!important}.google-brand p{font-size:12px!important;line-height:1.5!important}.google-status{font-size:11px!important}
.google-permission strong{font-size:12px!important}.google-permission small{font-size:11px!important}
.automation-card{padding:24px}.automation-row{grid-template-columns:44px 1fr auto;gap:13px;padding:17px 0}.automation-icon{width:39px;height:39px}
.automation-row strong{font-size:12px!important}.automation-row small{font-size:11px!important;line-height:1.5!important}.channel-list{gap:6px;margin-top:7px}.channel-chip{padding:4px 7px;font-size:10px!important}
.reminder-step strong,.meet-preview strong{font-size:12px!important}.reminder-step small,.meet-preview small{font-size:11px!important}
