/* «Remix» con el diseño de las herramientas (tribe.css). */
.rx [hidden] { display: none !important; }
.rx-hero { border: 0; background: none; box-shadow: none; padding: 24px 0 18px; }
.rx-eyebrow { margin: 0 0 10px; color: var(--hot, #ff5f8f); font-size: 12px; font-weight: 750; letter-spacing: 0.14em; text-transform: uppercase; }
.rx-hero h1 { margin: 0; font-size: clamp(2rem, 4.4vw, 3.3rem); letter-spacing: -0.04em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rx-lead { max-width: 64ch; margin: 14px 0 0; color: var(--text-soft); font-size: 1.02rem; line-height: 1.55; }
.rx-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.rx-chips li { padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); color: var(--text-soft); font-size: 0.8rem; font-weight: 650; }

.rx-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr) 260px; gap: 16px; align-items: start; }
.rx-panel { display: grid; gap: 12px; padding: 18px; border: 1px solid var(--border); border-radius: 22px; background: var(--surface); }
.rx-step { margin: 4px 0 0; color: var(--hot, #ff5f8f); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.rx-drop, .rx-add { position: relative; display: grid; justify-items: center; gap: 4px; padding: 18px 12px; border: 1.5px dashed color-mix(in srgb, var(--hot, #ff5f8f) 40%, var(--border)); border-radius: 16px; background: var(--surface-2); text-align: center; cursor: pointer; font-size: 0.85rem; }
.rx-drop:hover, .rx-add:hover { border-color: var(--hot, #ff5f8f); }
.rx-drop input, .rx-add input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.rx-drop span:last-child, .rx-add span { color: var(--muted); font-size: 0.75rem; }
.rx-drop__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; background: var(--grad-btn); }
.rx-drop__icon img { filter: brightness(0) invert(1); }
.rx-add.is-disabled { opacity: 0.45; pointer-events: none; }
.rx-layers { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.rx-layer { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 0.8rem; text-align: left; cursor: pointer; }
.rx-layer canvas { width: 40px; height: 40px; border-radius: 8px; background: repeating-conic-gradient(rgba(255, 255, 255, 0.07) 0 25%, transparent 0 50%) 0 0 / 10px 10px; }
.rx-layer span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rx-layer[aria-pressed="true"] { border-color: var(--hot, #ff5f8f); background: color-mix(in srgb, var(--hot, #ff5f8f) 12%, var(--surface-2)); }
.rx-selected { display: grid; gap: 10px; padding-top: 8px; border-top: 1px solid var(--border); }
.rx-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.rx-btn { min-height: 34px; padding: 6px 11px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 0.78rem; font-weight: 650; cursor: pointer; }
.rx-btn:hover { border-color: var(--hot, #ff5f8f); }
.rx-btn[aria-pressed="true"] { border-color: var(--hot, #ff5f8f); background: color-mix(in srgb, var(--hot, #ff5f8f) 14%, var(--surface-2)); }
.rx-btn--danger:hover { border-color: #ff5f6d; color: #ffb3ba; }
.rx .field span { display: flex; justify-content: space-between; font-size: 0.8rem; }
.rx .field output { color: var(--muted); font-variant-numeric: tabular-nums; }
.rx input[type="range"], .rx input[type="checkbox"] { accent-color: var(--hot, #ff5f8f); }
.rx-check { display: flex; gap: 8px; align-items: center; font-size: 0.82rem; }
.rx-light { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; font-size: 0.78rem; color: var(--muted); }
.rx .button--primary { background: var(--grad-btn); border: 0; color: #fff; }
.rx .button--primary:hover:not(:disabled) { background: var(--grad-btn-hover); }
.rx-note { margin: 0; color: var(--muted); font-size: 0.75rem; line-height: 1.5; }

.rx-view { display: grid; gap: 10px; }
.rx-stage { position: relative; width: 100%; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 20px; background: repeating-conic-gradient(rgba(255, 255, 255, 0.05) 0 25%, transparent 0 50%) 0 0 / 22px 22px, #0b0a12; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35); }
.rx-stage canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.rx-stage canvas:active { cursor: grabbing; }
.rx-empty { position: absolute; inset: 0; display: grid; place-content: center; gap: 6px; color: var(--muted); text-align: center; }
.rx-empty strong { color: var(--text); }
.rx-sun { position: absolute; z-index: 3; display: grid; place-items: center; width: 40px; height: 40px; transform: translate(-50%, -50%); border: 2px solid #fff; border-radius: 50%; background: radial-gradient(circle, #ffe9a8, #ffb347); color: #5a3200; font-size: 20px; box-shadow: 0 0 0 4px rgba(255, 200, 80, 0.25), 0 0 30px rgba(255, 210, 120, 0.8); cursor: grab; touch-action: none; }
.rx-split { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.rx-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 0.78rem; }
.rx-progress { display: grid; gap: 6px; font-size: 0.8rem; color: var(--text-soft); }
.rx-progress progress { width: 100%; height: 8px; accent-color: var(--hot, #ff5f8f); }

.rx-dialog { width: min(720px, calc(100vw - 24px)); padding: 20px; border: 1px solid var(--border-strong); border-radius: 20px; background: var(--surface); color: var(--text); }
.rx-dialog::backdrop { background: rgba(5, 4, 10, 0.7); backdrop-filter: blur(6px); }
.rx-dialog h2 { margin: 0 0 6px; font-size: 1.2rem; }
.rx-dialog p { margin: 0 0 12px; color: var(--muted); font-size: 0.85rem; }
/* sin «object-fit»: el lienzo mantiene su proporción para que los toques y el lazo caigan donde se ve */
.rx-cut-canvas { display: block; width: auto; height: auto; max-width: 100%; max-height: 60vh; margin: 0 auto 12px; border-radius: 12px; cursor: crosshair; touch-action: none; }

@media (max-width: 1100px) {
  .rx-grid { grid-template-columns: 1fr 1fr; }
  .rx-view { grid-column: 1 / -1; grid-row: 1; }
}
@media (max-width: 640px) {
  .rx-grid { grid-template-columns: 1fr; }
}

/* Fusión con IA */
.rx-ai { display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid var(--border); }
.rx-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.rx-seg .rx-btn { padding-inline: 6px; }
.rx-ai .button:disabled { opacity: 0.5; cursor: not-allowed; }
.rx-stage.is-ai canvas { cursor: default; }
.rx-stage.is-busy::after { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.08) 50%, transparent 70%) 0 0 / 250% 100%; animation: rx-shine 1.6s linear infinite; pointer-events: none; }
@keyframes rx-shine { to { background-position: -250% 0; } }
@media (prefers-reduced-motion: reduce) { .rx-stage.is-busy::after { animation: none; } }
.rx-cut-hint { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; padding: 8px 10px; border: 1px solid color-mix(in srgb, var(--hot, #ff5f8f) 40%, var(--border)); border-radius: 12px; background: color-mix(in srgb, var(--hot, #ff5f8f) 10%, var(--surface-2)); color: var(--text); font-size: 0.82rem; }
.rx-cut-hint[hidden] { display: none; }
