/* Tutorial guiado (tour.js): destaque, balão, convite e entrada no menu de Ajuda.
   Nada aqui captura o ponteiro fora do balão: o editor continua clicável durante o destaque. */
.tour-layer { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.tour-layer[hidden] { display: none; }
.tour-layer.is-center { background: #0b16294d; }
.tour-spot { position: fixed; border-radius: 10px; box-shadow: 0 0 0 3px #0058ef, 0 0 0 200vmax #0b162947; transition: left .25s ease, top .25s ease, width .25s ease, height .25s ease; }
.tour-spot.is-round { border-radius: 50%; animation: tour-pulse 1.6s ease-out infinite; }
.tour-spot[hidden] { display: none; }
@keyframes tour-pulse { 0% { box-shadow: 0 0 0 3px #0058ef, 0 0 0 0 #0058ef80, 0 0 0 200vmax #0b162947; } 100% { box-shadow: 0 0 0 3px #0058ef, 0 0 0 16px #0058ef00, 0 0 0 200vmax #0b162947; } }
.tour-marker { position: fixed; display: grid; place-items: center; width: 24px; height: 24px; margin: -30px 0 0 -12px; border: 2px solid #fff; border-radius: 50%; background: #0058ef; color: #fff; font: 700 12px/1 Inter, "Segoe UI", sans-serif; box-shadow: 0 2px 8px #10203c55; }

.tour-balloon { position: fixed; z-index: 61; width: min(360px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; padding: 14px 16px 12px; border: 1px solid #c8d6ec; border-radius: 12px; background: #fff; color: #10203c; box-shadow: 0 14px 40px #0b162940; font: 13.5px/1.5 Inter, "Segoe UI", sans-serif; transition: left .25s ease, top .25s ease; }
.tour-balloon[hidden] { display: none; }
.tour-balloon::before { content: ""; position: absolute; width: 14px; height: 14px; background: #fff; border: 1px solid #c8d6ec; transform: rotate(45deg); display: none; }
.tour-balloon[data-side="right"]::before { display: block; left: -8px; top: calc(var(--tour-arrow, 50%) - 7px); border-top: 0; border-right: 0; }
.tour-balloon[data-side="left"]::before { display: block; right: -8px; top: calc(var(--tour-arrow, 50%) - 7px); border-bottom: 0; border-left: 0; }
.tour-balloon[data-side="bottom"]::before { display: block; top: -8px; left: calc(var(--tour-arrow, 50%) - 7px); border-bottom: 0; border-right: 0; }
.tour-balloon[data-side="top"]::before { display: block; bottom: -8px; left: calc(var(--tour-arrow, 50%) - 7px); border-top: 0; border-left: 0; }
.tour-head { display: flex; align-items: center; gap: 10px; }
.tour-stage { color: #0045c8; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.tour-progress { flex: 1; height: 4px; border-radius: 4px; background: linear-gradient(90deg, #0058ef var(--tour-progress, 0%), #e3eaf5 0); }
.tour-minimize { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1px solid #d5deeb; border-radius: 8px; background: #fff; color: #10203c; font-size: 18px; line-height: 1; cursor: pointer; }
.tour-title { margin: 8px 0 4px; font-size: 16px; line-height: 1.3; outline: none; }
.tour-text p { margin: 0 0 6px; color: #33415c; }
.tour-hint { margin: 8px 0 0; padding: 7px 10px; border-radius: 8px; background: #eef4ff; color: #0b3c9a; font-weight: 600; }
.tour-hint[hidden] { display: none; }
.tour-hint[data-tone="ok"] { background: #e9f8ef; color: #136b39; }
.tour-hint[data-tone="ok"]::before { content: "✓ "; }
.tour-hint[data-tone="warn"] { background: #fff4e5; color: #8a4b00; }
.tour-extra { display: grid; gap: 6px; margin-top: 10px; }
.tour-extra:empty { display: none; }
.tour-more-toggle { display: none; }
.tour-action { min-height: 38px; padding: 7px 12px; border: 1px solid #c8d6ec; border-radius: 8px; background: #f5f8fd; color: #10203c; font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.tour-action.is-primary { border-color: #0058ef; background: #0058ef; color: #fff; text-align: center; }
.tour-action.is-done { border-color: #a6dcbc; background: #f1fbf5; }
.tour-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.tour-actions button { min-height: 38px; padding: 7px 12px; border: 1px solid #d5deeb; border-radius: 8px; background: #fff; color: #10203c; font: inherit; font-weight: 600; cursor: pointer; }
.tour-actions .tour-skip { border-color: transparent; background: transparent; color: #596784; text-decoration: underline; }
.tour-actions .tour-next { margin-left: auto; border-color: #0058ef; background: #0058ef; color: #fff; }
.tour-actions button[hidden] { display: none; }
.tour-balloon button:focus-visible, .tour-invite button:focus-visible, .tour-pill button:focus-visible { outline: 3px solid #0058ef66; outline-offset: 2px; }
.tour-balloon.is-collapsed { width: auto; max-width: calc(100vw - 24px); padding: 8px 10px; }
.tour-balloon.is-collapsed .tour-progress { min-width: 60px; }
.tour-balloon.is-collapsed::before { display: none; }

.tour-pill { position: fixed; z-index: 61; left: 50%; bottom: 18px; display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 14px; transform: translateX(-50%); border: 1px solid #c8d6ec; border-radius: 999px; background: #fff; color: #10203c; box-shadow: 0 8px 24px #0b162933; font: 600 13px/1.4 Inter, "Segoe UI", sans-serif; }
.tour-pill[hidden] { display: none; }
.tour-pill button { min-height: 34px; padding: 5px 12px; border: 1px solid #d5deeb; border-radius: 999px; background: #fff; color: #10203c; font: inherit; cursor: pointer; }
.tour-pill button:first-of-type { border-color: #0058ef; background: #0058ef; color: #fff; }

.tour-invite { position: absolute; z-index: 8; top: 14px; right: 14px; width: min(330px, calc(100% - 28px)); padding: 14px 16px; border: 1px solid #c8d6ec; border-radius: 12px; background: #fffffff2; color: #10203c; box-shadow: 0 10px 30px #0b162926; font: 13px/1.5 Inter, "Segoe UI", sans-serif; }
.tour-invite[hidden] { display: none; }
.tour-invite h2 { margin: 2px 0 4px; font-size: 16px; line-height: 1.3; }
.tour-invite p { margin: 0; color: #33415c; }
.tour-invite .tour-invite-eyebrow { color: #0045c8; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.tour-invite-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tour-invite-actions button { min-height: 38px; padding: 7px 14px; border: 1px solid #d5deeb; border-radius: 8px; background: #fff; color: #10203c; font: inherit; font-weight: 600; cursor: pointer; }
.tour-invite-actions .tour-invite-start { border-color: #0058ef; background: #0058ef; color: #fff; }

.workspace-utilities-content .help-section { display: grid; gap: 4px; padding-bottom: 6px; margin-bottom: 6px; border-bottom: 1px solid var(--lab-line, #dfe7f2); }
.workspace-utilities-content .help-heading { padding: 2px 4px; color: var(--lab-muted, #596784); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; }
.workspace-utilities-content .help-tutorial { font-weight: 700; }

body.structcalc-dark .tour-balloon, body.structcalc-dark .tour-balloon::before, body.structcalc-dark .tour-invite, body.structcalc-dark .tour-pill { border-color: #35445e; background: #1d2d47; color: #e5ecfa; }
body.structcalc-dark .tour-text p, body.structcalc-dark .tour-invite p { color: #c9d5ea; }
body.structcalc-dark .tour-actions button, body.structcalc-dark .tour-minimize, body.structcalc-dark .tour-invite-actions button, body.structcalc-dark .tour-pill button, body.structcalc-dark .tour-action { border-color: #3d5072; background: #243651; color: #e5ecfa; }
body.structcalc-dark .tour-actions .tour-next, body.structcalc-dark .tour-action.is-primary, body.structcalc-dark .tour-invite-actions .tour-invite-start, body.structcalc-dark .tour-pill button:first-of-type { border-color: #3b82f6; background: #2563eb; color: #fff; }
body.structcalc-dark .tour-actions .tour-skip { border-color: transparent; background: transparent; color: #a7b6cf; }
body.structcalc-dark .tour-stage { color: #8fb4ff; }

/* Celular (mesma regra do editor: mobile-editor.js marca o body): balão compacto e largo, convite no topo. */
body.mobile-editor .tour-balloon { width: calc(100vw - 24px); max-height: 46dvh; padding: 10px 12px; font-size: 13px; }
body.mobile-editor .tour-balloon:not(.show-more) .tour-more { display: none; }
body.mobile-editor .tour-more-toggle:not([hidden]) { display: inline; padding: 0; border: 0; background: none; color: #0045c8; font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
body.mobile-editor .tour-title { font-size: 15px; margin-top: 4px; }
body.mobile-editor .tour-text p { margin-bottom: 2px; }
body.mobile-editor .tour-hint { margin-top: 6px; padding: 6px 9px; }
body.mobile-editor .tour-actions { margin-top: 8px; }
body.mobile-editor .tour-actions button, body.mobile-editor .tour-action { min-height: 40px; }
body.mobile-editor .tour-extra { grid-template-columns: 1fr 1fr; }
body.mobile-editor .tour-action { font-size: 12.5px; }
body.mobile-editor .tour-invite { top: 10px; right: 12px; left: 12px; width: auto; }
@media (prefers-reduced-motion: reduce) {
  .tour-spot, .tour-balloon { transition: none; }
  .tour-spot.is-round { animation: none; }
}
@media print { .tour-layer, .tour-balloon, .tour-pill, .tour-invite { display: none !important; } }
