:root { --pm-brand:#16834f; --pm-focus:#146c43; --pm-surface:#fff; --pm-ink:#173c2a; }
/* Native dialog contains keyboard focus and closes with Escape. */
.document-preview { width:min(1000px, calc(100vw - 2rem)); max-height:calc(100dvh - 2rem); padding:1rem; border:1px solid var(--pm-brand); border-radius:1rem; color:var(--pm-ink); background:var(--pm-surface); }
.document-preview::backdrop { background:rgba(4,25,17,.7); }
.document-preview-header { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin-bottom:.75rem; }
.document-preview-header h2 { overflow-wrap:anywhere; }
.document-preview-content { height:60dvh; overflow:auto; margin-bottom:1rem; }
.pdf-preview-controls { display:flex; align-items:center; flex-wrap:wrap; gap:.5rem; margin-bottom:.5rem; }
.pdf-preview-controls .form-select { width:auto; max-width:100%; }
.pdf-preview-viewport { overflow:auto; max-height:43dvh; padding:.5rem; background:#dfe5e1; }
.pdf-preview-viewport canvas { display:block; margin:auto; background:#fff; }
.pdf-preview-text { margin-top:.5rem; }
.pdf-preview-text p { overflow-wrap:anywhere; }
.document-preview-content img { display:block; max-width:100%; max-height:100%; margin:auto; object-fit:contain; }
.document-preview footer { display:flex; align-items:center; gap:1rem; background:transparent !important; }
.document-preview button, .document-preview a { min-height:44px; flex-shrink:0; }
html { scroll-padding-top:6rem; scroll-padding-bottom:7rem; }
@media(max-width:575px) { .document-preview footer { flex-direction:column; align-items:stretch; } .document-preview-content { height:50dvh; } }
@media(prefers-reduced-motion:reduce) { html { scroll-behavior:auto !important; } *, *::before, *::after { animation-duration:.01ms !important; transition-duration:.01ms !important; } }
html.dark-mode { --pm-brand:#68d69b; --pm-focus:#a3efc4; --pm-surface:#132c20; --pm-ink:#e7f3eb; }
:focus-visible { outline:3px solid var(--pm-focus); outline-offset:3px; }
.reading-content { max-width:72ch; margin-inline:auto; line-height:1.8; overflow-wrap:anywhere; }
.reading-content p { margin-bottom:1.2em; }
.next-appointment { border-left:4px solid var(--pm-brand)!important; }
.skip-link { position:fixed; top:-10rem; left:1rem; z-index:9999; padding:.8rem; background:var(--pm-surface); color:var(--pm-ink); }
.skip-link:focus { top:1rem; }
.connection-note { color:var(--pm-ink); }
#content .text-muted, #content .form-text, #content .link-secondary { color:#52685b!important; }
html.dark-mode #content .text-muted, html.dark-mode #content .form-text, html.dark-mode #content .link-secondary { color:#b6cbbf!important; }
html.dark-mode #content a:not(.btn):hover { color:#a3efc4!important; }
.page-heading { display:flex; align-items:center; justify-content:space-between; gap:1.5rem; margin-block:3rem 2rem; }
.page-heading p { margin-bottom:0; }
.operation-card { color:var(--pm-ink); text-decoration:none; border:1px solid #d7e8dd; border-radius:1rem; transition:box-shadow .2s; }
.operation-card:hover { color:var(--pm-ink); box-shadow:0 6px 20px #16834f20; }
.operation-list li { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:.5rem; padding:.75rem 0; border-bottom:1px solid #d7e8dd; }
.operation-metrics { display:grid; gap:.6rem; }
.operation-metrics > div { display:flex; justify-content:space-between; gap:1rem; }
.operation-metrics dd { margin:0; font-weight:700; }
.operation-metrics dt { color:var(--pm-ink); font-weight:500; }
.service-status { display:flex; flex-wrap:wrap; align-items:center; gap:.5rem; padding-block:.75rem; border-top:1px solid #d7e8dd; }
.service-status small { width:100%; }
.clinical-provenance, .clinical-addendum { padding:1rem; border-left:3px solid var(--pm-brand); background:#eef7f1; border-radius:.5rem; color:var(--pm-ink); }
.clinical-text { white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.7; }
.timeline-event { border-left:3px solid var(--pm-brand); }
.timeline-event summary { cursor:pointer; color:var(--pm-ink); font-weight:600; padding-block:.5rem; }
.list-pagination { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin-block:1.5rem; }
html.dark-mode .clinical-provenance, html.dark-mode .clinical-addendum { background:#193e2b; }
html.dark-mode .operation-card, html.dark-mode .operation-list li, html.dark-mode .service-status { border-color:#315442; }
html.dark-mode dt { color:#d6eee0!important; }
@media(max-width:767px) {
    .page-heading { flex-direction:column; align-items:flex-start; margin-top:2rem; gap:1rem; }
    .page-heading > .btn { width:100%; }
    .operation-card { padding:1rem; }
    .operation-card .display-6 { font-size:2rem; }
    .operations-page .badge { white-space:normal; text-align:left; }
}
#patient-payment-form { display:flex; flex-direction:column; min-height:0; overflow:hidden; }
#patient-payment-form .modal-footer { flex-shrink:0; }
body.modal-open .mobile-glass-nav, body.modal-open .back-to-top { display:none!important; }
.institutional-hero { background:linear-gradient(140deg, #edf8f1, #f8fbf9 65%); padding-block:2rem; }
.institutional-eyebrow { color:var(--pm-brand); font-size:.82rem; font-weight:700; letter-spacing:.06em; }
.institutional-lead { max-width:58ch; }
.institutional-section { padding-block:5rem; }
.institutional-muted { background:#f1f7f3; }
.institutional-section-heading { max-width:68ch; margin-bottom:2rem; }
.care-journey, .care-feature { background:var(--pm-surface); border:1px solid #d7e8dd; border-radius:1.5rem; padding:2rem; }
.care-icon { width:3.5rem; height:3.5rem; border-radius:1rem; display:inline-flex; align-items:center; justify-content:center; background:#e5f4ea; color:#146c43; font-size:1.7rem; }
.care-steps { display:grid; gap:1.5rem; }
.care-steps li { display:flex; align-items:flex-start; gap:1rem; }
.care-step-number { display:inline-flex; align-items:center; justify-content:center; width:2.5rem; height:2.5rem; flex:0 0 2.5rem; border-radius:50%; background:#e5f4ea; color:#146c43; font-weight:700; font-size:1rem; }
.care-faq { background:var(--pm-surface); padding:1.25rem 1.5rem; border:1px solid #d7e8dd; border-radius:1rem; margin-bottom:.75rem; }
.care-faq summary { cursor:pointer; font-weight:600; color:var(--pm-ink); }
.care-urgent { background:var(--pm-surface); border-left:3px solid var(--pm-brand); border-radius:.5rem; padding:1rem 1.25rem; font-size:.9rem; color:var(--pm-ink); }
.care-cta { display:flex; align-items:center; justify-content:space-between; gap:2rem; border-radius:1.5rem; padding:2.5rem; background:#e5f4ea; }
.institutional-article-image { width:100%; height:13rem; object-fit:cover; }
html.dark-mode .institutional-hero { background:linear-gradient(140deg, #143a27, #10251b 65%); }
html.dark-mode .institutional-muted { background:#0c2017; }
html.dark-mode .care-journey, html.dark-mode .care-feature, html.dark-mode .care-faq { border-color:#315442; }
html.dark-mode .care-cta { background:#193e2b; }
html.dark-mode .care-icon, html.dark-mode .care-step-number { background:#214b34; color:#a3efc4; }
html.dark-mode .form-check, html.dark-mode .form-check-label { color:#d6eee0!important; }
html.dark-mode .text-primary, html.dark-mode .text-success { color:#89e3ad!important; }
html.dark-mode .input-group-text { background:#1d3d2b!important; color:#d6eee0!important; border-color:#42624e!important; }
html.dark-mode input[type=file]::file-selector-button { background:#1d3d2b; color:#d6eee0; }
@media(max-width:767px) {
    .institutional-section { padding-block:3rem; }
    .institutional-hero { padding-block:0; }
    .care-cta { flex-direction:column; align-items:flex-start; padding:1.5rem; }
    .care-cta .btn { width:100%; }
    .care-journey, .care-feature { padding:1.5rem; }
}
.cookie-container { background:var(--pm-surface)!important; color:var(--pm-ink)!important; border-top:1px solid var(--pm-brand); }
.cookie-container .cookie-text { color:var(--pm-ink)!important; }
.cookie-container .btn { color:var(--pm-ink)!important; border-color:var(--pm-brand)!important; }
html.dark-mode input:-webkit-autofill,
html.dark-mode input:-webkit-autofill:focus { -webkit-box-shadow:0 0 0 1000px var(--pm-surface) inset!important; -webkit-text-fill-color:var(--pm-ink)!important; caret-color:var(--pm-ink); }
@media(max-width:991px) {
    body:not(.has-mobile-nav) { padding-bottom:0!important; }
    body.has-mobile-nav { padding-bottom:calc(6rem + env(safe-area-inset-bottom))!important; }
    .mobile-glass-nav { bottom:calc(.75rem + env(safe-area-inset-bottom))!important; }
    .mobile-glass-nav a, .btn, .form-select { min-height:44px; }
    .form-control, .form-select { font-size:1rem; }
    .mobile-glass-nav { background-color:var(--pm-surface)!important; }
    .month-event { min-height:30px; font-size:.75rem!important; }
}
@media(prefers-reduced-motion:reduce) {
    *, *::before, *::after { animation-duration:.01ms!important; transition-duration:.01ms!important; scroll-behavior:auto!important; }
    [data-aos] { opacity:1!important; transform:none!important; }
}
.consultation-shortcuts { display: flex; flex-wrap: wrap; gap: .5rem; }
.consultation-shortcuts a { padding: .65rem .9rem; min-height: 44px; border: 1px solid #b4d8c3; border-radius: 999px; background: #f3faf6; color: #146c43; text-decoration: none; }
.consultation-shortcuts a:focus-visible { outline: 3px solid #198754; outline-offset: 2px; }
#pre-consulta, #medical-record-history, #troca-exames, #consultation-evolution, #clinical-evolution-content { scroll-margin-top: 110px; }
.security-card { max-width: 500px; }
.mfa-secret { overflow-wrap: anywhere; display: block; padding: 1rem; background: #e7f5ed; color: #145f3c; }
.recovery-codes pre { white-space: pre-wrap; color: inherit; }
.clinical-plain-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.consultation-progress-list { list-style: none; padding: 0; display: grid; gap: .75rem; }
.consultation-progress-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem; padding: .75rem; border: 1px solid #bdd9c6; border-radius: .75rem; }
.consultation-progress-list a { font-weight: 600; min-height: 24px; }
.consultation-progress-list span { color: var(--pm-ink); }
.consultation-progress-list a:focus-visible, #clinical-items summary:focus-visible { outline: 3px solid var(--pm-brand); outline-offset: 3px; }
html.dark-mode .consultation-progress-list li { border-color: #4b7c60; }
@media(max-width:767px) { .consultation-progress-list li { flex-direction: column; } .consultation-progress-list a { display: flex; align-items: center; min-height: 44px; } }
#clinical-history { scroll-margin-top: 110px; }
#clinical-items details summary { cursor: pointer; padding-block: .5rem; }
#clinical-items .badge { align-self: flex-start; white-space: normal; }
.measurement-chart { color: #198754; }
.measurement-chart svg { display: block; width: 100%; max-height: 200px; }
.measurement-chart circle { fill: currentColor; }
.session-warning { position: fixed; bottom: 100px; left: 1rem; right: 1rem; z-index: 1090; box-shadow: 0 8px 30px #0003; }
.session-lock-dialog { width: min(92vw, 480px); padding: 2rem; border: 1px solid #8ebea2; border-radius: 1.25rem; background: #fff; color: #183c28; }
.session-lock-dialog::backdrop { background: #0b2118f5; backdrop-filter: blur(14px); }
html.dark-mode .consultation-shortcuts a { background: #183b28; color: #b5f0cc; border-color: #4b7c60; }
html.dark-mode .session-lock-dialog { background: #132c20; color: #e7f3eb; }
html.dark-mode .mfa-secret { background: #0c2116; color: #b5f0cc; }
html.dark-mode .measurement-chart { color: #8ee8b1; }
html.dark-mode .exchange-message small { color: #b6d1c1; }
.async-save-feedback.alert-success { background: #e7f5ed; color: #16543b; border-color: #afd6be; }
.clinical-notice, .async-save-feedback.alert-info { background: #edf7f1; color: #1d4c34; border-color: #bdd9c6; }
html.dark-mode .clinical-notice, html.dark-mode .async-save-feedback.alert-info { background: #193e2b; color: #e7f3eb; border-color: #4b7c60; }
html.dark-mode .async-save-feedback.alert-success { background: #153e2a; color: #d6eee0; border-color: #377958; }
@media (min-width: 992px) and (max-width: 1399.98px) {
    #header:has(#doctorConsultationsMenu) .navbar-nav-wrap { flex-wrap: nowrap; }
    #header:has(#doctorConsultationsMenu) .navbar-collapse { min-width: 0; }
    #header:has(#doctorConsultationsMenu) .nav-link { font-size: .875rem; padding-inline: .55rem; white-space: nowrap; }
    #header:has(#doctorConsultationsMenu) .ms-lg-1 { margin-left: .35rem !important; }
}
@media (min-width: 992px) and (max-width: 1199.98px) {
    #header:has(#doctorConsultationsMenu) .nav-link { font-size: .8125rem; padding-inline: .35rem; }
}
@media (max-width: 991.98px) {
    #navbarNavDropdownNav > .nav-item:has(#doctorNotificationsMenu) { grid-column: 1 / -1; }
}
@media (max-width: 767.98px) {
    .consultation-shortcuts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; }
    .consultation-shortcuts a { text-align: center; font-size: .8rem; padding: .65rem .35rem; border-radius: .7rem; }
    #evolution-template { min-width: 0; width: 100%; }
    #insert-evolution-template { width: 100%; }
    .security-card { padding: 1.25rem !important; }
    .exchange-message { overflow-wrap: anywhere; }
}
/* Archived legal versions retain readable presentation without archiving site navigation. */
.legal-archive .card-header { background: #146c43; }
.legal-archive .clinical-notice { overflow-wrap: anywhere; }
.legal-archive h2 { color: #146c43; }
.dark-mode .legal-archive h2 { color: #9de5be; }
