/* Tutoriais (2026-10-10, docs/PLANO-TUTORIAL.md; motor em wwwroot/js/tour.js). Camadas: a .tour-layer apanha todos os cliques
   (z-index 180: acima das janelas, 100, da consulta de fichas, 150, e da gaveta, 70; abaixo do quadro de espera e dos avisos, 200);
   o .tour-spot realça o alvo e escurece o resto com a sombra; o .tour-pop é o balão (no telemóvel, uma folha). */

/* «?» no topo do menu (computador) e na barra de cima (telemóvel); o ponto diz que os primeiros passos da página estão por ver. */
.tour-help { position: relative; display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none; padding: 0; border: 1px solid rgba(255, 255, 255, .22); border-radius: 50%; background: rgba(255, 255, 255, .06); color: #e2e8f0; font: inherit; font-size: .9rem; font-weight: 700; line-height: 1; cursor: pointer; }
.tour-help:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.tour-help:focus-visible { outline: 2px solid var(--brand-line); outline-offset: 2px; }
.tour-help.tour-help--new::after { content: ""; position: absolute; top: -2px; right: -2px; width: 10px; height: 10px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 2px var(--navy); }
.mobile-bar .tour-help { width: 42px; height: 42px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, .08); font-size: 1.05rem; }
.tour-layer { position: fixed; inset: 0; z-index: 180; background: transparent; }
.tour-layer.is-dim { background: rgba(15, 23, 42, .55); }
.tour-spot { position: fixed; z-index: 181; border-radius: 10px; outline: 2px solid var(--brand-line); outline-offset: 0; box-shadow: 0 0 0 9999px rgba(15, 23, 42, .55); pointer-events: none; transition: left .2s ease, top .2s ease, width .2s ease, height .2s ease; }
.tour-spot[hidden] { display: none; }

.tour-pop { position: fixed; z-index: 182; width: min(360px, calc(100vw - 32px)); padding: 1rem 1.1rem .9rem; border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: 0 18px 50px rgba(15, 23, 42, .35); animation: tour-in .18s ease-out; }
.tour-pop:focus { outline: none; }
.tour-pop [hidden] { display: none !important; }
.tour-count { min-height: 1.1em; margin-bottom: .15rem; font-size: .74rem; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.tour-title { margin: 0 1.8rem .35rem 0; font-size: 1.02rem; line-height: 1.3; color: var(--ink); }
.tour-text { margin: 0; font-size: .9rem; line-height: 1.5; color: var(--ink-2); }
.tour-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .95rem; }
.tour-spacer { flex: 1; }
.tour-quit { padding-left: .4rem; padding-right: .4rem; color: var(--muted); }
.tour-x { position: absolute; top: .5rem; right: .5rem; display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-size: .95rem; cursor: pointer; }
.tour-x:hover { background: var(--surface-2); color: var(--ink); }
.tour-x:focus-visible, .tour-quit:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

@keyframes tour-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Telemóvel (o limite do app.css): o «?» fica na barra de cima (o da gaveta esconde-se) e o balão passa a folha com a largura
   do ecrã, botões de 44 px. */
@media (max-width: 860px) {
    .tour-pop.tour-sheet { left: 16px; right: 16px; width: auto; max-height: calc(100vh - 140px); max-height: calc(100dvh - 140px); overflow-y: auto; border-radius: 16px; }
    .tour-actions .btn { min-height: 44px; }
    .tour-x { top: .25rem; right: .25rem; width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
    .tour-spot { transition: none; }
    .tour-pop { animation: none; }
}
