/* ============================================================
   PLANTÃO — Simulador Médico | UI Engine (estilos)
   ============================================================ */
:root {
  --bg: #0d1420;
  --bg2: #131c2c;
  --panel: #1a2536;
  --panel2: #22304a;
  --line: #2c3d59;
  --text: #e8eef7;
  --text-dim: #93a4bd;
  --accent: #37c8c3;
  --accent2: #2b9fd8;
  --good: #3ddc84;
  --warn: #ffc94d;
  --orange: #ff9047;
  --danger: #ff5566;
  --purple: #b48cff;
  --radius: 12px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --mono: "Cascadia Code", "Consolas", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.hidden { display: none !important; }

.screen { display: none; height: 100dvh; overflow: hidden; }
.screen.active { display: block; }

button { font-family: var(--font); cursor: pointer; border: none; }

/* ============ MENU ============ */
#screen-menu { overflow-y: auto !important; }
.menu-wrap { max-width: 860px; margin: 0 auto; padding: 32px 16px 48px; }
.menu-header { text-align: center; margin-bottom: 28px; }
.logo { font-size: 56px; }
.menu-header h1 {
  font-size: 44px; letter-spacing: 12px; margin-top: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tagline { color: var(--text-dim); margin-top: 6px; font-size: 15px; }

.menu-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; margin-bottom: 18px;
}
.menu-card h2 {
  font-size: 13px; text-transform: uppercase; letter-spacing: 2px;
  color: var(--text-dim); margin: 14px 0 10px;
}
.menu-card h2:first-child { margin-top: 0; }

.mode-grid, .diff-grid { display: grid; gap: 10px; }
.mode-grid { grid-template-columns: 1fr 1fr; }
.diff-grid { grid-template-columns: 1fr 1fr 1fr; }

.mode-btn, .diff-btn {
  background: var(--bg2); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 14px; text-align: left; color: var(--text);
  display: flex; flex-direction: column; gap: 6px; transition: border-color .15s, transform .1s;
}
.mode-btn:hover, .diff-btn:hover { border-color: var(--accent2); }
.mode-btn.selected, .diff-btn.selected { border-color: var(--accent); background: #16283a; }
.mode-icon { font-size: 28px; }
.mode-name, .diff-name { font-weight: 700; font-size: 16px; }
.mode-desc, .diff-desc { font-size: 12.5px; color: var(--text-dim); line-height: 1.45; }

.btn-primary {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  color: #06222c; font-weight: 800; border-radius: 10px;
  padding: 12px 22px; font-size: 15px; letter-spacing: 1px;
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-big { width: 100%; padding: 16px; font-size: 17px; margin-top: 18px; }
.btn-ghost {
  background: transparent; color: var(--text-dim); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 18px; margin-top: 10px;
}
.btn-ghost:hover { color: var(--text); border-color: var(--text-dim); }

.profile-content { font-size: 14px; color: var(--text-dim); }
.profile-bars { display: grid; gap: 8px; margin-top: 6px; }
.pbar-row { display: grid; grid-template-columns: 130px 1fr 44px; align-items: center; gap: 10px; font-size: 13px; }
.pbar-track { height: 8px; background: var(--bg); border-radius: 6px; overflow: hidden; }
.pbar-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--accent2), var(--accent)); }
.pbar-val { text-align: right; font-family: var(--mono); color: var(--text-dim); }

.menu-footer { text-align: center; color: #5a6b85; font-size: 12px; margin-top: 10px; line-height: 1.5; }

/* Modo bloqueado (Plantão Caótico antes do XP necessário) */
.mode-btn.locked { opacity: .55; filter: grayscale(.5); }
.mode-btn.locked:hover { border-color: var(--line); }
#caotico-lock { color: var(--warn); }

/* Painel da IA opcional */
.ia-desc { font-size: 12.5px; color: var(--text-dim); line-height: 1.55; margin-bottom: 12px; }
.ia-row { display: flex; gap: 8px; flex-wrap: wrap; }
.ia-row input { flex: 1; min-width: 200px; }
.ia-row .btn-primary, .ia-row .btn-ghost { margin: 0; padding: 10px 16px; }
.ia-status { font-size: 12.5px; margin-top: 8px; color: var(--accent); }

/* Sala de observação (lista lateral) */
.ward-section-title {
  font-size: 11px; letter-spacing: 2px; color: var(--purple);
  margin: 14px 0 8px;
}
.bed-card.em-obs { border-style: dashed; }
.bed-card.reavaliar { border-color: var(--purple); animation: pulse-purple 1.4s infinite; }
@keyframes pulse-purple {
  0%, 100% { box-shadow: 0 0 0 0 rgba(180,140,255,0); }
  50% { box-shadow: 0 0 0 4px rgba(180,140,255,.28); }
}

/* Caixa de comunicação (família / equipe) */
#com-box {
  position: fixed; bottom: 18px; left: 18px; z-index: 270;
  width: min(400px, calc(100vw - 36px));
  background: #221a33; border: 1px solid var(--purple); border-radius: 14px;
  padding: 16px; box-shadow: 0 12px 44px rgba(0,0,0,.65);
  animation: toast-in .25s ease;
}
#com-box h4 { font-size: 13px; color: var(--purple); margin-bottom: 6px; }
#com-box .com-texto { font-size: 13.5px; line-height: 1.5; margin-bottom: 12px; }
#com-box .com-opcao {
  display: block; width: 100%; text-align: left; background: var(--bg2);
  border: 1px solid var(--line); border-radius: 9px; color: var(--text);
  padding: 9px 12px; margin-bottom: 6px; font-size: 13px; line-height: 1.4;
}
#com-box .com-opcao:hover { border-color: var(--purple); }
#com-box .com-timer { font-size: 11px; color: var(--text-dim); text-align: right; font-family: var(--mono); }

/* ============ TOPBAR ============ */
#topbar {
  height: 52px; display: flex; align-items: center; justify-content: space-between;
  background: var(--bg2); border-bottom: 1px solid var(--line); padding: 0 14px; gap: 10px;
}
.topbar-left { display: flex; align-items: baseline; gap: 10px; }
.tb-clock { font-family: var(--mono); font-size: 24px; font-weight: 700; color: var(--accent); }
.tb-label { font-size: 11px; letter-spacing: 3px; color: var(--text-dim); }
.topbar-mid { display: flex; gap: 16px; font-size: 14px; color: var(--text-dim); }
.tb-stat b { color: var(--text); font-family: var(--mono); }
.topbar-right { display: flex; gap: 8px; }
.tb-btn {
  background: var(--panel); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 12px; font-size: 13px;
}
.tb-btn:hover { border-color: var(--accent2); }
.tb-btn-danger:hover { border-color: var(--danger); color: var(--danger); }

/* ============ LAYOUT DO JOGO ============ */
#game-layout {
  display: grid; grid-template-columns: 275px 1fr 265px;
  height: calc(100dvh - 52px); gap: 0;
}

/* --- Leitos --- */
#ward-panel {
  background: var(--bg2); border-right: 1px solid var(--line);
  overflow-y: auto; padding: 12px;
}
#ward-panel h3, #notif-panel h3 {
  font-size: 11px; letter-spacing: 2px; color: var(--text-dim); margin-bottom: 10px;
}
#bed-list { display: flex; flex-direction: column; gap: 8px; }

.bed-card {
  background: var(--panel); border: 2px solid var(--line); border-radius: 10px;
  padding: 10px 12px; cursor: pointer; transition: border-color .15s;
  position: relative;
}
.bed-card:hover { border-color: var(--accent2); }
.bed-card.selected { border-color: var(--accent); background: #16283a; }
.bed-card.prio-vermelho { border-left: 5px solid var(--danger); }
.bed-card.prio-laranja { border-left: 5px solid var(--orange); }
.bed-card.prio-amarelo { border-left: 5px solid var(--warn); }
.bed-card.prio-verde { border-left: 5px solid var(--good); }
.bed-card.prio-preto { border-left: 5px solid #666; opacity: .6; }
.bed-card.deteriorando { animation: pulse-red 1.2s infinite; }
@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,85,102,0); }
  50% { box-shadow: 0 0 0 4px rgba(255,85,102,.25); }
}
.bed-top { display: flex; justify-content: space-between; align-items: center; }
.bed-name { font-weight: 700; font-size: 13.5px; }
.bed-status { font-size: 11px; color: var(--text-dim); }
.bed-vitals { font-family: var(--mono); font-size: 11.5px; color: var(--text-dim); margin-top: 4px; }
.bed-away { font-size: 12px; color: var(--purple); margin-top: 4px; }
.bed-empty {
  border: 2px dashed var(--line); border-radius: 10px; padding: 14px;
  text-align: center; color: #4a5b75; font-size: 12.5px;
}

#corridor-box { margin-top: 14px; }
#corridor-box h4 { font-size: 11px; color: var(--warn); letter-spacing: 1px; margin-bottom: 8px; }

/* --- Painel do paciente --- */
#patient-panel { overflow: hidden; display: flex; flex-direction: column; background: var(--bg); }
.pp-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--text-dim); font-size: 16px; gap: 8px; padding: 20px; text-align: center;
}
.pp-empty-sub { font-size: 13px; color: #5a6b85; }

#pp-content { display: flex; flex-direction: column; height: 100%; overflow: hidden; }
#pp-header {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap;
  padding: 12px 16px; gap: 10px; background: var(--bg2); border-bottom: 1px solid var(--line);
}
.pp-id { display: flex; align-items: center; gap: 10px; }
.prio-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.prio-dot.prio-vermelho { background: var(--danger); box-shadow: 0 0 8px var(--danger); }
.prio-dot.prio-laranja { background: var(--orange); }
.prio-dot.prio-amarelo { background: var(--warn); }
.prio-dot.prio-verde { background: var(--good); }
.prio-dot.prio-preto { background: #555; }
.pp-nome { font-weight: 800; font-size: 16px; }
.pp-sub { font-size: 12px; color: var(--text-dim); }

.pp-vitals { display: flex; gap: 14px; font-family: var(--mono); font-size: 13px; flex-wrap: wrap; }
.vital { display: flex; flex-direction: column; align-items: center; min-width: 52px; }
.vital-label { font-size: 9.5px; color: var(--text-dim); letter-spacing: 1px; }
.vital-value { font-size: 16px; font-weight: 700; color: var(--good); }
.vital-value.v-warn { color: var(--warn); }
.vital-value.v-danger { color: var(--danger); animation: blink .9s infinite; }
.vital-value.v-off { color: #4a5b75; }
@keyframes blink { 50% { opacity: .4; } }

#pp-tabs {
  display: flex; overflow-x: auto; background: var(--bg2);
  border-bottom: 1px solid var(--line); scrollbar-width: thin;
}
.pp-tab {
  background: transparent; color: var(--text-dim); padding: 10px 13px;
  font-size: 12.5px; white-space: nowrap; border-bottom: 2px solid transparent;
}
.pp-tab:hover { color: var(--text); }
.pp-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 700; }
.pp-tab .tab-badge {
  display: inline-block; background: var(--danger); color: #fff; border-radius: 8px;
  font-size: 10px; padding: 0 5px; margin-left: 4px; font-weight: 700;
}

#pp-body { flex: 1; overflow-y: auto; padding: 16px; }

/* Conteúdo das abas */
.tab-section { margin-bottom: 18px; }
.tab-section h4 {
  font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--text-dim); margin-bottom: 8px;
}
.info-block {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; font-size: 14px; line-height: 1.55; margin-bottom: 10px;
}
.info-block b { color: var(--accent); }

.action-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 8px; }
.action-btn {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; color: var(--text); text-align: left; font-size: 13.5px;
  transition: border-color .12s; line-height: 1.35;
}
.action-btn:hover { border-color: var(--accent2); }
.action-btn:disabled { opacity: .45; cursor: default; }
.action-btn.done { border-color: var(--good); background: #14301f33; }
.action-btn.pending { border-color: var(--warn); }
.action-btn .ab-sub { display: block; font-size: 11px; color: var(--text-dim); margin-top: 2px; }

.chat-log { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.chat-q, .chat-a {
  max-width: 85%; padding: 9px 13px; border-radius: 12px; font-size: 13.5px; line-height: 1.45;
}
.chat-q { align-self: flex-end; background: var(--accent2); color: #fff; border-bottom-right-radius: 3px; }
.chat-a { align-self: flex-start; background: var(--panel2); border-bottom-left-radius: 3px; }
.chat-a.chat-sys { background: transparent; border: 1px dashed var(--line); color: var(--text-dim); font-style: italic; }

.finding {
  background: var(--panel); border-left: 3px solid var(--accent); border-radius: 8px;
  padding: 10px 12px; font-size: 13.5px; margin-bottom: 8px; line-height: 1.5;
}
.finding .f-region { font-weight: 700; color: var(--accent); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }

.result-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 10px; font-size: 13.5px; line-height: 1.55;
}
.result-card.critical { border-color: var(--danger); }
.result-card .r-title { font-weight: 700; color: var(--accent); margin-bottom: 4px; }
.result-card.critical .r-title { color: var(--danger); }
.result-card pre { font-family: var(--mono); font-size: 12.5px; white-space: pre-wrap; color: var(--text); }
.result-pending { color: var(--warn); font-size: 12.5px; }

.rx-cat { margin-bottom: 14px; }
.rx-cat h5 { font-size: 11.5px; color: var(--purple); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 6px; }
.rx-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 12px; margin-bottom: 6px; font-size: 13.5px; flex-wrap: wrap;
}
.rx-name { font-weight: 600; }
.rx-doses { display: flex; gap: 6px; flex-wrap: wrap; }
.rx-dose-btn {
  background: var(--bg2); border: 1px solid var(--line); color: var(--text-dim);
  border-radius: 7px; padding: 5px 10px; font-size: 12px;
}
.rx-dose-btn:hover { border-color: var(--accent2); color: var(--text); }
.rx-row.done { border-color: var(--good); }
.rx-row.done .rx-name::after { content: " ✓ prescrito"; color: var(--good); font-size: 11px; }

.proc-steps { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.proc-step-btn {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); padding: 8px 12px; text-align: left; font-size: 13px;
}
.proc-step-btn.done { border-color: var(--good); color: var(--text-dim); }
.proc-step-btn.done::before { content: "✓ "; color: var(--good); }

.chart-field { margin-bottom: 10px; }
.chart-field label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 4px; }
.chart-check {
  display: flex; align-items: center; gap: 8px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px;
  font-size: 13px; margin-bottom: 6px; cursor: pointer;
}
.chart-check.done { border-color: var(--good); color: var(--text-dim); }
.chart-check.locked { opacity: .45; cursor: default; }

textarea.free-text, input.free-text {
  width: 100%; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); padding: 10px 12px; font-size: 14px; font-family: var(--font); resize: vertical;
}
textarea.free-text:focus, input.free-text:focus { outline: none; border-color: var(--accent); }

.dx-feedback { margin-top: 8px; padding: 10px 12px; border-radius: 8px; font-size: 13px; line-height: 1.5; }
.dx-feedback.ok { background: #14301f; border: 1px solid var(--good); }
.dx-feedback.partial { background: #33290f; border: 1px solid var(--warn); }
.dx-feedback.bad { background: #331419; border: 1px solid var(--danger); }

.destino-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.destino-btn {
  background: var(--panel); border: 2px solid var(--line); border-radius: 10px;
  color: var(--text); padding: 14px 10px; font-size: 13.5px; font-weight: 700;
}
.destino-btn:hover { border-color: var(--accent); }
.destino-btn.confirmando {
  border-color: var(--warn); background: #33290f; color: var(--warn);
  animation: pulse-warn 1s infinite;
}
@keyframes pulse-warn {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,201,77,0); }
  50% { box-shadow: 0 0 0 4px rgba(255,201,77,.25); }
}

/* --- Notificações --- */
#notif-panel {
  background: var(--bg2); border-left: 1px solid var(--line);
  overflow-y: auto; padding: 12px;
}
#notif-list { display: flex; flex-direction: column; gap: 8px; }
.notif {
  background: var(--panel); border-left: 3px solid var(--accent2); border-radius: 8px;
  padding: 9px 11px; font-size: 12.5px; line-height: 1.45; cursor: pointer;
  transition: opacity .2s;
}
.notif:hover { filter: brightness(1.15); }
.notif .n-tag { font-size: 10px; font-weight: 800; letter-spacing: 1px; display: block; margin-bottom: 2px; }
.notif.n-urgente { border-left-color: var(--danger); }
.notif.n-urgente .n-tag { color: var(--danger); }
.notif.n-lab { border-left-color: var(--purple); }
.notif.n-lab .n-tag { color: var(--purple); }
.notif.n-maqueiro { border-left-color: var(--accent2); }
.notif.n-maqueiro .n-tag { color: var(--accent2); }
.notif.n-enf { border-left-color: var(--warn); }
.notif.n-enf .n-tag { color: var(--warn); }
.notif.n-chegada { border-left-color: var(--good); }
.notif.n-chegada .n-tag { color: var(--good); }
.notif-time { color: #5a6b85; font-family: var(--mono); font-size: 10.5px; }

/* --- Toasts --- */
#toast-container {
  position: fixed; top: 62px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; z-index: 300; pointer-events: none;
  width: min(480px, 92vw);
}
.toast {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 16px; font-size: 13.5px; box-shadow: 0 8px 30px rgba(0,0,0,.5);
  animation: toast-in .25s ease; pointer-events: auto; cursor: pointer; line-height: 1.4;
}
.toast.t-danger { border-color: var(--danger); }
.toast.t-warn { border-color: var(--warn); }
.toast.t-good { border-color: var(--good); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } }

/* --- Supervisor --- */
#supervisor-box {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  width: min(560px, 94vw); background: #1c2a42; border: 1px solid var(--accent);
  border-radius: 14px; padding: 14px 40px 14px 14px; display: flex; gap: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,.6); z-index: 250; align-items: flex-start;
}
.sup-avatar { font-size: 30px; }
.sup-text { font-size: 13.5px; line-height: 1.5; }
.sup-text b { color: var(--accent); }
#supervisor-close {
  position: absolute; top: 8px; right: 10px; background: transparent;
  color: var(--text-dim); font-size: 14px;
}

/* --- Pausa --- */
#pause-overlay {
  position: fixed; inset: 0; background: rgba(5,10,18,.85); z-index: 400;
  display: flex; align-items: center; justify-content: center;
}
.pause-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 34px; text-align: center; display: flex; flex-direction: column; gap: 8px; }
.pause-card h2 { margin-bottom: 12px; }

/* ============ RELATÓRIO ============ */
#screen-report { overflow-y: auto !important; }
.report-wrap { max-width: 900px; margin: 0 auto; padding: 30px 16px 60px; }
.report-header { text-align: center; margin-bottom: 24px; }
.report-header h1 { font-size: 28px; letter-spacing: 2px; }
#report-subtitle { color: var(--text-dim); margin-top: 6px; }

.report-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 22px; }
.rstat {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; text-align: center;
}
.rstat .rs-val { font-size: 26px; font-weight: 800; font-family: var(--mono); }
.rstat .rs-label { font-size: 11px; color: var(--text-dim); letter-spacing: 1px; text-transform: uppercase; margin-top: 4px; }
.rstat.rs-good .rs-val { color: var(--good); }
.rstat.rs-warn .rs-val { color: var(--warn); }
.rstat.rs-danger .rs-val { color: var(--danger); }

.report-section { margin-bottom: 26px; }
.report-section > h2 {
  font-size: 15px; letter-spacing: 2px; text-transform: uppercase; color: var(--accent);
  border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 14px;
}

.pt-report {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  margin-bottom: 12px; overflow: hidden;
}
.pt-report-head {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 14px 16px; cursor: pointer; flex-wrap: wrap;
}
.pt-report-head:hover { background: var(--panel2); }
.pt-grade {
  font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 20px; letter-spacing: 1px;
}
.pt-grade.g-otimo { background: #14301f; color: var(--good); border: 1px solid var(--good); }
.pt-grade.g-bom { background: #14301f; color: var(--good); border: 1px solid var(--good); }
.pt-grade.g-parcial { background: #33290f; color: var(--warn); border: 1px solid var(--warn); }
.pt-grade.g-ruim { background: #331419; color: var(--orange); border: 1px solid var(--orange); }
.pt-grade.g-critico { background: #331419; color: var(--danger); border: 1px solid var(--danger); }
.pt-report-body { padding: 0 16px 16px; border-top: 1px solid var(--line); display: none; }
.pt-report.open .pt-report-body { display: block; }

.rb-row { margin-top: 14px; font-size: 14px; line-height: 1.6; }
.rb-row .rb-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-dim); display: block; margin-bottom: 3px; }
.err-item {
  border-left: 3px solid var(--warn); background: var(--bg2); border-radius: 8px;
  padding: 10px 12px; margin-bottom: 8px; font-size: 13.5px; line-height: 1.5;
}
.err-item.e-grave, .err-item.e-critico { border-left-color: var(--danger); }
.err-item.e-leve { border-left-color: var(--text-dim); }
.err-item .e-tag { font-size: 10.5px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.err-item.e-critico .e-tag, .err-item.e-grave .e-tag { color: var(--danger); }
.err-item.e-moderado .e-tag { color: var(--warn); }
.err-item.e-leve .e-tag { color: var(--text-dim); }
.ok-item {
  border-left: 3px solid var(--good); background: var(--bg2); border-radius: 8px;
  padding: 8px 12px; margin-bottom: 6px; font-size: 13px; color: var(--text-dim);
}

/* Explicação estruturada de cada erro (o quê / consequência / na realidade) */
.err-oque { margin-top: 4px; }
.err-exp {
  margin-top: 7px; padding: 8px 10px; border-radius: 7px; font-size: 12.5px; line-height: 1.55;
}
.err-conseq { background: #2b1a20; border-left: 3px solid var(--orange); }
.err-real { background: #14301f66; border-left: 3px solid var(--good); }

/* Dicas progressivas de diagnóstico (aba Conduta) */
.dica-dx {
  margin-top: 10px; background: #33290f; border: 1px solid var(--warn);
  border-radius: 10px; padding: 11px 14px; font-size: 13px; line-height: 1.55;
}
.dica-dx ul { margin: 6px 0 4px 18px; }
.dica-dx li { margin-bottom: 4px; }
.dica-dx-sub { font-size: 11.5px; color: var(--text-dim); }

/* Aula aprofundada (biblioteca) */
.aula-box { margin-top: 10px; }
.aula-fase { font-weight: 700; color: var(--accent); margin: 10px 0 4px; font-size: 13px; }
.aula-nao { border-color: var(--danger); }
.aula-nao h5 { color: var(--danger); }

.edu-box {
  background: #12233a; border: 1px solid var(--accent2); border-radius: 10px;
  padding: 14px 16px; margin-top: 12px; font-size: 13.5px; line-height: 1.65;
}
.edu-box h5 { color: var(--accent); font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 8px; }
.edu-box ul { margin: 8px 0 8px 18px; }
.edu-box li { margin-bottom: 5px; }
.edu-refs { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--text-dim); }
.ev-cite { margin-top: 6px; font-style: normal; line-height: 1.5; }
.ev-cite b { color: var(--text); font-weight: 600; }
.ev-tipo {
  display: inline-block; background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 0 8px; font-size: 10.5px; letter-spacing: .5px;
  color: var(--accent); margin-left: 4px; text-transform: uppercase;
}
.edu-lib-hint { margin-top: 10px; font-size: 12px; color: var(--text-dim); }

/* Biblioteca clínica */
#screen-library { overflow-y: auto !important; }

.lib-busca-wrap {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(180deg, var(--bg) 78%, transparent);
  padding: 4px 0 14px; margin-bottom: 6px;
}
.lib-busca-wrap input {
  flex: 1; font-size: 14.5px; padding: 12px 14px;
  border-radius: 11px; border-color: rgba(120,150,190,.28);
}
.lib-contador {
  font-size: 12px; color: var(--text-dim); white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.lib-dicionario { width: auto; white-space: nowrap; padding: 10px 14px; font-size: 13px; }
.lib-qtd {
  display: inline-block; background: rgba(43,159,216,.16); color: var(--accent);
  border-radius: 10px; padding: 1px 9px; font-size: 11.5px; margin-left: 8px;
  letter-spacing: 0; vertical-align: middle;
}
/* Título da aula = o DIAGNÓSTICO, para escolher o que estudar */
/* Cabeçalho da aula: título longo quebra em linhas, o selo nunca desce sozinho */
.lib-head { flex-wrap: nowrap; align-items: flex-start; }
.lib-head .pt-grade { flex: 0 0 auto; margin-top: 1px; }
.lib-titulo { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 auto; }
.lib-titulo b { font-size: 15px; line-height: 1.3; color: var(--text); }
.lib-sub { font-size: 12px; color: var(--text-dim); line-height: 1.4; }
.pt-grade.g-neutro {
  background: rgba(120,150,190,.12); color: var(--text-dim);
  border: 1px solid rgba(120,150,190,.22);
}
.lib-vazio {
  text-align: center; color: var(--text-dim); font-size: 14px; line-height: 1.7;
  padding: 40px 20px; border: 1px dashed var(--line); border-radius: 12px;
}
@media (max-width: 560px) {
  .lib-head { flex-wrap: wrap; }
  .lib-busca-wrap { flex-direction: column; align-items: stretch; gap: 6px; }
  .lib-contador { text-align: right; }
}

/* Pontos de desenvolvimento (menu) */
.dev-box {
  margin-top: 14px; background: #221a33; border: 1px solid var(--purple);
  border-radius: 10px; padding: 12px 14px; font-size: 13px; line-height: 1.55;
}
.dev-box ul { margin: 6px 0 0 18px; }
.dev-box li { margin-bottom: 4px; }

.timeline { font-family: var(--mono); font-size: 12.5px; line-height: 1.9; color: var(--text-dim); }
.timeline .tl-time { color: var(--accent); }
.timeline .tl-bad { color: var(--danger); }
.timeline .tl-good { color: var(--good); }

.report-actions { text-align: center; margin-top: 20px; }

/* ============ RESPONSIVO ============ */
@media (max-width: 1050px) {
  #game-layout { grid-template-columns: 235px 1fr; }
  #notif-panel {
    position: fixed; right: 0; top: 52px; bottom: 0; width: 265px; z-index: 200;
    transform: translateX(100%); transition: transform .2s; box-shadow: -10px 0 30px rgba(0,0,0,.5);
  }
  #notif-panel.open { transform: translateX(0); }
  .topbar-right { position: relative; }
}

@media (max-width: 720px) {
  #game-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  #ward-panel {
    border-right: none; border-bottom: 1px solid var(--line);
    max-height: 158px; overflow-x: auto; overflow-y: hidden; padding: 8px 10px;
  }
  #bed-list { flex-direction: row; }
  .bed-card { min-width: 165px; flex-shrink: 0; }
  #corridor-box { display: none; }
  .tb-clock { font-size: 19px; }
  .tb-label { display: none; }
  .topbar-mid { gap: 10px; font-size: 13px; }
  .pp-vitals { gap: 9px; font-size: 12px; }
  .vital { min-width: 44px; }
  .vital-value { font-size: 14px; }
  .action-grid { grid-template-columns: 1fr; }
  .mode-grid, .diff-grid { grid-template-columns: 1fr; }
  .menu-header h1 { font-size: 34px; letter-spacing: 8px; }
}

/* ============================================================
   INTERFACE REFINADA — painéis de vidro, cartões de leito,
   sinais vitais como pastilhas e feed de chamadas legível
   ============================================================ */

/* --- Barra superior --- */
body.mode3d #topbar {
  background: linear-gradient(180deg, rgba(13,20,32,.96), rgba(13,20,32,.86));
  border-bottom: 1px solid rgba(120,150,190,.2);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  z-index: 30; position: relative;
}
body.mode3d .tb-clock {
  text-shadow: 0 0 18px rgba(55,200,195,.35);
  font-variant-numeric: tabular-nums;
}
body.mode3d .topbar-mid { gap: 6px; }
body.mode3d .tb-stat {
  background: rgba(34,48,74,.55); border: 1px solid rgba(120,150,190,.18);
  border-radius: 20px; padding: 4px 12px; font-size: 12.5px;
  display: inline-flex; align-items: center; gap: 6px;
}
body.mode3d .tb-btn {
  background: rgba(34,48,74,.5); border-color: rgba(120,150,190,.2);
  border-radius: 9px; transition: background .15s, border-color .15s;
}
body.mode3d .tb-btn:hover { background: rgba(43,159,216,.2); border-color: var(--accent2); }

/* --- Cartões de leito --- */
body.mode3d #ward-panel h3, body.mode3d #notif-panel h3 {
  display: flex; align-items: center; gap: 7px;
  font-size: 10.5px; letter-spacing: 2.2px; margin-bottom: 11px;
  padding-bottom: 8px; border-bottom: 1px solid rgba(120,150,190,.16);
}
.bed-card {
  border-radius: 11px; padding: 9px 11px 9px 13px;
  background: linear-gradient(135deg, rgba(30,43,66,.9), rgba(24,35,55,.9));
  border: 1px solid rgba(120,150,190,.16);
  position: relative; overflow: hidden;
  transition: transform .12s, border-color .15s, box-shadow .15s;
}
.bed-card:hover { transform: translateX(2px); }
.bed-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 6px 18px rgba(55,200,195,.16);
}
.bed-card.prio-vermelho, .bed-card.prio-laranja,
.bed-card.prio-amarelo, .bed-card.prio-verde, .bed-card.prio-preto { border-left-width: 1px; }
.bed-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
}
.bed-card.prio-vermelho::before { background: var(--danger); box-shadow: 0 0 12px var(--danger); }
.bed-card.prio-laranja::before { background: var(--orange); }
.bed-card.prio-amarelo::before { background: var(--warn); }
.bed-card.prio-verde::before { background: var(--good); }
.bed-card.prio-preto::before { background: #6b7280; }
.bed-name { font-size: 13px; letter-spacing: .2px; }
.bed-status {
  font-size: 10px; letter-spacing: .4px; padding: 2px 7px; border-radius: 10px;
  background: rgba(120,150,190,.14); color: var(--text-dim); white-space: nowrap;
}
.bed-vitals {
  font-size: 11px; letter-spacing: .3px; margin-top: 5px;
  display: flex; gap: 8px; flex-wrap: wrap;
}
.bed-vitals b { color: var(--text); font-weight: 600; }
.bed-vitals .bv-alerta { color: var(--warn); }
.bed-vitals .bv-critico { color: var(--danger); }
.bed-vitals .bv-sem { color: var(--text-dim); font-style: italic; }

/* Cabeçalho do paciente sem monitor: sem números, com o atalho */
.pp-sem-monitor {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--text-dim); line-height: 1.4;
  padding: 7px 10px; border-radius: 9px;
  border: 1px dashed rgba(120,150,190,.28); background: rgba(13,20,32,.45);
}
.pp-monitorizar {
  width: auto; padding: 5px 12px; border-radius: 8px; cursor: pointer;
  font-size: 12.5px; font-weight: 700; color: #06121f;
  background: var(--accent); border: 0;
}
.pp-monitorizar:hover { filter: brightness(1.1); }
.bed-away { font-size: 11.5px; color: var(--text-dim); margin-top: 4px; opacity: .85; }
.bed-empty {
  border: 1px dashed rgba(120,150,190,.2); border-radius: 11px;
  padding: 11px; font-size: 11.5px; color: #55658044; text-align: center;
  color: #5a6b85;
}

/* --- Cabeçalho do paciente com pastilhas de sinais vitais --- */
body.mode3d #pp-header {
  background: linear-gradient(180deg, rgba(26,38,60,.95), rgba(20,30,48,.9));
  padding: 13px 16px; gap: 12px;
}
.pp-nome { font-size: 15.5px; letter-spacing: .2px; }
.pp-sub { font-size: 11.5px; margin-top: 2px; }
body.mode3d .pp-vitals { gap: 7px; }
body.mode3d .vital {
  background: rgba(13,20,32,.6); border: 1px solid rgba(120,150,190,.16);
  border-radius: 9px; padding: 5px 9px; min-width: 58px; gap: 1px;
}
body.mode3d .vital-label { font-size: 8.5px; letter-spacing: 1.2px; opacity: .8; }
body.mode3d .vital-value { font-size: 15px; font-variant-numeric: tabular-nums; }
body.mode3d .vital-value.v-danger { text-shadow: 0 0 10px rgba(255,85,102,.5); }

/* --- Abas --- */
body.mode3d #pp-tabs { padding: 0 6px; gap: 1px; }
body.mode3d .pp-tab { padding: 10px 11px; font-size: 12px; border-radius: 8px 8px 0 0; }
body.mode3d .pp-tab.active { background: rgba(43,159,216,.1); }

/* --- Feed de chamadas --- */
.notif {
  border-radius: 9px; padding: 8px 10px 8px 11px;
  background: rgba(30,43,66,.75); border: 1px solid rgba(120,150,190,.12);
  border-left-width: 3px; font-size: 12px;
  transition: transform .12s;
}
.notif:hover { transform: translateX(2px); filter: brightness(1.12); }
.notif .n-tag { font-size: 9.5px; letter-spacing: 1.1px; opacity: .95; }
.notif-time { opacity: .7; }

/* --- Indicador de local do jogador --- */
#world-local {
  position: absolute; left: 50%; top: 62px; transform: translateX(-50%);
  background: rgba(13,20,32,.72); backdrop-filter: blur(8px);
  border: 1px solid rgba(120,150,190,.2); border-radius: 20px;
  padding: 5px 15px; font-size: 11.5px; letter-spacing: 1.6px;
  color: var(--text-dim); text-transform: uppercase; pointer-events: none; z-index: 22;
  transition: opacity .3s;
}
#world-local b { color: var(--accent); letter-spacing: 1.6px; }

/* ============================================================
   MUNDO 3D — canvas + interface médica flutuando por cima
   ============================================================ */
#world-container {
  position: absolute; inset: 52px 0 0 0; overflow: hidden; background: #0b1220;
}
#world-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#world-canvas:active { cursor: grabbing; }

/* Vinheta + leve gradação de cor: assenta o 3D e dá acabamento
   cinematográfico sem custo de GPU (é só uma camada CSS). */
#world-container::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(0,0,0,0) 42%, rgba(4,9,18,.42) 100%),
    linear-gradient(180deg, rgba(80,130,190,.05) 0%, rgba(0,0,0,0) 30%, rgba(10,18,32,.12) 100%);
  mix-blend-mode: normal;
}

#world-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 3; }
#world-labels > * { position: absolute; left: 0; top: 0; will-change: transform; }

/* Etiqueta do paciente sobre a maca */
.w-label.w-pac {
  pointer-events: auto; cursor: pointer;
  background: rgba(13, 20, 32, .88); backdrop-filter: blur(6px);
  border: 1.5px solid var(--line); border-radius: 9px;
  padding: 5px 9px; min-width: 130px;
  font-size: 11.5px; line-height: 1.35; color: var(--text);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .45);
  transition: box-shadow .15s;
}
.w-label.w-pac.sel { box-shadow: 0 0 0 2px var(--accent), 0 8px 22px rgba(0, 0, 0, .5); }
.w-label.w-pac:hover { filter: brightness(1.15); }
.w-nome { display: flex; align-items: center; gap: 5px; font-weight: 700; white-space: nowrap; }
.w-nome i { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.w-vitais { display: block; font-family: var(--mono); font-size: 10px; color: var(--text-dim); white-space: nowrap; }
.w-tag { display: block; font-size: 10px; color: var(--purple); margin-top: 1px; }

/* Balões de fala (paciente e equipe) */
.w-balao {
  background: rgba(244, 248, 252, .95); color: #17212f;
  border-radius: 11px; padding: 5px 10px; max-width: 230px;
  font-size: 11.5px; line-height: 1.35; font-weight: 500;
  box-shadow: 0 5px 16px rgba(0, 0, 0, .4);
}
.w-balao::after {
  content: ''; position: absolute; left: 50%; bottom: -5px; transform: translateX(-50%);
  border-left: 6px solid transparent; border-right: 6px solid transparent;
  border-top: 6px solid rgba(244, 248, 252, .95);
}
.w-balao.w-equipe { background: rgba(41, 74, 104, .95); color: #eaf4fb; }
.w-balao.w-equipe::after { border-top-color: rgba(41, 74, 104, .95); }
.w-balao.w-equipe b { color: var(--accent); }

/* --- Painéis da interface como camadas sobre o 3D --- */
body.mode3d #game-layout {
  position: absolute; inset: 52px 0 0 0; display: block;
  height: auto; pointer-events: none; z-index: 20;
}
body.mode3d #ward-panel,
body.mode3d #patient-panel,
body.mode3d #notif-panel {
  pointer-events: auto;
  background: rgba(17, 25, 40, .86);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(120, 150, 190, .22);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .45);
}
body.mode3d #ward-panel {
  position: absolute; left: 12px; top: 12px; right: auto; bottom: auto;
  width: 232px; max-height: 42%; overflow-y: auto; padding: 11px;
}
body.mode3d #notif-panel {
  position: absolute; left: 12px; bottom: 12px; top: auto; right: auto;
  width: 232px; max-height: 38%; overflow-y: auto; padding: 11px;
  border-left: 1px solid rgba(120, 150, 190, .22);
  transform: none;
}
/* painel do paciente só aparece quando há paciente selecionado */
body.mode3d #patient-panel.vazio { display: none; }
body.mode3d #patient-panel {
  position: absolute; right: 12px; top: 12px; bottom: 12px;
  width: min(432px, 40vw); overflow: hidden;
  transition: transform .25s ease, opacity .25s ease;
}
body.mode3d #patient-panel.oculto {
  transform: translateX(calc(100% + 20px)); opacity: 0; pointer-events: none;
}
body.mode3d #pp-header { background: rgba(20, 30, 48, .8); border-radius: 14px 14px 0 0; }
body.mode3d #pp-tabs { background: rgba(16, 24, 38, .7); }
body.mode3d .pp-empty { display: none; }
body.mode3d #toast-container { top: 62px; }

/* Dica de controles */
#world-dica {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  background: rgba(13, 20, 32, .8); backdrop-filter: blur(6px);
  border: 1px solid var(--line); border-radius: 20px;
  padding: 7px 16px; font-size: 12px; color: var(--text-dim);
  pointer-events: none; z-index: 25; white-space: nowrap;
  transition: opacity .5s;
}
#world-dica b { color: var(--accent); }

/* Ações rápidas de delegação (equipe) */
.deleg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.deleg-btn {
  background: var(--panel); border: 1px solid var(--purple); border-radius: 10px;
  color: var(--text); padding: 10px 12px; font-size: 13px; text-align: left; line-height: 1.35;
}
.deleg-btn:hover { background: #2a2140; }
.deleg-btn .db-sub { display: block; font-size: 11px; color: var(--text-dim); margin-top: 2px; }

/* Aviso de fallback quando não há WebGL */
#no-webgl {
  position: absolute; inset: 52px 0 0 0; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 30px; color: var(--text-dim); font-size: 14px; line-height: 1.6; z-index: 5;
}

@media (max-width: 900px) {
  body.mode3d #patient-panel {
    left: 8px; right: 8px; top: auto; bottom: 8px; width: auto; height: 56%;
  }
  body.mode3d #patient-panel.oculto { transform: translateY(calc(100% + 20px)); }
  body.mode3d #ward-panel { width: 190px; max-height: 34%; left: 8px; top: 8px; padding: 8px; }
  body.mode3d #ward-panel .bed-card { min-width: 0; }
  body.mode3d #bed-list { flex-direction: column; }
  body.mode3d #notif-panel { display: none; }
  #world-dica { display: none; }
}

/* Botão flutuante de notificações (telas médias/pequenas) */
#notif-fab {
  display: none;
  position: fixed; bottom: 16px; right: 16px; z-index: 210;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--panel2); border: 1px solid var(--accent2); color: var(--text);
  font-size: 22px; box-shadow: 0 6px 24px rgba(0,0,0,.5);
}
#notif-fab .fab-badge {
  position: absolute; top: -4px; right: -4px; background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 800; border-radius: 10px; padding: 1px 6px;
}
@media (max-width: 1050px) { #notif-fab { display: block; } }


/* ============================================================
   MODO SITE — a página do simulador ganhou cabeçalho e rodapé.
   Fora do plantão ela se comporta como PÁGINA (rola, mostra o
   rodapé); durante o plantão volta a ser APLICAÇÃO em tela cheia.
   Este bloco fica no fim de style.css de propósito: ele precisa
   vencer as regras de app definidas lá em cima.
   ============================================================ */
body.site { overflow: auto; }
body.site .screen { height: auto; overflow: visible; }
body.site #screen-menu { overflow-y: visible !important; }
body.site .menu-wrap { padding-top: 20px; }

/* Durante o plantão: volta tudo ao comportamento de tela cheia */
body.site.em-jogo { overflow: hidden; }
body.site.em-jogo .screen { height: 100dvh; overflow: hidden; }

/* ============================================================
   CONTA E DESEMPENHO
   Reaproveita as variáveis de tema já definidas no topo do arquivo.
   ============================================================ */

.conta-desc, .conta-sub {
  color: var(--text-dim); font-size: 13px; line-height: 1.5; margin: 6px 0 12px;
}
.conta-input { width: 100%; margin-bottom: 8px; }
.conta-input.oculta { display: none; }
/* Código de 6 números da verificação em duas etapas */
.conta-codigo {
  text-align: center; font-family: var(--mono); font-size: 22px; letter-spacing: 8px;
  padding: 10px 12px;
}
.conta-seguranca {
  margin-top: 12px; padding: 10px 12px; border-radius: 10px;
  background: rgba(255,255,255,.03); border: 1px solid rgba(120,150,190,.16);
}
.conta-seg-linha { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; }
.conta-seg-linha .conta-link { width: auto; margin-top: 0; padding: 4px 10px; }
.conta-seg-desc { font-size: 12px; color: var(--text-dim); margin-top: 4px; line-height: 1.45; }
#conta-2fa-passo:not(:empty) { margin-top: 10px; }
.conta-botao { width: 100%; margin-top: 8px; }
.conta-link { width: 100%; margin-top: 6px; background: none; font-size: 13px; }

.conta-abas { display: flex; gap: 6px; margin-bottom: 12px; }
.conta-aba {
  flex: 1; padding: 8px; border-radius: 8px; cursor: pointer; font-size: 14px;
  background: rgba(255,255,255,.04); color: var(--text-dim);
  border: 1px solid rgba(255,255,255,.08);
}
.conta-aba.ativa { background: var(--acento, #2d8cf0); color: #04121d; font-weight: 600; }

.conta-status { font-size: 13px; margin-top: 10px; min-height: 1em; color: var(--text-dim); }
.conta-status.erro { color: #ff5566; }
.conta-status.ok   { color: #3ddc84; }

.conta-linha-selo { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.conta-selo {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px;
  background: rgba(255,255,255,.07); color: var(--text-dim);
}
.conta-selo.ativo { background: rgba(61,220,132,.16); color: #3ddc84; font-weight: 600; }
.conta-ate { font-size: 12px; color: var(--text-dim); }
.conta-plano { font-size: 12px; color: var(--text-dim); margin-top: 12px; }

/* --- Tela de desempenho --- */
.conta-vazio { text-align: center; padding: 40px 20px; color: var(--text-dim); }
.conta-vazio h3 { color: var(--text); margin-bottom: 8px; }

.conta-numeros {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px; margin-bottom: 22px;
}
.conta-numero {
  background: rgba(255,255,255,.04); border-radius: 12px; padding: 14px; text-align: center;
}
.conta-numero b { display: block; font-size: 26px; color: var(--acento, #2d8cf0); }
.conta-numero span { font-size: 12px; color: var(--text-dim); }

.conta-bloco {
  background: rgba(255,255,255,.03); border-radius: 14px; padding: 18px; margin-bottom: 16px;
}
.conta-bloco h3 { margin: 0 0 4px; font-size: 17px; }
.conta-bloco h4 { margin: 16px 0 6px; font-size: 14px; color: var(--text-dim); }

.conta-comp { margin-bottom: 14px; }
.conta-comp-topo { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; }
.conta-comp-nota { font-weight: 700; display: flex; gap: 8px; align-items: baseline; }
.conta-comp-pe { font-size: 11px; color: var(--text-dim); margin-top: 3px; }
.conta-tend { font-size: 11px; font-weight: 500; }
.conta-tend.sobe  { color: #3ddc84; }
.conta-tend.desce { color: #ff9047; }
.conta-tend.igual { color: var(--text-dim); }

.conta-barra { height: 8px; border-radius: 4px; background: rgba(255,255,255,.07); overflow: hidden; margin-top: 5px; }
.conta-barra i { display: block; height: 100%; border-radius: 4px; transition: width .4s ease; }
.conta-barra i.otimo   { background: #3ddc84; }
.conta-barra i.bom     { background: #9fd356; }
.conta-barra i.parcial { background: #ffc94d; }
.conta-barra i.ruim    { background: #ff5566; }

.conta-lista { list-style: none; padding: 0; margin: 10px 0 0; }
.conta-lista li {
  padding: 10px 12px; border-radius: 10px; margin-bottom: 8px; font-size: 13.5px;
  line-height: 1.5; background: rgba(255,255,255,.03); border-left: 3px solid transparent;
}
.conta-lista.forte li { border-left-color: #3ddc84; }
.conta-lista.fraco li { border-left-color: #ff9047; }
.conta-lista.plano li { border-left-color: var(--acento, #2d8cf0); }

.conta-fraco-topo { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.conta-cont { font-weight: 700; color: #ff9047; white-space: nowrap; }
.conta-fraco-meta { font-size: 11.5px; color: var(--text-dim); margin-top: 3px; }
.conta-fraco-meta b.grave { color: #ff5566; }
.conta-fraco-ex {
  font-size: 12px; color: var(--text-dim); margin-top: 6px;
  font-style: italic; border-left: 2px solid rgba(255,255,255,.1); padding-left: 8px;
}
.conta-porque { font-size: 12px; color: var(--text-dim); margin-top: 4px; }

.conta-insight { margin-top: 14px; }
.conta-insight p { font-size: 14px; line-height: 1.65; margin-bottom: 12px; }
.conta-fonte { font-size: 11.5px; color: var(--text-dim); margin-top: 12px; }

.conta-aut { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: end; margin-top: 12px; }
.conta-aut-valor b { display: block; font-size: 34px; line-height: 1; color: var(--acento, #2d8cf0); font-family: var(--mono); }
.conta-aut-valor span { display: block; font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.conta-aut-valor .conta-tend { margin-top: 6px; }
.conta-aut-barras { display: flex; align-items: flex-end; gap: 4px; height: 64px; }
.conta-aut-barras i { flex: 1; max-width: 22px; border-radius: 3px 3px 0 0; background: rgba(45,140,240,.45); }
.conta-aut-barras i:last-child { background: var(--acento, #2d8cf0); }
.conta-temas li.melhora { border-left-color: #3ddc84; }
.conta-temas li.atencao { border-left-color: #ffc94d; }

.conta-bloco.paywall { border: 1px solid rgba(45,140,240,.35); background: rgba(45,140,240,.06); }
.conta-beneficios { list-style: none; padding: 0; margin: 12px 0; }
.conta-beneficios li { font-size: 13.5px; padding: 6px 0 6px 24px; position: relative; line-height: 1.5; }
.conta-beneficios li::before { content: '✓'; position: absolute; left: 0; color: #3ddc84; font-weight: 700; }

@media (max-width: 560px) {
  .conta-numero b { font-size: 22px; }
  .conta-bloco { padding: 14px; }
}

/* --- Biblioteca: aulas fechadas --- */
.lib-travada { opacity: .62; }
.lib-travada .pt-report-head { cursor: default; }
.lib-travada .lib-titulo b { font-weight: 500; }

.lib-oferta {
  background: rgba(45,140,240,.08); border: 1px solid rgba(45,140,240,.32);
  border-radius: 14px; padding: 16px 18px; margin-bottom: 18px;
}
.lib-oferta b { font-size: 15px; }
.lib-oferta p { color: var(--text-dim); font-size: 13.5px; line-height: 1.55; margin: 6px 0 12px; }
.lib-oferta .btn-primary { width: auto; padding: 9px 20px; }
.oferta-faixa { margin-bottom: 22px; }
.oferta-faixa .conta-status { margin-top: 8px; }

/* ============================================================
   FIM DO PLANTÃO GRATUITO (#screen-oferta)

   Reaproveita .conta-bloco, .conta-beneficios e .report-stats de
   propósito: a oferta tem que parecer a mesma casa do relatório,
   não um anúncio colado por cima.
   ============================================================ */
#screen-oferta { overflow-y: auto !important; }
#oferta-titulo { font-size: 25px; letter-spacing: 1px; }

.oferta-medidor {
  background: rgba(255,255,255,.03); border-radius: 14px;
  padding: 14px 16px; margin-bottom: 18px;
}
.oferta-medidor-topo {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 10px; font-size: 14px; margin-bottom: 8px;
}
.oferta-medidor-topo span { font-family: var(--mono); color: var(--text-dim); font-size: 13px; }

.oferta-fraco { border-left: 3px solid var(--orange); }
.oferta-fraco h3 { font-size: 16px; line-height: 1.4; }

.oferta-casos { list-style: none; padding: 0; margin: 12px 0 0; }
.oferta-casos li {
  font-size: 13.5px; padding: 8px 12px 8px 30px; margin-bottom: 6px;
  border-radius: 10px; background: rgba(255,255,255,.03);
  color: var(--text-dim); position: relative;
}
.oferta-casos li::before { content: '🔒'; position: absolute; left: 9px; font-size: 12px; }

#screen-oferta .report-actions .btn-ghost { margin-top: 10px; }

@media (max-width: 560px) {
  #oferta-titulo { font-size: 21px; }
  .oferta-medidor-topo { flex-direction: column; gap: 2px; }
}


/* ============================================================
   PRECEPTOR VIRTUAL

   Um painel ao lado da ficha do paciente — nunca por cima dela.
   Poucas cores: fundo do próprio tema, e só a borda esquerda do
   cartão muda com o tipo (pista, raciocínio, urgência, medicamento,
   exame, aprenda mais). Nada de balão de chat: é um colega
   discreto que aparece quando precisa.
   ============================================================ */
/* Regra de posição: o painel NUNCA cobre a ficha do paciente. No layout
   sem 3D ele ocupa a coluna das chamadas (direita); no 3D, fica do lado
   OPOSTO à ficha, junto da coluna de leitos/chamadas, ancorado embaixo —
   acima da barra de ação em andamento, longe dos avisos do topo. */
.preceptor {
  position: fixed; z-index: 240;
  top: 64px; right: 6px; width: 253px;
  max-height: calc(100dvh - 76px);
  display: flex; flex-direction: column;
  background: rgba(17, 25, 40, .94);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(120, 150, 190, .24); border-radius: 14px;
  box-shadow: 0 14px 44px rgba(0, 0, 0, .5);
  animation: pc-entra .22s ease-out;
}
body.mode3d .preceptor {
  top: auto; right: auto; left: 256px; bottom: 84px;
  width: min(340px, calc(100vw - min(432px, 40vw) - 292px));
  max-height: calc(100dvh - 204px);
}
@keyframes pc-entra { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Minimizado: só uma pílula. Orientação automática não reabre o painel —
   quem decide abrir é o aluno (pedido explícito de ajuda reabre). */
.preceptor.pc-min, body.mode3d .preceptor.pc-min {
  width: auto; max-height: none; background: transparent; border: 0; box-shadow: none;
  backdrop-filter: none; -webkit-backdrop-filter: none; animation: none;
}
.preceptor.pc-min .pc-topo, .preceptor.pc-min .pc-rodape { display: none; }
.preceptor.pc-min .pc-corpo { padding: 0; overflow: visible; }
.pc-pilula {
  width: auto; display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 22px; cursor: pointer;
  font-size: 12.5px; font-weight: 700; color: var(--text);
  background: rgba(17, 25, 40, .94); border: 1px solid rgba(120, 150, 190, .3);
  box-shadow: 0 8px 26px rgba(0, 0, 0, .45);
}
.pc-pilula:hover { border-color: var(--accent); }
.pc-pilula .pc-pil-n {
  min-width: 20px; height: 20px; border-radius: 10px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #06121f; font-size: 11.5px;
}
.preceptor.pc-min-urg .pc-pilula { border-color: var(--danger); animation: pc-pulsa 1.4s ease-in-out infinite; }
.preceptor.pc-min-urg .pc-pil-n { background: var(--danger); color: #fff; }
@keyframes pc-pulsa { 50% { box-shadow: 0 0 0 6px rgba(255, 85, 102, .18), 0 8px 26px rgba(0,0,0,.45); } }
.pc-min-btn {
  background: transparent; border: 0; color: var(--text-dim); cursor: pointer;
  font-size: 15px; line-height: 1; padding: 2px 6px; border-radius: 6px; margin-left: auto;
}
.pc-min-btn:hover { color: var(--text); background: rgba(255,255,255,.06); }
.pc-min-btn + .pc-x { margin-left: 0; }

.pc-topo {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-bottom: 1px solid rgba(120, 150, 190, .16);
}
.pc-marca { font-weight: 800; font-size: 13px; letter-spacing: .3px; }
.pc-selo {
  font-size: 10.5px; color: var(--text-dim); border: 1px solid rgba(120, 150, 190, .25);
  border-radius: 20px; padding: 2px 8px; white-space: nowrap;
}
.pc-x, .pc-card-x {
  margin-left: auto; background: transparent; border: 0; color: var(--text-dim);
  font-size: 13px; cursor: pointer; padding: 2px 4px; border-radius: 6px;
}
.pc-x:hover, .pc-card-x:hover { color: var(--text); background: rgba(255,255,255,.06); }
.pc-corpo { overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.pc-rodape { font-size: 10.5px; color: var(--text-dim); padding: 8px 12px 10px; border-top: 1px solid rgba(120,150,190,.12); line-height: 1.45; }

.pc-card {
  background: rgba(255, 255, 255, .035); border: 1px solid rgba(120, 150, 190, .16);
  border-left: 3px solid var(--accent); border-radius: 10px; padding: 10px 12px;
  font-size: 13px; line-height: 1.55; animation: pc-entra .18s ease-out;
}
.pc-pista { border-left-color: var(--warn); }
.pc-raciocinio { border-left-color: var(--purple); }
.pc-urgente { border-left-color: var(--danger); background: rgba(255, 85, 102, .07); }
.pc-medicamento { border-left-color: var(--accent2); }
.pc-exame { border-left-color: var(--accent); }
.pc-aprenda { border-left-color: var(--good); }
.pc-supervisor { border-left-color: rgba(120, 150, 190, .5); }
.pc-menu { border-left-color: var(--accent); }

.pc-card-topo { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.pc-card-topo b { font-size: 13px; }
.pc-ico { font-size: 14px; }
.pc-pac {
  font-size: 10.5px; color: var(--text-dim); background: rgba(255,255,255,.05);
  border-radius: 10px; padding: 1px 7px;
}
.pc-pac.pc-outro { color: var(--warn); background: rgba(255, 201, 77, .1); }
.pc-card-corpo p { margin: 0 0 7px; }
.pc-card-corpo h5 {
  font-size: 10.5px; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--text-dim); margin: 10px 0 4px;
}
.pc-card-corpo ul, .pc-card-corpo ol { margin: 0 0 7px; padding-left: 18px; }
.pc-card-corpo li { margin-bottom: 3px; }
.pc-dx { font-weight: 800; font-size: 14px; color: var(--text); }
.pc-sub { color: var(--text-dim); font-size: 12px; }
.pc-aviso { color: var(--warn); }
.pc-urgente .pc-aviso { color: var(--danger); }
.pc-resumo { background: rgba(55, 200, 195, .08); border-radius: 8px; padding: 7px 9px; }
.pc-conclusao { font-weight: 600; margin-top: 6px !important; }
.pc-contexto { background: rgba(255, 201, 77, .08); border-radius: 8px; padding: 6px 9px; margin: 6px 0; }
.pc-contexto p { margin: 0 !important; color: var(--warn); font-size: 12.5px; }
.pc-fases > li { margin-bottom: 6px; }
.pc-fases ul { padding-left: 16px; margin-top: 2px; }
.pc-algoritmo li { margin-bottom: 5px; }
.pc-laudo {
  font-family: var(--mono); font-size: 12px; background: rgba(13, 20, 32, .6);
  border-radius: 8px; padding: 7px 9px; margin-bottom: 8px; white-space: pre-wrap;
}
.pc-passos li, .pc-interp li { margin-bottom: 4px; }

.pc-abcde { display: flex; flex-direction: column; gap: 4px; margin: 6px 0; }
.pc-abcde-l { display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; }
.pc-abcde-l > b {
  flex: 0 0 20px; height: 20px; border-radius: 6px; display: inline-flex;
  align-items: center; justify-content: center; font-size: 11px;
  background: rgba(255,255,255,.06);
}
.pc-abcde-l.pc-alerta > b { background: rgba(255, 201, 77, .18); color: var(--warn); }
.pc-abcde-l.pc-critico > b { background: rgba(255, 85, 102, .2); color: var(--danger); }
.pc-abcde-l i { font-style: normal; color: var(--text-dim); }

.pc-fonte { margin-top: 6px; font-size: 11.5px; }
.pc-fonte summary { cursor: pointer; color: var(--text-dim); list-style: none; }
.pc-fonte summary::-webkit-details-marker { display: none; }
.pc-fonte .ev-cite { font-size: 11.5px; margin-top: 4px; }

.pc-acoes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pc-btn {
  background: rgba(255,255,255,.05); border: 1px solid rgba(120,150,190,.24); color: var(--text);
  font-size: 12px; font-weight: 600; border-radius: 8px; padding: 6px 10px; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.pc-btn:hover { background: rgba(255,255,255,.09); }
.pc-btn-pri { background: rgba(55, 200, 195, .14); border-color: rgba(55, 200, 195, .5); color: #bff4f1; }
.pc-urgente .pc-btn-pri { background: rgba(255, 85, 102, .16); border-color: rgba(255, 85, 102, .55); color: #ffd5da; }

.pc-opcoes { display: flex; flex-direction: column; gap: 5px; }
.pc-opcao {
  display: flex; gap: 9px; align-items: center; text-align: left;
  background: rgba(255,255,255,.03); border: 1px solid rgba(120,150,190,.16); color: var(--text);
  border-radius: 8px; padding: 7px 9px; font-size: 12.5px; cursor: pointer;
}
.pc-opcao:hover { background: rgba(255,255,255,.07); border-color: rgba(120,150,190,.32); }
.pc-opcao-urgente { border-color: rgba(255, 85, 102, .35); }
.pc-chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 5px 0; }
.pc-chip {
  background: rgba(255,255,255,.05); border: 1px solid rgba(120,150,190,.22); color: var(--text);
  font-size: 11.5px; border-radius: 14px; padding: 4px 9px; cursor: pointer;
}
.pc-chip:hover { border-color: var(--accent); }
.pc-busca { width: 100%; margin-top: 4px; font-size: 12.5px; }
.pc-ia { margin-top: 8px; }
.pc-ia-caixa { border: 1px dashed rgba(180, 140, 255, .4); border-radius: 8px; padding: 8px 10px; }
.pc-ia-selo { font-size: 10.5px; color: var(--purple); letter-spacing: .3px; }

/* Botões de ajuda na ficha do paciente — discretos, sempre ao alcance */
.pp-ajuda-row { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.pp-ajuda {
  background: rgba(55, 200, 195, .1); border: 1px solid rgba(55, 200, 195, .35); color: #bff4f1;
  font-size: 11px; font-weight: 700; border-radius: 12px; padding: 3px 10px; cursor: pointer;
}
.pp-ajuda:hover { background: rgba(55, 200, 195, .2); }
.pp-ajuda-sec { background: transparent; border-color: rgba(120,150,190,.3); color: var(--text-dim); }

/* ⓘ da prescrição e "? Interpretar" dos exames */
.rx-info {
  background: transparent; border: 1px solid rgba(120,150,190,.3); color: var(--text-dim);
  width: 18px; height: 18px; border-radius: 50%; font-size: 11px; line-height: 1;
  margin-right: 6px; cursor: pointer; padding: 0; vertical-align: 1px;
}
.rx-info:hover { color: var(--accent); border-color: var(--accent); }
.r-interpretar {
  float: right; background: transparent; border: 1px solid rgba(120,150,190,.3); color: var(--text-dim);
  font-size: 11px; font-weight: 700; border-radius: 10px; padding: 1px 8px; cursor: pointer;
}
.r-interpretar:hover { color: var(--accent); border-color: var(--accent); }

/* Página completa do medicamento / dicionário */
#farmaco-pagina {
  position: fixed; inset: 0; z-index: 400; background: rgba(5, 9, 16, .72);
  display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow-y: auto;
}
#farmaco-pagina[hidden] { display: none; }
.fp-caixa {
  width: min(720px, 100%); background: var(--bg2); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.fp-topo { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; padding: 18px 20px 12px; border-bottom: 1px solid var(--line); }
.fp-topo h2 { font-size: 20px; margin: 2px 0; }
.fp-botoes { display: flex; gap: 8px; flex-shrink: 0; }
.fp-botoes .btn-ghost { width: auto; }
.fp-cat { font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--accent); }
.fp-classe { color: var(--text-dim); font-size: 13.5px; }
.fp-corpo { padding: 14px 20px 20px; font-size: 14px; line-height: 1.6; }
.fp-corpo h4 { font-size: 11px; letter-spacing: 1.3px; text-transform: uppercase; color: var(--text-dim); margin: 16px 0 5px; }
.fp-corpo ul { padding-left: 18px; }
.fp-oculto { background: rgba(255, 201, 77, .08); border-radius: 8px; padding: 8px 10px; color: var(--warn); }
.fp-nota, .fp-versao { font-size: 12px; color: var(--text-dim); margin-top: 10px; }
.fp-lista { display: flex; flex-wrap: wrap; gap: 6px; }
.fp-item {
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 6px 10px; font-size: 13px; cursor: pointer;
}
.fp-item:hover { border-color: var(--accent); }
#fp-busca { width: 100%; margin-bottom: 4px; }

/* Tela estreita: a ficha ocupa os 56% de baixo, então o painel fica na
   faixa de cima e termina ANTES dela. Começa minimizado (js). */
@media (max-width: 900px) {
  .preceptor, body.mode3d .preceptor {
    top: 56px; bottom: auto; left: 8px; right: 8px; width: auto;
    max-height: calc(44dvh - 70px);
  }
  /* a pílula vai para a direita: à esquerda está a lista de leitos */
  .preceptor.pc-min, body.mode3d .preceptor.pc-min { left: auto; right: 8px; }
  .pc-rodape { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .preceptor, .pc-card { animation: none; }
}

/* --- Relatório: "O que você aprendeu hoje?" --- */
.apr-grade { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.apr-col h4, .apr-uso h4, .apr-recomendacao h4, .report-section .menu-card > h4 {
  font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--text-dim); margin-bottom: 8px;
}
.apr-col ul { list-style: none; padding: 0; margin: 0; }
.apr-col li { font-size: 14px; padding: 5px 0 5px 22px; position: relative; line-height: 1.5; }
.apr-forte li::before { content: '✓'; position: absolute; left: 2px; color: var(--good); font-weight: 800; }
.apr-fraco li::before { content: '↗'; position: absolute; left: 2px; color: var(--warn); font-weight: 800; }
.apr-col li.apr-vazio { color: var(--text-dim); }
.apr-col li.apr-vazio::before { content: '·'; color: var(--text-dim); }
.apr-uso { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; align-items: center; margin-bottom: 12px; }
.apr-uso-num ul { list-style: none; padding: 0; margin: 0; }
.apr-uso-num li { display: flex; justify-content: space-between; font-size: 13.5px; padding: 4px 0; border-bottom: 1px solid rgba(120,150,190,.1); }
.apr-uso-num li b { font-family: var(--mono); }
.apr-autonomia { text-align: center; }
.apr-aut-valor { font-size: 38px; font-weight: 800; font-family: var(--mono); color: var(--accent); line-height: 1; }
.apr-aut-rotulo { font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--text-dim); margin: 6px 0 8px; }
.apr-autonomia p { font-size: 12px; color: var(--text-dim); margin-top: 8px; line-height: 1.5; text-align: left; }
.apr-ajuda { padding-left: 20px; font-size: 14px; }
.apr-ajuda li { margin-bottom: 3px; }
.apr-tendencia p { font-size: 14px; margin: 3px 0; }
.apr-recomendacao p { font-size: 14px; }
.apr-aulas { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.apr-aula { width: auto; font-size: 12.5px; padding: 6px 12px; }
.apr-treinar { width: auto; padding: 10px 22px; margin-top: 6px; }
.apr-nota { font-size: 12px; color: var(--text-dim); margin-top: 6px; }
.rep-med { color: var(--accent); text-decoration: underline dotted; cursor: pointer; }
@media (max-width: 620px) {
  .apr-grade, .apr-uso { grid-template-columns: 1fr; }
}

/* ============ CAIXA DE DIÁLOGO DO SITE (MED.Conta.dialogo) ============
   Substitui window.prompt/confirm, que navegadores embutidos bloqueiam. */
.med-dialogo {
  position: fixed; inset: 0; z-index: 900; background: rgba(5,10,18,.8);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.med-dialogo-cartao {
  width: 100%; max-width: 440px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; padding: 22px; box-shadow: 0 18px 50px rgba(0,0,0,.45);
}
.med-dialogo-cartao h3 { font-size: 18px; margin-bottom: 8px; }
.med-dialogo-texto { color: var(--text-dim); font-size: 14px; line-height: 1.5; margin-bottom: 14px; }
.med-dialogo-erro { color: var(--danger); font-size: 13px; min-height: 18px; margin: 6px 0 4px; }
.med-dialogo-botoes { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 6px; }
.med-dialogo-botoes .btn-ghost { margin-top: 0; }
.med-dialogo-botoes .btn-primary { padding: 10px 18px; font-size: 14px; letter-spacing: .3px; }
.btn-danger {
  background: var(--danger); color: #fff; font-weight: 700; border-radius: 10px;
  padding: 10px 18px; font-size: 14px;
}
.btn-danger:hover { filter: brightness(1.1); }
@media (max-width: 420px) {
  .med-dialogo-botoes { flex-direction: column-reverse; }
  .med-dialogo-botoes button { width: 100%; }
}

/* Escolha da forma de pagamento (cartão ou Pix) */
.med-dialogo-opcoes { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 2px; }
.med-dialogo-opcao {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left;
  width: 100%; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; color: var(--text); cursor: pointer;
}
.med-dialogo-opcao b { font-size: 15px; }
.med-dialogo-opcao span { font-size: 13px; color: var(--text-dim); }
.med-dialogo-opcao:hover, .med-dialogo-opcao:focus { border-color: var(--accent); outline: none; }

/* Janela do Pix */
.med-pix { max-height: calc(100vh - 32px); overflow-y: auto; }
.med-pix-qr {
  display: block; width: 200px; height: 200px; margin: 4px auto 14px;
  background: #fff; border-radius: 10px; padding: 8px; image-rendering: pixelated;
}
.med-pix-rotulo { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 4px; }
.med-pix-codigo { font-family: var(--mono); font-size: 12px; resize: none; word-break: break-all; }
.med-pix-copiar { width: 100%; margin-top: 8px; }
.med-pix-status { font-size: 13px; color: var(--text-dim); margin: 12px 0 4px; min-height: 18px; line-height: 1.45; }
.med-pix-status.ok { color: var(--good); font-weight: 700; }
.med-pix-status.erro { color: var(--danger); }
