/* --pm-* tokens live in tokens.css. */
/* 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:rgb(20 27 45 / .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:var(--pm-surface-2); }
.pdf-preview-viewport canvas { display:block; margin:auto; background:var(--pm-surface); }
.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; } }
/* Focus (visual foundation, UX-B, docs/VISUAL-SYSTEM.md): a 2 px pen-blue ring, 2 px away, on everything that takes focus,
   as in the approved prototypes (it was 3 px and 3 px away since 05/11). */
:focus-visible { outline:2px solid var(--pm-focus); outline-offset:2px; }
/* The template's ".btn:focus { outline:0 }" and its pale focus glow (1.3 to 2.1:1) beat the rule above on buttons, menu
   links and checks; the same ring now reaches them on every page, not only on the product pages (05/11). Its
   "a:focus, button:focus" pale blue (1.8:1) also beat it on plain links and buttons: "Voltar", the logo, the side menu
   button, the footer and the consultation's tool links (09/11). */
.btn:focus-visible, .nav-link:focus-visible, .dropdown-item:focus-visible, .page-link:focus-visible, .navbar-toggler:focus-visible,
.form-check-input:focus-visible, .btn-check:focus-visible + .btn, a:focus-visible, button:focus-visible { outline:2px solid var(--pm-focus); outline-offset:2px; }
/* The template paints the gray outline button's border straight (1.2:1); the token's border applies again. */
.btn-outline-secondary { border-color:var(--bs-btn-border-color); }
.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:var(--pm-ink-2)!important; }
html.dark-mode #content .text-muted, html.dark-mode #content .form-text, html.dark-mode #content .link-secondary { color:var(--pm-brand-ink)!important; }
html.dark-mode #content a:not(.btn):hover { color:var(--pm-brand-ink)!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 var(--pm-border); border-radius:1rem; transition:box-shadow .2s; }
.operation-card:hover { color:var(--pm-ink); box-shadow:0 6px 20px #2340D020; }
.operation-list li { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:.5rem; padding:.75rem 0; border-bottom:1px solid var(--pm-border); }
.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 var(--pm-border); }
.service-status small { width:100%; }
.clinical-provenance, .clinical-addendum { padding:1rem; border-left:3px solid var(--pm-brand); background:var(--pm-brand-soft); 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:var(--pm-brand-soft); }
html.dark-mode .operation-card, html.dark-mode .operation-list li, html.dark-mode .service-status { border-color:var(--pm-border); }
html.dark-mode dt { color:var(--pm-ink-2); } /* a term reads in the gray of support text, as in the light theme (it was pen blue for every term); a page that colors its own terms keeps them in both themes */
@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, var(--pm-brand-soft), var(--pm-surface) 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:var(--pm-brand-soft); }
.institutional-section-heading { max-width:68ch; margin-bottom:2rem; }
.care-journey, .care-feature { background:var(--pm-surface); border:1px solid var(--pm-border); 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:var(--pm-brand-soft); color:var(--pm-brand-ink); 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:var(--pm-brand-soft); color:var(--pm-brand-ink); font-weight:700; font-size:1rem; }
.care-faq { background:var(--pm-surface); padding:1.25rem 1.5rem; border:1px solid var(--pm-border); 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:var(--pm-brand-soft); }
.institutional-article-image { width:100%; height:13rem; object-fit:cover; }
html.dark-mode .institutional-hero { background:linear-gradient(140deg, var(--pm-brand-soft), var(--pm-surface) 65%); }
html.dark-mode .institutional-muted { background:var(--pm-surface); }
html.dark-mode .care-journey, html.dark-mode .care-feature, html.dark-mode .care-faq { border-color:var(--pm-border); }
html.dark-mode .care-cta { background:var(--pm-brand-soft); }
html.dark-mode .care-icon, html.dark-mode .care-step-number { background:var(--pm-brand-soft); color:var(--pm-brand-ink); }
/* The dark theme uses the same roles as the light one (docs/VISUAL-SYSTEM.md): labels of checks in ink-2, green only for
   "it worked", the unit beside a field on the gray strip. */
html.dark-mode .form-check, html.dark-mode .form-check-label { color:var(--pm-ink-2)!important; }
html.dark-mode .text-primary { color:var(--pm-brand-ink)!important; }
html.dark-mode .text-success { color:var(--pm-success)!important; }
html.dark-mode .input-group-text { background:var(--pm-surface-2)!important; color:var(--pm-ink-2)!important; border-color:var(--pm-border-strong)!important; }
html.dark-mode input[type=file]::file-selector-button { background:var(--pm-brand-soft); color:var(--pm-brand-ink); }
@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; }
/* 19/11/2026 (docs/VISUAL-SYSTEM.md, "Aviso de cookies no celular"): on a phone the notice was about 160 px tall and covered the
   first action of the screen under it. There it is a low strip: smaller text and the two answers side by side. */
@media (max-width:575.98px) {
    .cookie-container { padding:.6rem .75rem!important; }
    .cookie-container .cookie-text { margin:0 0 .45rem!important; font-size:.8125rem!important; line-height:1.4!important; }
    .cookie-container .agree { display:flex!important; gap:.5rem; margin:0!important; }
    .cookie-container .agree .btn { flex:1 1 0; min-width:0; min-height:40px; margin:0!important; padding:.35rem .5rem!important; font-size:.8125rem!important; line-height:1.2; white-space:normal; }
}
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; }
}
.consultation-shortcuts { display: flex; flex-wrap: wrap; gap: .5rem; }
.consultation-shortcuts a { padding: .65rem .9rem; min-height: 44px; border: 1px solid var(--pm-border); border-radius: 999px; background: var(--pm-brand-soft); color: var(--pm-brand-ink); text-decoration: none; }
.consultation-shortcuts a:focus-visible { outline: 2px solid var(--pm-focus); outline-offset: 2px; }
/* On a computer the consultation's shortcuts stay at the top while the long page scrolls; the section on screen is marked (workspace-ui.js). */
@media (min-width: 1200px) {
    .consultation-shortcuts-sticky { position: sticky; top: 0; z-index: 5; margin-inline: -.5rem; padding: .625rem .5rem; background: var(--pm-surface-2); }
    html.dark-mode .consultation-shortcuts-sticky { background: var(--pm-page); }
    :is(#pre-consulta, #consultation-evolution, #medical-record-history, #troca-exames) { scroll-margin-top: 5rem; }
}
.consultation-shortcuts a[aria-current="location"], html.dark-mode .consultation-shortcuts a[aria-current="location"] { border-color: var(--pm-brand); background: var(--pm-brand); color: var(--pm-on-brand); }
html.dark-mode #content .consultation-shortcuts a[aria-current="location"] { color: var(--pm-on-brand) !important; }
/* The patient record reuses the shortcuts for its pages, a little more compact so the five fit on one line. */
.patient-record-pages a { display: inline-flex; align-items: center; min-height: 38px; padding: .45rem .8rem; font-size: .8125rem; }
@media (max-width: 767.98px) { .consultation-shortcuts.patient-record-pages { grid-template-columns: repeat(2, minmax(0, 1fr)); } .consultation-shortcuts.patient-record-pages a { justify-content: flex-start; padding: .55rem .7rem; text-align: left; } .consultation-shortcuts.patient-record-pages a:last-child:nth-child(odd) { grid-column: 1 / -1; } }
#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: var(--pm-brand-soft); color: var(--pm-brand-ink); }
.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 var(--pm-border); 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: 2px solid var(--pm-focus); outline-offset: 2px; }
html.dark-mode .consultation-progress-list li { border-color: var(--pm-border-strong); }
@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: var(--pm-brand-ink); }
.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 var(--pm-border-strong); border-radius: 1.25rem; background: var(--pm-surface); color: var(--pm-brand-ink); }
.session-lock-dialog::backdrop { background: rgb(20 27 45 / .96); backdrop-filter: blur(14px); } /* --pm-ink, near opaque: nothing of the page shows while locked (17/11/2026: was the old green) */
html.dark-mode .consultation-shortcuts a { background: var(--pm-brand-soft); color: var(--pm-brand-ink); border-color: var(--pm-border-strong); }
html.dark-mode .session-lock-dialog { background: var(--pm-brand-soft); color: var(--pm-brand-ink); }
html.dark-mode .mfa-secret { background: var(--pm-surface); color: var(--pm-brand-ink); }
html.dark-mode .measurement-chart { color: var(--pm-brand-ink); }
html.dark-mode .exchange-message small { color: var(--pm-brand-ink); }
.async-save-feedback.alert-success { background: var(--pm-success-bg); color: var(--pm-success); border-color: var(--pm-success-border); }
.clinical-notice, .async-save-feedback.alert-info { background: var(--pm-brand-soft); color: var(--pm-brand-ink); border-color: var(--pm-border); }
html.dark-mode .clinical-notice, html.dark-mode .async-save-feedback.alert-info { background: var(--pm-brand-soft); color: var(--pm-brand-ink); border-color: var(--pm-border-strong); }
html.dark-mode .async-save-feedback.alert-success { background: var(--pm-success-bg); color: var(--pm-success); border-color: var(--pm-success-border); }
@media (min-width: 1200px) 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; }
    /* Area switch keeps its accessible name but shows only the icon while the expanded top header is tight (the side menu has room). */
    body:not(.app-shell) #header .nav-switch-link .bi-arrow-left-right { margin-right: 0 !important; }
    body:not(.app-shell) #header .nav-switch-label { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
}
@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: var(--pm-brand-solid); }
.legal-archive .clinical-notice { overflow-wrap: anywhere; }
.legal-archive h2 { color: var(--pm-brand-ink); }
.dark-mode .legal-archive h2 { color: var(--pm-brand-ink); }
/* A message that just appeared (ProntoAttention in scripts.js, in place of jQuery UI's bounce). */
@keyframes pm-attention { 0%,100% { transform:none; } 30% { transform:translateY(-4px); } 60% { transform:translateY(2px); } }
@media (prefers-reduced-motion:no-preference) { .pm-attention { animation:pm-attention .3s ease-out 1; } }
