/* Guía con cursor (market-guide.js): birrete del dock, menú desplegable de preguntas y el tour. Archivo propio para no chocar con market.css. */
.mg-btn { position: relative; color: #67e8f9; }
.mg-btn svg { width: 24px; height: 24px; }
/* Siempre llama la atención: brillo que late + anillo que se expande; más fuerte mientras no se ha abierto nunca. */
.mg-btn { animation: mg-glow 1.8s ease-in-out infinite; }
.mg-btn::after { content: ""; position: absolute; inset: -2px; border-radius: inherit; border: 2px solid rgba(103,232,249,.75); animation: mg-ring 1.8s ease-out infinite; pointer-events: none; }
.mg-btn.is-new { animation-duration: 1.1s; } .mg-btn.is-new::after { animation-duration: 1.1s; border-color: #a5f3fc; }
.mg-btn:hover, .mg-btn:hover::after { animation-play-state: paused; }
@keyframes mg-glow {
	0%, 100% { background: rgba(34,211,238,.10); box-shadow: 0 0 6px rgba(34,211,238,.35); color: #67e8f9; }
	50% { background: rgba(34,211,238,.32); box-shadow: 0 0 0 3px rgba(34,211,238,.35), 0 0 26px 4px rgba(34,211,238,.75); color: #ffffff; }
}
@keyframes mg-ring { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(1.55); } }
@media (prefers-reduced-motion: reduce) { .mg-btn, .mg-btn::after { animation: none; } .mg-btn { box-shadow: 0 0 0 2px rgba(34,211,238,.6), 0 0 16px rgba(34,211,238,.5); } }

.mg-menu {
	--mg-line: rgba(148, 163, 184, 0.14);
	--mg-ink: #e6edf5; --mg-sub: #a3b2c6; --mg-dim: #7f90a6; --mg-acc: #22d3ee; --mg-acc-ink: #a5f3fc;
	position: fixed; z-index: 9000; display: flex; flex-direction: column; max-height: calc(100vh - 96px);
	border: 1px solid rgba(34, 211, 238, 0.22); border-radius: 16px;
	background: linear-gradient(180deg, rgba(14, 22, 38, 0.98), rgba(8, 13, 24, 0.98));
	box-shadow: 0 28px 70px rgba(0, 0, 0, 0.6), 0 2px 0 rgba(255, 255, 255, 0.04) inset;
	font: 13px/1.4 Inter, system-ui, sans-serif; color: var(--mg-ink);
	transform-origin: var(--caret, 50%) 0; animation: mg-drop 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes mg-drop { from { opacity: 0; transform: translateY(-8px) scale(0.985); } }
.mg-menu[hidden], .mg-menu [hidden] { display: none !important; }
.mg-menu ::selection { background: rgba(34, 211, 238, 0.32); color: #fff; }
.mg-caret { position: absolute; top: -7px; left: calc(var(--caret, 50%) - 7px); width: 14px; height: 14px; rotate: 45deg; background: rgb(14, 22, 38); border-left: 1px solid rgba(34, 211, 238, 0.22); border-top: 1px solid rgba(34, 211, 238, 0.22); border-radius: 3px 0 0 0; }

/* Buscador: protagonista del menú */
.mg-search { display: flex; align-items: center; gap: 12px; margin: 14px 14px 0; padding: 0 14px; height: 50px; border-radius: 12px; border: 1px solid var(--mg-line); background: rgba(255, 255, 255, 0.035); cursor: text; transition: border-color 160ms, box-shadow 160ms, background 160ms; }
.mg-search:focus-within { border-color: rgba(34, 211, 238, 0.55); background: rgba(34, 211, 238, 0.05); box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.10); }
.mg-search > svg { width: 18px; height: 18px; flex: none; color: var(--mg-acc); }
.mg-q { flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none; color: var(--mg-ink); font: 500 15px Inter, system-ui, sans-serif; caret-color: var(--mg-acc); }
.mg-q::placeholder { color: var(--mg-dim); font-weight: 400; }
.mg-menu kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; margin-right: 3px; border-radius: 5px; border: 1px solid var(--mg-line); border-bottom-width: 2px; background: rgba(255, 255, 255, 0.04); color: var(--mg-sub); font: 600 10.5px Inter, system-ui, sans-serif; }

/* Contenido */
.mg-list, .mg-results { overflow: auto; padding: 14px 14px 10px; scrollbar-width: thin; scrollbar-color: rgba(148, 163, 184, 0.25) transparent; }
.mg-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.mg-box h4, .mg-calc h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; padding: 0 10px; font-size: 12.5px; font-weight: 600; color: var(--mg-ink); }
.mg-box h4 svg, .mg-calc h4 svg { width: 16px; height: 16px; color: var(--mg-acc); flex: none; }
.mg-calc h4 small { margin-left: auto; font-size: 11.5px; font-weight: 400; color: var(--mg-dim); }

.mg-item { position: relative; display: flex; align-items: flex-start; gap: 6px; width: 100%; padding: 6px 10px 6px 6px; border: 0; border-radius: 9px; background: none; color: var(--mg-sub); font: inherit; text-align: left; cursor: pointer; transition: background 140ms, color 140ms; }
.mg-item .mg-t { flex: 1; min-width: 0; text-wrap: pretty; }
.mg-list .mg-item em { display: none; }
.mg-item em { flex: none; font-style: normal; font-size: 11px; color: var(--mg-dim); padding-top: 1px; font-variant-numeric: tabular-nums; opacity: 0; transition: opacity 140ms; }
.mg-ptr { flex: none; width: 12px; height: 12px; margin-top: 3px; color: var(--mg-acc); opacity: 0; transform: translateX(-4px); transition: opacity 140ms, transform 200ms cubic-bezier(0.16, 1, 0.3, 1); }
.mg-ptr svg { width: 100%; height: 100%; display: block; }
.mg-item.is-active, .mg-item:focus-visible { background: rgba(34, 211, 238, 0.09); color: var(--mg-ink); outline: none; }
.mg-item.is-active .mg-ptr, .mg-item:focus-visible .mg-ptr { opacity: 1; transform: none; }
.mg-item.is-active em, .mg-item:focus-visible em { opacity: 1; }
.mg-item:active { background: rgba(34, 211, 238, 0.14); }

.mg-calc { display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; row-gap: 2px; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--mg-line); }
.mg-calc h4 { grid-column: 1 / -1; margin-bottom: 4px; }
.mg-fam { display: grid; grid-template-columns: 112px 1fr; gap: 8px; align-items: start; padding: 3px 10px; }
.mg-fam-l { padding-top: 4px; text-wrap: balance; font-size: 11.5px; color: var(--mg-dim); }
.mg-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.mg-item.mg-chip { width: auto; padding: 3px 10px; border: 1px solid var(--mg-line); border-radius: 999px; font-size: 12px; color: var(--mg-sub); }
.mg-item.mg-chip.is-active, .mg-item.mg-chip:focus-visible { border-color: rgba(34, 211, 238, 0.5); color: var(--mg-acc-ink); background: rgba(34, 211, 238, 0.08); }

/* Resultados al escribir */
.mg-results .mg-item { align-items: center; padding: 10px 12px; font-size: 13.5px; }
.mg-results .mg-ptr { margin-top: 0; }
.mg-results em { opacity: 1; }
.mg-ai .mg-ai-i { display: grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 8px; background: rgba(167, 139, 250, 0.14); color: #c4b5fd; }
.mg-ai .mg-ai-i svg { width: 15px; height: 15px; }
.mg-ai b { color: var(--mg-ink); font-weight: 600; }
.mg-ai.is-active { background: rgba(167, 139, 250, 0.12); }
.mg-sep { display: flex; align-items: center; gap: 10px; margin: 8px 12px; height: 1px; background: var(--mg-line); }
.mg-sep span { padding-right: 8px; margin-top: -1px; background: rgb(11, 18, 32); font-size: 11px; color: var(--mg-dim); transform: translateY(0); line-height: 1; }
.mg-sep:has(span) { height: auto; background: none; }
.mg-sep:has(span)::after { content: ""; flex: 1; height: 1px; background: var(--mg-line); }
.mg-empty { margin: 6px 12px 4px; color: var(--mg-dim); font-size: 12.5px; }

.mg-foot { display: flex; align-items: center; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--mg-line); color: var(--mg-dim); font-size: 11.5px; }
.mg-foot-r { margin-left: auto; text-align: right; }

@media (max-width: 900px) { .mg-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } .mg-calc { grid-template-columns: 1fr; } .mg-fam { grid-template-columns: 1fr; gap: 4px; } }
@media (max-width: 560px) { .mg-cols { grid-template-columns: 1fr; } .mg-foot, .mg-hint, .mg-calc h4 small { display: none; } .mg-search { margin: 10px 10px 0; } .mg-menu { left: 8px !important; right: 8px; width: auto !important; max-height: calc(100vh - 80px); } .mg-caret { display: none; } }
@media (prefers-reduced-motion: reduce) { .mg-menu { animation: none; } .mg-ptr { transition: none; } }

.mg-shield { position: fixed; inset: 0; z-index: 2147482000; cursor: progress; }
.mg-target { outline: 3px solid #22d3ee !important; outline-offset: 3px; border-radius: 8px; }
.mg-cursor { position: fixed; top: 0; left: 0; z-index: 2147483000; width: 24px; height: 24px; margin: -4px 0 0 -4px; pointer-events: none; opacity: 0; transition: transform 700ms cubic-bezier(.4,.1,.2,1), opacity 200ms; background: no-repeat center/contain url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M4 2l16 9-7 2-3 7z' fill='white' stroke='black' stroke-width='1.5' stroke-linejoin='round'/></svg>"); filter: drop-shadow(0 2px 3px rgba(0,0,0,.5)); }
.mg-cursor.show { opacity: 1; }
.mg-cursor.press { scale: .8; }
.mg-tip { position: fixed; z-index: 2147483001; max-width: 420px; padding: 12px 14px; background: #0b1220; color: #fff; border: 1px solid #22d3ee; border-radius: 10px; font: 14px/1.45 Inter, system-ui, sans-serif; opacity: 0; transition: opacity 200ms; box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.mg-tip.show { opacity: 1; }
.mg-tip p { margin: 0; }
.mg-tip button { margin-top: 10px; padding: 6px 14px; border: none; border-radius: 6px; cursor: pointer; background: #22d3ee; color: #001018; font-weight: 600; }
.mg-quit { position: fixed; bottom: 20px; left: 50%; translate: -50% 0; z-index: 2147483002; padding: 8px 16px; border-radius: 999px; border: 1px solid rgba(255,255,255,.3); background: #0b1220; color: #fff; cursor: pointer; font: 13px Inter, system-ui, sans-serif; }
