/* 0.4: consultation focus, clinical assistants and modules moved from the clinic system. Uses the brand tokens from style.css. */

/* Focus mode: the sidebar collapses while a consultation is being written; the menu stays one tap away. */
.shell.focus-mode{display:block}
.shell.focus-mode .sidebar{display:none}
.shell.focus-mode .main{width:100%}
.shell.focus-mode .mobile-menu-trigger{display:inline-flex!important}
.shell.focus-mode .content{max-width:1720px}
.shell.focus-mode .record-grid{grid-template-columns:200px minmax(0,1fr)}

/* Consultation header: state and time first, then pause, close and teleconsultation. */
.encounter-actions{align-items:center;gap:10px}
.encounter-state{display:flex;flex-direction:column;align-items:flex-start;gap:3px;min-width:132px;padding-right:6px}
.encounter-state .pill{margin:0}
.encounter-state .encounter-clock{font-size:22px;line-height:1.1;letter-spacing:-.4px}
.encounter-state .save-status{text-align:left;margin:0;max-width:220px}
.pill.paused{background:#f5ecdc;color:#84682f}

/* Single-choice groups (phototype). */
.choice-field{border:0;padding:0;margin:0;min-width:0}
.choice-field legend{font-size:12px;font-weight:550;margin-bottom:9px;padding:0}
.choice-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px}
.choice{position:relative;display:flex;flex-direction:column;gap:4px;padding:11px 12px;border:1px solid #dfd6cc;border-radius:9px;background:#fff;cursor:pointer;transition:border-color .15s,background .15s}
.choice input{position:absolute;opacity:0;pointer-events:none}
.choice strong{font:600 15px Montserrat,Inter,sans-serif;color:var(--brand)}
.choice small{font-size:10px;line-height:1.4;color:var(--muted)}
.choice:hover{border-color:#c9b29c}
.choice:has(input:checked){border-color:var(--brand);background:#f6eee4;box-shadow:inset 0 0 0 1px var(--brand)}
.choice:has(input:focus-visible){outline:3px solid var(--nude);outline-offset:2px}
.choice:has(input:disabled){cursor:default}

/* CID-10 suggestions. */
.cid-field input{font-variant-numeric:tabular-nums}
.cid-suggestions{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px;min-height:0}
.cid-suggestions:empty{display:none}
.cid-caption{width:100%;font-size:10px;color:var(--muted);letter-spacing:.2px}
.cid-chip{display:inline-flex;gap:6px;align-items:baseline;max-width:100%;padding:6px 10px;border:1px solid var(--line);border-radius:7px;background:#fff;color:var(--ink);font-size:11px;text-align:left;line-height:1.35;transition:border-color .15s,background .15s}
.cid-chip strong{color:var(--brand);font-weight:650;font-variant-numeric:tabular-nums;flex:none}
.cid-chip:hover{border-color:#c9b29c;background:#faf6f0}
.cid-chip.selected{border-color:var(--brand);background:#f3e9dd}
.cid-chip:disabled{cursor:default;opacity:.8}

/* Postal code status. */
.cep-status{display:block;font-size:10px;margin-top:5px;color:var(--muted)}
.cep-status.ok{color:var(--green)}.cep-status.error{color:var(--danger)}

@media(max-width:1250px){.choice-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.shell.focus-mode .record-grid{grid-template-columns:180px minmax(0,1fr)}}
@media(max-width:1020px){.shell.focus-mode .record-grid{grid-template-columns:1fr}}
@media(max-width:600px){.choice-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.encounter-state{flex-direction:row;align-items:center;flex-wrap:wrap;gap:8px;min-width:0;width:100%}.encounter-state .encounter-clock{font-size:18px}}

/* Finance: detailed reports and automatic closures. */
.report-actions{display:flex;flex-wrap:wrap;gap:14px 26px}
.report-pick{display:flex;align-items:flex-end;gap:10px;flex:1;min-width:260px}
.report-pick .field{flex:1}
.report-pick .btn{white-space:nowrap}

/* Agenda inside the record: the current patient stands out in the full agenda. */
.calendar-event.current-patient{box-shadow:inset 3px 0 0 var(--brand);background:#f3e7da}
.record-agenda-toolbar{margin-bottom:14px}
.status-choices{grid-template-columns:repeat(5,minmax(0,1fr))}
@media(max-width:700px){.status-choices{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Inline composer: editor always open, models one tap away, actions in a sticky bar. */
.composer{position:relative;overflow:visible}
.composer-top{display:flex;justify-content:space-between;align-items:flex-start;gap:18px;flex-wrap:wrap}
.composer-top .intro{margin-bottom:14px;max-width:640px}
.composer-models{display:flex;align-items:center;gap:7px;flex-wrap:wrap;padding:12px 0 4px;border-top:1px solid var(--line)}
.composer-label{font-size:10px;font-weight:600;letter-spacing:1.4px;text-transform:uppercase;color:#7e6c5b;margin-right:4px}
.model-chip{padding:7px 12px;border:1px solid var(--line);border-radius:7px;background:#fff;color:var(--ink);font-size:11px;line-height:1.3;max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transition:border-color .15s,background .15s}
.model-chip:hover{border-color:#c9b29c;background:#faf6f0}
.model-chip.selected{border-color:var(--brand);background:#f3e9dd;color:var(--brand-deep)}
.composer-template{display:flex;align-items:center;gap:7px;font-size:11px;color:var(--muted);margin:14px 0 0}
.composer-template .icon{width:15px;height:15px;color:var(--brand)}
.composer .document-editor{margin-top:12px}
.composer .rich-editor{min-height:300px}
.composer-bar{position:sticky;bottom:0;z-index:2;display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin:18px -28px -28px;padding:14px 28px;background:#fffdf9f2;backdrop-filter:blur(10px);border-top:1px solid var(--line);border-radius:0 0 var(--radius) var(--radius)}
.composer-bar .btn .icon{width:17px;height:17px}
.composer-meta{margin-top:6px}
.document-excerpt{font-size:12px!important;color:var(--ink)!important;opacity:.78;margin-top:6px!important;overflow-wrap:anywhere}
.composer-history .document-row .actions{justify-content:flex-end}
.model-list{display:grid;gap:8px;margin-top:16px;max-height:55dvh;overflow-y:auto}
.model-option{display:grid;gap:3px;text-align:left;padding:13px 15px;border:1px solid var(--line);border-radius:10px;background:#fff;color:var(--ink)}
.model-option:hover{border-color:#c9b29c;background:#faf6f0}
.model-option small{font-size:10px;color:var(--muted)}
.model-option span{font-size:11px;color:var(--muted);overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.share-ready{margin-top:18px;padding:16px;border:1px solid #d7e4d9;background:#f2f7f2;border-radius:10px}
.share-ready p{font-size:12px;margin-bottom:12px}

/* Product photos attached to a prescription. */

/* AI assistance strip. */
.ai-strip{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:12px 15px;margin:12px 0 0;border-radius:10px;background:linear-gradient(100deg,#f6eee4,#f4efe9 60%,#efe9f4);border:1px solid #e6d9ca;font-size:12px;color:var(--muted)}
.ai-strip>.icon{color:var(--brand)}
.ai-strip>span{flex:1;min-width:220px;line-height:1.55}
.ai-strip strong{color:var(--ink);font-weight:600;margin-right:4px}

@media(max-width:760px){.composer-bar{margin:18px -24px -24px;padding:12px 24px}.composer-bar>.actions{width:100%}.composer-bar>.actions:last-child .btn{flex:1 1 auto}}
@media(max-width:600px){.composer-bar{position:static}.composer-bar>.actions:last-child{display:grid;grid-template-columns:repeat(3,1fr)}.composer-bar>.actions:last-child .btn{padding-inline:8px;font-size:12px;gap:5px}.composer-bar>.actions:last-child .btn:last-child{grid-column:1/-1}.model-chip{max-width:100%}}
/* Comunicação interna na barra superior */
.chat-bell{position:relative}
.chat-bell .unread{position:absolute;top:1px;right:0;min-width:17px;height:17px;padding:0 4px;margin:0;border-radius:9px;background:var(--brand);color:#fff;font-size:10px;font-weight:600;line-height:17px;text-align:center}
.chat-bell[aria-expanded="true"]{background:var(--soft);color:var(--brand)}
.chat-bell.ringing .icon{animation:bell-ring .9s ease-in-out;transform-origin:50% 12%}
@keyframes bell-ring{0%,100%{transform:rotate(0)}15%{transform:rotate(15deg)}30%{transform:rotate(-13deg)}45%{transform:rotate(9deg)}60%{transform:rotate(-6deg)}75%{transform:rotate(3deg)}}
.chat-drawer{position:fixed;top:0;right:0;bottom:0;z-index:40;width:min(400px,100vw);display:flex;flex-direction:column;background:var(--surface);border-left:1px solid var(--line);box-shadow:-18px 0 44px rgba(49,38,30,.14);animation:drawer-in .22s ease-out}
.chat-drawer[hidden]{display:none}
@keyframes drawer-in{from{transform:translateX(24px);opacity:0}to{transform:none;opacity:1}}
.drawer-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:18px 16px 14px 20px;border-bottom:1px solid var(--line)}
.drawer-head strong{display:block;font-size:15px;font-weight:600}
.drawer-head small{display:block;margin-top:3px;color:var(--muted);font-size:11px}
.drawer-tools{display:flex;gap:2px}
.drawer-tools [aria-pressed="false"]{color:#b9afa4}
.drawer-people{display:flex;gap:4px;overflow-x:auto;padding:12px 14px;border-bottom:1px solid var(--line);flex:none;scrollbar-width:thin}
.drawer-person{position:relative;display:flex;flex-direction:column;align-items:center;gap:6px;min-width:66px;padding:8px 6px;border-radius:10px;background:none;color:var(--ink);font-size:11px}
.drawer-person:hover{background:var(--soft)}
.drawer-person.selected{background:#eee2d5}
.drawer-person .avatar{position:relative;width:38px;height:38px;font-size:12px}
.drawer-person .presence{position:absolute;right:-1px;bottom:-1px;width:11px;height:11px;border:2px solid var(--surface)}
.drawer-person-name{max-width:64px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.unread-dot{position:absolute;top:3px;right:8px;min-width:17px;height:17px;padding:0 4px;border-radius:9px;background:var(--brand);color:#fff;font-size:10px;line-height:17px;text-align:center}
.drawer-thread{flex:1;overflow-y:auto;padding:18px 16px;display:flex;flex-direction:column;gap:12px;background:#fcfaf7}
.drawer-thread .empty{margin:auto}
.drawer-compose{display:flex;align-items:flex-end;gap:10px;padding:12px 14px 6px;border-top:1px solid var(--line)}
.drawer-compose textarea{flex:1;min-height:46px;max-height:150px;resize:vertical;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:#fff;color:var(--ink);font:inherit;font-size:13px}
.drawer-compose textarea:focus{outline:2px solid var(--nude);outline-offset:1px}
.drawer-hint{padding:0 14px 12px;margin:0;color:var(--muted);font-size:10px}
@media(max-width:600px){.chat-drawer{left:0;width:auto;border-left:0}}
@media(prefers-reduced-motion:reduce){.chat-bell.ringing .icon,.chat-drawer{animation:none}}
/* Termos de consentimento */
.consent-list{display:grid;gap:12px;margin-top:6px}
.consent-card{border:1px solid var(--line);border-radius:12px;padding:16px 18px;background:#fff}
.consent-card-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}
.consent-card h3{font-size:15px;margin:0 0 4px}
.consent-card-head p,.consent-meta{margin:0;color:var(--muted);font-size:12px}
.consent-meta{margin:10px 0 12px}
.consent-card .actions{flex-wrap:wrap}
.consent-link{display:grid;grid-template-columns:220px minmax(0,1fr);gap:22px;align-items:start;margin-top:6px}
.consent-qr svg{width:220px;height:220px;display:block;border:1px solid var(--line);border-radius:12px}
.consent-link h3{font-size:16px;margin:0 0 6px}
.consent-link p{font-size:13px}
.consent-link .actions{flex-wrap:wrap;margin-top:12px}
.legacy-terms{margin-top:18px;font-size:12px;color:var(--muted)}
.legacy-terms p{display:flex;flex-wrap:wrap;align-items:center;gap:10px}
@media(max-width:600px){.consent-link{grid-template-columns:1fr;justify-items:center}.consent-qr svg{width:200px;height:200px}.consent-card-head{flex-direction:column}}
.form-grid[data-consent-fields][hidden],details[data-consent-fields][hidden]{display:none}
.quote-options{border:1px solid var(--line);border-radius:10px;padding:12px 16px;margin:18px 0;display:grid;gap:8px}
.quote-options legend{font-size:12px;font-weight:600;padding:0 6px}
.quote-options .field{max-width:260px;margin-top:4px}
.quote-options [hidden]{display:none}
/* Cirurgia micrográfica */
.micro-layout{display:grid;grid-template-columns:minmax(240px,320px) minmax(0,1fr);gap:20px;align-items:start}
.micro-list{display:grid;gap:10px}
.micro-list.horizontal{grid-template-columns:repeat(auto-fill,minmax(230px,1fr))}
.micro-card{display:grid;gap:4px;text-align:left;width:100%;padding:14px 16px;border:1px solid var(--line);border-radius:12px;background:#fff;color:var(--ink);font-size:13px}
.micro-card small{color:var(--muted);font-size:11px}
.micro-card .pill{justify-self:start;margin-top:4px}
.micro-card:hover{border-color:var(--nude)}
.micro-card.selected{border-color:var(--brand);box-shadow:0 0 0 2px #71574722}
.micro-sheet{margin-top:0}
.micro-status{display:grid;justify-items:end;gap:6px}
.micro-status small{color:var(--muted);font-size:11px}
.micro-stages{list-style:none;padding:0;margin:18px 0 12px;display:grid;gap:10px}
.micro-stage{display:grid;grid-template-columns:92px minmax(0,2fr) auto minmax(0,1.2fr) 36px;gap:10px;align-items:center;padding:10px 12px;border:1px solid var(--line);border-radius:12px;background:var(--soft)}
.micro-label{font-weight:600;font-size:13px}
.micro-stage input{min-height:44px;padding:9px 11px;border:1px solid var(--line);border-radius:9px;background:#fff;font:inherit;font-size:13px;color:var(--ink);min-width:0}
.micro-result{display:flex;gap:6px}
.micro-choice{min-height:44px;padding:8px 14px;border-radius:9px;border:1px solid var(--line);background:#fff;color:var(--ink);font-size:13px;font-weight:600}
.micro-choice.free[aria-pressed="true"]{background:#46745e;border-color:#46745e;color:#fff}
.micro-choice.involved[aria-pressed="true"]{background:#ad473c;border-color:#ad473c;color:#fff}
.micro-choice:disabled{opacity:.75;cursor:default}
.micro-verdict{margin:16px 0;padding:12px 16px;border-radius:10px;background:var(--soft);font-size:13px;color:var(--muted)}
.micro-verdict.free{background:#e6f0ea;color:#2f5a45;font-weight:600}
.micro-verdict.involved{background:#f6e3e0;color:#8c3a31;font-weight:600}
.micro-actions{flex-wrap:wrap}
.micro-numbering{display:flex;align-items:end;gap:10px;margin:-6px 0 12px}
.micro-numbering .field{max-width:240px}
@media(max-width:1000px){.micro-layout{grid-template-columns:1fr}.micro-stage{grid-template-columns:1fr 1fr;}.micro-stage .micro-label{grid-column:1/-1}.micro-stage [data-stage="description"],.micro-stage [data-stage="notes"]{grid-column:1/-1}.micro-remove{justify-self:end;grid-column:2;grid-row:1}}
/* Mapa estético */
.map-history{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:10px;margin:6px 0 18px}
.map-editor{border-top:1px solid var(--line);padding-top:16px;margin-top:6px}
.map-controls{display:flex;flex-wrap:wrap;align-items:center;gap:10px 14px;margin-bottom:14px}
.map-types{display:flex;flex-wrap:wrap;gap:6px}
.map-type{display:inline-flex;align-items:center;gap:7px;min-height:38px;padding:6px 12px;border-radius:9px;border:1px solid var(--line);background:#fff;color:var(--ink);font-size:12px}
.map-type[aria-pressed="true"]{border-color:var(--brand);box-shadow:0 0 0 2px #71574726;font-weight:600}
.map-swatch{display:inline-block;width:11px;height:11px;border-radius:50%;flex:none;vertical-align:-1px;margin-right:2px}
.map-swatch.toxina{background:#b07d5a}.map-swatch.preenchimento{background:#3f6f9a}.map-swatch.bioestimulador{background:#46745e}.map-swatch.skinbooster{background:#8a6d4f}
.map-zoom{display:flex;align-items:center;gap:4px;font-size:12px;color:var(--muted)}
.map-save{margin-left:auto;color:var(--muted);font-size:11px}
.map-body{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(280px,1fr);gap:22px;align-items:start}
.map-stage{overflow:auto;max-height:76vh;border:1px solid var(--line);border-radius:14px;background:#efe6db;position:sticky;top:12px}
.map-canvas{--fit:calc(72vh * .747);position:relative;margin:0 auto;width:min(100%,var(--fit));aspect-ratio:747/1000;user-select:none;-webkit-user-select:none}
.map-canvas.zoom-150{width:max(150%,calc(var(--fit) * 1.5))}.map-canvas.zoom-200{width:max(200%,calc(var(--fit) * 2))}.map-canvas.zoom-250{width:max(250%,calc(var(--fit) * 2.5))}
.map-canvas img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;pointer-events:none}
.map-overlay{position:absolute;inset:0;width:100%;height:100%;touch-action:manipulation}
.map-overlay.editable{cursor:crosshair}
.map-overlay .map-dot{cursor:pointer}
.map-overlay .map-dot circle{stroke:#fff;stroke-width:4;filter:drop-shadow(0 1px 2px #0006)}
.map-overlay .map-dot text{fill:#fff;font:700 17px/1 system-ui,sans-serif;text-anchor:middle;pointer-events:none}
.map-overlay .map-dot.toxina circle{fill:#b07d5a}.map-overlay .map-dot.preenchimento circle{fill:#3f6f9a}.map-overlay .map-dot.bioestimulador circle{fill:#46745e}.map-overlay .map-dot.skinbooster circle{fill:#8a6d4f}
.map-overlay .map-dot.selected circle{stroke:#1f1914;stroke-width:5}
.map-side{display:grid;gap:16px}
.map-point h3,.map-summary h3,.map-sheets-edit h3{font-size:14px;margin:0 0 8px}
.map-summary table{width:100%;border-collapse:collapse;font-size:12px}
.map-summary th,.map-summary td{text-align:left;padding:6px 4px;border-bottom:1px solid var(--line)}
.map-total{display:flex;flex-wrap:wrap;gap:6px 14px;font-size:12px;margin:8px 0 0}
.map-sheet-edit{border:1px solid var(--line);border-radius:10px;padding:10px 14px;margin:0 0 10px}
.map-sheet-edit legend{font-size:12px;font-weight:600;padding:0 6px}
@media(max-width:1000px){.map-body{grid-template-columns:1fr}.map-save{margin-left:0;flex-basis:100%}.map-stage{position:static}}
/* LME e imunobiológicos */
.medform-med{display:grid;grid-template-columns:24px 1fr;gap:6px 10px;align-items:start;padding:10px 0;border-bottom:1px solid var(--line)}
.medform-med>strong{padding-top:30px;color:var(--muted)}
.medform-qty{grid-column:2;display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px}
.medform-qty .field input{min-width:0}
.medform-alert{display:flex;flex-wrap:wrap;align-items:center;gap:8px;border-left:4px solid #c4873f}
@media(max-width:600px){.medform-qty{grid-template-columns:repeat(3,minmax(0,1fr))}}
.ai-strip.off{background:var(--soft);border-style:dashed}
.ai-strip.off>.icon{color:var(--muted)}
.ai-suggestion{display:grid;gap:10px}
.ai-suggestion h3{font-size:13px;margin:8px 0 0}
.ai-suggestion ul{margin:0;padding-left:18px;font-size:12px;line-height:1.7}
.ai-hypothesis{display:flex;gap:12px;align-items:flex-start;justify-content:space-between;padding:12px 14px;border:1px solid var(--line);border-radius:10px;background:#fff}
.ai-hypothesis strong{font-size:13px}
.ai-hypothesis small{font-size:11px;color:var(--muted);margin-left:4px}
.ai-hypothesis p{margin:5px 0 0;font-size:12px;line-height:1.6;color:var(--muted)}
.small-print{font-size:11px;margin:10px 0 0}
@media (max-width:640px){.ai-hypothesis{flex-direction:column}}
.history-table{width:100%;border-collapse:collapse;font-size:13px}
.history-table th{text-align:left;font-size:11px;font-weight:600;color:var(--muted);padding:10px 12px;border-bottom:1px solid var(--line);white-space:nowrap}
.history-table td{padding:0 12px;height:44px;border-bottom:1px solid var(--line);white-space:nowrap}
.history-table td:first-child{width:45%;white-space:normal}
.history-toggle{display:flex;align-items:center;gap:8px;width:100%;min-height:44px;padding:0;border:0;background:none;font:inherit;color:var(--ink);text-align:left;cursor:pointer}
.history-toggle .icon{width:15px;height:15px;flex:none;color:var(--muted);transition:transform .15s}
.history-row.open .history-toggle .icon{transform:rotate(90deg)}
.history-row:hover{background:var(--soft)}
.history-detail>td{padding:4px 12px 18px 35px;white-space:normal;height:auto;background:#fdfbf8}
.history-note h4{font-size:11px;color:var(--muted);margin:12px 0 2px}
.history-note p{margin:0 0 6px;font-size:13px;line-height:1.6}
@media (prefers-reduced-motion:reduce){.history-toggle .icon{transition:none}}
.compact-history{margin-top:18px}
.compact-history h3{font-size:12px;font-weight:600;color:var(--muted);margin:0 0 6px;display:flex;gap:6px;align-items:center}
.compact-history h3 small{font-weight:500}
.compact-record{border-bottom:1px solid var(--line)}
.compact-record>summary{display:grid;grid-template-columns:86px minmax(0,1.2fr) minmax(0,2fr) auto;gap:12px;align-items:center;min-height:44px;padding:4px 6px;font-size:12.5px;cursor:pointer;list-style:none}
.compact-record>summary::-webkit-details-marker{display:none}
.compact-record>summary>*{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.compact-record>summary:hover{background:var(--soft)}
.compact-record[open]>summary{background:var(--soft)}
.compact-record>article{margin:8px 0 14px}
@media(max-width:640px){.compact-record>summary{grid-template-columns:72px minmax(0,1fr) auto}.compact-record>summary>.muted{display:none}}

.composer-layout{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:24px;margin-top:16px;align-items:start}
.composer-side{display:grid;gap:18px;align-content:start}
.side-label{display:flex;align-items:center;gap:4px;font-size:12px;font-weight:600;margin-bottom:6px;color:var(--ink)}
.side-plus{border:0;background:none;color:var(--brand);padding:0;cursor:pointer;display:inline-grid;place-items:center;width:28px;height:28px;border-radius:6px}
.side-plus:hover,.side-plus:focus-visible{background:var(--soft)}
.side-plus .icon{width:16px;height:16px}
.composer-side select,.composer-side input,.composer-kind{width:100%;min-height:40px;border:1px solid var(--line);border-radius:8px;padding:8px 10px;font:inherit;font-size:13px;background:#fff;color:var(--ink)}
.composer-kind{width:auto}
.side-history{max-height:340px;overflow:auto;border:1px solid var(--line);border-radius:8px;background:#fff}
.side-history>p{margin:0;padding:14px;font-size:12px;text-align:center}
.side-history table{width:100%;border-collapse:collapse;font-size:12px}
.side-history th{position:sticky;top:0;background:var(--soft);text-align:left;padding:8px 10px;font-weight:600}
.side-history td{padding:7px 10px;border-top:1px solid var(--line);vertical-align:top}
.side-history td:first-child{white-space:nowrap;color:var(--muted)}
.side-history button{border:0;background:none;padding:0;font:inherit;text-align:left;color:var(--ink);cursor:pointer;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.side-history button:hover{color:var(--brand);text-decoration:underline}
.side-history tr.cancelled button{text-decoration:line-through;color:var(--muted)}
.composer-options{display:flex;flex-wrap:wrap;gap:14px 32px;align-items:flex-end;margin-top:16px}
.paper-choice{border:0;padding:0;margin:0;display:flex;flex-wrap:wrap;gap:4px 18px;align-items:center}
.paper-choice legend{font-size:12px;font-weight:600;margin-bottom:6px;padding:0}
.choice-inline{display:inline-flex;align-items:center;gap:6px;font-size:13px;min-height:32px;cursor:pointer}
.composer-date{display:flex;align-items:flex-end;gap:14px;flex-wrap:wrap}
.composer-date .field{min-width:160px;margin:0}
.composer-section{display:flex;align-items:center;gap:8px;font-size:14px;font-weight:600;color:var(--brand);margin:20px 0 10px}
.composer-section:first-of-type{margin-top:4px}
.composer-section .icon{width:16px;height:16px}
.exam-table{width:100%;border-collapse:collapse;font-size:13px;margin:4px 0 10px}
.exam-table th{text-align:left;font-size:11px;font-weight:600;color:var(--muted);padding:8px;border-bottom:1px solid var(--line)}
.exam-table td{padding:6px 8px;border-bottom:1px solid var(--line)}
.exam-table td:last-child,.exam-table th:last-child{width:64px;text-align:center}
.paper-note{display:flex;align-items:center;gap:6px;margin:0;font-size:12px;color:var(--muted)}.paper-note svg{width:14px;height:14px}
.released-check{margin-top:12px;font-size:12px}
@media(max-width:1000px){.composer-layout{grid-template-columns:1fr}.composer-side{order:-1}.side-history{max-height:180px}}/* Documento 15: telas mais compactas, agenda sem rolagem dupla e fundo com contraste para longos períodos */
:root{--bg:#eee7de}
@media(min-width:1001px){
  .content{padding:22px 30px 26px}
  .page-head{margin-bottom:14px}
  .page-head h1{font-size:25px}
  .page-head p{margin-top:2px}
  .metrics{padding:12px 0;margin:12px 0 16px}
  .metric-number{font-size:25px}
  .panel-head{padding:13px 20px}
  .patient-row{padding:13px 20px}
  .record-banner{margin-bottom:14px;padding-bottom:12px}
  .sidebar{padding:22px 16px 14px}
  .nav-item{padding:8px 12px;margin:1px 0}
  .record-tab{padding:6px 10px;margin:1px 0;font-size:11.5px;line-height:1.3}
  .record-tab>span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
  /* Document 16: one-line tabs keep the sticky menu inside the screen, so it never scrolls on its own and the wheel always moves the page. */
  .record-nav{max-height:none;overflow:visible}
  .form-grid{gap:12px 18px}
}
.record-nav{background:#e6ddd1;border-radius:12px;padding:12px 8px}
.timetable-scroll{max-height:none;overflow-y:visible}
.timetable td{height:30px}
.btn.calendar-slot{height:22px;min-height:0;padding:0;font-size:16px}
.calendar-event{display:flex;flex-wrap:wrap;align-items:baseline;gap:0 8px}
.calendar-event span,.calendar-event strong,.calendar-event small{display:inline}
.timetable th{padding:8px 6px}
.timetable tbody th{padding-top:8px}
.timetable:has(th:nth-child(4)){min-width:700px}
.calendar-event{padding:3px 7px;margin-bottom:2px}
.calendar-event strong{margin:0;font-size:11.5px}
.calendar-event .pill{display:none}
@media(min-width:1001px) and (max-height:700px){.record-nav{position:static}}
/* Cirurgias e curativos */
.surgery-tabs{width:max-content;max-width:100%;margin:0 0 18px}
.choice-grid.yes-no{grid-template-columns:repeat(2,minmax(0,1fr))}
.dressing-choices{margin:16px 0}
.dressing-summary{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px;margin:0 0 18px}
.dressing-summary>div{display:grid;gap:2px;padding:14px 16px;border:1px solid var(--line);border-radius:12px;background:#fff}
.dressing-summary span{font-size:12px;color:var(--muted)}
.dressing-summary strong{font-size:22px;color:var(--brand)}
.dressing-summary small{font-size:11px;color:var(--muted)}
.dressing-list td small{display:block;margin-top:4px;color:var(--muted);font-size:11px}
.dressing-list tr.cancelled td{color:var(--muted)}
.micro-numbering textarea{min-height:76px}
/* Documento 19: antecedentes compactos e marcação HIV+ do paciente */
.compact-notes textarea{min-height:56px}
.antecedents-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;flex-wrap:wrap}
/* Documento 26: cartão HIV+ menor */
.hiv-flag{display:inline-flex;align-items:center;gap:8px;padding:6px 12px;border:1px solid var(--line);border-radius:9px;background:#fff;cursor:pointer;max-width:max-content}
.hiv-flag input{width:16px;height:16px;accent-color:var(--danger);flex:none}
.hiv-flag strong{display:block;font-size:13px;line-height:1.2;color:var(--danger)}
.hiv-flag small{display:block;font-size:10.5px;line-height:1.3;color:var(--muted)}
.hiv-flag.on{border-color:var(--danger);background:#fbeeeb}
.hiv-flag:has(input:disabled){cursor:default}
.hiv-flag:has(input:focus-visible){outline:3px solid var(--nude);outline-offset:2px}
.patient-alert{display:inline-block;margin-left:12px;padding:3px 12px;border-radius:7px;background:var(--danger);color:#fff;font-size:15px;font-weight:700;letter-spacing:.5px;vertical-align:middle}

/* Catarina OS agenda notes: "!" parts (priority, preferential age) as red badges */
.appointment-notes .notes-alert{display:inline-block;margin:0 6px 4px 0;padding:2px 9px;border-radius:7px;background:var(--danger);color:#fff;font-size:13px;font-weight:700;line-height:1.5}
.note-text p{margin:0 0 4px;line-height:1.6}.note-text .note-heading{font-weight:600;margin:14px 0 4px;color:var(--ink)}.note-text .note-heading:first-child{margin-top:0}.note-text .note-list{margin:0 0 6px;padding-left:20px}.note-text .note-list li{margin:2px 0;line-height:1.6;font-size:13px}.note-text .note-gap{height:6px;margin:0}
/* Documento 24: letras um pouco menores e campos mais baixos, para ver mais da tela com menos rolagem */
@media(min-width:1001px){
  body{font-size:13px}
  h2{font-size:19px}h3{font-size:14px}
  .input,input:where(:not([type=checkbox]):not([type=radio]):not([type=file])),select,textarea{min-height:36px;padding:7px 11px;font-size:12.5px;line-height:1.45}
  .btn{min-height:37px;padding:8px 14px;font-size:11.5px}
  .btn.small{min-height:31px;padding:6px 10px;font-size:10.5px}
  .field{gap:5px}
  .field>span,.field>label{font-size:11.5px}
  .record-banner h1{font-size:22px}
  .record-banner .avatar{width:50px;height:50px;font-size:16px}
  .record-work h2{font-size:18px;margin-bottom:6px}
  .record-work .panel{padding:20px 22px}
  .record-work .panel+.panel{margin-top:16px}
  .intro{margin-bottom:14px;line-height:1.6;font-size:11.5px}
  .compact-notes textarea{min-height:44px}
  .composer-section{margin:14px 0 8px;font-size:13px}
  .encounter-state .encounter-clock{font-size:20px}
  .modal-body .form-grid,.form-block .form-grid{gap:11px 16px}
}
/* Documento 25: etiqueta da teleconsulta, faixa da chamada e janela pequena da chamada na própria página */
.tele-tag{display:inline-flex;align-items:center;gap:5px;flex:none;border-radius:6px;padding:4px 8px;background:#e8eef3;color:#3f5f79;font-size:10px;font-weight:600;line-height:1.3;white-space:nowrap;vertical-align:middle}
.tele-tag .icon{width:13px;height:13px}
.tele-tag.live{background:#e3efe7;color:#2f6a49}
.tele-tag.live .icon,.tele-live{animation:tele-pulse 1.6s ease-in-out infinite}
@keyframes tele-pulse{50%{opacity:.35}}
.history-toggle .tele-tag{margin-left:4px}
.history-note .meta{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.history-note .meta small{color:var(--muted);font-size:11px}
.row-action .tele-tag{align-self:flex-end}
.timeline-entry .tele-tag{margin:5px 0 2px}
.televisit-strip.live{background:#eef5f0;border-color:#cfe2d6}
.televisit-strip.ended{background:var(--soft)}
.televisit-strip>span:not(.tele-tag){font-size:13px;color:var(--ink)}
.televisit-actions{display:flex;flex-wrap:wrap;gap:8px;margin-left:auto}
.tele-window{position:fixed;z-index:44;display:flex;flex-direction:column;min-width:300px;min-height:220px;max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);background:#1f1915;border-radius:12px;box-shadow:0 24px 60px -16px #1f19158c;overflow:hidden}
.tele-window-head{display:flex;align-items:center;gap:6px;padding:7px 7px 7px 12px;background:var(--sidebar);color:#efe6dc;cursor:grab;touch-action:none;user-select:none}
.tele-window.dragging .tele-window-head{cursor:grabbing}
.tele-window.dragging iframe{pointer-events:none}
.tele-window-head div{flex:1;min-width:0}
.tele-window-head strong{display:block;font-size:12px;font-weight:600}
.tele-window-head small{display:block;color:#bfae9e;font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tele-window-head .icon-button{color:#d7bca3;width:32px;height:32px;min-width:32px;min-height:32px}
.tele-window-head .icon-button:hover{background:#ffffff14}
.tele-window-head [data-tele=minimize] .icon{transform:rotate(90deg)}
.tele-window.minimized [data-tele=minimize] .icon{transform:rotate(-90deg)}
.tele-live{width:8px;height:8px;flex:none;border-radius:50%;background:#8fc4a5}
.tele-end{flex:none;border:0;border-radius:7px;padding:7px 10px;background:#b4493d;color:#fff;font-size:11px;font-weight:600;cursor:pointer}
.tele-end:hover{background:#963a30}
.tele-window iframe{flex:1;width:100%;min-height:0;border:0;background:#111}
.tele-window.minimized{min-height:0;height:auto!important}
.tele-window.minimized iframe,.tele-window.minimized .tele-resize{display:none}
.tele-resize{position:absolute;right:0;bottom:0;width:18px;height:18px;cursor:nwse-resize;touch-action:none;background:linear-gradient(135deg,transparent 50%,#efe6dc99 50%,#efe6dc99 58%,transparent 58%,transparent 70%,#efe6dc99 70%,#efe6dc99 78%,transparent 78%)}
@media(max-width:600px){
  .tele-window{left:8px!important;right:8px;top:auto!important;bottom:8px;width:auto!important;height:46dvh!important}
  .tele-window.minimized{height:auto!important}
  .tele-window-head{cursor:default}
  .tele-resize{display:none}
  .televisit-actions{margin-left:0}
}
@media(prefers-reduced-motion:reduce){.tele-tag.live .icon,.tele-live{animation:none}}
@media print{.tele-window{display:none!important}}
/* Documento 26: aba Scores — mostradores coloridos por faixa, comparação com a consulta anterior e evolução */
:root{--score-ok:#4a8a64;--score-mild:#9bab3e;--score-moderate:#e0a43a;--score-severe:#dc7a3c;--score-critical:#c2483d;--score-neutral:#b9ab9d}
.scores-group{margin:22px 0 10px;font:600 15px Montserrat,Inter,sans-serif;color:var(--brand)}
.score-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:16px}
.score-card{display:flex;flex-direction:column;gap:8px;padding:16px 18px;border:1px solid var(--line);border-top:4px solid var(--line);border-radius:14px;background:#fff}
.score-card.tone-ok{border-top-color:var(--score-ok)}.score-card.tone-mild{border-top-color:var(--score-mild)}.score-card.tone-moderate{border-top-color:var(--score-moderate)}.score-card.tone-severe{border-top-color:var(--score-severe)}.score-card.tone-critical{border-top-color:var(--score-critical)}
.score-card header{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}
.score-card h3{margin:0;font:700 18px Montserrat,Inter,sans-serif;color:var(--ink)}
.score-card header p{margin:2px 0 0;font-size:12px;color:var(--muted)}
.score-gauge{display:block;width:100%;max-width:230px;margin:2px auto 0;overflow:visible}
.gauge-track{fill:none;stroke:#efe9e2;stroke-width:16;stroke-linecap:round}
.gauge-zone{fill:none;stroke-width:16}
.gauge-zone.tone-ok{stroke:var(--score-ok)}.gauge-zone.tone-mild{stroke:var(--score-mild)}.gauge-zone.tone-moderate{stroke:var(--score-moderate)}.gauge-zone.tone-severe{stroke:var(--score-severe)}.gauge-zone.tone-critical{stroke:var(--score-critical)}
.score-gauge.idle .gauge-zone{opacity:.25}
.gauge-needle{stroke:var(--ink);stroke-width:4;stroke-linecap:round;transform-origin:100px 100px;animation:score-needle .7s cubic-bezier(.2,.8,.3,1)}
.gauge-hub{fill:var(--ink)}
.gauge-tick{font:600 10px Inter,sans-serif;fill:var(--muted)}
@keyframes score-needle{from{transform:rotate(-30deg);opacity:0}}
.score-reading{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:center;gap:4px 8px;text-align:center}
.score-reading strong{font:700 30px/1 Montserrat,Inter,sans-serif;color:var(--ink);font-variant-numeric:tabular-nums}
.score-reading small{font-size:12px;color:var(--muted)}
.score-reading.is-empty{min-height:34px;align-items:center}
.score-band{flex-basis:100%;justify-self:center;margin:2px auto 0;max-width:max-content;padding:3px 11px;border-radius:999px;font:600 12px Inter,sans-serif}
.score-band.tone-ok{background:#e6f1ea;color:#2f6a48}.score-band.tone-mild{background:#f0f3dc;color:#5c681c}.score-band.tone-moderate{background:#fbf0d9;color:#86580f}.score-band.tone-severe{background:#fbe5d6;color:#94441a}.score-band.tone-critical{background:#f8e0dd;color:#912f29}.score-band.tone-neutral{background:#f1ece6;color:var(--muted)}
.score-compare{margin:0;font-size:13px;line-height:1.45;color:var(--ink);text-align:center}
.score-compare small{color:var(--muted)}
.score-trend{font-weight:700}
.score-compare.better .score-trend{color:#2f6a48}.score-compare.worse .score-trend{color:#a8382f}.score-compare.same .score-trend{color:var(--muted)}
.score-response{margin:0;font-size:12px;color:var(--muted);text-align:center}
.score-response strong{display:inline-block;margin-left:4px;padding:1px 8px;border-radius:999px;background:#e6f1ea;color:#2f6a48}
.score-history{margin:4px 0 0}
.score-history svg{display:block;width:100%;height:54px}
.history-line{fill:none;stroke:#cdbfb2;stroke-width:2;stroke-linejoin:round;stroke-linecap:round}
.history-dot{stroke:#fff;stroke-width:1.5;fill:var(--score-neutral)}
.history-dot.tone-ok{fill:var(--score-ok)}.history-dot.tone-mild{fill:var(--score-mild)}.history-dot.tone-moderate{fill:var(--score-moderate)}.history-dot.tone-severe{fill:var(--score-severe)}.history-dot.tone-critical{fill:var(--score-critical)}
.score-history figcaption{display:flex;justify-content:space-between;font-size:10px;color:var(--muted)}
.score-meta{margin:auto 0 0;font-size:11px;color:var(--muted);text-align:center}
.scores-source{margin-top:18px}
.score-form{display:grid;grid-template-columns:minmax(0,1fr) 240px;gap:24px;align-items:start}
.score-live{position:sticky;top:0;display:flex;flex-direction:column;gap:6px;padding:14px;border:1px solid var(--line);border-radius:14px;background:#fffdf9;text-align:center}
.score-table{width:100%;border-collapse:collapse}
.score-table th,.score-table td{padding:6px 6px;border-bottom:1px solid var(--line);text-align:left;vertical-align:middle;font-size:13px}
.score-table th small{display:block;font-weight:400;font-size:11px;color:var(--muted)}
.score-table select{width:100%;min-width:64px;padding:6px 8px;border:1px solid #dfd6cc;border-radius:8px;background:#fff;font:inherit;color:var(--ink)}
.score-table.compact th,.score-table.compact td{padding:4px}
.score-table.compact select{padding:4px 6px}
.dlqi-list{display:grid;gap:4px}
.dlqi-item,.score-scale{margin:0;padding:10px 0;border:0;border-bottom:1px solid var(--line);min-width:0}
.dlqi-item legend,.score-scale legend{padding:0;margin-bottom:8px;font:600 13px Inter,sans-serif;color:var(--ink)}
.dlqi-item div,.score-scale div{display:flex;flex-wrap:wrap;gap:6px}
.score-scale div{display:grid;grid-template-columns:repeat(11,minmax(0,1fr))}
.dlqi-item label,.score-scale label{position:relative;cursor:pointer}
.dlqi-item input,.score-scale input{position:absolute;opacity:0;pointer-events:none}
.dlqi-item span,.score-scale span{display:block;padding:6px 12px;border:1px solid #dfd6cc;border-radius:999px;background:#fff;font-size:12px;color:var(--ink);text-align:center;transition:border-color .15s,background .15s}
.score-scale span{padding:7px 0;border-radius:8px;font-weight:600;font-variant-numeric:tabular-nums}
.dlqi-item label:hover span,.score-scale label:hover span{border-color:#c9b29c}
.dlqi-item input:checked+span,.score-scale input:checked+span{border-color:var(--brand);background:#f6eee4;box-shadow:inset 0 0 0 1px var(--brand);color:var(--brand-deep)}
.dlqi-item input:focus-visible+span,.score-scale input:focus-visible+span{outline:3px solid var(--nude);outline-offset:2px}
.napsi-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-top:10px}
.napsi-grid h4,.score-subhead{margin:14px 0 6px;font:600 14px Montserrat,Inter,sans-serif;color:var(--brand)}
.napsi-side.toes{display:none}.napsi-grid.with-toes .napsi-side.toes{display:block}
.score-form .choice-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.caspar-entry{margin-bottom:12px;font-weight:600}
.caspar-items{display:grid;gap:8px;margin-top:12px}
.caspar-items small{color:var(--muted)}
.caspar-items .check,.score-form>.score-form-fields>.check{margin:0;font-size:13px;color:var(--ink)}
.score-form>.score-form-fields>.caspar-entry{margin:0 0 14px}
.score-table tbody th{text-transform:none;letter-spacing:0;font-size:13px;font-weight:600;color:var(--ink)}
.score-table td:last-child select{min-width:118px}
@media(max-width:800px){.score-form{grid-template-columns:minmax(0,1fr)}.score-live{position:static;order:-1}.napsi-grid{grid-template-columns:minmax(0,1fr)}.score-scale div{grid-template-columns:repeat(6,minmax(0,1fr))}}
@media(prefers-reduced-motion:reduce){.gauge-needle{animation:none}}
@media print{.score-card{break-inside:avoid}}
/* Documento 26: botão Status no agendamento, com a lista do MedicalSys */
.appointment-status{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin:8px 0 4px}
.status-menu{margin:8px 0 4px;padding:12px;border:1px solid var(--line);border-radius:12px;background:#fffdf9}
.status-menu>p{margin:0 0 8px}
.status-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.status-option{display:flex;flex-direction:column;align-items:flex-start;gap:3px;padding:10px 12px;border:1px solid #dfd6cc;border-radius:10px;background:#fff;color:var(--ink);font:inherit;text-align:left;cursor:pointer;transition:border-color .15s,background .15s}
.status-option strong{font:600 14px Montserrat,Inter,sans-serif;color:var(--brand)}
.status-option small{font-size:11px;line-height:1.35;color:var(--muted)}
.status-option:hover:not([disabled]){border-color:var(--brand);background:#f6eee4}
.status-option:focus-visible{outline:3px solid var(--nude);outline-offset:2px}
.status-option[disabled]{cursor:default;border-color:var(--brand);background:#f6eee4}
.status-option.danger strong{color:var(--danger)}
@media(max-width:600px){.status-options{grid-template-columns:repeat(2,minmax(0,1fr))}}
/* Documento 26: validade do orçamento no rodapé do modal */
.form-actions{align-items:center}
.form-actions-extra{margin-right:auto;min-width:0}
.validity-choice{display:flex;flex-wrap:wrap;align-items:center;gap:6px 18px;margin:0;padding:0;border:0}
.validity-choice legend{float:left;margin-right:6px;padding:0;font:600 13px Inter,sans-serif;color:var(--ink)}
.validity-choice label{display:inline-flex;align-items:center;gap:6px;font-size:13px;color:var(--ink);cursor:pointer}
.validity-choice input[type=number]{width:64px;padding:5px 8px;border:1px solid #dfd6cc;border-radius:8px;font:inherit;text-align:center}
.catalog-hint{margin:0 0 12px}
@media(max-width:700px){.form-actions{flex-wrap:wrap}.form-actions-extra{flex-basis:100%;margin-bottom:6px}}

/* Document 29: higher contrast across the record and the agenda (status colours of the Clínica OS). */
:root{--muted:#574d45;--line:#d9cfc3}
.pill{font-weight:650;font-size:10.5px}
.pill.scheduled{background:#f4e3bf;color:#5f4610}.pill.confirmed{background:#d7eadc;color:#24513a}.pill.arrived{background:#e4d9f5;color:#4c318e}
.pill.in_consult,.pill.active{background:#d6e5f0;color:#2f4d60}.pill.completed{background:#e4e1dd;color:#48423d}.pill.cancelled{background:#f5d6d2;color:#8e3027}
.pill.no_show{background:#f6dcc4;color:#7c3f12}.pill.rescheduled{background:#dfe4ee;color:#3a4763}.pill.paused{background:#f1dfbb;color:#5f4610}.pill.closed{background:#e1e6da;color:#46523a}
.record-nav{background:#e3d8ca}
.record-tab{color:#4a3b32}.record-tab>.icon{color:#7a5f49}
.record-tab:hover{background:#efe6db;color:#2f241d}
.record-tab.active{color:#2f2018;background:#fff;border-color:#bfa68d;box-shadow:inset 3px 0 0 var(--brand)}
.record-tab.active>.icon{color:var(--brand)}
.field>span,.field>label{color:#4a3f37}
.pathology-card{border-top:2px solid #cbb9a5}
.pathology-details{border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:14px 0}
.compact-record{border-bottom:1px solid #cdbfae}
.compact-record>summary{border-left:3px solid transparent}
.compact-record[open]>summary,.compact-record>summary:hover{border-left-color:var(--brand)}
.diagnosis-result{border-left-width:4px}
.nowrap{white-space:nowrap}
/* PVHIV: smaller than before (documents 26 and 29). */
.hiv-flag{gap:7px;padding:4px 10px;border-radius:8px}
.hiv-flag input{width:14px;height:14px}
.hiv-flag strong{font-size:12px;letter-spacing:.3px}
.hiv-flag small{font-size:10px}
.patient-alert{font-size:13px;padding:2px 10px}
/* Several CIDs in one visit. */
.cid-selected{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-top:8px}
.cid-selected:empty{display:none}
.cid-selected-label{font-size:11px;color:var(--muted)}
.cid-tag{display:inline-flex;align-items:center;gap:4px;padding:3px 6px 3px 10px;border-radius:999px;background:#efe3d6;border:1px solid #cdb39a;color:#3d2b20;font-size:12px;font-weight:650;letter-spacing:.2px}
.cid-tag button{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:50%;background:transparent;color:#6b5140;padding:0}
.cid-tag button:hover,.cid-tag button:focus-visible{background:#dcc6b0;color:#2f2018}
.cid-tag .icon{width:13px;height:13px}
/* Measurements of the visit (endocrinology and rheumatology). */
.vitals-box{border:1px solid #cdbfae;border-radius:12px;padding:12px 16px 14px;margin:0 0 20px;background:#fbf8f4}
.vitals-box legend{padding:0 6px;font-size:12px;font-weight:650;color:#4a3b32;letter-spacing:.2px}
.vitals-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;align-items:end}
.vital input{text-align:center;font-variant-numeric:tabular-nums}
.vital-bmi output{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:44px;border-radius:9px;background:#efe6db;padding:4px 8px;line-height:1.2}
.vital-bmi output strong{font-size:17px;color:#2f2018;font-variant-numeric:tabular-nums}
.vital-bmi output small{font-size:10px;color:var(--muted)}
.fracture-flag{display:flex;align-items:flex-start;gap:10px;margin:16px 0 0;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:#fff;max-width:max-content}
.fracture-flag strong{display:block;font-size:13px;color:#4a3b32}
.fracture-flag small{display:block;color:var(--muted)}
@media(max-width:900px){.vitals-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.vital-bmi{grid-column:1/-1}}
/* Login without page scroll on desktop screens. */
@media(min-width:761px){
  .login-page{height:100dvh;min-height:0;overflow:hidden}
  .login-story{min-height:0;padding-top:clamp(22px,4vh,42px);padding-bottom:clamp(18px,3.5vh,36px)}
  .login-editorial{padding:clamp(12px,5vh,70px) 0}
  .login-story p{margin:clamp(12px,2.6vh,28px) 0 clamp(14px,3vh,36px)}
  .login-access{overflow-y:auto;padding-top:clamp(16px,4vh,48px);padding-bottom:12px}
  .login-form{padding:clamp(12px,3vh,50px) 0}
  .login-intro{margin-bottom:clamp(14px,3vh,32px)}
}
/* boot.js: a module did not load. */
.boot-failed h2{margin-bottom:8px}.boot-failed button{margin-top:12px}
/* Document 29: agenda board like the Clínica OS (one column per doctor or per day, one row per patient). */
.ag-stats{display:flex;flex-wrap:wrap;gap:8px;margin:4px 0 14px}
.ag-stat{display:inline-flex;align-items:center;gap:8px;background:#fff;border:1px solid var(--line);border-radius:999px;padding:6px 14px;font-size:12px;color:var(--muted);font-weight:600;line-height:1.4}
.ag-stat b{font-family:Montserrat,Inter,sans-serif;font-weight:800;font-size:14px;color:var(--ink)}
.ag-stat.ok b{color:#2f6b4c}.ag-stat.warn b{color:#a4471f}.ag-stat.purple b{color:#5b3f9e}.ag-stat.done b{color:#6b645e}.ag-stat.sand b{color:#7f746b}
button.ag-stat{cursor:pointer}button.ag-stat[aria-pressed=true]{border-color:var(--brand);background:#f6efe7;color:var(--ink)}
.ag-search{max-width:420px;margin:0 0 14px}
.ag-board{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,340px),1fr));gap:16px;align-items:start}
.ag-board.by-day{grid-template-columns:repeat(auto-fill,minmax(min(100%,240px),1fr))}
.ag-col{background:#fff;border:1px solid var(--line);border-radius:14px;overflow:hidden;box-shadow:0 1px 2px #3a2e270d}
.ag-col.today{border-color:#bfa68d;box-shadow:0 0 0 2px #ead9c6}
.ag-col-h{display:flex;align-items:center;gap:11px;padding:12px 16px;background:#f4ece3;border-bottom:1px solid var(--line)}
.ag-col-h strong{display:block;font-size:14px;line-height:1.3;text-transform:capitalize}
.ag-col-h small{display:block;color:var(--muted);font-size:11.5px}
.ag-col-h .avatar{width:34px;height:34px;font-size:12px;flex:none}
.ag-pac{display:grid;grid-template-columns:48px minmax(0,1fr);gap:4px 12px;width:100%;text-align:left;background:#fff;padding:11px 16px 11px 12px;border:0;border-bottom:1px solid #e9dfd3;border-left:4px solid transparent;color:var(--ink);cursor:pointer;font:inherit;border-radius:0}
.ag-pac:last-child{border-bottom:0}
.ag-pac:hover{background:#faf5ef}
.ag-pac:focus-visible{outline:3px solid var(--nude);outline-offset:-3px}
.ag-h{font-family:Montserrat,Inter,sans-serif;font-weight:800;font-size:13px;font-variant-numeric:tabular-nums;padding-top:1px}
.ag-q strong{display:block;font-size:13.5px;font-weight:650;line-height:1.35;overflow-wrap:anywhere}
.ag-q small{display:block;font-size:11.5px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ag-st{grid-column:2;display:flex;flex-wrap:wrap;gap:5px;align-items:center}
.ag-pac.passado{opacity:.55}
.ag-pac.proximo{border-left-color:#c98f62;background:linear-gradient(90deg,#f6e2d1,#fff 72%)}
.ag-pac.chegou{border-left-color:#7c5cc7;background:linear-gradient(90deg,#ebe2f8,#fff 72%)}
.ag-pac.atendendo{border-left-color:#3d6a86;background:linear-gradient(90deg,#dde9f2,#fff 72%)}
.ag-pac.finalizado{border-left-color:#a9a29c;background:#f2f0ee}.ag-pac.finalizado strong,.ag-pac.finalizado .ag-h{color:#625b55}
.ag-pac.cancelado strong{text-decoration:line-through;color:var(--muted)}
.ag-pac.current-patient{box-shadow:inset 0 0 0 2px var(--brand);background:#f7eee4}
.ag-tag{display:inline-flex;padding:2px 8px;border-radius:999px;font-size:10.5px;font-weight:650;line-height:1.5}
.ag-tag.warn{background:#f6dcc4;color:#7c3f12}.ag-tag.info{background:#d6e5f0;color:#2f4d60}
.ag-free{padding:14px 16px;color:var(--muted);font-size:12px;margin:0}
.ag-empty{padding:28px;text-align:center;color:var(--muted)}
/* Booking: patient found by typing, or registered on the spot. */
.patient-results{display:grid;gap:4px;margin-top:6px}
.patient-results:empty{display:none}
.patient-option{display:flex;flex-direction:column;align-items:flex-start;text-align:left;padding:8px 12px;border:1px solid var(--line);border-radius:9px;background:#fff;color:var(--ink);font:inherit}
.patient-option:hover,.patient-option:focus-visible{border-color:var(--brand);background:#faf5ef}
.patient-option strong{font-size:13px}.patient-option small{color:var(--muted)}
.patient-picker>.btn{justify-self:start;margin-top:6px}
/* Document 29 · aesthetic map: one tab per product, biostimulator lines */
.map-tabs{display:flex;flex-wrap:wrap;gap:4px;border-bottom:2px solid var(--line);margin-bottom:12px}
.map-tab{display:inline-flex;align-items:center;gap:7px;min-height:40px;padding:8px 14px;border:1px solid transparent;border-bottom:none;border-radius:9px 9px 0 0;background:transparent;color:var(--muted);font:inherit;font-weight:600;cursor:pointer;margin-bottom:-2px}
.map-tab:hover{color:var(--ink);background:#f6f1ec}
.map-tab[aria-selected="true"]{background:#fff;color:var(--ink);border-color:var(--line);border-bottom:2px solid #fff}
.map-tab.toxina[aria-selected="true"]{box-shadow:inset 0 3px 0 #b07d5a}.map-tab.preenchimento[aria-selected="true"]{box-shadow:inset 0 3px 0 #3f6f9a}.map-tab.bioestimulador[aria-selected="true"]{box-shadow:inset 0 3px 0 #46745e}.map-tab.skinbooster[aria-selected="true"]{box-shadow:inset 0 3px 0 #8a6d4f}.map-tab.all[aria-selected="true"]{box-shadow:inset 0 3px 0 var(--ink)}
.map-count{display:inline-block;min-width:20px;padding:1px 6px;border-radius:10px;background:#efe7df;color:var(--ink);font-size:12px;text-align:center}
.map-overlay.stroke-mode{touch-action:none;cursor:crosshair}
.map-overlay .map-line .halo{stroke:#fff;stroke-width:15;stroke-linecap:round}
.map-overlay .map-line .stroke{stroke:#46745e;stroke-width:9;stroke-linecap:round}
.map-overlay .map-line.selected .halo{stroke:#1f1914}
.map-overlay .map-preview{stroke:#46745e;stroke-width:9;stroke-linecap:round;stroke-dasharray:14 10;opacity:.85;pointer-events:none}
/* Document 29 · prescription: medication search, interactions, undated issue, model visibility */
.med-results{display:grid;gap:4px;max-height:340px;overflow:auto;margin:6px 0}
.med-results:empty{display:none}
.med-option{display:grid;gap:2px;text-align:left;padding:8px 10px;border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--ink);font:inherit;cursor:pointer}
.med-option strong{font-size:14px}
.med-option small{color:var(--muted);font-size:12px;line-height:1.35}
.med-option.active,.med-option:hover{border-color:var(--brand);background:#faf6f2;box-shadow:0 0 0 2px #71574722}
.rx-alert{border-left:4px solid;padding:8px 10px;border-radius:6px;margin:6px 0;color:#2a201a}
.rx-alert.grave{border-color:#b5473f;background:#fbecea}
.rx-alert.atencao{border-color:#c48a1c;background:#fdf3df}
.rx-alert strong{font-size:13px}
.rx-alert p{margin:4px 0 0;font-size:13px;line-height:1.4}
.rx-alert small{display:block;margin-top:4px;color:#6b5a4d;font-size:12px}
.rx-note{font-size:12px;color:var(--muted);margin:8px 0 0;line-height:1.4}
.model-visibility{border:1px solid var(--line);border-radius:8px;padding:8px 12px 10px;display:flex;flex-wrap:wrap;gap:6px 18px;margin:10px 0 0}
.model-visibility legend{font-weight:600;padding:0 4px}
.model-visibility small{flex-basis:100%}
/* Document 29 · guided camera (Anexos e imagens), mirrored from the Clínica OS */
.guided-camera{position:fixed;inset:0;z-index:300;background:#14100c;display:flex;flex-direction:column;color:#f4ece4}
.guided-camera .gc-top{display:flex;align-items:center;gap:10px 14px;padding:10px 14px;background:#14100ceb;flex-wrap:wrap}
.guided-camera .gc-patient{display:grid;gap:2px;min-width:160px}
.guided-camera .gc-patient small{color:#cbb9a7;font-size:12px}
.guided-camera .gc-poses{display:flex;gap:6px;flex:1;overflow-x:auto;padding-bottom:2px}
.guided-camera .gc-pose{flex:none;min-height:36px;padding:6px 12px;border-radius:9px;border:1px solid #ffffff40;background:transparent;color:#f4ece4;font:inherit;font-size:13px;cursor:pointer}
.guided-camera .gc-pose[aria-pressed="true"]{background:#f4ece4;color:#14100c;border-color:#f4ece4;font-weight:700}
.guided-camera .gc-region{display:grid;gap:2px;font-size:12px;color:#cbb9a7}
.guided-camera .gc-region input{min-height:36px;padding:6px 10px;border-radius:8px;border:1px solid #ffffff40;background:#ffffff14;color:#fff;font:inherit;width:220px}
.guided-camera .gc-buttons{display:flex;gap:6px}
.guided-camera .gc-stage{flex:1;position:relative;overflow:hidden;display:flex;align-items:center;justify-content:center;background:#000}
.guided-camera video{width:100%;height:100%;object-fit:contain}
.guided-camera .gc-guide{position:absolute;inset:0;pointer-events:none;display:flex;align-items:center;justify-content:center}
.guided-camera .gc-guide svg{width:min(92%,560px);height:92%;filter:drop-shadow(0 1px 3px #0007);fill:none}
.guided-camera .g-main{stroke:#ffffffe6;stroke-width:1.4;stroke-dasharray:4 3}
.guided-camera .g-axis{stroke:#ffffff8c;stroke-width:.8}
.guided-camera .g-third{stroke:#ffffff73;stroke-width:.8;stroke-dasharray:3 3}
.guided-camera .g-faint{stroke:#ffffff4d;stroke-width:.8;stroke-dasharray:3 3}
.guided-camera .gc-bottom{display:flex;align-items:center;gap:16px;padding:14px 16px 22px;background:#14100ceb}
.guided-camera .gc-tip{flex:1;margin:0;color:#d9c9b8;font-size:14px;line-height:1.45}
.guided-camera .gc-shoot{width:74px;height:74px;border-radius:50%;border:4px solid #fff;background:var(--brand);cursor:pointer;flex:none;box-shadow:0 4px 18px #0008;transition:transform .1s}
.guided-camera .gc-shoot:active{transform:scale(.92)}
.guided-camera .gc-shoot:disabled{opacity:.5}
.guided-camera .gc-shoot:focus-visible{outline:3px solid #f4ece4;outline-offset:4px}
@media (max-width:720px){.guided-camera .gc-region input{width:100%}.guided-camera .gc-region{flex:1}}
