/* Ajuda: dicas ricas (tooltips), chips de teclado, barra de dicas do canvas, painel "Atalhos e dicas" e tour guiado. */
:root {
  --tip-bg: #1B1F24;
  --tip-fg: #F3F5F7;
  --tip-fg-2: #B9C1CA;
  --tip-border: rgba(255, 255, 255, .08);
  --kbd-bg: var(--c-surface);
  --kbd-border: var(--c-border);
  --tour-scrim: rgba(10, 18, 26, .58);
}
@media (prefers-color-scheme: dark) {
  :root { --tip-bg: #2B3138; --tip-border: rgba(255, 255, 255, .14); }
}

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Chips de teclado ---------- */
.keys { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; }
.keys__combo { display: inline-flex; align-items: center; gap: 3px; }
.keys__or { font-size: 11px; color: var(--c-text-2); }
.keys__plus { font-size: 11px; opacity: .6; }
.keys__word { font-size: 11.5px; font-weight: 600; color: var(--c-text); white-space: nowrap; }
.tip .keys__word { color: var(--tip-fg); }
.kbd {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin: 0;
  font: 600 11px/1 var(--font-ui); color: var(--c-text); white-space: nowrap;
  background: var(--kbd-bg); border: 1px solid var(--kbd-border); border-bottom-width: 2px; border-radius: 5px;
}

/* ---------- Dica flutuante (uma unica camada, posicionada pelo cria.js) ---------- */
.tip-sources { display: none; }
.tip {
  position: fixed; left: 0; top: 0; z-index: 500; max-width: 280px; padding: 9px 11px 10px;
  display: grid; gap: 3px; pointer-events: none;
  background: var(--tip-bg); color: var(--tip-fg); border: 1px solid var(--tip-border); border-radius: 10px;
  box-shadow: 0 12px 28px -10px rgba(0, 0, 0, .45), 0 2px 6px rgba(0, 0, 0, .18);
  font-size: 12px; line-height: 1.4; opacity: 0; visibility: hidden;
  transition: opacity .12s var(--ease), visibility 0s linear .12s;
}
.tip.is-visible { opacity: 1; visibility: visible; transition: opacity .12s var(--ease); }
.tip__title { font-weight: 650; font-size: 12.5px; color: var(--tip-fg); }
.tip__desc { color: var(--tip-fg-2); }
.tip__keys { margin-top: 4px; }
.tip .keys__or { color: var(--tip-fg-2); }
.tip .kbd { color: var(--tip-fg); background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .2); }

/* Rotulo de campo com "?" */
.field__label--help { display: inline-flex; align-items: center; gap: 5px; align-self: flex-start; cursor: help; }
.field__help {
  display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 50%;
  font: 700 9.5px/1 var(--font-ui); color: var(--c-text-2); border: 1px solid color-mix(in srgb, var(--c-text-2) 55%, transparent);
  opacity: .7; transition: opacity .15s, color .15s, border-color .15s;
}
.field__label--help:hover .field__help { opacity: 1; color: var(--c-accent); border-color: var(--c-accent); }

/* ---------- Barra de dicas do canvas ---------- */
.hintbar {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 4;
  display: flex; align-items: center; gap: 4px; max-width: calc(100% - 24px); padding: 4px 4px 4px 12px;
  border-radius: 999px; border: 1px solid var(--c-border-soft);
  background: color-mix(in srgb, var(--c-surface) 86%, transparent); backdrop-filter: blur(6px);
  box-shadow: var(--shadow-1); font-size: 12px; color: var(--c-text-2); pointer-events: none;
}
.hintbar__items { display: flex; align-items: center; gap: 0; min-width: 0; overflow: hidden; white-space: nowrap; }
.hintbar__item { display: inline-flex; align-items: center; gap: 6px; }
.hintbar__keys { display: inline-flex; align-items: center; gap: 1px; }
.hintbar .keys__word { color: var(--c-text); font-size: 12px; }
.hintbar__item + .hintbar__item::before { content: ""; width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .45; margin: 0 10px; }
.kbd--quiet { height: 18px; min-width: 18px; padding: 0 5px; font-size: 10.5px; color: var(--c-text-2); background: var(--c-surface-2); border-color: var(--c-border-soft); border-bottom-width: 1px; }
.hintbar__close {
  pointer-events: auto; flex: none; display: grid; place-items: center; width: 22px; height: 22px; margin-left: 6px;
  border: 0; border-radius: 50%; background: transparent; cursor: pointer; color: var(--c-text-2);
}
.hintbar__close:hover { background: var(--c-surface-2); color: var(--c-text); }
.canvas-hint { bottom: 64px; }

/* ---------- Painel "Atalhos e dicas" ---------- */
.help-scrim { position: fixed; inset: 0; z-index: 120; background: rgba(12, 18, 24, .28); animation: fade .15s; }
.help-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 121; width: min(420px, 100vw); display: flex; flex-direction: column;
  background: var(--c-surface); border-left: 1px solid var(--c-border-soft); box-shadow: var(--shadow-3);
  animation: slide-in .2s var(--ease);
}
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } }
.help-panel__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 18px 10px 22px; }
.help-panel__header h2 { font-size: 18px; font-weight: 750; }
.help-panel__subtitle { margin: 4px 0 0; font-size: 12.5px; color: var(--c-text-2); }
.help-panel__search { position: relative; padding: 4px 22px 12px; }
.help-panel__search .field__input { padding-left: 34px; height: 38px; border-radius: 10px; }
.help-panel__search-icon { position: absolute; left: 34px; top: 15px; pointer-events: none; }
.help-panel__body { flex: 1; overflow-y: auto; padding: 0 22px 18px; }
.help-panel__empty { color: var(--c-text-2); font-size: 13px; padding: 18px 0; }
.help-group { padding: 10px 0 4px; }
.help-group h3 { font: 700 11px var(--font-ui); text-transform: uppercase; letter-spacing: .08em; color: var(--c-text-2); margin-bottom: 6px; }
.help-list { list-style: none; margin: 0; padding: 0; display: grid; }
.help-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--c-border-soft); }
.help-item:last-child { border-bottom: 0; }
.help-item__text { display: grid; gap: 1px; min-width: 0; }
.help-item__text strong { font-size: 13px; font-weight: 600; }
.help-item__text span { font-size: 12px; color: var(--c-text-2); }
.help-item__keys { flex: none; justify-content: flex-end; max-width: 46%; }
.help-panel__footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 22px; border-top: 1px solid var(--c-border-soft); background: color-mix(in srgb, var(--c-surface-2) 40%, var(--c-surface)); }

/* ---------- Tour guiado ---------- */
.tour { position: fixed; inset: 0; z-index: 200; }
.tour__spot {
  position: fixed; border-radius: 12px; pointer-events: none;
  box-shadow: 0 0 0 2px var(--c-accent), 0 0 0 6px color-mix(in srgb, var(--c-accent) 30%, transparent), 0 0 0 9999px var(--tour-scrim);
  transition: left .25s var(--ease), top .25s var(--ease), width .25s var(--ease), height .25s var(--ease);
}
.tour__pop {
  position: fixed; left: 0; top: 0; width: min(340px, calc(100vw - 24px)); padding: 16px 18px 14px; outline: none;
  display: grid; gap: 6px; background: var(--c-surface); color: var(--c-text);
  border: 1px solid var(--c-border-soft); border-radius: 14px; box-shadow: var(--shadow-3);
  transition: transform .25s var(--ease);
}
.tour__progress { font: 700 11px var(--font-ui); text-transform: uppercase; letter-spacing: .08em; color: var(--c-accent); }
.tour__title { font-size: 16px; font-weight: 750; }
.tour__body { margin: 0; font-size: 13px; color: var(--c-text-2); }
.tour__footer { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.tour__dots { display: inline-flex; gap: 5px; margin-right: auto; }
.tour__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--c-border); transition: width .2s var(--ease), background .2s; }
.tour__dot.is-current { width: 16px; border-radius: 3px; background: var(--c-accent); }
.tour__skip { white-space: nowrap; border: 0; background: none; padding: 6px 8px; font-size: 12.5px; color: var(--c-text-2); cursor: pointer; border-radius: 8px; }
.tour__skip:hover { color: var(--c-text); background: var(--c-surface-2); }
.tour__btn { height: 32px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--c-border); background: var(--c-surface); font-weight: 600; font-size: 13px; cursor: pointer; }
.tour__btn:hover { background: var(--c-surface-2); }
.tour__btn--primary { background: var(--c-accent); border-color: var(--c-accent); color: #fff; }
.tour__btn--primary:hover { background: var(--c-accent-strong); }

/* ---------- Ajuda nos dialogos ---------- */
.help-box { display: grid; gap: 8px; }
.help-box p { margin: 0; }
.help-box .steps { margin: 0; }
.steps--compact { gap: 3px; }
.how-to { margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; background: var(--c-surface-2); font-size: 13px; }
.how-to summary { cursor: pointer; font-weight: 600; }
.how-to[open] summary { margin-bottom: 8px; }
.how-to .steps { margin-bottom: 6px; }
.how-to p { margin: 0; font-size: 12.5px; }

@media (max-width: 720px) {
  .hintbar { display: none; }
}
