/* Referências de 08/09: superfícies claras, navegação fixa e hierarquia por apps.
   Só o aplicativo móvel recebe estas regras. As ações continuam no motor real. */
.mw-clinic-avatar{flex:none;width:34px;height:34px;border:1px solid #d4d7d9;border-radius:50%;background:white;color:#596574;font:11px system-ui;padding:0}
#mw-account-line{display:flex;align-items:center;min-width:0;gap:5px;line-height:1.2}
#mw-clinic-name{min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:15px;font-weight:650;color:#141a1e}
body.mw-mobile[data-mw-raiz=true] #mw-account-line{display:flex}
body.mw-mobile[data-mw-raiz=true] #sm-header-tools{display:none}
body.mw-mobile[data-mw-raiz=true] #sm-titulo{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
body.mw-mobile[data-mw-raiz=true] #sm-subtitulo{font-size:12px}
body.mw-mobile[data-mw-rota=chat] #sm-header-tools{display:none}
body.mw-mobile[data-mw-raiz=false] #mw-account-line{display:none}
body.mw-mobile[data-mw-raiz=false] #sm-titulo{font-size:17px;color:#151b1e!important;letter-spacing:0}
.mw-dial-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin:20px 0}.mw-dial-key{min-height:64px;font-size:26px!important;background:#f4f7f7;color:#1d5650;border:0;border-radius:50%}
body.mw-mobile{--mw-bg:#fff;--mw-surface:#fff;--mw-ink:#374151;--mw-muted:#727b80;--mw-line:#e9eaec;--mw-accent:#00594f;--mw-soft:#cee3e2;--sm-ink:var(--mw-ink);--sm-muted:var(--mw-muted);--sm-accent:var(--mw-accent);--primaria:var(--mw-accent);--roxo:var(--mw-accent);color:var(--mw-ink);background:var(--mw-bg)}
body.mw-mobile[data-mw-tema=escuro]{--mw-bg:#111b1d;--mw-surface:#1c292c;--mw-ink:#e2f0ee;--mw-muted:#a5b9b7;--mw-line:#35494a;--mw-accent:#74cfbe;--mw-soft:#284c46;color-scheme:dark}
.mw-mobile #app,.mw-mobile #main,.mw-mobile #sm-page.mw-page{background:var(--mw-bg)}
.mw-mobile #sm-header{min-height:68px;padding:10px 14px;background:var(--mw-surface);border-bottom:1px solid var(--mw-line);backdrop-filter:none;box-shadow:0 6px 14px #182a3210;gap:6px}
.mw-mobile #sm-titulo{font-size:20px;font-weight:650;letter-spacing:-.4px;color:var(--mw-ink)!important}
.mw-mobile #sm-subtitulo{color:var(--mw-muted);font-size:12px}
.mw-mobile .sm-icon,.mw-mobile .mw-accounts{color:var(--mw-ink)}
.mw-mobile #view{padding-bottom:0!important}
.mw-mobile #sm-page.mw-page{padding:14px 14px 20px;scrollbar-gutter:auto;scrollbar-width:none}
.mw-mobile #sm-dock{position:static;flex:none;left:auto;right:auto;bottom:auto;transform:none;max-width:none;width:100%;height:calc(72px + var(--sm-bottom));border-radius:0;border:0;border-top:1px solid var(--mw-line);box-shadow:none;background:var(--mw-surface);padding:5px 6px calc(5px + var(--sm-bottom));gap:0;backdrop-filter:none}
.mw-mobile #sm-dock button{display:flex;flex-direction:column;gap:4px;justify-content:center;align-items:center;width:20%;height:65px;padding:0;border-radius:0;color:var(--mw-muted);background:transparent;font-weight:500}
.mw-mobile .mw-dock-icon{display:grid;place-items:center;min-height:33px;width:54px;border-radius:20px}
.mw-mobile #sm-dock button svg{width:23px;height:23px;stroke-width:1.7}
.mw-mobile #sm-dock .mw-dock-label{font-size:10px;line-height:1.2;white-space:nowrap}
.mw-mobile #sm-dock button[aria-current=page]{background:transparent;color:var(--mw-accent)}
.mw-mobile #sm-dock button[aria-current=page] .mw-dock-icon{background:var(--mw-soft)}
.mw-account-help{margin:2px 0 10px;color:var(--mw-muted);font-size:13px}
.mw-account-option[aria-current=true]{background:var(--mw-soft)!important;border-radius:12px;padding-left:10px;padding-right:10px}
.mw-mobile .mw-section{margin:0 0 14px;border:0;padding:14px;background:var(--mw-surface);border-radius:7px}
.mw-mobile .mw-section>h2{font-size:13px;color:var(--mw-ink);font-weight:500;margin:0 0 16px;letter-spacing:0}
.mw-mobile .mw-section>p{margin:12px 0}
.mw-mobile .mw-card{position:relative;border:1px solid var(--mw-line);box-shadow:0 1px 4px #182a3222}
.mw-mobile .mw-search{border:1px solid var(--mw-line);border-radius:9px;background:var(--mw-surface);color:var(--mw-ink);height:46px;padding:10px 14px;margin:0 0 20px}
.mw-mobile .mw-app-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));column-gap:7px;row-gap:14px}
.mw-mobile .mw-app-tile{border:0;background:transparent;color:var(--mw-ink);display:flex;flex-direction:column;align-items:center;gap:9px;min-width:0;min-height:80px;padding:4px 0;justify-content:flex-start}
.mw-mobile .mw-app-tile>span{display:grid;place-items:center;border-radius:50%;width:46px;height:46px;background:var(--mw-surface);border:1px solid #d2d4d7}
.mw-mobile .mw-app-tile svg{width:22px;height:22px;stroke-width:1.9}
.mw-mobile .mw-app-tile b{font-size:12px;font-weight:400;line-height:1.4;overflow-wrap:normal;hyphens:auto;max-width:100%;text-align:center}
.mw-mobile .mw-app-tile:active>span{background:var(--mw-soft)}
.mw-mobile .mw-edit-pins{position:absolute;top:6px;right:6px;display:grid;place-items:center;width:44px;height:44px;padding:12px;border:0;background:transparent;color:var(--mw-accent)}
.mw-edit-pins svg{width:20px;height:20px}
.mw-mobile .mw-home-metrics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:0 0 18px}
.mw-mobile .mw-metric{padding:14px;border:1px solid var(--mw-line);border-radius:12px;background:var(--mw-surface);text-align:left;color:var(--mw-ink)}
.mw-metric small{display:block;font-size:10px;color:var(--mw-muted);margin-bottom:8px}
.mw-metric>span{display:flex;align-items:center;justify-content:space-between;gap:6px;font-size:12px}
.mw-metric svg{width:18px;height:18px;color:var(--mw-accent)}
.mw-metric>b{display:block;margin-top:14px;font-size:20px;font-weight:500;color:var(--mw-accent)}
.mw-mobile .mw-muted,.mw-mobile .mw-section small{color:var(--mw-muted)}
.mw-mobile .mw-page .sm-option{background:transparent;color:var(--mw-ink);min-height:66px;padding:14px 0;border-bottom:1px solid var(--mw-line);gap:12px}
.mw-mobile .mw-page .sm-option b{font-size:15px;line-height:1.4;letter-spacing:0}
.mw-mobile .mw-page .sm-option small{font-size:12px;color:var(--mw-muted)}
.mw-mobile .mw-page .sm-option>svg{width:23px;height:23px;color:var(--mw-accent)}
.mw-mobile .mw-page .sm-option:last-child{border-bottom:0}
.mw-pin-notice{background:var(--mw-soft);border-radius:8px;padding:12px;font-size:13px;color:var(--mw-ink);margin:0 0 18px}
.mw-pin-row{display:flex;gap:8px;background:var(--mw-surface);padding:0;margin-bottom:9px}
.mw-pin-choice{display:flex;align-items:center;gap:12px;flex:1;min-width:0;min-height:44px;border:1px solid var(--mw-line);border-radius:7px;background:transparent;color:var(--mw-ink);text-align:left;padding:8px}
.mw-pin-choice svg{width:22px;height:22px;color:var(--mw-accent)}
.mw-pin-choice span:first-of-type{flex:1;font-size:14px;overflow-wrap:anywhere}
.mw-pin-choice[aria-pressed=true]{border-color:var(--mw-accent);background:var(--mw-surface)}
.mw-pin-handle{width:38px;flex:none;border:1px solid var(--mw-accent);border-radius:6px;background:var(--mw-surface);color:var(--mw-accent);touch-action:none;cursor:grab}.mw-pin-handle svg{width:16px;height:24px;fill:currentColor}.mw-pin-handle:focus-visible{outline:3px solid var(--mw-accent)}
.mw-pin-checkbox{display:grid;place-items:center;width:20px;height:20px;border:1px solid var(--mw-line);border-radius:4px;flex:none}.mw-pin-choice[aria-pressed=true] .mw-pin-checkbox{background:var(--mw-accent);border-color:var(--mw-accent);color:var(--mw-surface)}
.mw-pin-divider{margin:20px 0 16px;text-align:center;font-size:12px;font-weight:400;color:var(--mw-muted);border-top:1px solid var(--mw-line);padding-top:14px}.mw-pin-dragging{opacity:.6}.mw-pin-target{outline:2px dashed var(--mw-accent);outline-offset:2px}
.mw-pin-order{width:36px;min-height:44px;padding:4px;border:0;background:transparent;color:var(--mw-accent)}
.mw-temas{display:flex;border:1px solid var(--mw-line);background:var(--mw-bg);border-radius:9px;padding:4px;gap:4px}
.mw-temas button{flex:1;border:0!important;border-radius:6px!important;background:transparent!important;padding:8px!important;min-height:44px}
.mw-temas button[aria-pressed=true]{background:var(--mw-surface)!important;box-shadow:0 1px 4px #132f3520;color:var(--mw-accent)}
.mw-mobile .mw-primary{background:var(--mw-accent);border-color:var(--mw-accent);color:var(--mw-surface);border-radius:8px}
.mw-mobile .mw-quiet,.mw-mobile .mw-chip{background:var(--mw-surface);border-color:var(--mw-line);color:var(--mw-ink);border-radius:8px}
.mw-mobile .mw-chip[aria-pressed=true]{background:var(--mw-soft);border-color:var(--mw-accent);color:var(--mw-accent)}
.mw-mobile .mw-form input,.mw-mobile .mw-form select,.mw-mobile .mw-form textarea,.mw-mobile .mw-toolbar>button,.mw-mobile .mw-toolbar input{background:var(--mw-surface);color:var(--mw-ink);border-color:var(--mw-line);border-radius:8px}
.mw-mobile .mw-state{color:var(--mw-muted)}.mw-mobile .mw-state b{color:var(--mw-ink)}
.mw-month{background:var(--mw-surface);border:1px solid var(--mw-line);padding:10px;border-radius:12px}
.mw-month-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:0 0 12px;font-size:16px;text-transform:capitalize}
.mw-month-heading button{min-width:44px;font-size:24px!important;border:0!important}
.mw-month-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));row-gap:6px;align-items:center;text-align:center}
.mw-month-grid>span{font-size:11px;color:var(--mw-muted);padding:7px 0}
.mw-month-day{min-width:0;height:42px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--mw-ink);font-size:14px!important}
.mw-month-day[aria-pressed=true]{background:var(--mw-accent);color:var(--mw-surface)}
.mw-status-chart{display:flex;align-items:center;gap:18px;justify-content:center;flex-wrap:wrap;padding:8px 0 12px}
.mw-donut{width:138px;height:138px;border-radius:50%;display:grid;place-items:center;flex:none}
.mw-donut>span{width:106px;height:106px;display:grid;place-items:center;border-radius:50%;background:var(--mw-surface);font-size:25px}
.mw-status-chart ul{list-style:none;margin:0;padding:0;display:grid;gap:12px;min-width:105px;font-size:12px}
.mw-status-chart li{display:flex;align-items:center;gap:7px}.mw-status-chart li b{margin-left:auto}.mw-status-chart li i{width:8px;height:8px;border-radius:50%}
.mw-value{font-size:30px;letter-spacing:-1px}.mw-chart-bar{display:grid;grid-template-columns:minmax(80px,1fr) minmax(70px,1.5fr) 24px;align-items:center;gap:10px;font-size:11px;margin:15px 0}
.mw-chart-bar>span{overflow-wrap:anywhere}.mw-chart-bar>div{background:var(--mw-bg);height:22px;border-radius:3px;overflow:hidden}.mw-chart-bar i{height:100%;display:block;background:#2887d6;min-width:0}
.mw-funnel-table{width:100%;table-layout:fixed;border-collapse:collapse;margin-top:24px;font-size:11px}
.mw-funnel-table th,.mw-funnel-table td{text-align:left;overflow-wrap:anywhere;padding:12px 4px;border-bottom:1px solid var(--mw-line)}
.mw-funnel-table th{color:var(--mw-muted);font-weight:500;background:var(--mw-bg)}
.mw-mobile .sm-inbox .ccv-item,.mw-mobile .sm-inbox .rel-item{min-height:90px!important;border-bottom:1px solid var(--mw-line)!important}
.mw-mobile .sm-inbox .ccv-avatar,.mw-mobile .sm-inbox .rel-avatar{width:47px!important;height:47px!important;min-width:47px!important;background:#eaf3f1!important;color:#1c5650!important;border:1px solid #deebe7!important}
.mw-mobile .sm-inbox #ccv-buscar,.mw-mobile .sm-inbox #rel-busca{border-radius:8px!important;background:#f5f8f7!important;border:1px solid #e3ece9!important}
.mw-mobile .sm-inbox .ccv-badge{background:#095f54!important}
.mw-mobile .sm-inbox #ccv-abas button{border-radius:7px!important}
.mw-mobile .sm-inbox #ccv-abas button.on{background:#e1f2ed!important;color:#095a50!important;border-color:#bcded4!important}
.mw-mobile .sm-priority-ring{border-color:#519b88}.mw-mobile .sm-priority-empty{background:#f3f8f6}
.mw-mobile .sm-inbox #ccv-mensagens .ccv-msg,.mw-mobile .sm-inbox .rel-balao{background:#e6f4ef!important;border-radius:9px!important}
.mw-mobile .sm-inbox #ccv-mensagens .ccv-msg-linha.minha .ccv-msg,.mw-mobile .sm-inbox .rel-msg.minha .rel-balao{background:#f0f4f3!important}
.mw-mobile .sm-inbox #ccv-enviar,.mw-mobile .sm-inbox #rel-enviar,.mw-mobile .sm-camera-chat{background:#075c56!important}
.mw-mobile .sm-inbox .ccv-composer-linha,.mw-mobile .sm-inbox #ccv-texto,.mw-mobile .sm-inbox #rel-txt{border-radius:9px!important;background:#f3f7f5!important}
.mw-mobile .sm-inbox .ccv-thread-cab,.mw-mobile .sm-inbox .rel-cab{border-color:#e4ede8!important}
.mw-mobile[data-mw-tema=escuro] #sm-sheet,.mw-mobile[data-mw-tema=escuro] #sm-sheet header,.mw-mobile[data-mw-tema=escuro] #sm-sheet .sm-option{background:var(--mw-surface);color:var(--mw-ink)}
.mw-mobile[data-mw-tema=escuro] .mw-person p{color:var(--mw-muted)}
.mw-mobile[data-mw-tema=escuro] .mw-error{color:#ffafa5}
/* Formulários legados usam suas cores próprias. A aparência não inverte fotos
   de prontuário nem altera as cores clínicas de status e contraindicação. */
@media(max-width:359px){.mw-mobile .mw-section{padding:12px}.mw-mobile .mw-app-grid{gap:18px 6px}.mw-mobile .mw-app-tile b{font-size:10px}.mw-mobile .mw-app-tile>span{width:38px;height:38px}.mw-mobile #sm-dock .mw-dock-label{font-size:9px}.mw-mobile .mw-dock-icon{width:47px}.mw-mobile #sm-titulo{font-size:18px}}
@media(prefers-reduced-motion:reduce){.mw-mobile *{scroll-behavior:auto!important;animation:none!important;transition:none!important}}
