/* Componentes da demonstração, montados só com os tokens de tokens.css. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  font: var(--text-body);
  color: var(--text-primary);
  background: var(--surface-app);
  font-feature-settings: "cv05", "ss01";
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-md);
}

.tnum {
  font-variant-numeric: tabular-nums;
}

.mono {
  font-family: var(--font-mono);
  font-size: 13px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Ícones Lucide */
.ic {
  width: 20px;
  height: 20px;
  flex: none;
  stroke-width: 2;
}
i.ic { display: inline-block; }
.ic-16 { width: 16px; height: 16px; }
.ic-24 { width: 24px; height: 24px; }
.ic-32 { width: 32px; height: 32px; }

/* ---------------------------------------------------------------- Barra da demonstração */

.demo-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-6);
  background: var(--surface-base);
  border-bottom: 1px solid var(--border-default);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font: var(--text-title-sm);
  color: var(--text-primary);
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: var(--vida-500);
  color: #FFFFFF;
}

.demo-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--atencao-bg);
  color: var(--atencao-text);
  font: var(--text-caption);
  border: 1px solid color-mix(in srgb, var(--atencao-icon) 35%, transparent);
}

.demo-bar .spacer {
  flex: 1;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: var(--radius-pill);
  background: var(--surface-sunken);
  border: 1px solid var(--border-default);
}

.segmented button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 34px;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-secondary);
  font: 600 13px/18px var(--font-body);
  cursor: pointer;
  transition: background var(--duration-fast) var(--easing-standard);
}

.segmented button[aria-pressed="true"] {
  background: var(--surface-raised);
  color: var(--text-primary);
  box-shadow: var(--shadow-1);
}

/* ---------------------------------------------------------------- Palco */

.stage {
  display: grid;
  grid-template-columns: 410px minmax(0, 1fr);
  gap: var(--space-6);
  align-items: start;
  max-width: 1680px;
  margin: 0 auto;
  padding: var(--space-6);
}

.stage[data-view="patient"] {
  grid-template-columns: 1fr;
  justify-items: center;
}
.stage[data-view="patient"] .pro-wrap { display: none; }
.stage[data-view="pro"] { grid-template-columns: 1fr; }
.stage[data-view="pro"] .device-wrap { display: none; }

.pane-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-3);
  font: 600 13px/18px var(--font-body);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.device-wrap {
  position: sticky;
  top: 84px;
}

/* Moldura de celular */
.phone {
  position: relative;
  width: 410px;
  height: 860px;
  padding: 12px;
  border-radius: 54px;
  background: #0B1010;
  box-shadow: 0 30px 60px rgba(6, 36, 24, 0.25), inset 0 0 0 2px #2A3333;
}

.phone::before {
  content: "";
  position: absolute;
  top: 22px;
  left: 50%;
  width: 110px;
  height: 30px;
  margin-left: -55px;
  border-radius: 20px;
  background: #0B1010;
  z-index: 5;
}

.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 42px;
  background: var(--surface-sunken);
  display: flex;
  flex-direction: column;
}

.statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 50px;
  padding: 14px 30px 0;
  font: 600 14px/18px var(--font-ui);
  color: var(--text-primary);
  flex: none;
}

.statusbar .icons {
  display: flex;
  gap: 6px;
  align-items: center;
}

.p-view {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.app-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}
.app-body::-webkit-scrollbar { display: none; }

.app-scroll {
  padding: var(--space-2) var(--space-4) 120px;
}

/* Barra superior do app */
.appbar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4) var(--space-3);
  flex: none;
}

.appbar h1 {
  flex: 1;
  margin: 0;
  font: var(--text-title);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: var(--target-min);
  height: var(--target-min);
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  flex: none;
}

.icon-btn:hover {
  background: var(--surface-hover);
}

/* Barra de abas inferior */
.tabbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: var(--space-2) var(--space-2) 26px;
  background: var(--surface-base);
  border-top: 1px solid var(--border-default);
  z-index: 4;
}

.tabbar button {
  display: grid;
  justify-items: center;
  gap: 2px;
  min-height: var(--target-min);
  padding: var(--space-1) 0;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font: 600 11px/14px var(--font-body);
  cursor: pointer;
}

.tabbar button[aria-current="page"] {
  color: var(--text-brand);
}

.tabbar button[aria-current="page"] .tab-pill {
  background: var(--action-secondary-bg);
}

.tab-pill {
  display: grid;
  place-items: center;
  width: 56px;
  height: 30px;
  border-radius: var(--radius-pill);
  transition: background var(--duration-base) var(--easing-standard);
}

/* Botão de emergência fixo */
.sos {
  position: absolute;
  right: 16px;
  bottom: 104px;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--target-min);
  padding: 0 var(--space-4);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--urgente-500);
  color: #FFFFFF;
  font: 700 14px/18px var(--font-ui);
  box-shadow: var(--shadow-3);
  cursor: pointer;
  z-index: 6;
}

/* ---------------------------------------------------------------- Tipos de texto */

.t-caption { font: var(--text-caption); }
.t-body-sm { font: var(--text-body-sm); }
.t-body { font: var(--text-body); }
.t-strong { font: var(--text-body-strong); }
.t-title-sm { font: var(--text-title-sm); }
.t-title { font: var(--text-title); }
.t-title-lg { font: var(--text-title-lg); }
.t-display { font: var(--text-display); }
.muted { color: var(--text-secondary); }
.brand-text { color: var(--text-brand); }

h2.section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: var(--space-6) 0 var(--space-3);
  font: var(--text-title-sm);
}

h2.section .link {
  font: 600 14px/20px var(--font-body);
}

/* ---------------------------------------------------------------- Botões */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--target-min);
  padding: 0 var(--space-5);
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  font: 600 15px/20px var(--font-body);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--duration-fast) var(--easing-standard), transform var(--duration-fast) var(--easing-standard);
  white-space: nowrap;
}

.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--action-primary);
  color: var(--text-on-action);
}
.btn-primary:hover { background: var(--action-primary-hover); }

.btn-secondary {
  background: var(--action-secondary-bg);
  color: var(--action-secondary-text);
}

.btn-ghost {
  background: transparent;
  color: var(--text-brand);
  border-color: var(--border-default);
}
.btn-ghost:hover { background: var(--surface-hover); }

.btn-danger {
  background: var(--urgente-500);
  color: #FFFFFF;
}

.btn-sm {
  min-height: 36px;
  padding: 0 var(--space-3);
  font-size: 14px;
  border-radius: var(--radius-md);
}

.btn-block { width: 100%; }

.link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--text-brand);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

/* ---------------------------------------------------------------- Cartões e listas */

.card {
  background: var(--surface-raised);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  padding: var(--space-4);
}

.card + .card { margin-top: var(--space-3); }

.card-flat {
  background: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

.card-brand {
  background: var(--surface-brand-strong);
  color: var(--text-on-brand-strong);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
}

.row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.row-top { align-items: flex-start; }
.grow { flex: 1; min-width: 0; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.stack > * + * { margin-top: var(--space-3); }
.stack-2 > * + * { margin-top: var(--space-2); }

.list {
  background: var(--surface-raised);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}

.list-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: 60px;
  padding: var(--space-3) var(--space-4);
  border: 0;
  border-bottom: 1px solid var(--border-default);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.list-item:last-child { border-bottom: 0; }
.list-item:hover { background: var(--surface-hover); }
.list-item .chev { color: var(--text-tertiary); }

.cat-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--surface-brand);
  color: var(--text-brand);
  flex: none;
}

.avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  background: var(--vida-100);
  color: var(--vida-800);
  font: 700 14px/1 var(--font-ui);
  flex: none;
}
[data-theme="dark"] .avatar { background: #164233; color: var(--vida-100); }
.avatar-lg { width: 56px; height: 56px; font-size: 18px; }
.avatar-xl { width: 96px; height: 96px; font-size: 32px; }

/* ---------------------------------------------------------------- Selos e chips */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px 2px 6px;
  border-radius: var(--radius-pill);
  font: var(--text-caption);
  border: 1px solid currentColor;
  white-space: nowrap;
  background: transparent;
}
.badge .ic { width: 14px; height: 14px; }
.badge-verificado { color: var(--badge-verificado); }
.badge-parcial { color: var(--badge-parcial); }
.badge-autorrelato { color: var(--badge-autorrelato); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 36px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-default);
  background: var(--surface-raised);
  color: var(--text-primary);
  font: 500 14px/20px var(--font-body);
  cursor: pointer;
  white-space: nowrap;
}
.chip[aria-pressed="true"] {
  background: var(--action-secondary-bg);
  color: var(--action-secondary-text);
  border-color: var(--action-secondary-text);
}

.chips {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding-bottom: var(--space-1);
  scrollbar-width: none;
}

.sev {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font: 600 12px/16px var(--font-body);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}
.sev-info { background: var(--info-bg); color: var(--info-text); }
.sev-atencao { background: var(--atencao-bg); color: var(--atencao-text); }
.sev-urgente { background: var(--urgente-bg); color: var(--urgente-text); }
.sev-ok { background: var(--sucesso-bg); color: var(--sucesso-text); }
.sev-neutro { background: var(--surface-sunken); color: var(--text-secondary); }
.sev .ic { width: 14px; height: 14px; }

.notice {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  font: var(--text-body-sm);
}
.notice-info { background: var(--info-bg); color: var(--info-text); }
.notice-atencao { background: var(--atencao-bg); color: var(--atencao-text); }
.notice-urgente { background: var(--urgente-bg); color: var(--urgente-text); }
.notice-ok { background: var(--sucesso-bg); color: var(--sucesso-text); }
.notice-neutro { background: var(--surface-sunken); color: var(--text-secondary); border: 1px solid var(--border-default); }

/* ---------------------------------------------------------------- Dose e tarefas */

.dose {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
}

.dose-time {
  width: 52px;
  font: 700 16px/20px var(--font-ui);
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}

.dose-state {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font: 600 13px/18px var(--font-body);
}

.dose.done .dose-time { color: var(--text-tertiary); }
.dose.done .t-strong { color: var(--text-secondary); text-decoration: line-through; text-decoration-thickness: 1px; }

.check-btn {
  display: grid;
  place-items: center;
  width: var(--target-min);
  height: var(--target-min);
  border-radius: var(--radius-pill);
  border: 2px solid var(--action-primary);
  background: transparent;
  color: var(--action-primary);
  cursor: pointer;
  flex: none;
  transition: background var(--duration-base) var(--easing-standard);
}
.check-btn.on {
  background: var(--action-primary);
  color: var(--text-on-action);
}

/* ---------------------------------------------------------------- Formulários */

.field { display: grid; gap: var(--space-1); }
.field label { font: 600 14px/20px var(--font-body); }

.input,
textarea.input,
select.input {
  width: 100%;
  min-height: var(--target-min);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface-base);
  color: var(--text-primary);
}

textarea.input {
  min-height: 96px;
  resize: vertical;
}

.toggle {
  position: relative;
  width: 52px;
  height: 32px;
  border-radius: var(--radius-pill);
  border: 2px solid var(--border-strong);
  background: var(--surface-sunken);
  cursor: pointer;
  flex: none;
  transition: background var(--duration-base) var(--easing-standard);
}
.toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-pill);
  background: var(--border-strong);
  transition: transform var(--duration-base) var(--easing-standard);
}
.toggle[aria-checked="true"] {
  background: var(--action-primary);
  border-color: var(--action-primary);
}
.toggle[aria-checked="true"]::after {
  transform: translateX(20px);
  background: var(--text-on-action);
}

.consent-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-default);
}
.consent-row:last-child { border-bottom: 0; }

/* ---------------------------------------------------------------- Folhas, modais e avisos */

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 18, 14, 0.45);
  display: flex;
  align-items: flex-end;
  z-index: 20;
  animation: fade var(--duration-base) var(--easing-standard);
}

.sheet {
  width: 100%;
  max-height: 88%;
  overflow-y: auto;
  padding: var(--space-3) var(--space-5) var(--space-7);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  background: var(--surface-base);
  box-shadow: var(--shadow-2);
  animation: rise var(--duration-slow) var(--easing-emphasized);
}

.sheet .grip {
  width: 40px;
  height: 4px;
  margin: 0 auto var(--space-4);
  border-radius: var(--radius-pill);
  background: var(--border-default);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: var(--space-6);
  background: rgba(6, 18, 14, 0.5);
  animation: fade var(--duration-base) var(--easing-standard);
}

.modal {
  width: min(560px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: var(--space-6);
  border-radius: var(--radius-xl);
  background: var(--surface-base);
  box-shadow: var(--shadow-2);
  animation: rise var(--duration-slow) var(--easing-emphasized);
}

.toast-root {
  position: fixed;
  left: 50%;
  bottom: var(--space-6);
  transform: translateX(-50%);
  display: grid;
  gap: var(--space-2);
  z-index: 90;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 280px;
  max-width: 520px;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--neutro-900);
  color: var(--neutro-50);
  box-shadow: var(--shadow-2);
  font: 500 14px/20px var(--font-ui);
  animation: rise var(--duration-slow) var(--easing-emphasized);
}
[data-theme="dark"] .toast { background: var(--neutro-100); color: var(--neutro-900); }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* Notificação simulada (lembrete) */
.push {
  position: absolute;
  top: 54px;
  left: 12px;
  right: 12px;
  z-index: 30;
  padding: var(--space-3) var(--space-4);
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface-base) 92%, transparent);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-2);
  animation: drop var(--duration-slow) var(--easing-emphasized);
}
@keyframes drop { from { transform: translateY(-24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------------------------------------------------------------- Linha do tempo */

.timeline-day {
  margin: var(--space-5) 0 var(--space-2);
  font: 600 13px/18px var(--font-body);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.event-card {
  display: flex;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-4);
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  box-shadow: var(--shadow-1);
  text-align: left;
  cursor: pointer;
}
.event-card + .event-card { margin-top: var(--space-2); }

/* ---------------------------------------------------------------- Gráfico */

.chart {
  width: 100%;
  height: auto;
  display: block;
}
.chart .band { fill: var(--chart-band); }
.chart .grid { stroke: var(--chart-grid); stroke-width: 1; }
.chart .line { fill: none; stroke: var(--chart-line); stroke-width: 2.5; }
.chart .pt { fill: var(--surface-base); stroke: var(--chart-line); stroke-width: 2; }
.chart .pt-out { fill: var(--atencao-icon); stroke: var(--surface-base); stroke-width: 2; }
.chart text { fill: var(--text-secondary); font: 500 11px/1 var(--font-ui); }

/* ---------------------------------------------------------------- Chat do assistente */

.chat {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.bubble {
  max-width: 86%;
  padding: var(--space-3) var(--space-4);
  border-radius: 18px;
  font: var(--text-body-sm);
  animation: rise var(--duration-base) var(--easing-standard);
}

.bubble-me {
  align-self: flex-end;
  background: var(--action-primary);
  color: var(--text-on-action);
  border-bottom-right-radius: 6px;
}

.bubble-ai {
  align-self: flex-start;
  background: var(--surface-raised);
  box-shadow: var(--shadow-1);
  border-bottom-left-radius: 6px;
}

.bubble-ai p { margin: 0 0 var(--space-2); }
.bubble-ai p:last-child { margin-bottom: 0; }

.cite {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0 6px;
  margin: 0 2px;
  border-radius: var(--radius-sm);
  background: var(--surface-brand);
  color: var(--text-brand);
  font: 600 12px/18px var(--font-ui);
  border: 0;
  cursor: pointer;
  vertical-align: baseline;
}

.ai-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: var(--space-2);
  color: var(--text-secondary);
  font: 600 12px/16px var(--font-body);
}

.disclaimer {
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border-default);
  color: var(--text-secondary);
  font: var(--text-caption);
}

.typing {
  display: inline-flex;
  gap: 4px;
}
.typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-tertiary);
  animation: pulse 1s infinite;
}
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }

.composer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-3) 28px;
  background: var(--surface-base);
  border-top: 1px solid var(--border-default);
  z-index: 5;
}

.composer .input {
  border-radius: var(--radius-pill);
  min-height: 44px;
}

/* ---------------------------------------------------------------- Mapa da entrega */

.map {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #E8EEE9;
}
[data-theme="dark"] .map { background: #18211F; }
.map svg { display: block; width: 100%; height: auto; }
.map .block { fill: #DCE5DF; }
[data-theme="dark"] .map .block { fill: #212C29; }
.map .park { fill: #CDE8D6; }
[data-theme="dark"] .map .park { fill: #173826; }
.map .water { fill: #CFE0F2; }
[data-theme="dark"] .map .water { fill: #16283C; }
.map .road { stroke: #FFFFFF; stroke-width: 9; stroke-linecap: round; fill: none; }
[data-theme="dark"] .map .road { stroke: #2E3A37; }
.map .route { stroke: var(--vida-500); stroke-width: 5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.map .route-done { stroke: var(--vida-300); stroke-width: 5; fill: none; stroke-dasharray: 2 8; stroke-linecap: round; }

/* ---------------------------------------------------------------- Vídeo da teleconsulta */

.video {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: #0E1615;
  color: #FFFFFF;
}
.video video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.video .self {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 34%;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #1E2626;
  border: 2px solid rgba(255, 255, 255, 0.6);
}
.video .remote {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 40%, #1F3A30 0%, #0E1615 70%);
}
.video .speaking {
  box-shadow: 0 0 0 4px var(--vida-400);
  animation: pulse 1.6s infinite;
}
.video-controls {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  margin-top: var(--space-4);
}
.round-btn {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 0;
  background: var(--surface-raised);
  color: var(--text-primary);
  box-shadow: var(--shadow-1);
  cursor: pointer;
}
.round-btn.off { background: var(--neutro-700); color: #FFFFFF; }
.round-btn.leave { background: var(--urgente-500); color: #FFFFFF; }

/* ---------------------------------------------------------------- Cartão de emergência (aparência fixa) */

.emergency-card {
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: #FFFFFF;
  color: #000000;
  border: 2px solid #000000;
  font-family: var(--font-ui);
}
.emergency-card header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: #A9271B;
  color: #FFFFFF;
  font: 800 16px/22px var(--font-ui);
  letter-spacing: 0.02em;
}
.emergency-card dl { margin: 0; padding: var(--space-3) var(--space-4); display: grid; gap: var(--space-2); }
.emergency-card dt { font: 700 12px/16px var(--font-ui); text-transform: uppercase; letter-spacing: 0.05em; color: #3A3A3A; }
.emergency-card dd { margin: 0; font: 700 18px/24px var(--font-ui); }

.qr {
  display: grid;
  place-items: center;
  padding: var(--space-4);
  background: #FFFFFF;
  border-radius: var(--radius-lg);
}
.qr svg { width: 220px; height: 220px; }

/* ---------------------------------------------------------------- Receita (documento) */

.rx-doc {
  background: #FFFFFF;
  color: #121818;
  border-radius: var(--radius-md);
  padding: var(--space-6);
  box-shadow: var(--shadow-2);
  font: 400 14px/20px var(--font-ui);
}
.rx-doc h3 { margin: 0; font: 800 18px/24px var(--font-ui); color: #0F5C40; }
.rx-doc .rx-item { padding: var(--space-3) 0; border-bottom: 1px dashed #B6BCBC; }
.rx-doc .sig {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  margin-top: var(--space-4);
  padding: var(--space-3);
  border: 1px solid #AEE1C2;
  border-radius: var(--radius-md);
  background: #EEFAF3;
  color: #0F5C40;
  font: 500 12px/16px var(--font-ui);
}

/* ---------------------------------------------------------------- Painel do profissional */

.pro {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 140px);
  min-height: 760px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--surface-base);
  box-shadow: var(--shadow-2);
  border: 1px solid var(--border-default);
}

/* Topo do painel: clínica, menu, busca e conta (web-casca-do-painel) */
.pro-top {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-2) var(--space-5);
  border-bottom: 1px solid var(--border-default);
  flex: none;
}

.clinic-switch {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-2);
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.clinic-switch:hover { background: var(--surface-hover); }

.pro-menu {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 40px;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  font: 600 14px/20px var(--font-body);
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}
.nav-item:hover { background: var(--surface-hover); color: var(--text-primary); }
.nav-item[aria-current="page"] { background: var(--action-secondary-bg); color: var(--action-secondary-text); }
.nav-item .count {
  min-width: 22px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--urgente-bg);
  color: var(--urgente-text);
  font: 700 12px/20px var(--font-ui);
  text-align: center;
}
.pt-nav .nav-item .count { margin-left: auto; background: var(--surface-sunken); color: var(--text-secondary); }

.pro-body {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
}
.pro-body.with-patient { grid-template-columns: 220px minmax(0, 1fr); }

/* Navegação lateral do paciente aberto */
.pt-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-4) var(--space-3);
  background: var(--surface-sunken);
  border-right: 1px solid var(--border-default);
  overflow-y: auto;
}

.pro-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1;
  max-width: 340px;
  min-height: 40px;
  margin-left: auto;
  padding: 0 var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
  color: var(--text-tertiary);
  font: var(--text-body-sm);
}
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  outline: none;
}
.kbd {
  padding: 0 6px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font: 500 12px/18px var(--font-mono);
}

.pro-content {
  flex: 1;
  padding: var(--space-6);
  overflow-y: auto;
}

.pro h1 { margin: 0; font: var(--text-title-lg); }

.patient-head {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border-default);
  background: var(--surface-sunken);
}

.access-foot {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font: var(--text-caption);
  color: var(--text-secondary);
}

.subnav {
  display: flex;
  gap: var(--space-1);
  padding: 0 var(--space-6);
  border-bottom: 1px solid var(--border-default);
  overflow-x: auto;
}
.subnav button {
  min-height: 44px;
  padding: 0 var(--space-3);
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font: 600 14px/20px var(--font-body);
  cursor: pointer;
  white-space: nowrap;
}
.subnav button[aria-current="page"] {
  color: var(--text-brand);
  border-bottom-color: var(--action-primary);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font: var(--text-body-sm);
}
.table th {
  padding: var(--space-2) var(--space-3);
  text-align: left;
  font: 600 12px/16px var(--font-body);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border-default);
}
.table td {
  padding: var(--space-3);
  border-bottom: 1px solid var(--border-default);
  vertical-align: middle;
}
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--surface-hover); }

.kpi {
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  background: var(--surface-raised);
}
.kpi .v { font: 800 28px/34px var(--font-ui); font-variant-numeric: tabular-nums; }

.breakglass {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-6);
  background: #A9271B;
  color: #FFFFFF;
  font: 700 14px/20px var(--font-ui);
}

.empty {
  display: grid;
  justify-items: center;
  gap: var(--space-2);
  padding: var(--space-8) var(--space-4);
  text-align: center;
  color: var(--text-secondary);
}

/* ---------------------------------------------------------------- Roteiro */

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 100%);
  z-index: 70;
  padding: var(--space-6);
  overflow-y: auto;
  background: var(--surface-base);
  border-left: 1px solid var(--border-default);
  box-shadow: var(--shadow-2);
  transform: translateX(100%);
  transition: transform var(--duration-slow) var(--easing-emphasized);
}
.drawer.open { transform: none; }

.step {
  display: flex;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  text-align: left;
  cursor: pointer;
}
.step + .step { margin-top: var(--space-2); }
.step:hover { border-color: var(--action-primary); }
.step .n {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-pill);
  background: var(--action-secondary-bg);
  color: var(--action-secondary-text);
  font: 700 13px/1 var(--font-ui);
  flex: none;
}

/* ---------------------------------------------------------------- Responsivo */

@media (max-width: 1180px) {
  .stage { grid-template-columns: 1fr; justify-items: center; }
  .stage[data-view="both"] .pro-wrap { display: none; }
  .pro-wrap { width: 100%; }
  .device-wrap { position: static; }
}

@media (max-width: 700px) {
  .demo-bar { flex-wrap: wrap; padding: var(--space-3) var(--space-4); }
  .stage { padding: var(--space-4); }
  .phone { width: 100%; max-width: 410px; height: 820px; }
  .pro { height: auto; }
  .pro-body.with-patient { grid-template-columns: 1fr; }
  .pt-nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border-default); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ================================================================ Complementos do app da paciente */

.login {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 8px 24px;
}
.login-hero { text-align: center; padding-top: 48px; }
.login-mark {
  display: inline-grid;
  place-items: center;
  width: 80px;
  height: 80px;
  border-radius: 24px;
  background: var(--vida-500);
  color: #FFFFFF;
  box-shadow: 0 12px 30px rgba(23, 138, 94, 0.35);
}

.profile-switch {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--target-min);
  padding: 0 var(--space-3) 0 var(--space-1);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  background: var(--surface-raised);
  cursor: pointer;
}
.profile-switch .avatar { width: 36px; height: 36px; font-size: 13px; }

.bell { position: relative; }
.bell .dot {
  position: absolute;
  top: 12px;
  right: 13px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--action-primary);
  border: 2px solid var(--surface-sunken);
}
.dot-inline {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--action-primary);
  flex: none;
}

.progress {
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-sunken);
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--action-primary);
  transition: width var(--duration-slow) var(--easing-standard);
}
.dose-list .dose { padding: var(--space-3) 0; border-bottom: 1px solid var(--border-default); }
.dose-list .dose:last-child { border-bottom: 0; padding-bottom: 0; }
.card > .dose + .dose { border-top: 1px solid var(--border-default); }

.next-appt { margin-top: var(--space-3); }

.duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin: var(--space-3) 0;
}
.mini {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  border: 0;
  text-align: left;
  cursor: pointer;
  color: inherit;
}
.card + .duo, .duo + .card { margin-top: var(--space-3); }

.shortcut {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  border: 0;
  color: inherit;
  cursor: pointer;
  margin-top: var(--space-3);
}
.shortcut .chev { color: var(--text-tertiary); }
.shortcut.ai .cat-icon, .ai-card .ai-label { color: var(--text-brand); }
.clamp { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }

.big-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.big-action {
  display: grid;
  place-items: center;
  gap: var(--space-2);
  min-height: 150px;
  padding: var(--space-4);
  border: 2px solid var(--border-default);
  border-radius: var(--radius-xl);
  background: var(--surface-raised);
  color: var(--text-primary);
  font: 700 18px/24px var(--font-body);
  text-align: center;
  cursor: pointer;
}
.big-action .ic { color: var(--text-brand); }
.big-action.sos-big { background: var(--urgente-500); border-color: var(--urgente-500); color: #FFFFFF; }
.big-action.sos-big .ic { color: #FFFFFF; }

.grant { margin-top: var(--space-3); }
.grant-off { opacity: 0.72; }
.cat-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--space-3); }
.mini-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--surface-sunken);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  font: 500 12px/18px var(--font-body);
  white-space: nowrap;
}
.mini-chip .ic { width: 14px; height: 14px; }

.btn-danger-ghost {
  background: transparent;
  color: var(--urgente-text);
  border-color: currentColor;
}
.btn-on-brand { background: #FFFFFF; color: var(--vida-800); }
[data-theme="contrast"] .btn-on-brand { color: #000000; }

.radio {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  flex: none;
}
.radio.on { border: 7px solid var(--action-primary); }

.log-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-default);
}
.log-row:last-child { border-bottom: 0; }
.cat-atencao { background: var(--atencao-bg); color: var(--atencao-icon); }

.fp-anim {
  display: inline-grid;
  place-items: center;
  width: 80px;
  height: 80px;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--surface-brand);
  color: var(--text-brand);
  animation: pulse 1.2s infinite;
}

.with-composer .app-scroll { padding-bottom: 190px; }

.suggest { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4); }
.suggest .chip { white-space: normal; text-align: left; min-height: 40px; }

.pensar {
  margin-top: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
}
.ai-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-3);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border-default);
}
.ai-foot .link { display: inline-flex; align-items: center; gap: 4px; }
.icon-btn.sm { width: 36px; height: 36px; color: var(--text-secondary); }

.bars {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--space-2);
  align-items: end;
}
.bars.wide { grid-template-columns: repeat(auto-fit, minmax(40px, 1fr)); max-width: 560px; }
.bar-col { display: grid; justify-items: center; gap: 4px; }
.bar {
  width: 100%;
  max-width: 28px;
  height: 72px;
  border-radius: 6px;
  background: var(--surface-sunken);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.bar > span { display: block; width: 100%; background: var(--vida-400); border-radius: 6px 6px 0 0; transition: height var(--duration-slow) var(--easing-standard); }
[data-theme="contrast"] .bar > span { background: var(--vida-800); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; font: var(--text-body-sm); }
.kv dt { color: var(--text-secondary); }
.kv dd { margin: 0; font-weight: 600; }

.browser-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  background: var(--surface-sunken);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  font: 500 13px/18px var(--font-mono);
}

/* Teleconsulta */
.tele-dark { background: #0B1211; color: #FFFFFF; }
.tele-dark .t-caption { color: rgba(255, 255, 255, 0.8); }
.video .remote .t-body-sm, .video .remote .t-caption { color: #FFFFFF; }
.video-top {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.pill-dark {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.55);
  color: #FFFFFF;
  font: 600 12px/16px var(--font-ui);
}
.video .caption {
  position: absolute;
  left: 12px;
  right: 40%;
  bottom: 12px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.6);
  font: 500 13px/18px var(--font-ui);
}
.video .caption:empty { display: none; }
.video-name {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 4px 10px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.55);
  font: 600 13px/18px var(--font-ui);
}
.meter { flex: 1; height: 6px; border-radius: 999px; background: var(--surface-sunken); overflow: hidden; }
.meter span { display: block; height: 100%; width: 40%; background: var(--vida-400); animation: meter 1.4s ease-in-out infinite alternate; }
@keyframes meter { from { width: 12%; } to { width: 70%; } }

/* Farmácia e entrega */
.cart-btn { position: relative; }
.cart-n {
  position: absolute;
  top: 6px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--action-primary);
  color: var(--text-on-action);
  font: 700 11px/18px var(--font-ui);
}
.products { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.product {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  box-shadow: var(--shadow-1);
}
.product-img {
  display: grid;
  place-items: center;
  height: 84px;
  margin-bottom: var(--space-2);
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
  color: var(--text-brand);
}
.icon-btn.add { width: 40px; height: 40px; background: var(--action-secondary-bg); color: var(--action-secondary-text); }
.stepper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: var(--radius-pill);
  background: var(--action-secondary-bg);
  color: var(--action-secondary-text);
  font-weight: 700;
}
.stepper button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.cart-bar { position: sticky; bottom: 112px; margin-top: var(--space-4); box-shadow: var(--shadow-2); }

.tracking-banner {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  background: var(--info-bg);
  color: var(--info-text);
  font: 600 13px/18px var(--font-body);
}
.tracking-banner.off { background: var(--sucesso-bg); color: var(--sucesso-text); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.steps li { display: flex; align-items: center; gap: var(--space-3); color: var(--text-tertiary); font: var(--text-body-sm); }
.steps li.done { color: var(--text-primary); }
.steps li.now { color: var(--text-primary); font-weight: 700; }
.step-dot {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border-default);
  flex: none;
}
.steps li.done .step-dot { background: var(--action-primary); border-color: var(--action-primary); color: var(--text-on-action); }
.steps li.now .step-dot { border-color: var(--action-primary); box-shadow: 0 0 0 4px var(--action-secondary-bg); }

/* ================================================================ Complementos do painel */

.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); }
.access-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-6);
  border-top: 1px solid var(--border-default);
  background: var(--surface-sunken);
  color: var(--text-secondary);
  font: var(--text-caption);
  flex: none;
}
.next-pro { display: flex; align-items: center; gap: var(--space-4); border-color: var(--vida-300); background: var(--surface-brand); }
.agenda-row, .alert-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-default);
}
.card-flat > .agenda-row { padding-left: 0; padding-right: 0; }
.agenda-row:last-child, .alert-row:last-child { border-bottom: 0; }
.agenda-row.atendida { opacity: 0.7; }
.alert-row.is-new { animation: flash 2.4s var(--easing-standard); }
@keyframes flash { 0%, 40% { background: var(--atencao-bg); } 100% { background: transparent; } }
.kv-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-default);
}
.kv-row:last-child { border-bottom: 0; }
.kv-row > .t-strong { flex: 1; min-width: 120px; font-size: 14px; }
.evo { margin-bottom: var(--space-3); }
.soap { display: grid; grid-template-columns: 28px 1fr; gap: 6px 8px; margin: var(--space-3) 0 0; font: var(--text-body-sm); }
.soap dt { font-weight: 800; color: var(--text-brand); }
.soap dd { margin: 0; }
.rx-sugestoes { display: grid; gap: 2px; margin-top: var(--space-2); max-height: 220px; overflow-y: auto; }
.rx-sug {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 40px;
  padding: 0 var(--space-3);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.rx-sug:hover { background: var(--surface-hover); border-color: var(--border-default); }
.tele-pro { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--space-5); align-items: start; }
.tele-side { max-height: calc(100vh - 260px); overflow-y: auto; }
.tele-side .rx-form .grid-2 { grid-template-columns: 1fr; }

.drawer h2 { margin: 0; font: var(--text-title); }
.drawer .tip { margin-top: 4px; color: var(--text-secondary); font: var(--text-body-sm); }

@media (max-width: 1400px) {
  .tele-pro { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.duo > .card + .card, .grid-2 > .card + .card { margin-top: 0; }

/* Topo do painel em telas médias: tudo numa linha só */
.pro-top { gap: var(--space-3); padding: var(--space-2) var(--space-4); }
.clinic-switch span { white-space: nowrap; }
.pro-menu { flex: 0 1 auto; min-width: 0; }
.pro-menu .nav-item { padding: 0 10px; }
.pro-top .search { flex: 0 1 220px; min-width: 120px; }
@media (max-width: 1720px) {
  .pro-menu .nav-item > .ic { display: none; }
}
.dose-actions { display: flex; gap: var(--space-2); margin-top: var(--space-2); }
.dose { align-items: flex-start; }
.dose .dose-time { padding-top: 2px; }
.dose .check-btn { align-self: center; }

/* ================================================================ Tamanho da tela
   Notebook: o celular encolhe para caber na altura. Celular de verdade: sem moldura,
   o app ocupa a tela toda e a barra da demonstração vira uma faixa fina só com ícones. */
.phone { height: min(860px, calc(100dvh - 110px)); min-height: 560px; }

@media (max-width: 1180px) {
  .only-wide { display: none !important; }
}

@media (max-width: 700px) {
  .demo-bar {
    flex-wrap: nowrap;
    gap: 6px;
    height: 52px;
    padding: 0 8px;
  }
  .demo-bar .lbl, .demo-tag { display: none; }
  .demo-bar .spacer { flex: 1; }
  .demo-bar .segmented button { min-height: 34px; padding: 0 9px; }
  .demo-bar .btn-sm { min-height: 38px; padding: 0 10px; }
  .brand-mark { width: 30px; height: 30px; }

  .stage { display: block; padding: 0; max-width: none; }
  .pane-label { display: none; }
  .device-wrap { position: static; }
  .phone {
    width: 100%;
    max-width: none;
    height: calc(100dvh - 52px);
    min-height: 0;
    padding: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
  }
  .phone::before { display: none; }
  .phone-screen { border-radius: 0; }
  .statusbar { display: none; }
  .push { top: 8px; }
  .tabbar { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .sos { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .pro { height: calc(100dvh - 52px); min-height: 0; border: 0; border-radius: 0; box-shadow: none; }
  .pro-top { flex-wrap: wrap; }
  .pro-top .search { order: 3; flex: 1 1 100%; max-width: none; }
  .pro-content { padding: 16px; }
  .patient-head { flex-wrap: wrap; padding: 12px 16px; }
  .toast-root { bottom: 96px; width: calc(100% - 32px); }
  .toast { min-width: 0; }
}

/* ================================================================ Motor de telas: blocos novos */
.app-scroll { zoom: var(--app-zoom, 1); }
.espaco-maior .t-body, .espaco-maior .t-body-sm, .espaco-maior p, .espaco-maior li { line-height: 1.8 !important; }
.sem-animacao *, .sem-animacao *::before, .sem-animacao *::after { animation: none !important; transition: none !important; }
.phone-screen[data-cor="suave"] { filter: saturate(0.55); }
.phone-screen[data-cor="cinza"] { filter: grayscale(1); }

.faixa {
  display: flex; align-items: center; gap: 6px;
  margin: 0 0 10px; padding: 6px 10px;
  border-radius: var(--radius-md);
  background: var(--surface-sunken); border: 1px solid var(--border-default);
  color: var(--text-secondary); font: 600 12px/16px var(--font-body);
}
.faixa-atencao { background: var(--atencao-bg); color: var(--atencao-text); border-color: transparent; flex-wrap: wrap; }

.hero-block { display: grid; justify-items: center; text-align: center; padding: 16px 8px 8px; }
.hero-ic { width: 72px; height: 72px; border-radius: 20px; }
.cat-urgente { background: var(--urgente-bg); color: var(--urgente-icon); }
.pulsa { animation: pulse 1.2s infinite; }

.option {
  display: flex; align-items: center; gap: var(--space-3);
  width: 100%; min-height: 56px; padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-default); border-radius: var(--radius-lg);
  background: var(--surface-raised); color: var(--text-primary);
  text-align: left; cursor: pointer;
}
.option:hover { border-color: var(--action-primary); }
.option.on { border-color: var(--action-primary); background: var(--action-secondary-bg); }
.option.dark { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.2); color: #fff; }
.option .chev { color: var(--text-tertiary); }

.scale { display: flex; gap: 6px; flex-wrap: wrap; }
.scale button {
  flex: 1 0 36px; min-height: 44px; border-radius: var(--radius-md);
  border: 1px solid var(--border-strong); background: var(--surface-base); color: var(--text-primary);
  font: 700 15px/1 var(--font-ui); cursor: pointer;
}
.scale button[aria-pressed="true"] { background: var(--action-primary); border-color: var(--action-primary); color: var(--text-on-action); }
.scale.big button { min-height: 56px; font-size: 18px; }
.scale.nps button { flex: 1 0 24px; min-height: 40px; padding: 0; font-size: 13px; }

.chips-wrap { flex-wrap: wrap; overflow: visible; }
.form-card .field + .field { margin-top: var(--space-3); }
.tab-n { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--surface-sunken); font: 700 11px/18px var(--font-ui); text-align: center; }
.tabs-p { margin-bottom: 4px; }
.mini-toggle {
  min-height: 32px; padding: 0 10px; border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong); background: transparent; color: var(--text-secondary);
  font: 600 12px/1 var(--font-body); cursor: pointer;
}
.mini-toggle[aria-pressed="true"] { background: var(--action-primary); border-color: var(--action-primary); color: var(--text-on-action); }
.chip-sens { border-color: var(--atencao-icon); color: var(--atencao-text); }
.termo { text-decoration: underline dotted; text-underline-offset: 3px; cursor: pointer; color: var(--text-brand); }
.notice-btn { width: 100%; border: 0; text-align: left; cursor: pointer; margin-bottom: 12px; }
.card.soft { background: var(--surface-brand); box-shadow: none; margin-bottom: 12px; }
.table-card { padding: 0; overflow-x: auto; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border-default); border-radius: var(--radius-lg); }
.table-wrap .table th:first-child, .table-wrap .table td:first-child { padding-left: var(--space-4); }
.split { display: grid; gap: var(--space-4); align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); }
.progress .indeterminado { width: 40% !important; animation: indet 1.2s infinite; }
@keyframes indet { from { margin-left: -40%; } to { margin-left: 100%; } }
.res-line { display: grid; grid-template-columns: 1.4fr 0.8fr 0.8fr; gap: 6px; margin-top: 6px; }
.imp-row { display: flex; align-items: flex-start; gap: var(--space-2); padding: var(--space-2) 0; border-bottom: 1px solid var(--border-default); }
.imp-row:last-child { border-bottom: 0; }
.dose.skipped .t-strong { color: var(--text-secondary); }
.task-card { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); margin-bottom: var(--space-2); border-radius: var(--radius-lg); background: var(--surface-raised); box-shadow: var(--shadow-1); }
.task-card.done .t-strong { text-decoration: line-through; color: var(--text-secondary); }
.task-card .check-btn { width: 40px; height: 40px; }

/* Visor de câmera (escanear, ler QR) */
.viewfinder { position: relative; height: 300px; border-radius: var(--radius-xl); background: #111; overflow: hidden; display: grid; place-items: center; color: #fff; margin-bottom: 12px; }
.viewfinder.small { height: 200px; }
.viewfinder p { position: absolute; bottom: 10px; margin: 0; font: 600 13px/18px var(--font-ui); opacity: .85; }
.vf { position: absolute; width: 36px; height: 36px; border: 4px solid var(--vida-300); }
.vf.c1 { top: 24px; left: 24px; border-right: 0; border-bottom: 0; border-radius: 10px 0 0 0; }
.vf.c2 { top: 24px; right: 24px; border-left: 0; border-bottom: 0; border-radius: 0 10px 0 0; }
.vf.c3 { bottom: 24px; left: 24px; border-right: 0; border-top: 0; border-radius: 0 0 0 10px; }
.vf.c4 { bottom: 24px; right: 24px; border-left: 0; border-top: 0; border-radius: 0 0 10px 0; }
.vf-doc { width: 150px; height: 190px; background: #f4f4ee; border-radius: 4px; padding: 14px; display: grid; gap: 8px; transform: rotate(-3deg); }
.vf-doc div { height: 8px; background: #c9cfcb; border-radius: 3px; }
.vf-doc div:nth-child(2n) { width: 70%; }

/* Tela bloqueada, bloqueio do app, alternador, visualizador, QR em tela cheia */
.lockscreen, .lockapp, .switcher, .viewer, .qr-full {
  position: absolute; inset: 0; z-index: 40; display: flex; flex-direction: column; align-items: center;
  animation: fade var(--duration-base) var(--easing-standard);
}
.lockscreen { justify-content: flex-start; padding: 70px 16px 24px; background: linear-gradient(160deg, #0a3527, #121818); color: #fff; }
.lock-time { font: 300 64px/1 var(--font-ui); }
.lock-date { margin: 4px 0 24px; opacity: .85; }
.lock-note { width: 100%; padding: 12px 14px; border-radius: 18px; background: rgba(255,255,255,.14); backdrop-filter: blur(10px); color: #fff; }
.lock-ghost { color: #fff !important; border-color: rgba(255,255,255,.4) !important; }
.lock-close { margin-top: auto; background: none; border: 0; color: #fff; opacity: .8; font: 600 14px/1 var(--font-ui); cursor: pointer; }
.lock-preview { padding: 16px; border-radius: var(--radius-xl); background: linear-gradient(160deg, #0a3527, #121818); color: #fff; }
.lockapp { justify-content: center; padding: 24px; background: var(--surface-base); text-align: center; }
.lockapp .lock-bio { margin-top: 16px; }
.switcher { justify-content: center; padding: 24px; background: rgba(6,18,14,.92); }
.switch-cards { display: flex; gap: 10px; }
.sw-card { width: 96px; height: 170px; border-radius: 14px; display: grid; place-items: center; align-content: center; color: #fff; font: 600 12px/1 var(--font-ui); }
.sw-card.other { background: #33403c; }
.sw-card.mine { background: var(--surface-base); color: var(--text-primary); border: 2px solid var(--vida-400); display: flex; flex-direction: column; justify-content: center; align-items: center; }
.viewer { background: #000; color: #fff; justify-content: space-between; }
.us-img { flex: 1; width: 100%; background:
  radial-gradient(ellipse 30% 18% at 38% 48%, #555 0%, #222 70%, transparent 71%),
  radial-gradient(ellipse 30% 18% at 64% 48%, #5a5a5a 0%, #222 70%, transparent 71%),
  radial-gradient(circle at 50% 30%, #333, #000 70%); filter: blur(.6px); }
.qr-full { justify-content: center; gap: 12px; background: #fff; color: #000; }
.qr-full .qr svg { width: 280px; height: 280px; }

/* Família, foco e comunidade */
.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); margin: var(--space-3) 0; }
.quick { display: grid; justify-items: center; gap: 6px; padding: var(--space-3) var(--space-1); border: 0; border-radius: var(--radius-lg); background: var(--surface-raised); box-shadow: var(--shadow-1); color: var(--text-primary); font: 600 12px/16px var(--font-body); text-align: center; cursor: pointer; }
.quick .ic { color: var(--text-brand); }
.mono-tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--radius-pill); background: var(--surface-brand); color: var(--text-brand); font: 600 12px/16px var(--font-body); }
.foco-obj { margin-top: 16px; }
.foco-timer { margin-top: 16px; padding: var(--space-6) var(--space-4); border-radius: var(--radius-xl); background: var(--surface-raised); box-shadow: var(--shadow-1); text-align: center; }
.foco-timer.pausada { opacity: .6; }
.pausa-escura { background: #0b1211; color: #e8f2ee; }
.pausa-ini, .pausa-run, .pausa-fim { min-height: 520px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.pausa-fim { align-items: stretch; }
.pausa-escura .chip { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.breath { display: grid; place-items: center; height: 220px; }
.breath span { width: 90px; height: 90px; border-radius: 50%; background: var(--vida-200); animation: respira 12s ease-in-out infinite; }
.breath.parado span { animation: none; }
@keyframes respira { 0% { transform: scale(.8); } 33% { transform: scale(1.6); } 50% { transform: scale(1.6); } 100% { transform: scale(.8); } }
.egrid { display: grid; grid-template-columns: 44px repeat(7, 1fr); gap: 4px; text-align: center; align-items: center; }
.ecell { display: grid; place-items: center; height: 28px; border-radius: 6px; font: 700 12px/1 var(--font-ui); color: var(--text-primary); }
.ecell.e0 { background: var(--surface-sunken); }
.e1 { background: var(--neutro-100); } .e2 { background: var(--vida-50); } .e3 { background: var(--vida-100); } .e4 { background: var(--vida-200); } .e5 { background: var(--vida-300); }
[data-theme="dark"] .e1, [data-theme="dark"] .e2 { background: #1d2a26; } [data-theme="dark"] .e3 { background: #164233; } [data-theme="dark"] .e4 { background: #1d5a43; } [data-theme="dark"] .e5 { background: #2a7a5a; }
.dias { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 12px; }
.dia { height: 26px; border-radius: 6px; background: var(--surface-sunken); border: 1px solid var(--border-default); }
.dia.on { background: var(--vida-200); border-color: var(--vida-300); }
.sart { display: grid; justify-items: center; gap: 12px; padding-top: 40px; }
.sart-n { font: 800 120px/1 var(--font-ui); height: 130px; color: var(--text-primary); }
.sart-btn { min-height: 72px; font-size: 20px; }
.fases { display: flex; height: 14px; border-radius: 7px; overflow: hidden; margin-top: 6px; }
.fase.f0 { background: var(--vida-700); } .fase.f1 { background: var(--vida-300); } .fase.f2 { background: var(--info-icon); } .fase.f3 { background: var(--neutro-300); }
.rota { display: block; width: 100%; height: auto; }
.rota-bg { fill: var(--surface-sunken); }
.rota-ruas { stroke: var(--border-default); stroke-width: 8; fill: none; }
.rota-linha { stroke: var(--vida-500); stroke-width: 4; fill: none; stroke-linecap: round; }
.rota-ini { fill: var(--vida-700); } .rota-fim { fill: var(--atencao-icon); }
.perfil { width: 100%; height: 50px; } .perfil path { fill: var(--vida-100); stroke: var(--vida-500); stroke-width: 1.5; }
.insurance-card { padding: 18px; border-radius: var(--radius-xl); background: linear-gradient(135deg, #2B5FA8, #183F75); color: #fff; box-shadow: var(--shadow-2); }
.product-hero { display: grid; place-items: center; height: 180px; border-radius: var(--radius-xl); background: var(--surface-raised); box-shadow: var(--shadow-1); color: var(--text-brand); margin-bottom: 12px; }
.product-hero .ic { width: 64px; height: 64px; }
.product-name { color: var(--text-primary); text-align: left; font: 600 14px/18px var(--font-body); }

/* ================================================================ Painel: blocos novos */
.list-flat { box-shadow: none; border: 1px solid var(--border-default); }
.doc-fake { display: grid; place-items: center; align-content: center; gap: 6px; height: 160px; border-radius: var(--radius-lg); background: var(--surface-sunken); border: 1px dashed var(--border-strong); color: var(--text-secondary); text-align: center; font: 600 13px/18px var(--font-body); }
.diff-del { text-decoration: line-through; color: var(--urgente-text); background: var(--urgente-bg); padding: 0 3px; border-radius: 3px; }
.diff-add { text-decoration: underline; color: var(--sucesso-text); background: var(--sucesso-bg); padding: 0 3px; border-radius: 3px; }
.phone-mini { max-width: 300px; padding: 14px; border-radius: 18px; border: 6px solid #0B1010; background: var(--surface-sunken); }
.pane-label-pro { flex-wrap: wrap; }
.papel-select { min-height: 30px; padding: 0 8px; border-radius: var(--radius-md); border: 1px solid var(--border-strong); background: var(--surface-base); color: var(--text-primary); font: 600 13px/18px var(--font-body); text-transform: none; letter-spacing: 0; }
.papel-quem { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--text-tertiary); }
.cat-group { margin-bottom: 14px; }
.cat-group h3 { margin: 0 0 6px; font: 700 12px/16px var(--font-body); text-transform: uppercase; letter-spacing: .05em; color: var(--text-secondary); display: flex; justify-content: space-between; }
.cat-item { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 6px 10px; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--text-primary); text-align: left; cursor: pointer; font: 500 14px/18px var(--font-body); }
.cat-item:hover { background: var(--surface-hover); }
.cat-item .ref { margin-left: auto; font: 500 11px/14px var(--font-mono); color: var(--text-tertiary); max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 700px) { .pane-label-pro { display: flex !important; padding: 6px 8px; margin: 0; } .stage[data-view="pro"] .pane-label-pro { display: flex !important; } }
.ai-label { display: flex; }
@media (max-width: 1720px) {
  .pro-top .search { flex: 0 1 150px; min-width: 110px; }
  .pro-menu .nav-item { padding: 0 8px; }
}
.pro-menu { flex: 1 1 0; flex-wrap: wrap; row-gap: 2px; overflow: visible; }
@media (max-width: 700px) {
  .pro-top { flex-wrap: wrap; row-gap: 6px; }
  .pro-top .pro-menu { order: 3; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .pro-top .search { order: 4; }
  .pro-top > .grow { display: none; }
  .split { grid-template-columns: 1fr !important; }
  .grid-3 { grid-template-columns: 1fr; }
}
.pensar-mais { margin-top: 10px; padding: 8px 10px; border-radius: var(--radius-md); background: var(--surface-sunken); }
.pensar-mais summary { display: flex; align-items: center; gap: 4px; color: var(--text-secondary); font-weight: 600; cursor: pointer; }
.pensar-mais > :not(summary) { display: block; margin-top: 6px; text-align: left; }
.destaca-fontes .cite { outline: 2px solid var(--focus-ring); background: var(--action-secondary-bg); }
