/* Castellaris Workflow V71 */

/* ---------- Página inicial ---------- */
.wf70-home .wf55-spec-card{overflow:hidden}
.wf70-home .wf55-spec-card img{height:190px!important;object-fit:cover;border-bottom:1px solid #e6ebf2}
.wf70-home .wf55-spec-card b{font-weight:650;letter-spacing:.01em;color:#0d2e60}
.wf70-home .wf55-spec-card:hover{box-shadow:0 18px 40px #1327461a!important}
.wf70-home .wf55-spec-card.active{border-color:#b79751!important}
.v71-install{margin:22px auto 0;display:block}

/* ---------- Receituário: janela "Adicionar medicamento" ---------- */
.v71-rx-add{white-space:nowrap}
.v71-rx-empty{color:#6b7a8f;font-size:13px;margin:6px 0}
.v71-rxg-back{position:fixed;inset:0;background:#08162b66;z-index:900}
.v71-rxg{position:fixed;z-index:901;left:50%;top:50%;transform:translate(-50%,-50%);width:min(640px,calc(100vw - 24px));max-height:min(80vh,720px);display:flex;flex-direction:column;background:#fff;border-radius:16px;box-shadow:0 24px 60px #08162b40;overflow:hidden}
.v71-rxg-h{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:1px solid #e3e9f1;color:#0d2e60;font-size:16px}
.v71-rxg-body{padding:14px 16px;overflow:auto;flex:1}
.v71-rxg-body .v66-mini-search{width:100%;font-size:16px;padding:11px 12px}
.v71-rxg-body .v66-rxresults{max-height:none}
.v71-rxg-item{margin:0;padding:0}
.v71-rxg-miss{color:#8a6420;font-size:13px;margin:8px 0 0}.v71-rxg-ok{color:#1f6d52;font-size:13px;margin:8px 0 0}
.v71-rxg-f{display:flex;justify-content:flex-end;gap:8px;padding:12px 16px;border-top:1px solid #e3e9f1;background:#f8fafc}
.v71-allergy{margin:8px 0 0;padding:8px 10px;border-radius:10px;background:#fdecec;border:1px solid #f2b8b8;color:#8f1d1d;font-size:13px}

/* ---------- Gráficos: parâmetros personalizados ---------- */
.v71c-new{display:flex;flex-wrap:wrap;gap:10px;align-items:flex-end;margin:12px 0;padding:12px;border:1px solid #d4dfec;border-radius:12px;background:#f8fbff}
.v71c-new label{display:flex;flex-direction:column;gap:4px;font-size:12px;color:#33465e;flex:1;min-width:160px}
.v71c-new input,.v71c-add input{padding:8px 10px;border:1px solid #bcc9d8;border-radius:8px;font-size:14px}
.v71c-tag{font-style:normal;font-size:10px;font-weight:700;padding:1px 7px;border-radius:999px;background:#f1ecfb;color:#5b45b8;margin-left:4px;vertical-align:middle}
.v71c-empty{color:#7d8ba0;font-size:13px;margin:16px 0}
.v71c-add{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}.v71c-add input[name=v]{width:90px}
.v71c-vals{margin-top:8px;font-size:13px}.v71c-vals summary{cursor:pointer;color:#24538a}
.v71c-vals ul{list-style:none;margin:6px 0;padding:0}.v71c-vals li{display:flex;gap:10px;align-items:center;padding:3px 0;border-bottom:1px solid #eef2f7}
.v71c-vals li span{color:#6b7a8f;min-width:70px}.v71c-vals li button{margin-left:auto;border:0;background:none;color:#a23;cursor:pointer}
.v71c-rm{display:inline-block;margin-top:6px;font-size:12px;color:#a23!important}

/* ---------- Quadro de horários: intervalo rigoroso ---------- */
.wf71-strict{display:flex;align-items:center;gap:5px;font-size:12px;color:#33465e;margin-top:5px;white-space:nowrap}
.wf71-sleep{display:block;font-size:11px;font-weight:400;color:#6b7a8f}
.wf70-tag.t-strict{background:#efe9fb;color:#5b45b8}

/* ---------- Histórico: fotos após a conclusão ---------- */
.v71-media-ctx{font-size:13px;color:#33465e;background:#f6f8fb;border-radius:10px;padding:9px 12px;margin:10px 0}

/* ---------- Em evolução ---------- */
.v71-evo-chip{display:inline-flex;align-items:center;gap:7px;border:1px solid #c6a354;background:#c6a3541a;color:#f0e2bd;border-radius:999px;padding:6px 12px;font:600 13px/1 system-ui,sans-serif;cursor:pointer;white-space:nowrap}
.v71-evo-chip b{background:#c6a354;color:#091629;border-radius:999px;padding:2px 7px;font-size:12px}
.v71-evo-chip:hover{background:#c6a35433}
.v71-evo-chip.zero{opacity:.75}.v71-evo-chip.zero .v71-dot{animation:none;background:#8a96a8;box-shadow:none}
.v71-dot{width:8px;height:8px;border-radius:50%;background:#e9c46a;box-shadow:0 0 0 3px #e9c46a33;animation:v71pulse 2s infinite}
@keyframes v71pulse{50%{box-shadow:0 0 0 6px #e9c46a00}}
@media (prefers-reduced-motion:reduce){.v71-dot{animation:none}}
.v71-evo-list{list-style:none;margin:0;padding:0;display:grid;gap:10px}
.v71-evo-list li{display:flex;gap:12px;justify-content:space-between;align-items:center;flex-wrap:wrap;padding:12px 14px;border:1px solid #dbe2eb;border-radius:12px}
.v71-evo-list li.on{border-color:#b79751;background:#fbf8f0}
.v71-evo-list li small{display:block;color:#6b7a8f;font-size:12px;margin-top:2px}
.v71-evo-list .v71-evo-qp{color:#33465e;font-style:italic}
.v71-evo-now{font-size:11px;font-weight:700;color:#8a6420;background:#f6ecd2;border-radius:999px;padding:2px 8px;margin-left:8px}
.v71-evo-act{display:flex;gap:6px}
.v71-evo-note,.v71-muted{font-size:12px;color:#6b7a8f;margin-top:12px}
.v71-evo-empty{color:#6b7a8f}
.v71-dlg-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}

/* ---------- Evolução: títulos em caixa normal ---------- */
.wf42-editor-section h3,.wf37-output h3,.live-record h3,.wf37-doc h3{text-transform:none!important;letter-spacing:.01em!important}

/* ---------- Finalizar consulta: separado e discreto ---------- */
.wf37-header-tools .wf65-finish{margin-left:14px!important;order:99}
.wf37-header-tools{display:flex;align-items:center;gap:8px}

/* ---------- Evolução no celular (painel deslizante) ---------- */
.v71-evo-toggle{display:none}
.v71-cam{display:none}

@media (max-width:820px){
  html,body{overflow-x:hidden}
  input,select,textarea{font-size:16px!important}            /* evita zoom automático no iOS */
  .topbar{position:sticky;top:0;padding:8px 10px!important;gap:8px!important;min-height:0!important;height:auto!important;flex-wrap:wrap!important;padding-top:max(8px,env(safe-area-inset-top))!important}
  .topbar .brand .wf-product23,.topbar .brand>span:not(.wf69-symbol){display:none!important}
  .topbar .wf69-symbol{flex-basis:40px!important;width:40px!important;height:42px!important;background-size:280px 350px!important;background-position:-120px -94px!important}
  .topbar .consult-timer{display:none!important}
  .wf37-header-tools{flex-wrap:wrap;gap:6px!important;margin-left:auto}
  .wf37-header-tools .btn,.wf65-back,.wf65-finish,.v71-evo-chip{padding:7px 10px!important;font-size:13px!important}
  #feedback-host{display:none!important}

  /* menus laterais viram abas roláveis */
  .app,.wf37-app{display:block!important;min-height:0!important}
  aside.side,.wf37-sidebar{position:sticky!important;top:58px;z-index:20;background:#fff;border-right:0!important;border-bottom:1px solid #dbe2eb;padding:6px 8px!important;width:auto!important;max-width:100vw}
  aside.side .nav-label,aside.side .side-note,.wf37-sidebar h2,.wf37-sidebar .wf37-side-note{display:none!important}
  aside.side nav.nav,.wf37-menu{display:flex!important;flex-direction:row!important;gap:6px;overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch}
  aside.side nav.nav>*,.wf37-menu>*{flex:0 0 auto;white-space:nowrap;margin:0!important}
  main,.wf37-main{padding:12px!important;min-width:0}

  /* formulário em uma coluna; a evolução abre por baixo */
  .consult-layout,.wf37-layout{display:block!important}
  .live-record,.wf37-output{position:fixed!important;left:0;right:0;bottom:0;top:auto!important;z-index:850;max-height:78vh!important;height:78vh;border-radius:18px 18px 0 0!important;transform:translateY(105%);transition:transform .25s ease;box-shadow:0 -12px 40px #08162b33!important;padding-bottom:env(safe-area-inset-bottom)}
  body.v71-evo-open .live-record,body.v71-evo-open .wf37-output{transform:none}
  .v71-evo-toggle{display:block;position:fixed;right:14px;bottom:calc(14px + env(safe-area-inset-bottom));z-index:860;border:0;border-radius:999px;padding:12px 18px;background:#0d2e60;color:#fff;font:600 14px system-ui,sans-serif;box-shadow:0 8px 24px #08162b40}
  body.v71-evo-open .v71-evo-toggle{bottom:calc(78vh + 10px)}

  /* tabelas e cartões */
  table{max-width:100%}
  .wf70-ptable-wrap,.wf65-table,.v67c-fig svg{max-width:100%}
  .v67c-grid{grid-template-columns:1fr!important}
  .wf70-home .wf55-spec-grid{grid-template-columns:1fr 1fr!important;gap:12px!important}
  .wf70-home .wf55-spec-card img{height:120px!important}
  .wf70-home .wf55-spec-card b{font-size:15px!important;margin:12px 12px 4px!important}
  .wf70-home h1{font-size:1.45rem!important}
  .wf65-dialog{width:calc(100vw - 16px)!important;max-height:88vh;overflow:auto}
  .v71-rxg{top:auto;bottom:0;transform:translateX(-50%);width:100vw;max-height:88vh;border-radius:18px 18px 0 0}
  .v71-cam{display:inline-flex;align-items:center;gap:6px;justify-content:center}
  .wf65-media-form{grid-template-columns:1fr!important}
  .wf70-tl-pt{min-width:96px}
}
@media (max-width:420px){
  .wf70-home .wf55-spec-card img{height:104px!important}
  .wf70-home .wf55-spec-card b{font-size:14px!important}
}
