/* Planejamento visual (Clientes → paciente → Planejamento → Procedimentos). Escopado a #sheet; app e /ios. */
#sheet .pl-seg{margin:10px 0 12px}
#sheet .vp-title input{width:100%;min-height:44px;border:0;background:transparent;font-size:17px;font-weight:650;color:var(--ad-ink,#3d2817);padding:0 4px}
#sheet .vp-title input:focus-visible{outline:3px solid var(--ad-focus,#b8892f);border-radius:8px}
#sheet .vp-save{min-height:44px;padding-inline:18px}
#sheet .vp-icon,#sheet .vp-tool{display:inline-grid;place-items:center;width:44px;height:44px;min-width:44px;border-radius:12px;border:0;background:transparent;color:var(--ad-ink,#3d2817);cursor:pointer}
#sheet .vp-tool[aria-pressed=true]{background:var(--vp-control,#f2f2f2);box-shadow:inset 0 0 0 1px var(--vp-line,#e3e3e3)}
#sheet .vp-tool:disabled{opacity:.35;cursor:default}
#sheet .vp-tool:focus-visible,#sheet .vp-icon:focus-visible,#sheet .vp-swatch:focus-visible{outline:3px solid var(--ad-focus,#b8892f);outline-offset:1px}
#sheet .vp-txt{font-size:15px;font-weight:650}
#sheet .vp-sep{width:1px;height:24px;background:var(--vp-line,#e3e3e3);margin:0 4px}
#sheet .vp-style{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
#sheet .vp-swatches{display:flex;gap:2px}
#sheet .vp-swatch{width:44px;height:44px;border:0;background:transparent;border-radius:50%;display:grid;place-items:center;cursor:pointer}
#sheet .vp-swatch::before{content:"";width:22px;height:22px;border-radius:50%;background:var(--sw);box-shadow:inset 0 0 0 1px rgb(0 0 0 / 18%)}
#sheet .vp-swatch[aria-pressed=true]::before{box-shadow:0 0 0 2px var(--ad-surface,#fff),0 0 0 4px var(--ad-ink,#3d2817)}
#sheet .vp-seg{display:flex;padding:2px;gap:2px;border-radius:10px;background:var(--vp-control,#f2f2f2)}
#sheet .vp-seg button{min-height:44px;min-width:44px;padding:0 10px;border:0;border-radius:8px;background:transparent;color:var(--ad-muted,#6b5d52);font-size:13px;display:grid;place-items:center}
#sheet .vp-seg button[aria-pressed=true]{background:var(--ad-surface,#fff);color:var(--ad-ink,#3d2817);box-shadow:0 1px 2px rgb(0 0 0 / 8%)}
#sheet .vp-seg i{display:block;width:22px;border-radius:9px;background:currentColor}
#sheet .vp-layers{display:flex;gap:6px;overflow-x:auto;padding-bottom:2px;scrollbar-width:thin}
#sheet .vp-layer{flex:none;min-height:44px;padding:0 12px;border-radius:20px;border:1px solid var(--vp-line,#e3e3e3);background:var(--ad-surface,#fff);color:var(--ad-muted,#6b5d52);font-size:13px;white-space:nowrap}
#sheet .vp-layer[aria-selected=true]{color:var(--ad-ink,#3d2817);border-color:var(--ad-ink,#3d2817);font-weight:600}
#sheet .vp-canvas{display:block;position:absolute;inset:0}
#sheet .vp-note{color:var(--ad-muted,#6b5d52);margin:0}
#sheet .vp-note:empty{display:none}
#sheet .vp-add{padding:10px;border-radius:12px;border:1px solid var(--vp-line,#e3e3e3)}
#sheet .vp-template-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:8px;margin:8px 0}
#sheet .vp-template-grid button{min-height:44px}
#sheet .vp-photos{display:grid;grid-template-columns:repeat(auto-fill,minmax(72px,1fr));gap:6px;max-height:220px;overflow:auto}
#sheet .vp-photo{padding:0;border:0;border-radius:10px;overflow:hidden;aspect-ratio:3/4;min-height:44px;background:var(--vp-control,#f2f2f2)}
#sheet .vp-photo img{width:100%;height:100%;object-fit:cover;display:block}
#sheet .vp-chip{display:inline-block;padding:1px 8px;border-radius:10px;font-size:11px;font-weight:600;background:var(--vp-control,#f2f2f2);color:var(--ad-ink,#3d2817)}
#sheet .vp-origin{font-size:12px;color:var(--ad-muted,#6b5d52)}
#sheet .vp-templates{margin-top:8px}
#sheet .vp-root .text-button,#sheet .vp-editor .text-button{min-height:44px;min-width:44px}

/* Editor em tela cheia (estilo editor de foto): cabeçalho, camadas, palco flexível e barra inferior. */
dialog#sheet.vp-wide{width:min(1180px,calc(100vw - 20px));height:calc(100dvh - 20px);max-height:calc(100dvh - 20px);padding:0;display:flex;flex-direction:column;overflow:hidden;background:#fff}
#sheet.vp-wide #plan-root.vp-root{display:flex;flex-direction:column;flex:1;min-height:0}
#sheet .vp-editor{--vp-paper:#ffffff;--vp-control:#f2f2f2;--vp-line:#e3e3e3;display:flex;flex-direction:column;flex:1;min-height:0;gap:6px;padding:0 10px calc(8px + env(safe-area-inset-bottom));background:#fff;color:var(--ad-ink,#3d2817);overflow:hidden}
#sheet .vp-editor>*{flex-shrink:0;min-width:0}
#sheet .vp-head{display:grid;grid-template-columns:44px minmax(0,1fr) 44px auto;align-items:center;gap:4px;padding:calc(6px + env(safe-area-inset-top)) 0 4px;background:#fff;border-bottom:1px solid var(--vp-line)}
#sheet .vp-alerts{max-height:30dvh;overflow:auto;display:grid;gap:6px}
#sheet .vp-alerts .form-error{margin:0}
#sheet .vp-main{position:relative;flex:1 1 auto;min-height:0;display:flex;gap:10px}
#sheet .vp-stage{position:relative;flex:1 1 auto;min-width:0;min-height:0;height:auto;border-radius:12px;overflow:hidden;background:var(--vp-paper);border:1px solid var(--vp-line);touch-action:none;-webkit-user-select:none;user-select:none}
#sheet .vp-zoom{position:absolute;top:8px;right:8px;z-index:2;display:flex;flex-direction:column;gap:2px;padding:2px;border-radius:12px;background:rgb(255 255 255 / 92%);box-shadow:0 1px 4px rgb(0 0 0 / 12%)}
#sheet .vp-side{display:contents}
#sheet .vp-pop{display:none;position:absolute;left:0;right:0;bottom:0;z-index:3;max-height:70%;overflow:auto;padding:10px 12px;border-radius:14px 14px 12px 12px;background:#fff;border:1px solid var(--vp-line);box-shadow:0 -4px 18px rgb(0 0 0 / 12%);gap:8px;flex-direction:column}
#sheet .vp-pop[data-open]{display:flex}
#sheet .vp-pop-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
#sheet .vp-pop-close{font-size:24px;line-height:1}
#sheet .vp-ann{background:#fff}
#sheet .vp-toolbar{display:flex;align-items:center;justify-content:space-between;gap:2px;padding:2px;border-radius:14px;background:var(--vp-control);overflow-x:auto;scrollbar-width:none}
#sheet .vp-toolbar .vp-tool[aria-pressed=true]{background:#fff}
#sheet .vp-sample{display:grid;place-items:center;width:28px;height:28px;border-radius:50%;background:#fff;box-shadow:inset 0 0 0 1px var(--vp-line);color:var(--sw)}
#sheet .vp-sample i{display:block;width:16px;border-radius:9px;background:currentColor}
#sheet .vp-layers{gap:6px}
#sheet .vp-layer-add{color:var(--ad-ink,#3d2817)}
@media (max-width:700px){
  dialog#sheet.vp-wide{width:100vw;max-width:100vw;height:var(--app-h,100dvh);max-height:var(--app-h,100dvh);margin:0;inset:0;border-radius:0;padding:0}
  html[data-ad-mobile="ios"] dialog#sheet.vp-wide{max-height:var(--app-h,100dvh);padding-bottom:0}
}
@media (max-width:400px){#sheet .vp-editor{padding-inline:6px}#sheet .vp-toolbar{gap:0}}
/* Desktop: palco grande e painel lateral fixo com estilo e detalhes. */
@media (min-width:900px){
  #sheet .vp-side{display:flex;flex-direction:column;gap:10px;width:300px;flex:none;overflow:auto}
  #sheet .vp-side .vp-pop{display:flex;position:static;max-height:none;box-shadow:none;border-radius:12px}
  #sheet .vp-side .vp-pop-close,#sheet .vp-style-btn,#sheet .vp-details-btn{display:none}
  #sheet .vp-head{grid-template-columns:44px minmax(0,1fr) auto}
  #sheet .vp-toolbar{justify-content:flex-start;align-self:flex-start}
}

/* Abertura: casca imediata clara + resumo do card já autorizado + esqueleto discreto. */
.vp-opening .vp-opening-title { flex: 1; font-weight: 600; }
.vp-opening .vp-opening-copy { min-width: 0; display: grid; gap: 2px; }
.vp-opening .vp-opening-copy b, .vp-opening .vp-opening-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vp-opening .vp-opening-copy b { font-size: 17px; font-weight: 650; }
.vp-opening .vp-opening-copy small { color: var(--ad-muted,#6b5d52); font-size: 12px; }
.vp-skel { display: grid; gap: 14px; padding: 18px 16px 24px; justify-items: center; }
.vp-skel-bar { width: min(60%, 320px); height: 14px; border-radius: 7px; }
.vp-skel-stage { width: 100%; max-width: 960px; aspect-ratio: 2 / 1; border-radius: 14px; }
.vp-skel-bar, .vp-skel-stage { background: linear-gradient(90deg, var(--surface-2, rgba(0,0,0,.05)) 0%, var(--surface-3, rgba(0,0,0,.09)) 50%, var(--surface-2, rgba(0,0,0,.05)) 100%); background-size: 200% 100%; animation: vp-skel 1.2s ease-in-out infinite; }
@keyframes vp-skel { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .vp-skel-bar, .vp-skel-stage { animation: none; } }
.vp-open-error { margin: 18px 16px; }
.vp-opening .text-button { min-height: 44px; }
